本文整理汇总了Java中org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.VerificationException类的典型用法代码示例。如果您正苦于以下问题:Java VerificationException类的具体用法?Java VerificationException怎么用?Java VerificationException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VerificationException类属于org.apache.tinkerpop.gremlin.process.traversal.strategy.verification包,在下文中一共展示了VerificationException类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: g_V_hasLabelXpersonX_pageRank_byXrankX_byXbothEX_rank_profile
import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.VerificationException; //导入依赖的package包/类
@Test
@LoadGraphWith(MODERN)
@IgnoreEngine(TraversalEngine.Type.STANDARD)
public void g_V_hasLabelXpersonX_pageRank_byXrankX_byXbothEX_rank_profile() {
final Traversal<Vertex, TraversalMetrics> traversal = get_g_V_hasLabelXpersonX_pageRank_byXrankX_byXbothEX_rank_profile();
//printTraversalForm(traversal);
try {
traversal.iterate();
fail("Should have tossed an exception because multi-OLAP is unsolvable");
} catch (Exception ex) {
assertTrue(ex instanceof VerificationException || ExceptionUtils.getRootCause(ex) instanceof VerificationException);
}
}
示例2: validateForGraphComputer
import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.VerificationException; //导入依赖的package包/类
private static boolean validateForGraphComputer(final Throwable e) {
Throwable ex = e;
while (ex != null) {
if (ex instanceof VerificationException)
return true;
else if (ex instanceof NotSerializableException)
return true;
else if (ex.getClass().getSimpleName().contains("ResponseException"))
return true;
ex = ex.getCause();
}
return false;
}
示例3: shouldNeverPropagateANoBulkTraverser
import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.VerificationException; //导入依赖的package包/类
@Test
@LoadGraphWith
public void shouldNeverPropagateANoBulkTraverser() {
try {
assertFalse(g.V().dedup().sideEffect(t -> t.asAdmin().setBulk(0)).hasNext());
assertEquals(0, g.V().dedup().sideEffect(t -> t.asAdmin().setBulk(0)).toList().size());
g.V().dedup().sideEffect(t -> t.asAdmin().setBulk(0)).sideEffect(t -> fail("this should not have happened")).iterate();
} catch (VerificationException e) {
// its okay if lambdas can't be serialized by the test suite
}
}
示例4: shouldNeverPropagateANullValuedTraverser
import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.VerificationException; //导入依赖的package包/类
@Test
@LoadGraphWith
public void shouldNeverPropagateANullValuedTraverser() {
try {
assertFalse(g.V().map(t -> null).hasNext());
assertEquals(0, g.V().map(t -> null).toList().size());
g.V().map(t -> null).sideEffect(t -> fail("this should not have happened")).iterate();
} catch (VerificationException e) {
// its okay if lambdas can't be serialized by the test suite
}
}
示例5: shouldSucceedWithProperTraverserRequirements
import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.VerificationException; //导入依赖的package包/类
@Test
@LoadGraphWith(MODERN)
public void shouldSucceedWithProperTraverserRequirements() throws Exception {
final VertexProgramQ vp = VertexProgramQ.build().property("pl").create();
final Map<String, List<Integer>> expected = new HashMap<>();
expected.put("vadas", Collections.singletonList(2));
expected.put("lop", Arrays.asList(2, 2, 2, 3));
expected.put("josh", Collections.singletonList(2));
expected.put("ripple", Arrays.asList(2, 3));
try {
g.V().repeat(__.out()).emit().program(vp).dedup()
.valueMap("name", "pl").forEachRemaining((Map<String, Object> map) -> {
final String name = (String) ((List) map.get("name")).get(0);
final List<Integer> pathLengths = (List<Integer>) map.get("pl");
assertTrue(expected.containsKey(name));
final List<Integer> expectedPathLengths = expected.remove(name);
assertTrue(expectedPathLengths.containsAll(pathLengths));
assertTrue(pathLengths.containsAll(expectedPathLengths));
});
assertTrue(expected.isEmpty());
} catch (VerificationException ex) {
assumeNoException(ex);
}
}
示例6: shouldFailWithImproperTraverserRequirements
import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.VerificationException; //导入依赖的package包/类
@Test
@LoadGraphWith(MODERN)
public void shouldFailWithImproperTraverserRequirements() throws Exception {
final VertexProgramQ vp = VertexProgramQ.build().property("pl").useTraverserRequirements(false).create();
try {
g.V().repeat(__.out()).emit().program(vp).dedup()
.forEachRemaining((Vertex v) -> assertFalse(v.property("pl").isPresent()));
} catch (VerificationException ex) {
assumeNoException(ex);
}
}
示例7: whenAttemptingToMutateViaTraversal_Throw
import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.VerificationException; //导入依赖的package包/类
@Test
public void whenAttemptingToMutateViaTraversal_Throw(){
expectedException.expect(VerificationException.class);
expectedException.expectMessage("not read only");
tx.getTinkerTraversal().V().drop().iterate();
}