m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/pl/edu/mimuw
diff options
context:
space:
mode:
authorMartin <marcin.j.chrzanowski@gmail.com>2019-11-24 16:53:37 +0100
committerGitHub <noreply@github.com>2019-11-24 16:53:37 +0100
commit3f7ef0f1929d739be9d4a9176f389f90e3700126 (patch)
tree9c8ae44787f2b9a5d6974200050c36fef40fe962 /src/test/java/pl/edu/mimuw
parentd8c3798d068aa2e128ca7a43a9451ce6d87cc230 (diff)
Validate query names (#33)
Diffstat (limited to 'src/test/java/pl/edu/mimuw')
-rw-r--r--src/test/java/pl/edu/mimuw/cloudatlas/agent/ApiImplementationTests.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/java/pl/edu/mimuw/cloudatlas/agent/ApiImplementationTests.java b/src/test/java/pl/edu/mimuw/cloudatlas/agent/ApiImplementationTests.java
index d98377c..c964ed9 100644
--- a/src/test/java/pl/edu/mimuw/cloudatlas/agent/ApiImplementationTests.java
+++ b/src/test/java/pl/edu/mimuw/cloudatlas/agent/ApiImplementationTests.java
@@ -102,6 +102,18 @@ public class ApiImplementationTests {
assertAttributeInZmiEquals("num_processes", new ValueInt(799l), "/");
}
+ @Test
+ public void testInstallQueryWithInvalidNameFails() throws Exception {
+ String name = "query";
+ String queryCode = "SELECT 1 AS one";
+ try {
+ api.installQuery(name, queryCode);
+ assertTrue("should have thrown", false);
+ } catch (Exception e) {
+ assertEquals("Invalid query identifier", e.getMessage());
+ }
+ }
+
public void assertAttributeInZmiEquals(String attribute, Value expected, String zmiPath) throws Exception {
AttributesMap attributes = api.getZoneAttributeValues(zmiPath);
assertEquals(expected, attributes.get(attribute));