Skip to content

Commit

Permalink
Clean test cases 2
Browse files Browse the repository at this point in the history
  • Loading branch information
sathishk committed Mar 14, 2024
1 parent ed1d33e commit b0ece31
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 27 deletions.
16 changes: 8 additions & 8 deletions src/main/java/com/techatpark/sjson/core/Json.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
import java.util.Map;
import java.util.stream.Collectors;

import static com.techatpark.sjson.core.ArrayParser.getArray;
import static com.techatpark.sjson.core.BooleanParser.getFalse;
import static com.techatpark.sjson.core.BooleanParser.getTrue;
import static com.techatpark.sjson.core.NullParser.getNull;
import static com.techatpark.sjson.core.ObjectParser.getObject;
import static com.techatpark.sjson.core.parser.ArrayParser.getArray;
import static com.techatpark.sjson.core.parser.BooleanParser.getFalse;
import static com.techatpark.sjson.core.parser.BooleanParser.getTrue;
import static com.techatpark.sjson.core.parser.NullParser.getNull;
import static com.techatpark.sjson.core.parser.ObjectParser.getObject;
import static com.techatpark.sjson.core.util.ReaderUtil.ILLEGAL_JSON_VALUE;
import static com.techatpark.sjson.core.util.ReaderUtil.nextClean;
import static com.techatpark.sjson.core.StringParser.getString;
import static com.techatpark.sjson.core.NumberParser.getNumber;
import static com.techatpark.sjson.core.parser.StringParser.getString;
import static com.techatpark.sjson.core.parser.NumberParser.getNumber;

/**
* Json parser for server side workloads.
Expand Down Expand Up @@ -204,7 +204,7 @@ public ContentExtractor(final Reader theReader) {
* @return object
* @throws IOException
*/
Object getValue() throws IOException {
public Object getValue() throws IOException {
// 1. move to the first clean character to determine the Data type
final char character = nextClean(reader);
setCursor(character);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package com.techatpark.sjson.core;
package com.techatpark.sjson.core.parser;

import com.techatpark.sjson.core.Json;

import java.io.IOException;
import java.io.Reader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.techatpark.sjson.core;
package com.techatpark.sjson.core.parser;

import java.io.IOException;
import java.io.Reader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.techatpark.sjson.core;
package com.techatpark.sjson.core.parser;

import java.io.IOException;
import java.io.Reader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package com.techatpark.sjson.core;
package com.techatpark.sjson.core.parser;

import com.techatpark.sjson.core.Json;

import java.io.IOException;
import java.io.Reader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.techatpark.sjson.core;
package com.techatpark.sjson.core.parser;

import com.techatpark.sjson.core.Json;

import java.io.IOException;
import java.io.Reader;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import static com.techatpark.sjson.core.StringParser.getString;
import static com.techatpark.sjson.core.parser.StringParser.getString;
import static com.techatpark.sjson.core.util.ReaderUtil.next;
import static com.techatpark.sjson.core.util.ReaderUtil.nextClean;
import static com.techatpark.sjson.core.util.ReaderUtil.getCharacter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.techatpark.sjson.core;
package com.techatpark.sjson.core.parser;

import java.io.IOException;
import java.io.Reader;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* Parsers for JSON Core Data types.
*/
package com.techatpark.sjson.core.parser;
4 changes: 2 additions & 2 deletions src/main/java/com/techatpark/sjson/schema/BooleanSchema.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.techatpark.sjson.schema;

import com.techatpark.sjson.core.BooleanParser;
import com.techatpark.sjson.core.NullParser;
import com.techatpark.sjson.core.parser.BooleanParser;
import com.techatpark.sjson.core.parser.NullParser;
import com.techatpark.sjson.core.util.ReaderUtil;

import java.io.IOException;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/techatpark/sjson/schema/StringSchema.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.techatpark.sjson.schema;

import com.techatpark.sjson.core.NullParser;
import com.techatpark.sjson.core.parser.NullParser;
import com.techatpark.sjson.core.util.ReaderUtil;
import com.techatpark.sjson.core.StringParser;
import com.techatpark.sjson.core.parser.StringParser;

import java.io.IOException;
import java.io.Reader;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@

opens com.techatpark.sjson.core;
opens com.techatpark.sjson.schema;
opens com.techatpark.sjson.schema.generator;
}
10 changes: 3 additions & 7 deletions src/test/java/com/techatpark/sjson/core/NumberParserTest.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
package com.techatpark.sjson.core;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.techatpark.sjson.core.util.TestUtil;
import com.techatpark.sjson.core.parser.NumberParser;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;

import java.io.IOException;
import java.io.StringReader;
import java.math.BigInteger;
import java.nio.file.Path;
import java.util.List;
import java.util.Set;

import static com.techatpark.sjson.core.util.ReaderUtil.nextClean;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

class NumberParserTest {

Expand Down Expand Up @@ -71,9 +67,9 @@ private void testCursor(final String jsonString, final String suffix) throws IOE
}

/**
* Provides paths to JSON files for parameterized tests.
* Provides Numbers to Test.
*
* @return Stream of paths to JSON files
* @return Stream of Numbers
* @throws IOException if there is an issue listing files
*/
private static List<Number> numbers() {
Expand Down

0 comments on commit b0ece31

Please sign in to comment.