test_class.file: spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/traversal/strategy/optimization/SparkInterceptorStrategyTest.java
test_class.identifier: SparkInterceptorStrategyTest
test_class.superclass: extends AbstractSparkTest
test_case.body: @Test
      public void shouldSuccessfullyEvaluateInterceptedTraversals() throws Exception {
          final Configuration configuration = getBaseConfiguration();
          configuration.setProperty(Constants.GREMLIN_HADOOP_INPUT_LOCATION, SparkHadoopGraphProvider.PATHS.get("tinkerpop-modern.kryo"));
          configuration.setProperty(Constants.GREMLIN_HADOOP_GRAPH_READER, GryoInputFormat.class.getCanonicalName());
          configuration.setProperty(Constants.GREMLIN_HADOOP_GRAPH_WRITER, PersistedOutputRDD.class.getCanonicalName());
          configuration.setProperty(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION, TestHelper.makeTestDataDirectory(SparkSingleIterationStrategyTest.class, UUID.randomUUID().toString()));
          configuration.setProperty(Constants.GREMLIN_HADOOP_DEFAULT_GRAPH_COMPUTER, SparkGraphComputer.class.getCanonicalName());
          configuration.setProperty(Constants.GREMLIN_SPARK_PERSIST_CONTEXT, true);
          ///
          Graph graph = GraphFactory.open(configuration);
          GraphTraversalSource g = graph.traversal().withComputer().withoutStrategies(SparkSingleIterationStrategy.class);
          assertFalse(g.getStrategies().toList().contains(SparkSingleIterationStrategy.instance()));
          assertFalse(g.V().count().explain().toString().contains(SparkSingleIterationStrategy.class.getSimpleName()));
          assertTrue(g.getStrategies().toList().contains(SparkInterceptorStrategy.instance()));
          assertTrue(g.V().count().explain().toString().contains(SparkInterceptorStrategy.class.getSimpleName()));
          /// SparkCountInterceptor matches
          test(SparkStarBarrierInterceptor.class, 6l, g.V().count());
          test(SparkStarBarrierInterceptor.class, 2l, g.V().hasLabel("software").count());
          test(SparkStarBarrierInterceptor.class, 2l, g.V().hasLabel("person").has("age", P.gt(30)).count());
          test(SparkStarBarrierInterceptor.class, 2l, g.V().hasLabel("person").has("age", P.gt(30)).values("name").count());
          test(SparkStarBarrierInterceptor.class, 2l, g.V().hasLabel("person").has("age", P.gt(30)).properties("name").count());
          test(SparkStarBarrierInterceptor.class, 4l, g.V().hasLabel("person").has("age", P.gt(30)).properties("name", "age").count());
          test(SparkStarBarrierInterceptor.class, 3l, g.V().hasLabel("person").has("age", P.gt(30)).out().count());
          test(SparkStarBarrierInterceptor.class, 0l, g.V().hasLabel("person").has("age", P.gt(30)).out("knows").count());
          test(SparkStarBarrierInterceptor.class, 3l, g.V().has(T.label, P.not(P.within("robot", "android")).and(P.within("person", "software"))).hasLabel("person").has("age", P.gt(30)).out("created").count());
          test(SparkStarBarrierInterceptor.class, 3l, g.V(1).out().count());
          test(SparkStarBarrierInterceptor.class, 2l, g.V(1).out("knows").count());
          test(SparkStarBarrierInterceptor.class, 3l, g.V(1).out("knows", "created").count());
          test(SparkStarBarrierInterceptor.class, 5l, g.V(1, 4).out("knows", "created").count());
          test(SparkStarBarrierInterceptor.class, 1l, g.V(2).in("knows").count());
          test(SparkStarBarrierInterceptor.class, 0l, g.V(6).has("name", "peter").in().count());
          test(SparkStarBarrierInterceptor.class, 6l, g.V().as("a").values("name").as("b").count());
          test(SparkStarBarrierInterceptor.class, 6l, g.V().as("a").count());
          test(SparkStarBarrierInterceptor.class, 1l, g.V().has("name", "marko").as("a").values("name").as("b").count());
          test(SparkStarBarrierInterceptor.class, 4l, g.V().has(T.label, P.not(P.within("robot", "android")).and(P.within("person", "software"))).hasLabel("person").has("age").out("created").count());
          test(SparkStarBarrierInterceptor.class, 123l, g.V().has("age").values("age").sum());
          test(SparkStarBarrierInterceptor.class, 67l, g.V().has("age").has("age", P.gt(30)).values("age").sum());
          test(SparkStarBarrierInterceptor.class, 27, g.V().hasLabel("person").values("age").min());
          test(SparkStarBarrierInterceptor.class, 35, g.V().hasLabel("person").values("age").max());
          test(SparkStarBarrierInterceptor.class, new HashMap<String, Long>() {{
              put("software", 2l);
              put("person", 4l);
          }}, g.V().<String>groupCount().by(T.label));
          test(SparkStarBarrierInterceptor.class, Collections.singletonMap("person", 2l), g.V().has("person", "age", P.lt(30)).<String>groupCount().by(T.label));
          test(SparkStarBarrierInterceptor.class, new HashMap<String, Long>() {{
              put("software", 2l);
              put("person", 4l);
          }}, g.V().<String, Long>group().by(T.label).by(__.count()));
          test(SparkStarBarrierInterceptor.class, 123l, g.V().hasLabel("person").values("age").fold(0l, Operator.sum));
          /// No interceptor matches
          test(2l, g.V().out().out().count());
          test(6l, g.E().count());
          test(2l, g.V().out().out().count());
          test(6l, g.V().out().values("name").count());
          test(2l, g.V().out("knows").values("name").count());
          test(3l, g.V().in().has("name", "marko").count());
          test(6l, g.V().repeat(__.dedup()).times(2).count());
          test(6l, g.V().dedup().count());
          test(4l, g.V().hasLabel("person").order().by("age").count());
          test(1l, g.V().count().count());
          test(2l, g.V().limit(2).count());
          test(3l, g.V().tail(3).count());
      }
test_case.class_method_signature: SparkInterceptorStrategyTest.shouldSuccessfullyEvaluateInterceptedTraversals()
test_case.full_signature: @Test public void shouldSuccessfullyEvaluateInterceptedTraversals()
test_case.identifier: shouldSuccessfullyEvaluateInterceptedTraversals
test_case.invocations: getBaseConfiguration setProperty get setProperty getCanonicalName setProperty getCanonicalName setProperty makeTestDataDirectory toString randomUUID setProperty getCanonicalName setProperty open withoutStrategies withComputer traversal assertFalse contains toList getStrategies instance assertFalse contains toString explain count V getSimpleName assertTrue contains toList getStrategies instance assertTrue contains toString explain count V getSimpleName test count V test count hasLabel V test count has hasLabel V gt test count values has hasLabel V gt test count properties has hasLabel V gt test count properties has hasLabel V gt test count out has hasLabel V gt test count out has hasLabel V gt test count out has hasLabel has V and not within within gt test count out V test count out V test count out V test count out V test count in V test count in has V test count as values as V test count as V test count as values as has V test count out has hasLabel has V and not within within test sum values has V test sum values has has V gt test min values hasLabel V test max values hasLabel V test put put by groupCount V test singletonMap by groupCount has V lt test put put by by group V count test fold values hasLabel V test count out out V test count E test count out out V test count values out V test count values out V test count has in V test count times repeat V dedup test count dedup V test count by order hasLabel V test count count V test count limit V test count tail V
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldSuccessfullyEvaluateInterceptedTraversals()
focal_class.declarator: INSTANCE = new SparkInterceptorStrategy()
focal_class.modifier: private static final
focal_class.original_string: private static final SparkInterceptorStrategy INSTANCE = new SparkInterceptorStrategy();
focal_class.type: SparkInterceptorStrategy
focal_class.var_name: INSTANCE
focal_class.file: spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/traversal/strategy/optimization/SparkInterceptorStrategy.java
focal_class.identifier: SparkInterceptorStrategy
focal_class.interfaces: implements TraversalStrategy.ProviderOptimizationStrategy
focal_class.class_method_signature: SparkInterceptorStrategy.SparkInterceptorStrategy()
focal_class.full_signature: private  SparkInterceptorStrategy()
focal_class.identifier: SparkInterceptorStrategy
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  SparkInterceptorStrategy()
focal_class.class_method_signature: SparkInterceptorStrategy.apply(final Traversal.Admin<?, ?> traversal)
focal_class.full_signature: @Override public void apply(final Traversal.Admin<?, ?> traversal)
focal_class.identifier: apply
focal_class.modifiers: @Override public
focal_class.parameters: (final Traversal.Admin<?, ?> traversal)
focal_class.return: void
focal_class.signature: void apply(final Traversal.Admin<?, ?> traversal)
focal_class.class_method_signature: SparkInterceptorStrategy.instance()
focal_class.full_signature: public static SparkInterceptorStrategy instance()
focal_class.identifier: instance
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: SparkInterceptorStrategy
focal_class.signature: SparkInterceptorStrategy instance()
focal_class.superclass: extends AbstractTraversalStrategy<TraversalStrategy.ProviderOptimizationStrategy>
focal_method.body: public static SparkInterceptorStrategy instance() {
          return INSTANCE;
      }
focal_method.class_method_signature: SparkInterceptorStrategy.instance()
focal_method.full_signature: public static SparkInterceptorStrategy instance()
focal_method.identifier: instance
focal_method.modifiers: public static
focal_method.parameters: ()
focal_method.return: SparkInterceptorStrategy
focal_method.signature: SparkInterceptorStrategy instance()