Repository: incubator-gearpump Updated Branches: refs/heads/master cae9f9c7d -> f200da531
[GEARPUMP-259] fix integration test Be sure to do all of the following to help us incorporate your contribution quickly and easily: - [x] Make sure the commit message is formatted like: `[GEARPUMP-<Jira issue #>] Meaningful description of pull request` - [ ] Make sure tests pass via `sbt clean test`. - [x] Make sure old documentation affected by the pull request has been updated and new documentation added for new functionality. Author: huafengw <[email protected]> Closes #129 from huafengw/fix259. Project: http://git-wip-us.apache.org/repos/asf/incubator-gearpump/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-gearpump/commit/f200da53 Tree: http://git-wip-us.apache.org/repos/asf/incubator-gearpump/tree/f200da53 Diff: http://git-wip-us.apache.org/repos/asf/incubator-gearpump/diff/f200da53 Branch: refs/heads/master Commit: f200da531c2e84d5902836f44200e2cb39511539 Parents: cae9f9c Author: huafengw <[email protected]> Authored: Fri Jan 6 16:18:06 2017 +0800 Committer: manuzhang <[email protected]> Committed: Fri Jan 6 16:18:06 2017 +0800 ---------------------------------------------------------------------- .../gearpump/integrationtest/TestSpecBase.scala | 2 +- .../checklist/CommandLineSpec.scala | 2 +- .../checklist/ConnectorKafkaSpec.scala | 2 +- .../checklist/DynamicDagSpec.scala | 2 +- .../integrationtest/checklist/ExampleSpec.scala | 10 +++---- .../checklist/MessageDeliverySpec.scala | 2 +- .../checklist/StormCompatibilitySpec.scala | 11 ++++---- project/BuildExamples.scala | 29 ++++++++++++-------- project/BuildExperiments.scala | 1 - 9 files changed, 33 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-gearpump/blob/f200da53/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/TestSpecBase.scala ---------------------------------------------------------------------- diff --git a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/TestSpecBase.scala b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/TestSpecBase.scala index 1e49236..a00495a 100644 --- a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/TestSpecBase.scala +++ b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/TestSpecBase.scala @@ -51,7 +51,7 @@ trait TestSpecBase lazy val commandLineClient = cluster.commandLineClient lazy val restClient = cluster.restClient - lazy val wordCountJar = cluster.queryBuiltInExampleJars("wordcount-").head + lazy val wordCountJar = cluster.queryBuiltInExampleJars("wordcount_").head lazy val wordCountName = "wordCount" lazy val wordCountClass = "org.apache.gearpump.streaming.examples.wordcount.WordCount" http://git-wip-us.apache.org/repos/asf/incubator-gearpump/blob/f200da53/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/CommandLineSpec.scala ---------------------------------------------------------------------- diff --git a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/CommandLineSpec.scala b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/CommandLineSpec.scala index f4e463e..3fa6f6a 100644 --- a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/CommandLineSpec.scala +++ b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/CommandLineSpec.scala @@ -90,7 +90,7 @@ class CommandLineSpec extends TestSpecBase { // setup val args = "-debug true -sleep 10" val appId = expectSubmitAppSuccess(wordCountJar, args) - var success = commandLineClient.killApp(appId) + val success = commandLineClient.killApp(appId) success shouldBe true } http://git-wip-us.apache.org/repos/asf/incubator-gearpump/blob/f200da53/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ConnectorKafkaSpec.scala ---------------------------------------------------------------------- diff --git a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ConnectorKafkaSpec.scala b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ConnectorKafkaSpec.scala index d8bdc1e..e69a425 100644 --- a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ConnectorKafkaSpec.scala +++ b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ConnectorKafkaSpec.scala @@ -28,7 +28,7 @@ import org.apache.gearpump.integrationtest.{TestSpecBase, Util} class ConnectorKafkaSpec extends TestSpecBase { private lazy val kafkaCluster = new KafkaCluster(cluster.getNetworkGateway) - private lazy val kafkaJar = cluster.queryBuiltInExampleJars("kafka-").head + private lazy val kafkaJar = cluster.queryBuiltInExampleJars("kafka").head private var producer: NumericalDataProducer = null override def beforeAll(): Unit = { http://git-wip-us.apache.org/repos/asf/incubator-gearpump/blob/f200da53/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/DynamicDagSpec.scala ---------------------------------------------------------------------- diff --git a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/DynamicDagSpec.scala b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/DynamicDagSpec.scala index a1d1162..c4276bd 100644 --- a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/DynamicDagSpec.scala +++ b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/DynamicDagSpec.scala @@ -26,7 +26,7 @@ class DynamicDagSpec extends TestSpecBase { val sourceTaskClass = "org.apache.gearpump.streaming.examples.sol.SOLStreamProducer" val sinkTaskClass = "org.apache.gearpump.streaming.examples.sol.SOLStreamProcessor" - lazy val solJar = cluster.queryBuiltInExampleJars("sol-").head + lazy val solJar = cluster.queryBuiltInExampleJars("sol").head "dynamic dag" should { "can retrieve a list of built-in partitioner classes" in { http://git-wip-us.apache.org/repos/asf/incubator-gearpump/blob/f200da53/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ExampleSpec.scala ---------------------------------------------------------------------- diff --git a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ExampleSpec.scala b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ExampleSpec.scala index 5554a26..97d5daf 100644 --- a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ExampleSpec.scala +++ b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ExampleSpec.scala @@ -32,7 +32,7 @@ class ExampleSpec extends TestSpecBase { "distributed shell" should { "execute commands on machines where its executors are running" in { - val distShellJar = cluster.queryBuiltInExampleJars("distributedshell-").head + val distShellJar = cluster.queryBuiltInExampleJars("distributedshell").head val mainClass = "org.apache.gearpump.examples.distributedshell.DistributedShell" val clientClass = "org.apache.gearpump.examples.distributedshell.DistributedShellClient" val appId = restClient.getNextAvailableAppId() @@ -61,7 +61,7 @@ class ExampleSpec extends TestSpecBase { } "wordcount" should { - val wordCountJarNamePrefix = "wordcount-" + val wordCountJarNamePrefix = "wordcount_" behave like streamingApplication(wordCountJarNamePrefix, wordCountName) "can submit immediately after killing a former one" in { @@ -84,19 +84,19 @@ class ExampleSpec extends TestSpecBase { } "wordcount(java)" should { - val wordCountJavaJarNamePrefix = "wordcountjava-" + val wordCountJavaJarNamePrefix = "wordcountjava" val wordCountJavaName = "wordcountJava" behave like streamingApplication(wordCountJavaJarNamePrefix, wordCountJavaName) } "sol" should { - val solJarNamePrefix = "sol-" + val solJarNamePrefix = "sol" val solName = "sol" behave like streamingApplication(solJarNamePrefix, solName) } "complexdag" should { - val dynamicDagJarNamePrefix = "complexdag-" + val dynamicDagJarNamePrefix = "complexdag" val dynamicDagName = "dag" behave like streamingApplication(dynamicDagJarNamePrefix, dynamicDagName) } http://git-wip-us.apache.org/repos/asf/incubator-gearpump/blob/f200da53/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/MessageDeliverySpec.scala ---------------------------------------------------------------------- diff --git a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/MessageDeliverySpec.scala b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/MessageDeliverySpec.scala index bb9982a..9186364 100644 --- a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/MessageDeliverySpec.scala +++ b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/MessageDeliverySpec.scala @@ -64,7 +64,7 @@ class MessageDeliverySpec extends TestSpecBase { "-sourceTask", sourcePartitionNum).mkString(" ") val appId = restClient.getNextAvailableAppId() - val stateJar = cluster.queryBuiltInExampleJars("state-").head + val stateJar = cluster.queryBuiltInExampleJars("state").head val success = restClient.submitApp(stateJar, executorNum = 1, args = args) success shouldBe true http://git-wip-us.apache.org/repos/asf/incubator-gearpump/blob/f200da53/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/StormCompatibilitySpec.scala ---------------------------------------------------------------------- diff --git a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/StormCompatibilitySpec.scala b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/StormCompatibilitySpec.scala index b327bf4..7c04cc0 100644 --- a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/StormCompatibilitySpec.scala +++ b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/StormCompatibilitySpec.scala @@ -53,7 +53,7 @@ class StormCompatibilitySpec extends TestSpecBase { } def getStormJar(stormVersion: String): String = { - cluster.queryBuiltInITJars(s"storm$stormVersion-").head + cluster.queryBuiltInITJars(s"storm$stormVersion").head } "Storm over Gearpump" should withStorm { @@ -168,11 +168,10 @@ class StormCompatibilitySpec extends TestSpecBase { s"executor $executorToKill killed") // verify no message loss - val detector = new - MessageLossDetector(producer.lastWriteNum) - val kafkaReader = new - SimpleKafkaReader(detector, sinkTopic, host = kafkaCluster.advertisedHost, - port = kafkaCluster.advertisedPort) + val detector = new MessageLossDetector(producer.lastWriteNum) + val kafkaReader = + new SimpleKafkaReader(detector, sinkTopic, host = kafkaCluster.advertisedHost, + port = kafkaCluster.advertisedPort) Util.retryUntil(() => { kafkaReader.read() http://git-wip-us.apache.org/repos/asf/incubator-gearpump/blob/f200da53/project/BuildExamples.scala ---------------------------------------------------------------------- diff --git a/project/BuildExamples.scala b/project/BuildExamples.scala index 5507f00..2af19ba 100644 --- a/project/BuildExamples.scala +++ b/project/BuildExamples.scala @@ -102,23 +102,30 @@ object BuildExamples extends sbt.Build { lazy val distributedshell = Project( id = "gearpump-examples-distributedshell", base = file("examples/distributedshell"), - settings = exampleSettings("org.apache.gearpump.examples.distributedshell.DistributedShell") + settings = commonSettings ++ noPublish ++ myAssemblySettings ++ Seq( + mainClass in(Compile, packageBin) := + Some("org.apache.gearpump.examples.distributedshell.DistributedShell"), + target in assembly := baseDirectory.value.getParentFile / "target" / + CrossVersion.binaryScalaVersion(scalaVersion.value) + ) ).dependsOn(core % "test->test; provided") lazy val distributeservice = Project( id = "gearpump-examples-distributeservice", base = file("examples/distributeservice"), - settings = - exampleSettings("org.apache.gearpump.experiments.distributeservice.DistributeService") ++ - Seq( - libraryDependencies ++= Seq( - "commons-httpclient" % "commons-httpclient" % commonsHttpVersion, - "commons-lang" % "commons-lang" % commonsLangVersion, - "commons-io" % "commons-io" % commonsIOVersion, - "io.spray" %% "spray-can" % sprayVersion, - "io.spray" %% "spray-routing-shapeless2" % sprayVersion - ) + settings = commonSettings ++ noPublish ++ myAssemblySettings ++ Seq( + mainClass in(Compile, packageBin) := + Some("org.apache.gearpump.experiments.distributeservice.DistributeService"), + target in assembly := baseDirectory.value.getParentFile / "target" / + CrossVersion.binaryScalaVersion(scalaVersion.value), + libraryDependencies ++= Seq( + "commons-httpclient" % "commons-httpclient" % commonsHttpVersion, + "commons-lang" % "commons-lang" % commonsLangVersion, + "commons-io" % "commons-io" % commonsIOVersion, + "io.spray" %% "spray-can" % sprayVersion, + "io.spray" %% "spray-routing-shapeless2" % sprayVersion ) + ) ).dependsOn(core % "test->test; provided") lazy val fsio = Project( http://git-wip-us.apache.org/repos/asf/incubator-gearpump/blob/f200da53/project/BuildExperiments.scala ---------------------------------------------------------------------- diff --git a/project/BuildExperiments.scala b/project/BuildExperiments.scala index 550b407..e07b688 100644 --- a/project/BuildExperiments.scala +++ b/project/BuildExperiments.scala @@ -88,7 +88,6 @@ object BuildExperiments extends sbt.Build { exclude("clout", "clout") exclude("compojure", "compojure") exclude("hiccup", "hiccup") - exclude("javax.servlet", "servlet-api") exclude("jline", "jline") exclude("joda-time", "joda-time") exclude("org.clojure", "core.incubator")
