use of org.whole.lang.tests.model.TestSuite in project whole by wholeplatform.
the class TestSuitePart method refreshVisuals.
@Override
protected void refreshVisuals() {
TestSuite entity = getModelEntity();
getFigure().showDescription(EntityUtils.isNotResolver(entity.getDescription()));
getFigure().showDeployer(EntityUtils.isNotResolver(entity.getDeployer()));
getFigure().showFilterFamilies(EntityUtils.isNotResolver(entity.getFilterFamilies()));
getFigure().updateResults(entity.getExpectedResults(), entity.getActualResults());
}
use of org.whole.lang.tests.model.TestSuite in project whole by wholeplatform.
the class TestSuitePart method getModelSpecificChildren.
protected List<IEntity> getModelSpecificChildren() {
TestSuite entity = getModelEntity();
List<IEntity> list = new ArrayList<IEntity>(6);
list.add(entity.getDescription());
list.add(entity.getPackageName());
list.add(entity.getName());
list.add(entity.getDeployer());
list.add(entity.getFilterFamilies());
list.add(entity.getTestCases());
return list;
}
use of org.whole.lang.tests.model.TestSuite in project whole by wholeplatform.
the class TestsDefaultEntityRegistryConfiguration method apply.
public void apply(IEntityRegistry er) {
super.apply(er);
TestsEntityFactory ef = TestsEntityFactory.instance(er);
TestSuite testSuite = ef.createTestSuite();
testSuite.setFilterFamilies(ef.createFilterFamilies(0));
er.put(testSuite);
TestCase testCase = ef.createTestCase();
testCase.setAspects(ef.createAspects(0));
er.put(testCase);
er.put(ef.createAllOf(2));
er.put(ef.createAnyOf(2));
}
use of org.whole.lang.tests.model.TestSuite in project whole by wholeplatform.
the class TestsInterpreterVisitorTest method testInterpreter.
@Test
public void testInterpreter() throws Exception {
TestSuite testSuite = new TestSuiteCompleted().create();
IEntity result = InterpreterOperation.interpret(testSuite).getResult();
Assert.assertEquals(1, result.wGet(0).wIntValue());
Assert.assertEquals(0, result.wGet(1).wIntValue());
Assert.assertEquals(0, result.wGet(2).wIntValue());
}
use of org.whole.lang.tests.model.TestSuite in project whole by wholeplatform.
the class TestsInterpreterVisitorTest method testLearningInterpreter.
@Test
public void testLearningInterpreter() throws Exception {
TestSuite testSuiteToComplete = new TestSuiteToComplete().create();
TestSuite testSuiteCompleted = new TestSuiteCompleted().create();
IBindingManager bm = BindingManagerFactory.instance.createArguments();
bm.wDefValue("learnMode", true);
bm.wDefValue("learnCycles", 2);
IEntity result = InterpreterOperation.interpret(testSuiteToComplete, bm).getResult();
Assert.assertEquals(1, result.wGet(0).wIntValue());
Assert.assertEquals(0, result.wGet(1).wIntValue());
Assert.assertEquals(0, result.wGet(2).wIntValue());
result = InterpreterOperation.interpret(testSuiteCompleted).getResult();
Assert.assertEquals(1, result.wGet(0).wIntValue());
Assert.assertEquals(0, result.wGet(1).wIntValue());
Assert.assertEquals(0, result.wGet(2).wIntValue());
// remove timestamps from both the models
IEntityIterator<IEntity> iterator = IteratorFactory.descendantOrSelfMatcherIterator().withPattern(JavaEntityDescriptorEnum.LongLiteral);
iterator.reset(testSuiteToComplete);
while (iterator.hasNext()) {
iterator.next();
iterator.remove();
}
iterator = IteratorFactory.descendantOrSelfMatcherIterator().withPattern(JavaEntityDescriptorEnum.LongLiteral);
iterator.reset(testSuiteCompleted);
while (iterator.hasNext()) {
iterator.next();
iterator.remove();
}
Assert.assertTrue(Matcher.match(testSuiteCompleted, testSuiteToComplete));
}
Aggregations