<commit_before>package com.tinkerpop.gremlin.scala

import com.tinkerpop.gremlin.AbstractGremlinSuite
import com.tinkerpop.gremlin.AbstractGraphProvider
import com.tinkerpop.gremlin.process.ProcessStandardSuite
import com.tinkerpop.tinkergraph.TinkerGraph
import org.junit.runner.RunWith
import org.junit.runners.model.RunnerBuilder
import java.util.{Map => JMap}
import java.io.File
import org.apache.commons.configuration.Configuration
import scala.collection.JavaConversions._
import com.tinkerpop.gremlin.process.steps.filter.DedupTest
import com.tinkerpop.gremlin.process._

class ScalaProcessStandardSuite(clazz: Class[_], builder: RunnerBuilder) extends AbstractGremlinSuite(clazz, builder, Array(
    classOf[Tests.ScalaDedupTest]))

// actual tests are inside an object so that they are not executed twice
object Tests {
  class ScalaDedupTest extends DedupTest {
      //TODO: provide implicit conversion to traversal incl. cast?
    override def get_g_V_both_dedup_name(): Traversal[Vertex, String] = 
      ScalaGraph(g).V.both.dedup.value[String]("name").traversal.asInstanceOf[Traversal[Vertex, String]]

      //TODO properly implement dedup
    override def get_g_V_both_dedupXlangX_name(): Traversal[Vertex, String] = 
      ScalaGraph(g).V.both.dedup.value[String]("name").traversal.asInstanceOf[Traversal[Vertex, String]]
  }
}

@RunWith(classOf[ScalaProcessStandardSuite]) 
@AbstractGremlinSuite.GraphProviderClass(classOf[ScalaTinkerGraphProcessStandardTest])
class ScalaTinkerGraphProcessStandardTest extends AbstractGraphProvider {
  override def getBaseConfiguration(graphName: String): JMap[String, AnyRef] =
    Map("gremlin.graph" -> classOf[TinkerGraph].getName)

  override def clear(graph: Graph, configuration: Configuration): Unit = {
    graph.close()
    if (configuration.containsKey("gremlin.tg.directory"))
      new File(configuration.getString("gremlin.tg.directory")).delete()
  }
}<commit_msg>auto-convert to Traversal<commit_after>package com.tinkerpop.gremlin.scala

import com.tinkerpop.gremlin.AbstractGremlinSuite
import com.tinkerpop.gremlin.AbstractGraphProvider
import com.tinkerpop.gremlin.process.ProcessStandardSuite
import com.tinkerpop.tinkergraph.TinkerGraph
import org.junit.runner.RunWith
import org.junit.runners.model.RunnerBuilder
import java.util.{Map => JMap}
import java.io.File
import org.apache.commons.configuration.Configuration
import scala.collection.JavaConversions._
import com.tinkerpop.gremlin.process.steps.filter.DedupTest
import com.tinkerpop.gremlin.process._

class ScalaProcessStandardSuite(clazz: Class[_], builder: RunnerBuilder) extends AbstractGremlinSuite(clazz, builder, Array(
    classOf[Tests.ScalaDedupTest]))

trait StandardTest {
  implicit def toTraversal[S,E](gs: GremlinScala[_,E]): Traversal[S,E] = gs.traversal.asInstanceOf[Traversal[S,E]]
}

// actual tests are inside an object so that they are not executed twice
object Tests {
  class ScalaDedupTest extends DedupTest with StandardTest {
    override def get_g_V_both_dedup_name(): Traversal[Vertex, String] = 
      ScalaGraph(g).V.both.dedup.value[String]("name")

      //TODO properly implement dedup
    override def get_g_V_both_dedupXlangX_name(): Traversal[Vertex, String] = 
      ScalaGraph(g).V.both.dedup.value[String]("name")
  }
}

@RunWith(classOf[ScalaProcessStandardSuite]) 
@AbstractGremlinSuite.GraphProviderClass(classOf[ScalaTinkerGraphProcessStandardTest])
class ScalaTinkerGraphProcessStandardTest extends AbstractGraphProvider {
  override def getBaseConfiguration(graphName: String): JMap[String, AnyRef] =
    Map("gremlin.graph" -> classOf[TinkerGraph].getName)

  override def clear(graph: Graph, configuration: Configuration): Unit = {
    graph.close()
    if (configuration.containsKey("gremlin.tg.directory"))
      new File(configuration.getString("gremlin.tg.directory")).delete()
  }
}
{'fraction_non_alphanumeric': 0.10258397932816538, 'fraction_numerical': 0.0, 'mean_word_length': 6.155268022181146, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7491546', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1168, 'n_words': 218}