Skip to content

Commit

Permalink
Fixes wrt [core#1378]
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 3, 2025
1 parent 211594a commit 4c407bc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
18 changes: 9 additions & 9 deletions cbor/src/test/java/tools/jackson/jaxrs/cbor/JaxrsTestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ protected void _verifyBytes(byte[] actBytes, byte... expBytes)
* available methods, and ensures results are consistent, before
* returning them
*/
protected String getAndVerifyText(JsonParser jp)
protected String getAndVerifyText(JsonParser p)
{
// Ok, let's verify other accessors
int actLen = jp.getTextLength();
char[] ch = jp.getTextCharacters();
String str2 = new String(ch, jp.getTextOffset(), actLen);
String str = jp.getText();
int actLen = p.getStringLength();
char[] ch = p.getStringCharacters();
String str2 = new String(ch, p.getStringOffset(), actLen);
String str = p.getString();

if (str.length() != actLen) {
fail("Internal problem (jp.token == "+jp.currentToken()+"): jp.getText().length() ['"+str+"'] == "+str.length()+"; jp.getTextLength() == "+actLen);
fail("Internal problem (p.token == "+p.currentToken()+"): p.getString().length() ['"+str+"'] == "+str.length()+"; p.getStringLength() == "+actLen);
}
assertEquals("String access via getText(), getTextXxx() must be the same", str, str2);
assertEquals("String access via getString(), getStringXxx() must be the same", str, str2);

return str;
}
Expand All @@ -86,11 +86,11 @@ protected String getAndVerifyText(JsonParser jp)
/**********************************************************
*/

public String quote(String str) {
public String q(String str) {
return '"'+str+'"';
}

protected String aposToQuotes(String json) {
protected String a2q(String json) {
return json.replace("'", "\"");
}

Expand Down
18 changes: 9 additions & 9 deletions smile/src/test/java/tools/jackson/jaxrs/smile/JaxrsTestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ protected void _verifyBytes(byte[] actBytes, byte... expBytes)
* available methods, and ensures results are consistent, before
* returning them
*/
protected String getAndVerifyText(JsonParser jp)
protected String getAndVerifyText(JsonParser p)
{
// Ok, let's verify other accessors
int actLen = jp.getTextLength();
char[] ch = jp.getTextCharacters();
String str2 = new String(ch, jp.getTextOffset(), actLen);
String str = jp.getText();
int actLen = p.getStringLength();
char[] ch = p.getStringCharacters();
String str2 = new String(ch, p.getStringOffset(), actLen);
String str = p.getString();

if (str.length() != actLen) {
fail("Internal problem (jp.token == "+jp.currentToken()+"): jp.getText().length() ['"+str+"'] == "+str.length()+"; jp.getTextLength() == "+actLen);
fail("Internal problem (p.token == "+p.currentToken()+"): p.getString().length() ['"+str+"'] == "+str.length()+"; p.getStringLength() == "+actLen);
}
assertEquals("String access via getText(), getTextXxx() must be the same", str, str2);
assertEquals("String access via getString(), getStringXxx() must be the same", str, str2);

return str;
}
Expand All @@ -86,11 +86,11 @@ protected String getAndVerifyText(JsonParser jp)
/**********************************************************
*/

public String quote(String str) {
public String q(String str) {
return '"'+str+'"';
}

protected String aposToQuotes(String json) {
protected String a2q(String json) {
return json.replace("'", "\"");
}

Expand Down
15 changes: 7 additions & 8 deletions yaml/src/test/java/tools/jackson/jaxrs/yaml/JaxrsTestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import tools.jackson.core.JsonParser;
import tools.jackson.core.JsonToken;
import tools.jackson.jaxrs.yaml.YAMLMediaTypes;

import org.junit.Assert;

Expand Down Expand Up @@ -70,18 +69,18 @@ protected void _verifyBytes(byte[] actBytes, byte... expBytes)
* available methods, and ensures results are consistent, before
* returning them
*/
protected String getAndVerifyText(JsonParser jp)
protected String getAndVerifyText(JsonParser p)
{
// Ok, let's verify other accessors
int actLen = jp.getTextLength();
char[] ch = jp.getTextCharacters();
String str2 = new String(ch, jp.getTextOffset(), actLen);
String str = jp.getText();
int actLen = p.getStringLength();
char[] ch = p.getStringCharacters();
String str2 = new String(ch, p.getStringOffset(), actLen);
String str = p.getString();

if (str.length() != actLen) {
fail("Internal problem (jp.token == "+jp.currentToken()+"): jp.getText().length() ['"+str+"'] == "+str.length()+"; jp.getTextLength() == "+actLen);
fail("Internal problem (p.token == "+p.currentToken()+"): jp.getString().length() ['"+str+"'] == "+str.length()+"; p.getStringLength() == "+actLen);
}
assertEquals("String access via getText(), getTextXxx() must be the same", str, str2);
assertEquals("String access via getString(), getStringXxx() must be the same", str, str2);

return str;
}
Expand Down

0 comments on commit 4c407bc

Please sign in to comment.