Updated Branches: refs/heads/master 9b360405c -> 7c5411686
SAMZA-114; fixing cyclic dependency between samza-kv and samza-test. Project: http://git-wip-us.apache.org/repos/asf/incubator-samza/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-samza/commit/7c541168 Tree: http://git-wip-us.apache.org/repos/asf/incubator-samza/tree/7c541168 Diff: http://git-wip-us.apache.org/repos/asf/incubator-samza/diff/7c541168 Branch: refs/heads/master Commit: 7c5411686540caab08cfa7a4b03d87b1ce8dd691 Parents: 9b36040 Author: Chris Riccomini <[email protected]> Authored: Fri Jan 3 12:16:47 2014 -0800 Committer: Chris Riccomini <[email protected]> Committed: Fri Jan 3 12:16:47 2014 -0800 ---------------------------------------------------------------------- build.gradle | 3 +- .../scala/org/apache/samza/util/TestUtil.scala | 11 +++++++ .../scala/org/apache/samza/util/TestUtil.scala | 33 -------------------- 3 files changed, 13 insertions(+), 34 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-samza/blob/7c541168/build.gradle ---------------------------------------------------------------------- diff --git a/build.gradle b/build.gradle index 04b0de7..263511c 100644 --- a/build.gradle +++ b/build.gradle @@ -169,7 +169,8 @@ project(":samza-kv_$scalaVersion") { compile "org.clapper:grizzled-slf4j_$scalaVersion:$grizzledVersion" compile "org.fusesource.leveldbjni:leveldbjni-all:$leveldbVersion" testCompile "junit:junit:$junitVersion" - testCompile project(":samza-test_$scalaVersion") + // Depend on samza-core's test classes so TestUtils can be used. + testCompile project(":samza-core_$scalaVersion").sourceSets.test.output } } http://git-wip-us.apache.org/repos/asf/incubator-samza/blob/7c541168/samza-core/src/test/scala/org/apache/samza/util/TestUtil.scala ---------------------------------------------------------------------- diff --git a/samza-core/src/test/scala/org/apache/samza/util/TestUtil.scala b/samza-core/src/test/scala/org/apache/samza/util/TestUtil.scala index 9c225d3..82d4278 100644 --- a/samza-core/src/test/scala/org/apache/samza/util/TestUtil.scala +++ b/samza-core/src/test/scala/org/apache/samza/util/TestUtil.scala @@ -24,6 +24,17 @@ import org.apache.samza.system.SystemStreamPartition import org.apache.samza.util.Util._ import org.junit.Assert._ +object TestUtil { + def expect[T](exception: Class[T], msg: Option[String] = None)(block: => Unit) = try { + block + } catch { + case e => if (msg.isDefined) { + assertEquals(msg.get, e.getMessage) + } + case _ => fail("Expected an NPE.") + } +} + class TestUtil { @Test def testGetTopicPartitionsForTask() { http://git-wip-us.apache.org/repos/asf/incubator-samza/blob/7c541168/samza-test/src/main/scala/org/apache/samza/util/TestUtil.scala ---------------------------------------------------------------------- diff --git a/samza-test/src/main/scala/org/apache/samza/util/TestUtil.scala b/samza-test/src/main/scala/org/apache/samza/util/TestUtil.scala deleted file mode 100644 index 11a7666..0000000 --- a/samza-test/src/main/scala/org/apache/samza/util/TestUtil.scala +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.samza.util - -import org.junit.Assert._ - -object TestUtil { - def expect[T](exception: Class[T], msg: Option[String] = None)(block: => Unit) = try { - block - } catch { - case e => if (msg.isDefined) { - assertEquals(msg.get, e.getMessage) - } - case _ => fail("Expected an NPE.") - } -} \ No newline at end of file
