use of org.qi4j.index.rdf.ContainsAllTest.ExampleEntity in project qi4j-sdk by Qi4j.
the class ContainsTest method performContainsStringValueTest.
private ExampleEntity performContainsStringValueTest(Set<String> entityStrings, String queryableString) throws Exception {
UnitOfWork creatingUOW = this.module.newUnitOfWork();
String[] entityStringsArray = new String[entityStrings.size()];
ContainsAllTest.createEntityWithComplexValues(creatingUOW, this.module, entityStrings.toArray(entityStringsArray));
creatingUOW.complete();
UnitOfWork queryingUOW = this.module.newUnitOfWork();
try {
ExampleEntity entity = this.findEntityBasedOnValueString(queryableString);
return entity;
} finally {
queryingUOW.discard();
}
}
use of org.qi4j.index.rdf.ContainsAllTest.ExampleEntity in project qi4j-sdk by Qi4j.
the class ContainsTest method performContainsStringTest.
private ExampleEntity performContainsStringTest(Set<String> entityStrings, String queryableString) throws Exception {
UnitOfWork creatingUOW = this.module.newUnitOfWork();
String[] entityStringsArray = new String[entityStrings.size()];
ContainsAllTest.createEntityWithStrings(creatingUOW, this.module, entityStrings.toArray(entityStringsArray));
creatingUOW.complete();
UnitOfWork queryingUOW = this.module.newUnitOfWork();
try {
ExampleEntity entity = this.findEntity(queryableString);
return entity;
} finally {
queryingUOW.discard();
}
}
use of org.qi4j.index.rdf.ContainsAllTest.ExampleEntity in project qi4j-sdk by Qi4j.
the class ContainsTest method simpleContainsStringValueFailTest.
@Test
public void simpleContainsStringValueFailTest() throws Exception {
ExampleEntity result = this.performContainsStringTest(new HashSet<String>(Arrays.asList(ContainsAllTest.TEST_STRING_1, ContainsAllTest.TEST_STRING_2, ContainsAllTest.TEST_STRING_3)), ContainsAllTest.TEST_STRING_4);
Assert.assertTrue("The entity must not have been found", result == null);
}
use of org.qi4j.index.rdf.ContainsAllTest.ExampleEntity in project qi4j-sdk by Qi4j.
the class ContainsTest method simpleContainsSuccessTest.
@Test
public void simpleContainsSuccessTest() throws Exception {
ExampleEntity result = this.performContainsStringTest(new HashSet<String>(Arrays.asList(ContainsAllTest.TEST_STRING_1, ContainsAllTest.TEST_STRING_2, ContainsAllTest.TEST_STRING_3)), ContainsAllTest.TEST_STRING_3);
Assert.assertTrue("The entity must have been found", result != null);
}
use of org.qi4j.index.rdf.ContainsAllTest.ExampleEntity in project qi4j-sdk by Qi4j.
the class ContainsTest method simpleContainsSuccessFailTest.
@Test
public void simpleContainsSuccessFailTest() throws Exception {
ExampleEntity result = this.performContainsStringTest(new HashSet<String>(Arrays.asList(ContainsAllTest.TEST_STRING_1, ContainsAllTest.TEST_STRING_2, ContainsAllTest.TEST_STRING_3)), ContainsAllTest.TEST_STRING_4);
Assert.assertTrue("The entity must not have been found", result == null);
}
Aggregations