Running Tinkerpop test in Janusgraph repo

Hi I'm trying to run the below Tinkerpop test to test out some of the changes I've made to Janusgraph. By copying the test over from Tinkerpop repo into Janusgraph repo (just for testing one test).
@RunWith(Parameterized.class)
public class TraversalInterruptionTest extends AbstractGremlinProcessTest {
private static final Logger logger = LoggerFactory.getLogger(TraversalInterruptionTest.class);

@Parameterized.Parameters(name = "expectInterruption({0})")
public static Iterable<Object[]> data() {
return Arrays.asList(new Object[][]{
// ...
});
}

@Parameterized.Parameter(value = 0)
public String name;

@Parameterized.Parameter(value = 1)
public Function<GraphTraversalSource,GraphTraversal<?,?>> traversalBeforePause;

@Parameterized.Parameter(value = 2)
public UnaryOperator<GraphTraversal<?,?>> traversalAfterPause;

@Test
@LoadGraphWith(GRATEFUL)
public void shouldRespectThreadInterruptionInVertexStep() throws Exception {
// ...
}
}
@RunWith(Parameterized.class)
public class TraversalInterruptionTest extends AbstractGremlinProcessTest {
private static final Logger logger = LoggerFactory.getLogger(TraversalInterruptionTest.class);

@Parameterized.Parameters(name = "expectInterruption({0})")
public static Iterable<Object[]> data() {
return Arrays.asList(new Object[][]{
// ...
});
}

@Parameterized.Parameter(value = 0)
public String name;

@Parameterized.Parameter(value = 1)
public Function<GraphTraversalSource,GraphTraversal<?,?>> traversalBeforePause;

@Parameterized.Parameter(value = 2)
public UnaryOperator<GraphTraversal<?,?>> traversalAfterPause;

@Test
@LoadGraphWith(GRATEFUL)
public void shouldRespectThreadInterruptionInVertexStep() throws Exception {
// ...
}
}
But I'm getting
java.lang.NullPointerException: Cannot invoke "org.apache.tinkerpop.gremlin.GraphProvider.getStaticFeatures()" because "this.innerGraphProvider" is null
java.lang.NullPointerException: Cannot invoke "org.apache.tinkerpop.gremlin.GraphProvider.getStaticFeatures()" because "this.innerGraphProvider" is null
I need to be able to inject the graph implementation into this test somehow? How can I do that? Thank you.
Solution:
You should copy the test suite definition test
Jump to solution
7 Replies
Painguin
PainguinOP•8mo ago
This workflow was suggested by @Boxuan Li btw. So would be great if you already know the answer 😄
Bo
Bo•8mo ago
Oh nope you don't need to copy this test
Solution
Bo
Bo•8mo ago
You should copy the test suite definition test
Bo
Bo•8mo ago
Search in the TinkerPop repository, there should be a mention of TraversalInterruptionTest .class
Painguin
PainguinOP•8mo ago
I've got this now
java.lang.Exception: The ProcessStandardSuite will not run for this Graph until it is publicly acknowledged with the @OptIn annotation on the Graph instance itself
java.lang.Exception: The ProcessStandardSuite will not run for this Graph until it is publicly acknowledged with the @OptIn annotation on the Graph instance itself
Oh I've got it
Bo
Bo•8mo ago
Sorry let me rephrase my words. Let's say you want to debug TraversalInterruptionTest in JanusGraph. 1. Open JanusGraph repo in your IDE. 2. Find BerkeleyJanusGraphProcessTest - see how it mentions ProcessStandardSuite 3. Open ProcessStandardSuite (either from TinkerPop repo or from your current IDE window directly) 4. Copy it to JanusGraph repo 5. Remove other tests other than TraversalInterruptionTest
Painguin
PainguinOP•8mo ago
Thanks for this, I was able to run the test successfully 💪
Want results from more Discord servers?
Add your server