2 * Copyright (C) 2015 IBM, Inc.
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
9 package org.opendaylight.neutron.e2etest;
11 import java.io.OutputStreamWriter;
13 import java.lang.Thread;
15 import java.net.HttpURLConnection;
18 import org.junit.Assert;
20 public class NeutronLBListenerTests {
23 public NeutronLBListenerTests(String base) {
27 public void listener_collection_get_test() {
28 String url = base + "/lbaas/listeners";
29 ITNeutronE2E.test_fetch(url, "LB Listener Collection GET failed");
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");
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();