Merge "Add vlan-transparent and mtu attributes to Network pojo"
[neutron.git] / integration / test / src / test / java / org / opendaylight / neutron / e2etest / NeutronLBListenerTests.java
1 /*
2  * Copyright (C) 2015 IBM, Inc.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.neutron.e2etest;
10
11 import java.io.OutputStreamWriter;
12
13 import java.lang.Thread;
14
15 import java.net.HttpURLConnection;
16 import java.net.URL;
17
18 import org.junit.Assert;
19
20 public class NeutronLBListenerTests {
21     String base;
22
23     public NeutronLBListenerTests(String base) {
24         this.base = base;
25     }
26
27     public void listener_collection_get_test() {
28         String url = base + "/lbaas/listeners";
29         ITNeutronE2E.test_fetch(url, "LB Listener Collection GET failed");
30     }
31
32     //TODO handle SB check
33     public void singleton_lb_listener_create_test() {
34         String url = base + "/lbaas/listeners";
35         String content = "{ \"listener\": { " +
36             "\"admin_state_up\": true, " +
37             "\"connection_limit\": 100, " +
38             "\"default_pool_id\": null, " +
39             "\"description\": \"listener one\", " +
40             "\"id\": \"39de4d56-d663-46e5-85a1-5b9d5fa17829\", " +
41             "\"loadbalancers\": [ { " +
42                 "\"id\": \"a36c20d0-18e9-42ce-88fd-82a35977ee8c\" } ], " +
43             "\"name\": \"listener1\", " +
44             "\"protocol\": \"HTTP\", " +
45             "\"protocol_port\": 80, " +
46             "\"tenant_id\": \"b7c1a69e88bf4b21a8148f787aef2081\" } }";
47         ITNeutronE2E.test_create(url, content, "Singleton LB Listener Post Failed NB");
48     }
49
50     public static void runTests(String base) {
51         NeutronLBListenerTests listener_tester = new NeutronLBListenerTests(base);
52         listener_tester.listener_collection_get_test();
53         listener_tester.singleton_lb_listener_create_test();
54     }
55 }