本文整理汇总了Java中org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine.Type方法的典型用法代码示例。如果您正苦于以下问题:Java TraversalEngine.Type方法的具体用法?Java TraversalEngine.Type怎么用?Java TraversalEngine.Type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine
的用法示例。
在下文中一共展示了TraversalEngine.Type方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerOptOuts
import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine; //导入方法依赖的package包/类
private void registerOptOuts(final Class<? extends Graph> graphClass,
final Optional<GraphProvider.Descriptor> graphProviderDescriptor,
final TraversalEngine.Type traversalEngineType) throws InitializationError {
final Graph.OptOut[] optOuts = graphClass.getAnnotationsByType(Graph.OptOut.class);
if (optOuts != null && optOuts.length > 0) {
// validate annotation - test class and reason must be set
if (!Arrays.stream(optOuts).allMatch(ignore -> ignore.test() != null && ignore.reason() != null && !ignore.reason().isEmpty()))
throw new InitializationError("Check @IgnoreTest annotations - all must have a 'test' and 'reason' set");
try {
filter(new OptOutTestFilter(optOuts, graphProviderDescriptor, traversalEngineType));
} catch (NoTestsRemainException ex) {
throw new InitializationError(ex);
}
}
}
示例2: initializeMatchAlgorithm
import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine; //导入方法依赖的package包/类
private void initializeMatchAlgorithm(final TraversalEngine.Type traversalEngineType) {
try {
this.matchAlgorithm = this.matchAlgorithmClass.getConstructor().newInstance();
} catch (final NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e) {
throw new IllegalStateException(e.getMessage(), e);
}
this.matchAlgorithm.initialize(traversalEngineType, this.matchTraversals);
}
示例3: AbstractGremlinSuite
import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine; //导入方法依赖的package包/类
/**
* Constructs a Gremlin Test Suite implementation.
*
* @param klass Required for JUnit Suite construction
* @param builder Required for JUnit Suite construction
* @param testsToExecute The list of tests to execute
* @param testsToEnforce The list of tests to "enforce" such that a check is made to ensure that in this list,
* there exists an implementation in the testsToExecute (use {@code null} for no
* enforcement).
* @param gremlinFlavorSuite Ignore validation of {@link org.apache.tinkerpop.gremlin.structure.Graph.OptIn}
* annotations which is typically reserved for structure tests
* @param traversalEngineType The {@link org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine.Type} to
* enforce on this suite
*/
public AbstractGremlinSuite(final Class<?> klass, final RunnerBuilder builder, final Class<?>[] testsToExecute,
final Class<?>[] testsToEnforce, final boolean gremlinFlavorSuite,
final TraversalEngine.Type traversalEngineType) throws InitializationError {
super(builder, klass, enforce(testsToExecute, testsToEnforce));
this.gremlinFlavorSuite = gremlinFlavorSuite;
// figures out what the implementer assigned as the GraphProvider class and make it available to tests.
// the klass is the Suite that implements this suite (e.g. GroovyTinkerGraphProcessStandardTest).
// this class should be annotated with GraphProviderClass. Failure to do so will toss an InitializationError
final Pair<Class<? extends GraphProvider>, Class<? extends Graph>> pair = getGraphProviderClass(klass);
// the GraphProvider.Descriptor is only needed right now if the test if for a computer engine - an
// exception is thrown if it isn't present.
final Optional<GraphProvider.Descriptor> graphProviderDescriptor = getGraphProviderDescriptor(traversalEngineType, pair.getValue0());
// validate public acknowledgement of the test suite and filter out tests ignored by the implementation
validateOptInToSuite(pair.getValue1());
validateOptInAndOutAnnotationsOnGraph(pair.getValue1());
registerOptOuts(pair.getValue1(), graphProviderDescriptor, traversalEngineType);
try {
final GraphProvider graphProvider = pair.getValue0().newInstance();
GraphManager.setGraphProvider(graphProvider);
GraphManager.setTraversalEngineType(traversalEngineType);
} catch (Exception ex) {
throw new InitializationError(ex);
}
}
示例4: getGraphProviderDescriptor
import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine; //导入方法依赖的package包/类
private Optional<GraphProvider.Descriptor> getGraphProviderDescriptor(final TraversalEngine.Type traversalEngineType,
final Class<? extends GraphProvider> klass) throws InitializationError {
final GraphProvider.Descriptor descriptorAnnotation = klass.getAnnotation(GraphProvider.Descriptor.class);
if (traversalEngineType == TraversalEngine.Type.COMPUTER) {
// can't be null if this is graph computer business
if (null == descriptorAnnotation)
throw new InitializationError(String.format("For 'computer' tests, '%s' must have a GraphProvider.Descriptor annotation", klass.getName()));
}
return Optional.ofNullable(descriptorAnnotation);
}
示例5: OptOutTestFilter
import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine; //导入方法依赖的package包/类
public OptOutTestFilter(final Graph.OptOut[] optOuts,
final Optional<GraphProvider.Descriptor> graphProviderDescriptor,
final TraversalEngine.Type traversalEngineType) {
this.graphProviderDescriptor = graphProviderDescriptor;
this.traversalEngineType = traversalEngineType;
// split the tests to filter into two groups - true represents those that should ignore a whole
final Map<Boolean, List<Graph.OptOut>> split = Arrays.stream(optOuts)
.filter(this::checkGraphProviderDescriptorForComputer)
.collect(Collectors.groupingBy(optOut -> optOut.method().equals("*")));
final List<Graph.OptOut> optOutsOfIndividualTests = split.getOrDefault(Boolean.FALSE, Collections.emptyList());
individualSpecificTestsToIgnore = optOutsOfIndividualTests.stream()
.filter(ignoreTest -> !ignoreTest.method().equals("*"))
.filter(allowAbstractMethod(false))
.<Pair>map(ignoreTest -> Pair.with(ignoreTest.test(), ignoreTest.specific().isEmpty() ? ignoreTest.method() : String.format("%s[%s]", ignoreTest.method(), ignoreTest.specific())))
.<Description>map(p -> Description.createTestDescription(p.getValue0().toString(), p.getValue1().toString()))
.collect(Collectors.toList());
testGroupToIgnore = optOutsOfIndividualTests.stream()
.filter(ignoreTest -> !ignoreTest.method().equals("*"))
.filter(allowAbstractMethod(true))
.<Pair>map(ignoreTest -> Pair.with(ignoreTest.test(), ignoreTest.specific().isEmpty() ? ignoreTest.method() : String.format("%s[%s]", ignoreTest.method(), ignoreTest.specific())))
.<Description>map(p -> Description.createTestDescription(p.getValue0().toString(), p.getValue1().toString()))
.collect(Collectors.toList());
entireTestCaseToIgnore = split.getOrDefault(Boolean.TRUE, Collections.emptyList());
}
示例6: initialize
import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine; //导入方法依赖的package包/类
@Override
public void initialize(final TraversalEngine.Type traversalEngineType, final List<Traversal.Admin<Object, Object>> traversals) {
this.traversals = traversals;
}
示例7: setTraversalEngineType
import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine; //导入方法依赖的package包/类
public static TraversalEngine.Type setTraversalEngineType(final TraversalEngine.Type traversalEngine) {
final TraversalEngine.Type old = GraphManager.traversalEngineType;
GraphManager.traversalEngineType = traversalEngine;
return old;
}
示例8: getTraversalEngineType
import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine; //导入方法依赖的package包/类
public static TraversalEngine.Type getTraversalEngineType() {
return traversalEngineType;
}