Add more classes for E2E Tests
[neutron.git] / integration / test / src / test / java / org / opendaylight / neutron / e2etest / NeutronMeteringRuleTests.java
diff --git a/integration/test/src/test/java/org/opendaylight/neutron/e2etest/NeutronMeteringRuleTests.java b/integration/test/src/test/java/org/opendaylight/neutron/e2etest/NeutronMeteringRuleTests.java
new file mode 100644 (file)
index 0000000..c753dea
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2015 IBM, Inc.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.neutron.e2etest;
+
+import java.io.OutputStreamWriter;
+
+import java.lang.Thread;
+
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+import org.junit.Assert;
+
+public class NeutronMeteringRuleTests {
+    String base;
+
+    public NeutronMeteringRuleTests(String base) {
+        this.base = base;
+    }
+
+    public void meteringRule_collection_get_test() {
+        String url_s = base + "/metering/metering-label-rules";
+        try {
+            URL url = new URL(url_s);
+            HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
+            httpConn.setRequestMethod("GET");
+            httpConn.setRequestProperty("Content-Type", "application/json");
+            httpConn.setRequestProperty("Authorization", "Basic YWRtaW46YWRtaW4=");
+            Assert.assertEquals("Metering Rule Collection GET failed",
+                        200, httpConn.getResponseCode());
+        } catch (Exception e) {
+            Assert.assertFalse("E2E Tests Failed", true);
+        }
+    }
+}