summaryrefslogtreecommitdiff
path: root/src/test/scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala')
-rw-r--r--src/test/scala/org/xapek/influxdb/AppTest.scala43
-rw-r--r--src/test/scala/org/xapek/influxdb/InfluxdbTest.scala45
2 files changed, 45 insertions, 43 deletions
diff --git a/src/test/scala/org/xapek/influxdb/AppTest.scala b/src/test/scala/org/xapek/influxdb/AppTest.scala
deleted file mode 100644
index 26ed08f..0000000
--- a/src/test/scala/org/xapek/influxdb/AppTest.scala
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.xapek.influxdb
-
-import org.junit._
-import Assert._
-import org.xapek.influxdb.Influxdb._
-
-@Test
-class AppTest {
-
- @Test
- def testStatements() = {
- assertTrue((Influxdb SELECT "foo" FROM "bla" WHERE col("a") == "asd")
- .toString().contains("as"))
-
- assertTrue((Influxdb SELECT List("foo", "bla") FROM "bla" WHERE col("a") == "asd")
- .toString().contains("foo"))
-
- assertTrue((Influxdb SELECT List("foo", "bla") FROM "bla" WHERE col("a") == 1)
- .toString().contains("== 1"))
-
- assertTrue((Influxdb
- SELECT col("foo")
- FROM "bla"
- WHERE col("a") == "asd" || col("b") == "C" && col("c") == "d").toString().contains("bla"))
-
- assertTrue((Influxdb
- SELECT "foo"
- FROM "bla"
- WHERE (col("a") == "asd" || col("b") == "C") && col("c") == "d").toString().contains("foo"))
-
- assertTrue((Influxdb
- SELECT "foo"
- FROM "bla"
- WHERE (col("a") == "asd" || col("b") == "C") && col("c") == "d"
- GROUP_BY "asd").toString().contains("GROUP BY"))
-
- assertTrue((Influxdb
- SELECT col("foo")
- FROM "bla"
- WHERE (col("a") == "asd" || col("b") == "C") && col("c") == "d"
- GROUP_BY "asd" <<= "asd2").toString().contains("asd2"))
- }
-}
diff --git a/src/test/scala/org/xapek/influxdb/InfluxdbTest.scala b/src/test/scala/org/xapek/influxdb/InfluxdbTest.scala
new file mode 100644
index 0000000..806c798
--- /dev/null
+++ b/src/test/scala/org/xapek/influxdb/InfluxdbTest.scala
@@ -0,0 +1,45 @@
+package org.xapek.influxdb
+
+import org.junit._
+import Assert._
+import org.xapek.influxdb.Influxdb._
+
+@Test
+class AppTest {
+
+ @Test
+ def testStatements() = {
+ val url = "http://localhost:8086/query"
+
+ assertTrue((Influxdb.SELECT("foo") FROM "bla" WHERE col("a") == "asd")
+ .toString().contains("as"))
+
+ assertTrue((Influxdb.SELECT("foo")("bla") FROM "bla" WHERE col("a") == "asd")
+ .toString().contains("foo"))
+
+ assertTrue((Influxdb.SELECT("foo")("bla") FROM "bla")
+ .toString().contains("== 1"))
+
+ assertTrue((Influxdb
+ SELECT "foo"
+ FROM "bla"
+ WHERE col("a") == "asd" || col("b") == "C" && col("c") == "d").toString().contains("bla"))
+
+ assertTrue((Influxdb
+ SELECT "foo"
+ FROM "bla"
+ WHERE (col("a") == "asd" || col("b") == "C") && col("c") == "d").toString().contains("foo"))
+
+ // assertTrue((Influxdb
+ // SELECT "foo"
+ // FROM "bla"
+ // WHERE (col("a") == "asd" || col("b") == "C") && col("c") == "d"
+ // GROUP_BY "asd").toString().contains("GROUP BY"))
+
+ // assertTrue((Influxdb
+ // SELECT col("foo")
+ // FROM "bla"
+ // WHERE (col("a") == "asd" || col("b") == "C") && col("c") == "d"
+ // GROUP_BY "asd" <<= "asd2").toString().contains("asd2"))
+ }
+}