/*
 * 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 = base + "/metering/metering-label-rules";
        ITNeutronE2E.test_fetch(url, "Metering Rule Collection GET failed");
    }

    //TODO handle SB check
    public void singleton_meteringLabel_create_test() {
        String url = base + "/metering/metering-label-rules";
        String content = "{ \"metering_label_rule\": { " +
            "\"remote_ip_prefix\": \"10.0.1.0/24\", " +
            "\"direction\": \"ingress\", " +
            "\"metering_label_id\": \"bc91b832-8465-40a7-a5d8-ba87de442266\", " +
            "\"id\": \"00e13b58-b4f2-4579-9c9c-7ac94615f9ae\", " +
            "\"excluded\": false } }";
        ITNeutronE2E.test_create(url, content, "Singleton Metering Rule Post Failed NB");
    }

    public static void runTests(String base) {
        NeutronMeteringRuleTests meteringRule_tester = new NeutronMeteringRuleTests(base);
        meteringRule_tester.meteringRule_collection_get_test();
    }
}

@@ -852,13 +852,12 @@
 ring
-Label
+Rule
 _cre
@@ -1391,186 +1391,1159 @@
 lic 
-static void runTests(String base) %7B%0A        NeutronMeteringRuleTests meteringRule_tester = new NeutronMeteringRuleTests(base);%0A        meteringRule_tester.meteringRule_collection
+void meteringRule_element_get_test() %7B%0A        String url = base + %22/metering/metering-label-rules/00e13b58-b4f2-4579-9c9c-7ac94615f9ae%22;%0A        ITNeutronE2E.test_fetch(url, true ,%22Metering Rule Element Get Failed%22);%0A    %7D%0A%0A    public void meteringRule_delete_test() %7B%0A        String url = base + %22/metering/metering-label-rules/00e13b58-b4f2-4579-9c9c-7ac94615f9ae%22;%0A        ITNeutronE2E.test_delete(url, %22Metering Rule Element Delete Failed%22);%0A    %7D%0A%0A    public void meteringRule_element_negative_get_test() %7B%0A        String url = base + %22/metering/metering-label-rules/00e13b58-b4f2-4579-9c9c-7ac94615f9ae%22;%0A        ITNeutronE2E.test_fetch(url, false ,%22Metering Rule Element Negative Get Failed%22);%0A    %7D%0A%0A    public static void runTests(String base) %7B%0A        NeutronMeteringRuleTests meteringRule_tester = new NeutronMeteringRuleTests(base);%0A        meteringRule_tester.meteringRule_collection_get_test();%0A        meteringRule_tester.singleton_meteringRule_create_test();%0A        meteringRule_tester.meteringRule_element_get_test();%0A        meteringRule_tester.meteringRule_delete_test();%0A        meteringRule_tester.meteringRule_element_negative
 _get

Add IT cases for Metering Rules