[
https://issues.apache.org/jira/browse/TINKERPOP-1052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15063994#comment-15063994
]
Martin Häusler commented on TINKERPOP-1052:
-------------------------------------------
Thanks for the bugfix, I would gladly test it - if I could find the snapshot.
Checked maven central (no snapshots) and SonaType (no org.apache namespace
there).
Regarding making the "method" and "specific" settings optional - at least in
case of "method", you can simply specify the default in the annotation
interface:
{code}
public @interface OptOut {
public String method() default "*";
// all the rest of the annotation
}
{code}
JUnit won't care, this is only "syntactic sugar", as you already allow the \*
character as wildcard in your code. In fact, for "method", the code above
should already do the trick entirely. As for "specific" - I have used
{{@Parameterized}} tests on several occasions. I don't think that this is a
JUnit issue. Assembling and filtering of the test classes and test methods
appears to happen in Gremlin code. From a first look, this appears to happen in
{{AbstractGremlinSuite}}@143, in the static {{enforce}} method (which is called
by the suite constructor to pass the result to the superclass). Basically this
is the only place that needs to be aware of the contract changes in
{{@OptOut}}, but that's just what I make of it after skimming through the code
base for a couple of minutes.
I'd like to contribute, but all of my time is currently absorbed by the Gremlin
implementation I'm trying to build (which is also why I am detecting these
issues with the test suite - because I actually use it all day long ;) ).
Also, I must admit I'm not very familiar with all of the GitHub stuff (pull
requests etc.), I first need to read up on all of that.
> @Graph.OptOut causes Exception during Suite setup
> -------------------------------------------------
>
> Key: TINKERPOP-1052
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1052
> Project: TinkerPop
> Issue Type: Bug
> Components: test-suite
> Affects Versions: 3.0.2-incubating
> Environment: Java 8, Windows 10 x64, Gradle (Dependencies)
> Reporter: Martin Häusler
> Assignee: stephen mallette
> Priority: Minor
> Fix For: 3.1.1-incubating
>
> Original Estimate: 4h
> Remaining Estimate: 4h
>
> According to the documentation, adding the following annotation to my graph
> class should allow me to opt-out from I/O-Tests, right?
> {code}
> @Graph.OptOut(test = "org.apache.tinkerpop.gremlin.structure.io.IoGraphTest",
> method = "*", reason = "IO Isuses on windows")
> {code}
> ... well, unfortunately starting the test suite with this annotation creates
> the following exception (cancelling the execution of the suite as a whole):
> {code}
> java.lang.NullPointerException
> at java.lang.Class.isAssignableFrom(Native Method)
> at
> org.apache.tinkerpop.gremlin.AbstractGremlinSuite$OptOutTestFilter.lambda$shouldRun$15(AbstractGremlinSuite.java:289)
> at java.util.stream.MatchOps$1MatchSink.accept(Unknown Source)
> at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
> at java.util.ArrayList$ArrayListSpliterator.tryAdvance(Unknown Source)
> at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
> at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
> at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
> at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
> at java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
> at java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
> at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
> at java.util.stream.ReferencePipeline.anyMatch(Unknown Source)
> at
> org.apache.tinkerpop.gremlin.AbstractGremlinSuite$OptOutTestFilter.shouldRun(AbstractGremlinSuite.java:289)
> at
> org.apache.tinkerpop.gremlin.AbstractGremlinSuite$OptOutTestFilter.shouldRun(AbstractGremlinSuite.java:301)
> at org.junit.runners.ParentRunner.shouldRun(ParentRunner.java:434)
> at org.junit.runners.ParentRunner.filter(ParentRunner.java:382)
> at org.junit.runner.manipulation.Filter.apply(Filter.java:97)
> at org.junit.runners.ParentRunner.filter(ParentRunner.java:384)
> at
> org.apache.tinkerpop.gremlin.AbstractGremlinSuite.registerOptOuts(AbstractGremlinSuite.java:136)
> at
> org.apache.tinkerpop.gremlin.AbstractGremlinSuite.<init>(AbstractGremlinSuite.java:93)
> at
> org.apache.tinkerpop.gremlin.structure.StructureStandardSuite.<init>(StructureStandardSuite.java:111)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
> Source)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at
> org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:107)
> at
> org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
> at
> org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
> at
> org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
> at
> org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
> at
> org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:84)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:70)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:43)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
> {code}
> Here's my full graph interface declaration, for reference:
> {code}
> @Graph.OptIn(Graph.OptIn.SUITE_STRUCTURE_STANDARD)
> @Graph.OptOut(test = "org.apache.tinkerpop.gremlin.structure.io.IoGraphTest",
> method = "*", reason = "IO Isuses on windows")
> @GraphFactoryClass(MyGraphFactoryImpl.class)
> public interface MyGraph extends Graph {
> // ...
> }
> {code}
> ... and my test suite declaration:
> {code}
> @RunWith(StructureStandardSuite.class)
> @GraphProviderClass(provider = MyGraphProvider.class, graph = MyGraph.class)
> public class MyGraphStructureStandardTestSuite {
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)