Java Code Examples for io.vlingo.symbio.store.QueryExpression#using()

The following examples show how to use io.vlingo.symbio.store.QueryExpression#using() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ObjectQueryFailedExceptionTest.java    From vlingo-lattice with Mozilla Public License 2.0 5 votes vote down vote up
@Test
public void testThatFailedHasAttempt() {
  final QueryAttempt<?,?,?> queryAttempt = new QueryAttempt(QueryAttempt.Cardinality.All, Object.class, QueryExpression.using(Object.class, ""), CompletionTranslator.translatorOrNull((o) -> null, null));
  final ObjectQueryFailedException e = new ObjectQueryFailedException(queryAttempt);

  Assert.assertNotNull(e);
  Assert.assertNotNull(e.queryAttempt);
  Assert.assertEquals(QueryAttempt.Cardinality.All, e.queryAttempt.cardinality);
  Assert.assertNotNull(e.queryAttempt.stateObjectType);
  Assert.assertNotNull(e.queryAttempt.query);
  Assert.assertNotNull(e.queryAttempt.completionTranslator);
  Assert.assertNull(e.getMessage());
  Assert.assertNull(e.getCause());
}
 
Example 2
Source File: ObjectQueryFailedExceptionTest.java    From vlingo-lattice with Mozilla Public License 2.0 5 votes vote down vote up
@Test
public void testThatFailedHasExceptionInfo() {
  final Exception cause = new Exception("TestInner", new Exception());
  final QueryAttempt<?,?,?> queryAttempt = new QueryAttempt(QueryAttempt.Cardinality.All, Object.class, QueryExpression.using(Object.class, ""), CompletionTranslator.translatorOrNull((o) -> null, null));
  final ObjectQueryFailedException e = new ObjectQueryFailedException(queryAttempt, "TestOuter", cause);

  Assert.assertNotNull(e);
  Assert.assertNotNull(e.queryAttempt);
  Assert.assertEquals("TestOuter", e.getMessage());
  Assert.assertNotNull(e.getCause());
  Assert.assertEquals("TestInner", e.getCause().getMessage());
  Assert.assertNotNull(e.getMessage());
  Assert.assertNotNull(e.getCause().getCause());
  Assert.assertNull(e.getCause().getCause().getMessage());
}