Commit 6c627813 authored by Stefan Schuhbaeck's avatar Stefan Schuhbaeck
Browse files

Merge branch 'measurementAreaRefactorProcessors_rebased' into 'master'

Measurement area refactor processors rebased

See merge request !55
parents dcffc7d3 83cb5e48
Pipeline #103785 passed with stages
in 137 minutes and 9 seconds
package org.vadere.simulator.projects.dataprocessing.processor;
import org.mockito.Mockito;
import org.vadere.simulator.projects.dataprocessing.datakey.TimestepKey;
import org.vadere.simulator.projects.dataprocessing.writer.VadereWriterFactory;
import org.vadere.state.attributes.processor.AttributesAreaDensityVoronoiProcessor;
import org.vadere.state.attributes.scenario.AttributesMeasurementArea;
import org.vadere.state.scenario.Agent;
import org.vadere.state.scenario.MeasurementArea;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
......@@ -28,8 +31,12 @@ public class AreaDensityVoronoiProcessorTestEnv extends ProcessorTestEnv<Timeste
testedProcessor.setId(nextProcessorId());
AttributesAreaDensityVoronoiProcessor attr =
(AttributesAreaDensityVoronoiProcessor) testedProcessor.getAttributes();
attr.setVoronoiArea(new VRectangle(0, 0, 16, 16));
attr.setMeasurementArea(new VRectangle(0, 0, 16, 16));
attr.setVoronoiMeasurementAreaId(42);
attr.setMeasurementAreaId(42);
MeasurementArea measurementArea = new MeasurementArea(
new AttributesMeasurementArea(42, new VRectangle(0, 0, 16, 16)));
Mockito.when(manager.getMeasurementArea(42)).thenReturn(measurementArea);
try {
outputFile = outputFileFactory.createDefaultOutputfileByDataKey(
......
......@@ -20,13 +20,11 @@ public class AreaSpeedProcessorTest extends ProcessorTest {
assertEquals("Must be zero after init.", 0, p.getData().size());
assertEquals("Must be zero after init.", 0, (int) r.valOfField("lastStep"));
AttributesAreaProcessor attr = (AttributesAreaProcessor) p.getAttributes();
assertEquals(attr.getMeasurementArea(), r.valOfField("measurementArea"));
}
@Test
public void doUpdate() throws Exception {
AttributesAreaProcessor attr = (AttributesAreaProcessor) p.getAttributes();
attr.setMeasurementArea(new VRectangle(0, 0, 4, 5));
processorTestEnv.init();
super.doUpdate();
}
......
......@@ -4,8 +4,11 @@ import org.mockito.Mockito;
import org.vadere.simulator.projects.dataprocessing.datakey.TimestepKey;
import org.vadere.simulator.projects.dataprocessing.writer.VadereWriterFactory;
import org.vadere.state.attributes.processor.AttributesAreaSpeedProcessor;
import org.vadere.state.attributes.scenario.AttributesMeasurementArea;
import org.vadere.state.scenario.MeasurementArea;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import java.util.ArrayList;
import java.util.Comparator;
......@@ -45,6 +48,11 @@ public class AreaSpeedProcessorTestEnv extends ProcessorTestEnv<TimestepKey, Dou
addRequiredProcessors(pedPosProcEnv);
Mockito.when(manager.getProcessor(pedPosProcId)).thenReturn(pedPosProc);
attr.setMeasurementAreaId(99);
MeasurementArea measurementArea = new MeasurementArea(
new AttributesMeasurementArea(99, new VRectangle(0, 0, 4, 5)));
Mockito.when(manager.getMeasurementArea(99)).thenReturn(measurementArea);
try {
outputFile = outputFileFactory.createDefaultOutputfileByDataKey(
TimestepKey.class,
......
......@@ -24,7 +24,6 @@ public class PedestrianWaitingEndTimeProcessorTest extends ProcessorTest {
assertInit(p);
AttributesPedestrianWaitingEndTimeProcessor attr =
(AttributesPedestrianWaitingEndTimeProcessor) p.getAttributes();
assertEquals(attr.getWaitingArea(), r.valOfField("waitingArea"));
for (SimulationState s : processorTestEnv.getSimStates()) {
p.update(s);
......
package org.vadere.simulator.projects.dataprocessing.processor;
import org.mockito.Mockito;
import org.vadere.simulator.projects.dataprocessing.datakey.PedestrianIdKey;
import org.vadere.simulator.projects.dataprocessing.writer.VadereWriterFactory;
import org.vadere.state.attributes.processor.AttributesPedestrianWaitingEndTimeProcessor;
import org.vadere.state.attributes.scenario.AttributesMeasurementArea;
import org.vadere.state.scenario.MeasurementArea;
import org.vadere.util.geometry.shapes.VRectangle;
import java.util.ArrayList;
import java.util.Comparator;
......@@ -27,6 +32,13 @@ public class PedestrianWaitingEndTimeProcessorTestEnv extends ProcessorTestEnv<P
e.printStackTrace();
}
outputFile.setVadereWriterFactory(VadereWriterFactory.getStringWriterFactory());
AttributesPedestrianWaitingEndTimeProcessor attr =
(AttributesPedestrianWaitingEndTimeProcessor) testedProcessor.getAttributes();
attr.setWaitingAreaId(42);
MeasurementArea measurementArea = new MeasurementArea(
new AttributesMeasurementArea(42, new VRectangle(0, 0, 16, 16)));
Mockito.when(manager.getMeasurementArea(42)).thenReturn(measurementArea);
}
......
......@@ -25,7 +25,6 @@ public class PedestrianWaitingTimeProcessorTest extends ProcessorTest{
@Test
public void doUpdate() throws Exception {
r.setValOfFile("waitingArea", new VRectangle(0, 0, 2, 5));
super.doUpdate();
}
......@@ -35,9 +34,7 @@ public class PedestrianWaitingTimeProcessorTest extends ProcessorTest{
AttributesPedestrianWaitingTimeProcessor attr =
(AttributesPedestrianWaitingTimeProcessor) p.getAttributes();
assertEquals(attr.getWaitingArea(), r.valOfField("waitingArea"));
r.setValOfFile("waitingArea", new VRectangle(0, 0, 2, 5));
for (SimulationState s : processorTestEnv.getSimStates()) {
p.update(s);
}
......
......@@ -3,8 +3,12 @@ package org.vadere.simulator.projects.dataprocessing.processor;
import org.mockito.Mockito;
import org.vadere.simulator.projects.dataprocessing.datakey.PedestrianIdKey;
import org.vadere.simulator.projects.dataprocessing.writer.VadereWriterFactory;
import org.vadere.state.attributes.processor.AttributesPedestrianWaitingTimeProcessor;
import org.vadere.state.attributes.scenario.AttributesMeasurementArea;
import org.vadere.state.scenario.MeasurementArea;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import java.util.ArrayList;
import java.util.Comparator;
......@@ -32,6 +36,16 @@ public class PedestrianWaitingTimeProcessorTestEnv extends ProcessorTestEnv<Pede
e.printStackTrace();
}
outputFile.setVadereWriterFactory(VadereWriterFactory.getStringWriterFactory());
AttributesPedestrianWaitingTimeProcessor attr =
(AttributesPedestrianWaitingTimeProcessor) testedProcessor.getAttributes();
attr.setWaitingAreaId(42);
MeasurementArea measurementArea = new MeasurementArea(
new AttributesMeasurementArea(42, new VRectangle(0, 0, 2, 5)));
Mockito.when(manager.getMeasurementArea(42)).thenReturn(measurementArea);
}
......
......@@ -43,7 +43,7 @@ public abstract class ProcessorTestEnv<K extends DataKey<K>, V> {
/**
* Factories
*/
DataProcessorFactory processorFactory;
org.vadere.simulator.projects.dataprocessing.processor.DataProcessorFactory processorFactory;
OutputFileFactory outputFileFactory;
/**
* Needed for DataProcessor doUpdate call. (mocked)
......@@ -70,7 +70,7 @@ public abstract class ProcessorTestEnv<K extends DataKey<K>, V> {
testedProcessor = null;
outputFile = null;
requiredProcessors = new LinkedList<>();
processorFactory = DataProcessorFactory.instance();
processorFactory = org.vadere.simulator.projects.dataprocessing.processor.DataProcessorFactory.instance();
outputFileFactory = OutputFileFactory.instance();
}
......
......@@ -6,6 +6,7 @@ import org.junit.After;
import org.junit.Test;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.simulator.projects.io.TestUtils;
import org.vadere.simulator.projects.migration.jsontranformation.JsonMigrationAssistant;
import org.vadere.state.util.StateJsonConverter;
import org.vadere.simulator.utils.reflection.TestResourceHandler;
import org.vadere.util.io.IOUtils;
......@@ -18,7 +19,7 @@ import joptsimple.internal.Strings;
import static org.junit.Assert.assertEquals;
public class JoltMigrationAssistantTest implements TestResourceHandler {
public class JsonMigrationAssistantTest implements TestResourceHandler {
@Override
public Path getTestDir() {
......@@ -41,9 +42,9 @@ public class JoltMigrationAssistantTest implements TestResourceHandler {
// String json = IOUtils.readTextFileFromResources("/migration/testProject_v0.1/scenarios/WithDots_basic_1_chicken_osm1.scenario");
JsonNode node = StateJsonConverter.deserializeToNode(json);
JoltMigrationAssistant joltMigrationAssistant = new JoltMigrationAssistant();
JsonMigrationAssistant jsonMigrationAssistant = new JsonMigrationAssistant();
try {
JsonNode newNode = joltMigrationAssistant.transform(node, Version.V0_2);
JsonNode newNode = jsonMigrationAssistant.transform(node, Version.V0_2);
} catch (MigrationException e) {
e.printStackTrace();
}
......@@ -56,9 +57,9 @@ public class JoltMigrationAssistantTest implements TestResourceHandler {
public void TestTransformProject() throws URISyntaxException, IOException {
Path projectPath = getRelativeTestPath("testProject_v0.1");
JoltMigrationAssistant joltMigrationAssistant = new JoltMigrationAssistant();
JsonMigrationAssistant jsonMigrationAssistant = new JsonMigrationAssistant();
MigrationResult res = joltMigrationAssistant.analyzeProject(projectPath.toString());
MigrationResult res = jsonMigrationAssistant.analyzeProject(projectPath.toString());
assertEquals("", new MigrationResult(12, 0, 11, 1), res);
System.out.println(Strings.repeat('#', 80));
}
......
package org.vadere.simulator.projects.migration.jolttranformation;
package org.vadere.simulator.projects.migration.jsontranformation;
import com.fasterxml.jackson.databind.JsonNode;
......@@ -6,8 +6,6 @@ import org.junit.Test;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.simulator.projects.migration.MigrationException;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Path;
import static org.junit.Assert.assertEquals;
......@@ -16,7 +14,7 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
public class JoltTransformV0toV1Test extends JoltTransformationTest {
public class JoltTransformV0toV1Test extends JsonTransformationTest {
@Override
......@@ -27,10 +25,10 @@ public class JoltTransformV0toV1Test extends JoltTransformationTest {
// Source postHook should not bee used here
@Test
public void TestPostHooks1() throws MigrationException {
JoltTransformation transformation = JoltTransformation.get(Version.NOT_A_RELEASE);
JsonTransformation transformation = AbstractJsonTransformation.get(Version.NOT_A_RELEASE);
String TEST1 = "/migration/vNOT-A-RELEASE_to_v0.1_Test1.scenario";
JsonNode in = getJsonFromResource(TEST1);
JsonNode out = transformation.applyTransformation(in);
JsonNode out = transformation.applyAll(in);
// will test that sources exists.
JsonNode sources = pathMustExist(out, "vadere/topography/sources");
assertEquals("Therer must be one source", 1, sources.size());
......@@ -49,10 +47,10 @@ public class JoltTransformV0toV1Test extends JoltTransformationTest {
// All postHooks should bee used here
@Test
public void TestPostHooks2() throws MigrationException {
JoltTransformation transformation = factory.getJoltTransformV0toV1();
JsonTransformation transformation = factory.getJoltTransformV0toV1();
String TEST2 = "/migration/vNOT-A-RELEASE_to_v0.1_Test2.scenario";
JsonNode in = getJsonFromResource(TEST2);
JsonNode out = transformation.applyTransformation(in);
JsonNode out = transformation.applyAll(in);
JsonNode sources = pathMustExist(out, "vadere/topography/sources");
assertEquals("Therer must be one source", 1, sources.size());
......@@ -70,10 +68,10 @@ public class JoltTransformV0toV1Test extends JoltTransformationTest {
// should fail because no main model was found
@Test(expected = MigrationException.class)
public void TestPostHooks3() throws MigrationException {
JoltTransformation transformation = factory.getJoltTransformV0toV1();
JsonTransformation transformation = factory.getJoltTransformV0toV1();
String TEST3 = "/migration/vNOT-A-RELEASE_to_v0.1_Test3.scenario";
JsonNode in = getJsonFromResource(TEST3);
transformation.applyTransformation(in);
transformation.applyAll(in);
fail("should not be reached! The Transformation should fail with MigrationException");
}
......
package org.vadere.simulator.projects.migration.jolttranformation;
package org.vadere.simulator.projects.migration.jsontranformation;
import com.fasterxml.jackson.databind.JsonNode;
......@@ -6,13 +6,11 @@ import org.junit.Test;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.simulator.projects.migration.MigrationException;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Path;
import static org.junit.Assert.*;
public class JoltTransformV1toV2Test extends JoltTransformationTest {
public class JoltTransformV1toV2Test extends JsonTransformationTest {
@Override
public Path getTestDir() {
......@@ -21,8 +19,8 @@ public class JoltTransformV1toV2Test extends JoltTransformationTest {
@Test
public void Test1() throws MigrationException {
JoltTransformation t = JoltTransformation.get(Version.V0_1);
JsonNode node = t.applyTransformation(getJsonFromResource("/migration/v0.1_to_v0.2_Test1.scenario"));
JsonTransformation t = AbstractJsonTransformation.get(Version.V0_1);
JsonNode node = t.applyAll(getJsonFromResource("/migration/v0.1_to_v0.2_Test1.scenario"));
pathMustExist(node, "scenario/attributesModel/org.vadere.state.attributes.models.AttributesPotentialCompact");
pathMustExist(node, "scenario/attributesModel/org.vadere.state.attributes.models.AttributesOSM");
pathMustExist(node, "scenario/attributesModel/org.vadere.state.attributes.models.AttributesFloorField");
......@@ -31,8 +29,8 @@ public class JoltTransformV1toV2Test extends JoltTransformationTest {
@Test
public void Test2() throws MigrationException {
JoltTransformation t = JoltTransformation.get(Version.V0_1);
JsonNode node = t.applyTransformation(getJsonFromResource("/migration/v0.1_to_v0.2_Test2.scenario"));
JsonTransformation t = AbstractJsonTransformation.get(Version.V0_1);
JsonNode node = t.applyAll(getJsonFromResource("/migration/v0.1_to_v0.2_Test2.scenario"));
pathMustExist(node, "scenario/attributesModel/org.vadere.state.attributes.models.AttributesPotentialCompact");
pathMustExist(node, "scenario/attributesModel/org.vadere.state.attributes.models.AttributesOSM");
pathMustExist(node, "scenario/attributesModel/org.vadere.state.attributes.models.AttributesFloorField");
......@@ -42,8 +40,8 @@ public class JoltTransformV1toV2Test extends JoltTransformationTest {
// Test default values if only name is given.
@Test
public void Test3() throws MigrationException {
JoltTransformation t = JoltTransformation.get(Version.V0_1);
JsonNode node = t.applyTransformation(getJsonFromResource("/migration/v0.1_to_v0.2_Test3.scenario"));
JsonTransformation t = AbstractJsonTransformation.get(Version.V0_1);
JsonNode node = t.applyAll(getJsonFromResource("/migration/v0.1_to_v0.2_Test3.scenario"));
pathMustExist(node, "scenario/attributesModel");
assertEquals("should be empty", 0, pathMustExist(node, "scenario/attributesModel").size());
assertThat(pathMustExist(node, "name"), nodeHasText("XXXX"));
......
package org.vadere.simulator.projects.migration.jolttranformation;
package org.vadere.simulator.projects.migration.jsontranformation;
import java.nio.file.Path;
public class JoltTransformV2toV3Test extends JoltTransformationTest{
public class JoltTransformV2toV3Test extends JsonTransformationTest {
@Override
public Path getTestDir() {
......
package org.vadere.simulator.projects.migration.jolttranformation;
package org.vadere.simulator.projects.migration.jsontranformation;
import org.hamcrest.core.StringContains;
import org.junit.After;
......@@ -16,7 +16,7 @@ import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
public class JoltTransformV3toV4Test extends JoltTransformationTest {
public class JoltTransformV3toV4Test extends JsonTransformationTest {
private ArrayList<Path> scenarios;
private ArrayList<Path> bakScenarios;
......@@ -55,7 +55,7 @@ public class JoltTransformV3toV4Test extends JoltTransformationTest {
public void TestTransform() {
MigrationAssistant ma = MigrationAssistant.getNewInstance(MigrationOptions.defaultOptions());
try {
String out = ma.convertFile(scenarios.get(0), Version.V0_4);
String out = ma.migrateScenarioFile(scenarios.get(0), Version.V0_4);
// System.out.println(out);
assertThat("New Version must be V0.4", out, v04);
assertThat("New Entry missing", out, useFixedSeed);
......
package org.vadere.simulator.projects.migration.jolttranformation;
package org.vadere.simulator.projects.migration.jsontranformation;
import com.fasterxml.jackson.databind.JsonNode;
......@@ -6,14 +6,14 @@ import org.vadere.simulator.entrypoints.Version;
import org.junit.Test;
import org.vadere.simulator.projects.migration.MigrationException;
import org.vadere.simulator.projects.migration.helper.JsonFilterIterator;
import org.vadere.simulator.projects.migration.incident.helper.JsonFilterIterator;
import java.nio.file.Path;
import java.util.Iterator;
import static org.junit.Assert.*;
public class JoltTransformV4toV5Test extends JoltTransformationTest {
public class JoltTransformV4toV5Test extends JsonTransformationTest {
@Override
......@@ -37,10 +37,10 @@ public class JoltTransformV4toV5Test extends JoltTransformationTest {
public void needsBoundaryIsRemoved() {
JsonNode v4 = test001();
pathMustExist(v4, "scenario/attributesSimulation/needsBoundary");
JoltTransformation t = factory.getJoltTransformV4toV5();
JsonTransformation t = factory.getJoltTransformV4toV5();
JsonNode v5 = null;
try {
v5 = t.applyTransformation(v4);
v5 = t.applyAll(v4);
} catch (MigrationException e) {
fail("Should not fail with MigrationException: " + e.getMessage());
}
......@@ -87,7 +87,7 @@ public class JoltTransformV4toV5Test extends JoltTransformationTest {
JoltTransformation t = factory.getJoltTransformV4toV5();
JsonNode v5 = null;
try {
v5 = t.applyTransformation(v4);
v5 = t.applyAll(v4);
} catch (MigrationException e) {
fail("Should not fail with MigrationException: " + e.getMessage());
}
......
package org.vadere.simulator.projects.migration.jolttranformation;
package org.vadere.simulator.projects.migration.jsontranformation;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
......@@ -14,7 +14,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
public class JoltTransformV5toV6Test extends JoltTransformationTest{
public class JoltTransformV5toV6Test extends JsonTransformationTest {
@Override
public Path getTestDir() {
......@@ -39,7 +39,7 @@ public class JoltTransformV5toV6Test extends JoltTransformationTest{
JoltTransformation t = factory.getJoltTransformV5toV6();
JsonNode v6 = null;
try {
v6 = t.applyTransformation(v5);
v6 = t.applyAll(v5);
} catch (MigrationException e) {
fail("Should not fail with MigrationException: " + e.getMessage());
}
......@@ -64,10 +64,10 @@ public class JoltTransformV5toV6Test extends JoltTransformationTest{
@Test
public void testTransformWithCorrectKey(){
JsonNode v5 = test002();
JoltTransformation t = factory.getJoltTransformV5toV6();
JsonTransformation t = factory.getJoltTransformV5toV6();
JsonNode v6 = null;
try {
v6 = t.applyTransformation(v5);
v6 = t.applyAll(v5);
} catch (MigrationException e) {
fail("Should not fail with MigrationException: " + e.getMessage());
}
......
package org.vadere.simulator.projects.migration.jolttranformation;
package org.vadere.simulator.projects.migration.jsontranformation;
import com.fasterxml.jackson.databind.JsonNode;
......@@ -15,7 +15,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
public class JoltTransformV6toV7Test extends JoltTransformationTest{
public class JoltTransformV6toV7Test extends JsonTransformationTest {
@Override
public Path getTestDir() {
......@@ -31,10 +31,10 @@ public class JoltTransformV6toV7Test extends JoltTransformationTest{
assertThat(group_OSM_1Source2Places, versionMatcher(Version.V0_6));
JsonNode group_OSM_1Source2PlacesJson = getJsonFromString(group_OSM_1Source2Places);
JoltTransformation t = factory.getJoltTransformV6toV7();
JsonTransformation t = factory.getJoltTransformV6toV7();
JsonNode v7 = null;
try {
v7 = t.applyTransformation(group_OSM_1Source2PlacesJson);
v7 = t.applyAll(group_OSM_1Source2PlacesJson);
} catch (MigrationException e){
fail("Should not fail with MigrationException: " + e.getMessage());
}
......@@ -55,10 +55,10 @@ public class JoltTransformV6toV7Test extends JoltTransformationTest{
assertThat(group_OSM_1Source2Places, versionMatcher(Version.V0_6));
JsonNode group_OSM_1Source2PlacesJson = getJsonFromString(group_OSM_1Source2Places);
JoltTransformation t = factory.getJoltTransformV6toV7();
JsonTransformation t = factory.getJoltTransformV6toV7();
JsonNode v7 = null;
try {
v7 = t.applyTransformation(group_OSM_1Source2PlacesJson);
v7 = t.applyAll(group_OSM_1Source2PlacesJson);
} catch (MigrationException e){
fail("Should not fail with MigrationException: " + e.getMessage());
}
......@@ -78,10 +78,10 @@ public class JoltTransformV6toV7Test extends JoltTransformationTest{
assertThat(group_OSM_1Source2Places, versionMatcher(Version.V0_6));
JsonNode group_OSM_1Source2PlacesJson = getJsonFromString(group_OSM_1Source2Places);
JoltTransformation t = factory.getJoltTransformV6toV7();
JsonTransformation t = factory.getJoltTransformV6toV7();
JsonNode v7 = null;
try {
v7 = t.applyTransformation(group_OSM_1Source2PlacesJson);
v7 = t.applyAll(group_OSM_1Source2PlacesJson);
} catch (MigrationException e){
fail("Should not fail with MigrationException: " + e.getMessage());
}
......
package org.vadere.simulator.projects.migration.jolttranformation;
package org.vadere.simulator.projects.migration.jsontranformation;
import org.junit.After;
import org.junit.Before;
import org.vadere.simulator.utils.reflection.TestJsonNodeExplorer;
import org.vadere.simulator.utils.reflection.TestJsonNodeHelper;
import org.vadere.simulator.utils.reflection.TestResourceHandler;
import org.vadere.simulator.projects.migration.jsontranformation.JsonTransformationFactory;
public abstract class JsonTransformationTest implements TestJsonNodeExplorer, TestJsonNodeHelper, TestResourceHandler {
abstract class JoltTransformationTest implements TestJsonNodeExplorer, TestJsonNodeHelper, TestResourceHandler {
org.vadere.simulator.projects.migration.jolttranformation.JoltTransformationFactory factory = org.vadere.simulator.projects.migration.jolttranformation.JoltTransformationFactory.instance();
protected JsonTransformationFactory factory = JsonTransformationFactory.instance();
@Before
......
package org.vadere.simulator.projects.migration.jsontranformation.json;
import com.fasterxml.jackson.databind.JsonNode;
import org.junit.Test;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.simulator.projects.migration.MigrationException;
import org.vadere.simulator.projects.migration.jsontranformation.JsonTransformationTest;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Iterator;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.*;
public class JsonTransformV7ToV8Test extends JsonTransformationTest {
// JsonNode jsonOld;
// JsonNode jsonNew;
// JsonTransformation transformation;
@Override
public Path getTestDir() {
return getPathFromResources("/migration/v07_to_v08");
}
@Test
public void testTyp1() throws MigrationException{
String[] processorTypes = {