bump Gradle version
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
package net.woggioni.wson;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.io.TempDir;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
public class Foo {
|
||||
|
||||
@TempDir
|
||||
Path tempDir;
|
||||
|
||||
@BeforeEach
|
||||
void beforeEach() {
|
||||
Assertions.assertTrue(Files.isDirectory(this.tempDir));
|
||||
}
|
||||
|
||||
@Test
|
||||
void throwsErrorWhenTargetFileExists() throws IOException {
|
||||
Path output = Files.createFile(
|
||||
tempDir.resolve("output.txt")
|
||||
);
|
||||
}
|
||||
|
||||
}
|
@@ -8,10 +8,12 @@ import net.woggioni.wson.test.JsonBomb;
|
||||
import net.woggioni.wson.xface.Parser;
|
||||
import net.woggioni.wson.xface.Value;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class JsonBombTest {
|
||||
@Test
|
||||
@Disabled
|
||||
@SneakyThrows
|
||||
public void jackson() {
|
||||
ObjectMapper om = new ObjectMapper();
|
||||
|
@@ -76,7 +76,7 @@ public class ValueWalkerTest {
|
||||
List<Value> preResult = new ArrayList<>();
|
||||
List<Value> postResult = new ArrayList<>();
|
||||
walk(preResult, postResult, root);
|
||||
return new Tuple2<>(preResult, postResult);
|
||||
return Tuple2.newInstance(preResult, postResult);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -86,6 +86,6 @@ public class ValueWalkerTest {
|
||||
ValueWalker.walk(v, visitor);
|
||||
Assertions.assertFalse(visitor.preValues.isEmpty());
|
||||
Assertions.assertFalse(visitor.postValues.isEmpty());
|
||||
Assertions.assertEquals(recursiveWalk(v), new Tuple2<>(visitor.preValues, visitor.postValues));
|
||||
Assertions.assertEquals(recursiveWalk(v), Tuple2.newInstance(visitor.preValues, visitor.postValues));
|
||||
}
|
||||
}
|
||||
|
@@ -12,10 +12,10 @@ public class ObjectValueImplementationTest {
|
||||
|
||||
private static List<Tuple2<ObjectValue.Implementation, Class<? extends ObjectValue>>> getImplementationMapping() {
|
||||
return Arrays.asList(
|
||||
new Tuple2<>(ObjectValue.Implementation.ArrayList, ListObjectValue.class),
|
||||
new Tuple2<>(ObjectValue.Implementation.TreeMap, TreeMapObjectValue.class),
|
||||
new Tuple2<>(ObjectValue.Implementation.HashMap, HashMapObjectValue.class),
|
||||
new Tuple2<>(ObjectValue.Implementation.LinkedHashMap, LinkedHashMapObjectValue.class)
|
||||
Tuple2.newInstance(ObjectValue.Implementation.ArrayList, ListObjectValue.class),
|
||||
Tuple2.newInstance(ObjectValue.Implementation.TreeMap, TreeMapObjectValue.class),
|
||||
Tuple2.newInstance(ObjectValue.Implementation.HashMap, HashMapObjectValue.class),
|
||||
Tuple2.newInstance(ObjectValue.Implementation.LinkedHashMap, LinkedHashMapObjectValue.class)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -26,15 +26,15 @@ public class ObjectValueImplementationTest {
|
||||
ObjectValue.Implementation expectedImplementation =
|
||||
ObjectValue.Implementation.valueOf(System.getProperty(ObjectValue.class.getName() + ".implementation", "TreeMap"));
|
||||
Class<? extends ObjectValue> expectedClass =
|
||||
mapping.stream().filter(t -> t._1 == expectedImplementation).findFirst().get()._2;
|
||||
mapping.stream().filter(t -> t.get_1() == expectedImplementation).findFirst().get().get_2();
|
||||
ObjectValue obj = ObjectValue.newInstance();
|
||||
Assertions.assertEquals(expectedClass, obj.getClass());
|
||||
mapping.forEach(tuple -> {
|
||||
Value.Configuration cfg = Value.Configuration.builder()
|
||||
.objectValueImplementation(tuple._1)
|
||||
.objectValueImplementation(tuple.get_1())
|
||||
.build();
|
||||
ObjectValue obj2 = ObjectValue.newInstance(cfg);
|
||||
Assertions.assertEquals(tuple._2, obj2.getClass());
|
||||
Assertions.assertEquals(tuple.get_2(), obj2.getClass());
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user