diff --git a/examples/src/test/java/druid/examples/web/InputSupplierUpdateStreamTest.java b/examples/src/test/java/druid/examples/web/InputSupplierUpdateStreamTest.java index b562286d4a7..df00f598b40 100644 --- a/examples/src/test/java/druid/examples/web/InputSupplierUpdateStreamTest.java +++ b/examples/src/test/java/druid/examples/web/InputSupplierUpdateStreamTest.java @@ -21,8 +21,8 @@ package druid.examples.web; import com.google.common.io.InputSupplier; import junit.framework.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; +import org.junit.Before; +import org.junit.Test; import java.util.ArrayList; import java.util.HashMap; @@ -38,7 +38,7 @@ public class InputSupplierUpdateStreamTest Map expectedAnswer = new HashMap(); String timeDimension; - @BeforeClass + @Before public void setUp() { timeDimension = "time"; diff --git a/examples/src/test/java/druid/examples/web/RenamingKeysUpdateStreamTest.java b/examples/src/test/java/druid/examples/web/RenamingKeysUpdateStreamTest.java index da363eba106..e31b8a8e346 100644 --- a/examples/src/test/java/druid/examples/web/RenamingKeysUpdateStreamTest.java +++ b/examples/src/test/java/druid/examples/web/RenamingKeysUpdateStreamTest.java @@ -21,8 +21,8 @@ package druid.examples.web; import com.google.common.io.InputSupplier; import junit.framework.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; +import org.junit.Before; +import org.junit.Test; import java.util.HashMap; import java.util.Map; @@ -35,7 +35,7 @@ public class RenamingKeysUpdateStreamTest private InputSupplier testCaseSupplier; String timeDimension; - @BeforeClass + @Before public void setUp() { timeDimension = "time"; diff --git a/examples/src/test/java/druid/examples/web/WebFirehoseFactoryTest.java b/examples/src/test/java/druid/examples/web/WebFirehoseFactoryTest.java index f24866c4ca3..755bcfd197a 100644 --- a/examples/src/test/java/druid/examples/web/WebFirehoseFactoryTest.java +++ b/examples/src/test/java/druid/examples/web/WebFirehoseFactoryTest.java @@ -24,6 +24,9 @@ import com.google.common.collect.Lists; import com.metamx.druid.input.InputRow; import com.metamx.druid.realtime.firehose.Firehose; import org.joda.time.DateTime; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; import java.util.Collections; import java.util.List; @@ -36,7 +39,7 @@ public class WebFirehoseFactoryTest private WebFirehoseFactory webbie; private WebFirehoseFactory webbie1; - @BeforeClass + @Before public void setUp() throws Exception { dimensions.add("item1"); @@ -185,7 +188,7 @@ public class WebFirehoseFactoryTest throw new RuntimeException("queue is empty"); } - Assert.assertEquals((float) 2.0, inputRow.getFloatMetric("item2")); + Assert.assertEquals((float) 2.0, inputRow.getFloatMetric("item2"), 0.0f); } private static class MyUpdateStream implements UpdateStream diff --git a/examples/src/test/java/druid/examples/web/WebJsonSupplierTest.java b/examples/src/test/java/druid/examples/web/WebJsonSupplierTest.java index 48a1f5e7c96..c1bc5c4dc34 100644 --- a/examples/src/test/java/druid/examples/web/WebJsonSupplierTest.java +++ b/examples/src/test/java/druid/examples/web/WebJsonSupplierTest.java @@ -19,13 +19,13 @@ package druid.examples.web; -import org.testng.annotations.Test; +import org.junit.Test; import java.net.UnknownHostException; public class WebJsonSupplierTest { - @Test(expectedExceptions = UnknownHostException.class) + @Test(expected = UnknownHostException.class) public void checkInvalidUrl() throws Exception {