public void addExpressionElement(String stepName, String className) { this.className = className; expressionElements.add(new ExpressionElement(stepName)); }
public void addExpressionElement(String stepName, String className) { this.className = className; expressionElements.add(new ExpressionElement(stepName)); }
@Override public Function<String, String> from1_2to1_3() { return rawXml -> { ScenarioSimulationXMLPersistence xmlPersistence = ScenarioSimulationXMLPersistence.getInstance(); ScenarioSimulationModel model = xmlPersistence.unmarshal(rawXml, false); for (FactMapping factMapping : model.getSimulation().getSimulationDescriptor().getUnmodifiableFactMappings()) { factMapping.getExpressionElements().add(0, new ExpressionElement(factMapping.getFactIdentifier().getName())); } return xmlPersistence.marshal(model).replaceAll("<ScenarioSimulationModel version=\"1.2\">", "<ScenarioSimulationModel version=\"1.3\">"); }; } }
@Test public void isPropertyAssigned() { factMappingDescription.getExpressionElements().clear(); assertTrue(scenarioGrid.isPropertyAssigned(false, factMappingDescription)); assertTrue(scenarioGrid.isPropertyAssigned(true, factMappingDescription)); factMappingDescription.getExpressionElements().add(new ExpressionElement("test")); assertTrue(scenarioGrid.isPropertyAssigned(false, factMappingDescription)); assertTrue(scenarioGrid.isPropertyAssigned(true, factMappingDescription)); factMappingGiven.getExpressionElements().clear(); assertFalse(scenarioGrid.isPropertyAssigned(false, factMappingGiven)); assertFalse(scenarioGrid.isPropertyAssigned(true, factMappingGiven)); factMappingGiven.getExpressionElements().add(new ExpressionElement("test")); assertFalse(scenarioGrid.isPropertyAssigned(false, factMappingGiven)); assertTrue(scenarioGrid.isPropertyAssigned(true, factMappingGiven)); factMappingInteger.getExpressionElements().clear(); assertFalse(scenarioGrid.isPropertyAssigned(false, factMappingInteger)); assertTrue(scenarioGrid.isPropertyAssigned(true, factMappingInteger)); }