Search in sources :

Example 6 with NeutronNetworksNorthboundAction

use of org.apache.cloudstack.network.opendaylight.api.resources.NeutronNetworksNorthboundAction in project cloudstack by apache.

the class NeutronRestApiMock method neutronNetworksFail.

@Test(expected = NeutronRestApiException.class)
public void neutronNetworksFail() throws NeutronRestApiException {
    URL url;
    try {
        url = new URL("http://localhost:8080");
        NeutronNetworksNorthboundAction neutron = new NeutronNetworksNorthboundAction(url, "admin", "admin");
        neutron.listAllNetworks();
    } catch (MalformedURLException e) {
        Assert.fail("Should not fail here.");
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) URL(java.net.URL) NeutronNetworksNorthboundAction(org.apache.cloudstack.network.opendaylight.api.resources.NeutronNetworksNorthboundAction) Test(org.junit.Test)

Example 7 with NeutronNetworksNorthboundAction

use of org.apache.cloudstack.network.opendaylight.api.resources.NeutronNetworksNorthboundAction in project cloudstack by apache.

the class NeutronRestApiMock method neutronHTTPGetMethod.

/*
     * Test fails because there is no controller. It's used only to test that
     * the HTTP methods are correct.
     */
@Test(expected = NeutronRestApiException.class)
public void neutronHTTPGetMethod() throws NeutronRestApiException {
    URL url;
    try {
        url = new URL("http://localhost:8080");
        NeutronNetworksNorthboundAction neutron = new NeutronNetworksNorthboundAction(url, "admin", "admin");
        neutron.listAllNetworks();
    } catch (MalformedURLException e) {
        Assert.fail("Should not fail here.");
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) URL(java.net.URL) NeutronNetworksNorthboundAction(org.apache.cloudstack.network.opendaylight.api.resources.NeutronNetworksNorthboundAction) Test(org.junit.Test)

Example 8 with NeutronNetworksNorthboundAction

use of org.apache.cloudstack.network.opendaylight.api.resources.NeutronNetworksNorthboundAction in project cloudstack by apache.

the class NeutronRestApiMock method neutronFindNetworkByIdFail.

@Test(expected = NeutronRestApiException.class)
public void neutronFindNetworkByIdFail() throws NeutronRestApiException {
    URL url;
    try {
        url = new URL("http://localhost:8080");
        NeutronNetworksNorthboundAction neutron = new NeutronNetworksNorthboundAction(url, "admin", "admin");
        neutron.findNetworkById("0AACEED5-A688-429A-92FC-E1C9E4EEEE98");
    } catch (MalformedURLException e) {
        Assert.fail("Should not fail here.");
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) URL(java.net.URL) NeutronNetworksNorthboundAction(org.apache.cloudstack.network.opendaylight.api.resources.NeutronNetworksNorthboundAction) Test(org.junit.Test)

Aggregations

NeutronNetworksNorthboundAction (org.apache.cloudstack.network.opendaylight.api.resources.NeutronNetworksNorthboundAction)8 MalformedURLException (java.net.MalformedURLException)7 URL (java.net.URL)7 Test (org.junit.Test)7 NeutronNetworkWrapper (org.apache.cloudstack.network.opendaylight.api.model.NeutronNetworkWrapper)4 NeutronNetwork (org.apache.cloudstack.network.opendaylight.api.model.NeutronNetwork)3 Random (java.util.Random)1 ConfigureNetworkAnswer (org.apache.cloudstack.network.opendaylight.agent.responses.ConfigureNetworkAnswer)1 NeutronRestApiException (org.apache.cloudstack.network.opendaylight.api.NeutronRestApiException)1