use of org.drools.workbench.models.testscenarios.backend.MatryoshkaDoll in project drools by kiegroup.
the class FactAssignmentFieldPopulatorTest method testMatryoshkaDollSituation.
@Test
public void testMatryoshkaDollSituation() throws Exception {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
TypeResolver typeResolver = new ClassTypeResolver(new HashSet<String>(), classLoader);
typeResolver.addImport("org.drools.workbench.models.testscenarios.backend.MatryoshkaDoll");
MatryoshkaDoll matryoshkaDoll = new MatryoshkaDoll();
FactAssignmentField factAssignmentField = createFactAssignmentField();
addFactAssignmentFieldIntoFactAssignmentField(factAssignmentField, 5);
FactAssignmentFieldPopulator factAssignmentFieldPopulator = new FactAssignmentFieldPopulator(matryoshkaDoll, factAssignmentField, typeResolver);
factAssignmentFieldPopulator.populate(new HashMap<String, Object>());
assertNotNull(matryoshkaDoll.getMatryoshkaDoll());
assertNotNull(matryoshkaDoll.getMatryoshkaDoll().getMatryoshkaDoll());
assertNotNull(matryoshkaDoll.getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll());
assertNotNull(matryoshkaDoll.getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll());
assertNotNull(matryoshkaDoll.getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll());
assertNotNull(matryoshkaDoll.getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll());
assertNull(matryoshkaDoll.getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll());
}
Aggregations