diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2015-06-05 23:55:38 +0200 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2015-06-05 23:55:38 +0200 |
commit | 8a17a2f6d77cb6bd3e5629d3944b30f449cb1237 (patch) | |
tree | fe4375cbfb298a1c0e1db1e322e72368bafb7af2 /src/test | |
parent | a52a91d6a96529dbefaae9f682af3a6025190e8d (diff) | |
download | influxdb-tools-8a17a2f6d77cb6bd3e5629d3944b30f449cb1237.tar.gz influxdb-tools-8a17a2f6d77cb6bd3e5629d3944b30f449cb1237.zip |
size typed query builder until WHERE
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/scala/org/xapek/influxdb/AppTest.scala | 43 | ||||
-rw-r--r-- | src/test/scala/org/xapek/influxdb/InfluxdbTest.scala | 45 |
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")) + } +} |