}
@Test
@DB
public void createInvalidlyHostedPrivateNetwork() {
TransactionLegacy __txn;
__txn = TransactionLegacy.open("createInvalidlyHostedPrivateNetworkTest");
/* Network nw; */
try {
/* nw = */
networkService.createPrivateNetwork("bla", "fake", 1L, "vlan:1", "10.1.1.2", null, "10.1.1.1", "255.255.255.0", 1L, 1L, true, 1L);
/* nw = */
networkService.createPrivateNetwork("bla", "fake", 1L, "lswitch:3", "10.1.1.2", null, "10.1.1.1", "255.255.255.0", 1L, 1L, false, 1L);
boolean invalid = false;
boolean unsupported = false;
try {
/* nw = */
networkService.createPrivateNetwork("bla", "fake", 1, "bla:2", "10.1.1.2", null, "10.1.1.1", "255.255.255.0", 1, 1L, true, 1L);
} catch (CloudRuntimeException e) {
Assert.assertEquals("unexpected parameter exception", "string 'bla:2' has an unknown BroadcastDomainType.", e.getMessage());
invalid = true;
}
try {
/* nw = */
networkService.createPrivateNetwork("bla", "fake", 1, "mido://4", "10.1.1.2", null, "10.1.1.1", "255.255.255.0", 1, 1L, false, 1L);
} catch (InvalidParameterValueException e) {
Assert.assertEquals("unexpected parameter exception", "unsupported type of broadcastUri specified: mido://4", e.getMessage());
unsupported = true;
}
Assert.assertEquals("'bla' should not be accepted as scheme", true, invalid);
Assert.assertEquals("'mido' should not yet be supported as scheme", true, unsupported);
} catch (ResourceAllocationException e) {
s_logger.error("no resources", e);
fail("no resources");
} catch (ConcurrentOperationException e) {
s_logger.error("another one is in the way", e);
fail("another one is in the way");
} catch (InsufficientCapacityException e) {
s_logger.error("no capacity", e);
fail("no capacity");
} finally {
__txn.close("createInvalidlyHostedPrivateNetworkTest");
}
}