package org.xapek.influxdb import org.junit._ import Assert._ import org.xapek.influxdb.InfluxDB._ @Test class AppTest { @Test def testStatements() = { val db :InfluxDB = fromUrl("http://localhost") assertTrue((SELECT("foo") FROM "bla" WHERE col("a") == "asd") .toString().contains("as")) assertTrue((SELECT("foo")("bla") FROM "bla" WHERE col("a") == "asd") .toString().contains("foo")) assertTrue((SELECT("foo")("bla") FROM "bla" WHERE col("b") == 1) .toString().contains("\"b\" = 1")) assertTrue(( SELECT("foo") FROM "bla" WHERE col("a") == "asd" || col("b") == "C" && col("c") == "d").toString().contains("bla")) assertTrue(( SELECT("foo") FROM "bla" WHERE (col("a") == "asd" || col("b") == "C") && col("c") == "d").toString().contains("foo")) assertTrue(( SELECT("foo") FROM "bla" WHERE (col("a") == "asd" || col("b") == "C") && col("c") == "d" GROUP_BY "asd").toString().contains("GROUP BY")) assertTrue((( SELECT("foo") FROM "bla" WHERE (col("a") == "asd" || col("b") == "C") && col("c") == "d" GROUP_BY ("asd"))("asdasd")).toString().contains("asdasd")) } }