use of org.junit.jupiter.params.provider.MethodSource in project janusgraph by JanusGraph.
the class JanusGraphStepStrategyTest method doTest.
@ParameterizedTest
@MethodSource("generateTestParameters")
public void doTest(Traversal original, Traversal optimized, Collection<TraversalStrategy> otherStrategies) {
final TraversalStrategies strategies = new DefaultTraversalStrategies();
strategies.addStrategies(JanusGraphStepStrategy.instance());
for (final TraversalStrategy strategy : otherStrategies) {
strategies.addStrategies(strategy);
}
original.asAdmin().setStrategies(strategies);
original.asAdmin().applyStrategies();
assertEquals(optimized, original);
}
use of org.junit.jupiter.params.provider.MethodSource in project janusgraph by JanusGraph.
the class JanusGraphMultiQueryStepTest method testReset.
@ParameterizedTest
@MethodSource("generateTestParameters")
public void testReset(Traversal.Admin traversal, boolean limitBatchSize, Collection<MultiQueriable> clients) {
JanusGraphMultiQueryStep originalStep = new JanusGraphMultiQueryStep(traversal, limitBatchSize);
clients.forEach(originalStep::attachClient);
originalStep.reset();
assertEquals(limitBatchSize, originalStep.isLimitBatchSize());
assertEquals(originalStep.getClientSteps().size(), clients.size());
assertTrue(clients.containsAll(originalStep.getClientSteps()));
assertTrue(originalStep.getClientSteps().containsAll(clients));
}
use of org.junit.jupiter.params.provider.MethodSource in project janusgraph by JanusGraph.
the class JanusGraphMultiQueryStepTest method testClone.
@ParameterizedTest
@MethodSource("generateTestParameters")
public void testClone(Traversal.Admin traversal, boolean limitBatchSize, Collection<MultiQueriable> clients) {
JanusGraphMultiQueryStep originalStep = new JanusGraphMultiQueryStep(traversal, limitBatchSize);
clients.forEach(originalStep::attachClient);
JanusGraphMultiQueryStep clone = originalStep.clone();
assertEquals(limitBatchSize, clone.isLimitBatchSize());
assertEquals(originalStep.getClientSteps().size(), clone.getClientSteps().size());
assertTrue(clone.getClientSteps().containsAll(originalStep.getClientSteps()));
assertTrue(originalStep.getClientSteps().containsAll(clone.getClientSteps()));
}
use of org.junit.jupiter.params.provider.MethodSource in project janusgraph by JanusGraph.
the class JanusGraphTest method testSupportOfDataTypes.
@ParameterizedTest
@MethodSource("generateParametersTestSupportOfDataTypes")
public <T> void testSupportOfDataTypes(Class<T> classes, T data, Equals<T> a) {
clopen(option(CUSTOM_ATTRIBUTE_CLASS, "attribute10"), SpecialInt.class.getCanonicalName(), option(CUSTOM_SERIALIZER_CLASS, "attribute10"), SpecialIntSerializer.class.getCanonicalName());
PropertyKey num = makeKey("propertyKey", classes);
finishSchema();
clopen();
num = tx.getPropertyKey("propertyKey");
JanusGraphVertex v = tx.addVertex();
v.property(VertexProperty.Cardinality.single, n(num), data);
// ######## VERIFICATION ##########
assertTrue(a.verifyValue(v.value("propertyKey")));
clopen();
v = getV(tx, v);
// ######## CHECK AFTER REOPEN ##########
assertTrue(a.verifyValue(v.value("propertyKey")));
}
use of org.junit.jupiter.params.provider.MethodSource in project janusgraph by JanusGraph.
the class GeoshapeGraphBinarySerializerTest method shouldSerializeViaIoRegistry.
@ParameterizedTest
@MethodSource("geoshapeProvider")
public void shouldSerializeViaIoRegistry(Geoshape geoshape) throws IOException {
final GraphBinaryMessageSerializerV1 serializer = new GraphBinaryMessageSerializerV1();
final Map<String, Object> config = new HashMap<>();
config.put(TOKEN_IO_REGISTRIES, Collections.singletonList(JanusGraphIoRegistry.class.getName()));
serializer.configure(config, Collections.emptyMap());
assertSymmetricGeoshapeSerializationInResponseMessage(serializer, geoshape);
}
Aggregations