mirror of https://github.com/apache/jclouds.git
Prefer Assert.fail over assert
The former cannot be disabled.
This commit is contained in:
parent
10ab929097
commit
0761874578
|
@ -19,6 +19,7 @@
|
||||||
package org.jclouds.atmos;
|
package org.jclouds.atmos;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.UndeclaredThrowableException;
|
import java.lang.reflect.UndeclaredThrowableException;
|
||||||
|
@ -272,7 +273,7 @@ public class AtmosClientLiveTest extends BaseBlobStoreIntegrationTest {
|
||||||
Strings2.toStringAndClose(URI.create(
|
Strings2.toStringAndClose(URI.create(
|
||||||
"http://accesspoint.emccis.com/rest/objects/" + getBlob.getSystemMetadata().getObjectID()).toURL()
|
"http://accesspoint.emccis.com/rest/objects/" + getBlob.getSystemMetadata().getObjectID()).toURL()
|
||||||
.openStream());
|
.openStream());
|
||||||
assert false : "shouldn't have worked, since it is private";
|
fail("shouldn't have worked, since it is private");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
package org.jclouds.byon.config;
|
package org.jclouds.byon.config;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -144,7 +145,7 @@ public class CacheNodeStoreModuleTest {
|
||||||
assertEquals(map.size(), 0);
|
assertEquals(map.size(), 0);
|
||||||
try {
|
try {
|
||||||
assertEquals(store.getUnchecked(key), null);
|
assertEquals(store.getUnchecked(key), null);
|
||||||
assert false : "should not work as null is invalid";
|
fail("should not work as null is invalid");
|
||||||
} catch (UncheckedExecutionException e) {
|
} catch (UncheckedExecutionException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
package org.jclouds.byon.config;
|
package org.jclouds.byon.config;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -162,7 +163,7 @@ public class YamlNodeStoreModuleTest {
|
||||||
assertEquals(map.size(), 0);
|
assertEquals(map.size(), 0);
|
||||||
try {
|
try {
|
||||||
assertEquals(store.getUnchecked(key), null);
|
assertEquals(store.getUnchecked(key), null);
|
||||||
assert false : "should not work as null is invalid";
|
fail("should not work as null is invalid");
|
||||||
} catch (UncheckedExecutionException e) {
|
} catch (UncheckedExecutionException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ import static org.jclouds.cloudstack.compute.options.CloudStackTemplateOptions.B
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertFalse;
|
import static org.testng.Assert.assertFalse;
|
||||||
import static org.testng.Assert.assertTrue;
|
import static org.testng.Assert.assertTrue;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -179,7 +180,7 @@ public class CloudStackTemplateOptionsTest {
|
||||||
public void testSecurityGroupIdsNullHasDecentMessage() {
|
public void testSecurityGroupIdsNullHasDecentMessage() {
|
||||||
try {
|
try {
|
||||||
new CloudStackTemplateOptions().securityGroupIds(null);
|
new CloudStackTemplateOptions().securityGroupIds(null);
|
||||||
assert false : "should NPE";
|
fail("should NPE");
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
assertEquals(e.getMessage(), "securityGroupIds was null");
|
assertEquals(e.getMessage(), "securityGroupIds was null");
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ package org.jclouds.cloudstack.features;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertTrue;
|
import static org.testng.Assert.assertTrue;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
|
@ -82,7 +83,7 @@ public class SecurityGroupClientLiveTest extends BaseCloudStackClientLiveTest {
|
||||||
checkGroup(group);
|
checkGroup(group);
|
||||||
try {
|
try {
|
||||||
client.getSecurityGroupClient().createSecurityGroup(prefix);
|
client.getSecurityGroupClient().createSecurityGroup(prefix);
|
||||||
assert false;
|
fail("Expected IllegalStateException");
|
||||||
} catch (IllegalStateException e) {
|
} catch (IllegalStateException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static org.jclouds.scriptbuilder.domain.Statements.exec;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertFalse;
|
import static org.testng.Assert.assertFalse;
|
||||||
import static org.testng.Assert.assertNotNull;
|
import static org.testng.Assert.assertNotNull;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
|
@ -233,7 +234,7 @@ public class CloudApplicationArchitecturesEC2ClientLiveTest extends BaseComputeS
|
||||||
private void setUserDataForInstanceInRegion() {
|
private void setUserDataForInstanceInRegion() {
|
||||||
try {
|
try {
|
||||||
client.getInstanceServices().setUserDataForInstanceInRegion(null, instanceId, "test".getBytes());
|
client.getInstanceServices().setUserDataForInstanceInRegion(null, instanceId, "test".getBytes());
|
||||||
assert false : "shouldn't be allowed, as instance needs to be stopped";
|
fail("shouldn't be allowed, as instance needs to be stopped");
|
||||||
} catch (AWSResponseException e) {
|
} catch (AWSResponseException e) {
|
||||||
assertEquals("IncorrectInstanceState", e.getError().getCode());
|
assertEquals("IncorrectInstanceState", e.getError().getCode());
|
||||||
}
|
}
|
||||||
|
@ -243,7 +244,7 @@ public class CloudApplicationArchitecturesEC2ClientLiveTest extends BaseComputeS
|
||||||
try {
|
try {
|
||||||
String ramdisk = client.getInstanceServices().getRamdiskForInstanceInRegion(null, instanceId);
|
String ramdisk = client.getInstanceServices().getRamdiskForInstanceInRegion(null, instanceId);
|
||||||
client.getInstanceServices().setRamdiskForInstanceInRegion(null, instanceId, ramdisk);
|
client.getInstanceServices().setRamdiskForInstanceInRegion(null, instanceId, ramdisk);
|
||||||
assert false : "shouldn't be allowed, as instance needs to be stopped";
|
fail("shouldn't be allowed, as instance needs to be stopped");
|
||||||
} catch (AWSResponseException e) {
|
} catch (AWSResponseException e) {
|
||||||
assertEquals("IncorrectInstanceState", e.getError().getCode());
|
assertEquals("IncorrectInstanceState", e.getError().getCode());
|
||||||
}
|
}
|
||||||
|
@ -253,7 +254,7 @@ public class CloudApplicationArchitecturesEC2ClientLiveTest extends BaseComputeS
|
||||||
try {
|
try {
|
||||||
String oldKernel = client.getInstanceServices().getKernelForInstanceInRegion(null, instanceId);
|
String oldKernel = client.getInstanceServices().getKernelForInstanceInRegion(null, instanceId);
|
||||||
client.getInstanceServices().setKernelForInstanceInRegion(null, instanceId, oldKernel);
|
client.getInstanceServices().setKernelForInstanceInRegion(null, instanceId, oldKernel);
|
||||||
assert false : "shouldn't be allowed, as instance needs to be stopped";
|
fail("shouldn't be allowed, as instance needs to be stopped");
|
||||||
} catch (AWSResponseException e) {
|
} catch (AWSResponseException e) {
|
||||||
assertEquals("IncorrectInstanceState", e.getError().getCode());
|
assertEquals("IncorrectInstanceState", e.getError().getCode());
|
||||||
}
|
}
|
||||||
|
@ -262,7 +263,7 @@ public class CloudApplicationArchitecturesEC2ClientLiveTest extends BaseComputeS
|
||||||
private void setInstanceTypeForInstanceInRegion() {
|
private void setInstanceTypeForInstanceInRegion() {
|
||||||
try {
|
try {
|
||||||
client.getInstanceServices().setInstanceTypeForInstanceInRegion(null, instanceId, InstanceType.C1_MEDIUM);
|
client.getInstanceServices().setInstanceTypeForInstanceInRegion(null, instanceId, InstanceType.C1_MEDIUM);
|
||||||
assert false : "shouldn't be allowed, as instance needs to be stopped";
|
fail("shouldn't be allowed, as instance needs to be stopped");
|
||||||
} catch (AWSResponseException e) {
|
} catch (AWSResponseException e) {
|
||||||
assertEquals("IncorrectInstanceState", e.getError().getCode());
|
assertEquals("IncorrectInstanceState", e.getError().getCode());
|
||||||
}
|
}
|
||||||
|
@ -272,7 +273,7 @@ public class CloudApplicationArchitecturesEC2ClientLiveTest extends BaseComputeS
|
||||||
Map<String, BlockDevice> mapping = Maps.newLinkedHashMap();
|
Map<String, BlockDevice> mapping = Maps.newLinkedHashMap();
|
||||||
try {
|
try {
|
||||||
client.getInstanceServices().setBlockDeviceMappingForInstanceInRegion(null, instanceId, mapping);
|
client.getInstanceServices().setBlockDeviceMappingForInstanceInRegion(null, instanceId, mapping);
|
||||||
assert false : "shouldn't be allowed, as instance needs to be ebs based-ami";
|
fail("shouldn't be allowed, as instance needs to be ebs based-ami");
|
||||||
} catch (AWSResponseException e) {
|
} catch (AWSResponseException e) {
|
||||||
assertEquals("InvalidParameterCombination", e.getError().getCode());
|
assertEquals("InvalidParameterCombination", e.getError().getCode());
|
||||||
}
|
}
|
||||||
|
@ -282,7 +283,7 @@ public class CloudApplicationArchitecturesEC2ClientLiveTest extends BaseComputeS
|
||||||
try {
|
try {
|
||||||
client.getInstanceServices().setInstanceInitiatedShutdownBehaviorForInstanceInRegion(null, instanceId,
|
client.getInstanceServices().setInstanceInitiatedShutdownBehaviorForInstanceInRegion(null, instanceId,
|
||||||
InstanceInitiatedShutdownBehavior.STOP);
|
InstanceInitiatedShutdownBehavior.STOP);
|
||||||
assert false : "shouldn't be allowed, as instance needs to be ebs based-ami";
|
fail("shouldn't be allowed, as instance needs to be ebs based-ami");
|
||||||
} catch (AWSResponseException e) {
|
} catch (AWSResponseException e) {
|
||||||
assertEquals("UnsupportedInstanceAttribute", e.getError().getCode());
|
assertEquals("UnsupportedInstanceAttribute", e.getError().getCode());
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ import static org.easymock.EasyMock.replay;
|
||||||
import static org.easymock.EasyMock.verify;
|
import static org.easymock.EasyMock.verify;
|
||||||
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c1_medium;
|
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c1_medium;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -181,7 +182,7 @@ public class EC2TemplateBuilderImplTest extends TemplateBuilderImplTest {
|
||||||
optionsProvider, templateBuilderProvider);
|
optionsProvider, templateBuilderProvider);
|
||||||
try {
|
try {
|
||||||
template.imageId("ami").build();
|
template.imageId("ami").build();
|
||||||
assert false;
|
fail("Expected IllegalArgumentException");
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.eucalyptus.compute;
|
package org.jclouds.eucalyptus.compute;
|
||||||
|
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import org.jclouds.compute.domain.ExecResponse;
|
import org.jclouds.compute.domain.ExecResponse;
|
||||||
import org.jclouds.compute.domain.NodeMetadata;
|
import org.jclouds.compute.domain.NodeMetadata;
|
||||||
import org.jclouds.ec2.compute.EC2ComputeServiceLiveTest;
|
import org.jclouds.ec2.compute.EC2ComputeServiceLiveTest;
|
||||||
|
@ -42,7 +44,7 @@ public class EucalyptusComputeServiceLiveTest extends EC2ComputeServiceLiveTest
|
||||||
public void testSuspendResume() throws Exception {
|
public void testSuspendResume() throws Exception {
|
||||||
try {
|
try {
|
||||||
super.testSuspendResume();
|
super.testSuspendResume();
|
||||||
assert false;
|
fail("Expected HttpResponseException");
|
||||||
} catch (HttpResponseException e) {
|
} catch (HttpResponseException e) {
|
||||||
// ebs backed not yet available
|
// ebs backed not yet available
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ package org.jclouds.openstack.nova.v2_0.compute.loaders;
|
||||||
|
|
||||||
import static org.easymock.EasyMock.createMock;
|
import static org.easymock.EasyMock.createMock;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
|
@ -80,7 +81,7 @@ public class FindSecurityGroupOrCreateTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SecurityGroupInZone apply(ZoneSecurityGroupNameAndPorts input) {
|
public SecurityGroupInZone apply(ZoneSecurityGroupNameAndPorts input) {
|
||||||
assert false;
|
fail();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +106,7 @@ public class FindSecurityGroupOrCreateTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SecurityGroupInZone apply(ZoneSecurityGroupNameAndPorts input) {
|
public SecurityGroupInZone apply(ZoneSecurityGroupNameAndPorts input) {
|
||||||
assert false;
|
fail();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +131,7 @@ public class FindSecurityGroupOrCreateTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SecurityGroupInZone apply(ZoneSecurityGroupNameAndPorts input) {
|
public SecurityGroupInZone apply(ZoneSecurityGroupNameAndPorts input) {
|
||||||
assert false;
|
fail();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ import static org.jclouds.trmk.vcloud_0_8.options.CloneVAppOptions.Builder.deplo
|
||||||
import static org.jclouds.trmk.vcloud_0_8.options.InstantiateVAppTemplateOptions.Builder.processorCount;
|
import static org.jclouds.trmk.vcloud_0_8.options.InstantiateVAppTemplateOptions.Builder.processorCount;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertNotNull;
|
import static org.testng.Assert.assertNotNull;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
@ -348,13 +349,13 @@ public abstract class TerremarkClientLiveTest<S extends TerremarkVCloudClient, A
|
||||||
|
|
||||||
try {// per docs, this is not supported
|
try {// per docs, this is not supported
|
||||||
connection.undeployVApp(vApp.getHref());
|
connection.undeployVApp(vApp.getHref());
|
||||||
assert false;
|
fail("Expected UnsupportedOperationException");
|
||||||
} catch (UnsupportedOperationException e) {
|
} catch (UnsupportedOperationException e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {// per docs, this is not supported
|
try {// per docs, this is not supported
|
||||||
connection.suspendVApp(vApp.getHref());
|
connection.suspendVApp(vApp.getHref());
|
||||||
assert false;
|
fail("Expected UnsupportedOperationException");
|
||||||
} catch (UnsupportedOperationException e) {
|
} catch (UnsupportedOperationException e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static org.easymock.EasyMock.expect;
|
||||||
import static org.easymock.EasyMock.replay;
|
import static org.easymock.EasyMock.replay;
|
||||||
import static org.easymock.EasyMock.verify;
|
import static org.easymock.EasyMock.verify;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -242,7 +243,7 @@ public class TemplateBuilderImplTest {
|
||||||
optionsProvider, templateBuilderProvider);
|
optionsProvider, templateBuilderProvider);
|
||||||
try {
|
try {
|
||||||
template.imageId("us-east-1/imageId").build();
|
template.imageId("us-east-1/imageId").build();
|
||||||
assert false;
|
fail("Expected NoSuchElementException");
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
// make sure message is succinct
|
// make sure message is succinct
|
||||||
assertEquals(e.getMessage(), "no hardware profiles support images matching params: idEquals(differentImageId)");
|
assertEquals(e.getMessage(), "no hardware profiles support images matching params: idEquals(differentImageId)");
|
||||||
|
@ -380,7 +381,7 @@ public class TemplateBuilderImplTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
template.imageId("foo").locationId("location").build();
|
template.imageId("foo").locationId("location").build();
|
||||||
assert false;
|
fail("Expected NoSuchElementException");
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -413,7 +414,7 @@ public class TemplateBuilderImplTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
template.imageId("foo").options(provideTemplateOptions()).locationId("location").build();
|
template.imageId("foo").options(provideTemplateOptions()).locationId("location").build();
|
||||||
assert false;
|
fail("Expected NoSuchElementException");
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -442,7 +443,7 @@ public class TemplateBuilderImplTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
template.os64Bit(true).build();
|
template.os64Bit(true).build();
|
||||||
assert false;
|
fail("Expected IllegalStateException");
|
||||||
} catch (IllegalStateException e) {
|
} catch (IllegalStateException e) {
|
||||||
assertEquals(e.getMessage(), "no images present!");
|
assertEquals(e.getMessage(), "no images present!");
|
||||||
}
|
}
|
||||||
|
@ -470,7 +471,7 @@ public class TemplateBuilderImplTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
template.os64Bit(true).build();
|
template.os64Bit(true).build();
|
||||||
assert false;
|
fail("Expected IllegalStateException");
|
||||||
} catch (IllegalStateException e) {
|
} catch (IllegalStateException e) {
|
||||||
assertEquals(e.getMessage(), "no hardware profiles present!");
|
assertEquals(e.getMessage(), "no hardware profiles present!");
|
||||||
}
|
}
|
||||||
|
@ -499,7 +500,7 @@ public class TemplateBuilderImplTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
template.imageId("region/imageId2").build();
|
template.imageId("region/imageId2").build();
|
||||||
assert false;
|
fail("Expected NoSuchElementException");
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
// make sure big data is not in the exception message
|
// make sure big data is not in the exception message
|
||||||
assertEquals(e.getMessage(), "imageId(region/imageId2) not found");
|
assertEquals(e.getMessage(), "imageId(region/imageId2) not found");
|
||||||
|
@ -529,7 +530,7 @@ public class TemplateBuilderImplTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
template.imageDescriptionMatches("notDescription").build();
|
template.imageDescriptionMatches("notDescription").build();
|
||||||
assert false;
|
fail("Expected NoSuchElementException");
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
// make sure big data is not in the exception message
|
// make sure big data is not in the exception message
|
||||||
assertEquals(e.getMessage(), "no image matched predicate: And(nullEqualToIsParentOrIsGrandparentOfCurrentLocation(),imageDescription(notDescription))");
|
assertEquals(e.getMessage(), "no image matched predicate: And(nullEqualToIsParentOrIsGrandparentOfCurrentLocation(),imageDescription(notDescription))");
|
||||||
|
@ -564,7 +565,7 @@ public class TemplateBuilderImplTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
template.imageId("region/ami").options(provideTemplateOptions()).build();
|
template.imageId("region/ami").options(provideTemplateOptions()).build();
|
||||||
assert false;
|
fail("Expected NoSuchElementException");
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ import static org.jclouds.compute.predicates.NodePredicates.runningInGroup;
|
||||||
import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
|
import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertNotNull;
|
import static org.testng.Assert.assertNotNull;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -293,7 +294,7 @@ public abstract class BaseComputeServiceLiveTest extends BaseComputeServiceConte
|
||||||
ExecResponse response = null;
|
ExecResponse response = null;
|
||||||
try {
|
try {
|
||||||
response = future.get(1, TimeUnit.MILLISECONDS);
|
response = future.get(1, TimeUnit.MILLISECONDS);
|
||||||
assert false : node.getId() + ": " + response;
|
fail(node.getId() + ": " + response);
|
||||||
} catch (TimeoutException e) {
|
} catch (TimeoutException e) {
|
||||||
assert !future.isDone();
|
assert !future.isDone();
|
||||||
response = client.runScriptOnNode(node.getId(), Statements.exec("/tmp/init-sleeper status"),
|
response = client.runScriptOnNode(node.getId(), Statements.exec("/tmp/init-sleeper status"),
|
||||||
|
@ -305,7 +306,7 @@ public abstract class BaseComputeServiceLiveTest extends BaseComputeServiceConte
|
||||||
assert response.getOutput().trim().equals("") : node.getId() + ": " + response;
|
assert response.getOutput().trim().equals("") : node.getId() + ": " + response;
|
||||||
try {
|
try {
|
||||||
future.get();
|
future.get();
|
||||||
assert false : future;
|
fail(future.toString());
|
||||||
} catch (CancellationException e1) {
|
} catch (CancellationException e1) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class FutureIterablesTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
}, MoreExecutors.sameThreadExecutor(), null, Logger.CONSOLE, "");
|
}, MoreExecutors.sameThreadExecutor(), null, Logger.CONSOLE, "");
|
||||||
assert false;
|
fail("Expected AuthorizationException");
|
||||||
} catch (AuthorizationException e) {
|
} catch (AuthorizationException e) {
|
||||||
assertEquals(counter.get(), 2);
|
assertEquals(counter.get(), 2);
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ public class FutureIterablesTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
}, MoreExecutors.sameThreadExecutor(), null, Logger.CONSOLE, "");
|
}, MoreExecutors.sameThreadExecutor(), null, Logger.CONSOLE, "");
|
||||||
assert false;
|
fail("Expected TransformParallelException");
|
||||||
} catch (TransformParallelException e) {
|
} catch (TransformParallelException e) {
|
||||||
assertEquals(e.getFromToException().size(), 2);
|
assertEquals(e.getFromToException().size(), 2);
|
||||||
assertEquals(counter.get(), 10);
|
assertEquals(counter.get(), 10);
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static org.easymock.EasyMock.expect;
|
||||||
import static org.easymock.EasyMock.replay;
|
import static org.easymock.EasyMock.replay;
|
||||||
import static org.easymock.EasyMock.verify;
|
import static org.easymock.EasyMock.verify;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
@ -80,7 +81,7 @@ public class FuturesTest {
|
||||||
CallGetAndRunExecutionList<String> caller = new CallGetAndRunExecutionList<String>(future, executionList);
|
CallGetAndRunExecutionList<String> caller = new CallGetAndRunExecutionList<String>(future, executionList);
|
||||||
try {
|
try {
|
||||||
caller.run();
|
caller.run();
|
||||||
assert false;
|
fail("Expected IllegalStateException");
|
||||||
} catch (IllegalStateException e) {
|
} catch (IllegalStateException e) {
|
||||||
assertEquals(e.getMessage(), "interrupted calling get() on [EasyMock for interface java.util.concurrent.Future], so could not run listeners");
|
assertEquals(e.getMessage(), "interrupted calling get() on [EasyMock for interface java.util.concurrent.Future], so could not run listeners");
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static org.easymock.EasyMock.expect;
|
||||||
import static org.easymock.EasyMock.replay;
|
import static org.easymock.EasyMock.replay;
|
||||||
import static org.easymock.EasyMock.verify;
|
import static org.easymock.EasyMock.verify;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
@ -61,7 +62,7 @@ public class RetryOnTimeOutExceptionFunctionTest {
|
||||||
delegate);
|
delegate);
|
||||||
try {
|
try {
|
||||||
supplier.apply("baz");
|
supplier.apply("baz");
|
||||||
assert false;
|
fail();
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
assertEquals(e.getCause(), timeout);
|
assertEquals(e.getCause(), timeout);
|
||||||
}
|
}
|
||||||
|
@ -113,7 +114,7 @@ public class RetryOnTimeOutExceptionFunctionTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
supplier.apply("baz");
|
supplier.apply("baz");
|
||||||
assert false;
|
fail();
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
assertEquals(e.getCause(), auth);
|
assertEquals(e.getCause(), auth);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static org.easymock.EasyMock.expect;
|
||||||
import static org.easymock.EasyMock.replay;
|
import static org.easymock.EasyMock.replay;
|
||||||
import static org.easymock.EasyMock.verify;
|
import static org.easymock.EasyMock.verify;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
@ -61,7 +62,7 @@ public class RetryOnTimeOutExceptionSupplierTest {
|
||||||
delegate);
|
delegate);
|
||||||
try {
|
try {
|
||||||
supplier.get();
|
supplier.get();
|
||||||
assert false;
|
fail();
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
assertEquals(e.getCause(), timeout);
|
assertEquals(e.getCause(), timeout);
|
||||||
}
|
}
|
||||||
|
@ -113,7 +114,7 @@ public class RetryOnTimeOutExceptionSupplierTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
supplier.get();
|
supplier.get();
|
||||||
assert false;
|
fail();
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
assertEquals(e.getCause(), auth);
|
assertEquals(e.getCause(), auth);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static org.easymock.EasyMock.expect;
|
||||||
import static org.easymock.EasyMock.replay;
|
import static org.easymock.EasyMock.replay;
|
||||||
import static org.easymock.EasyMock.verify;
|
import static org.easymock.EasyMock.verify;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
@ -233,7 +234,7 @@ Caused by: java.lang.IllegalStateException: foo
|
||||||
static void checkFutureGetFailsWith(Future<?> task, String ...requiredPhrases) throws Exception {
|
static void checkFutureGetFailsWith(Future<?> task, String ...requiredPhrases) throws Exception {
|
||||||
try {
|
try {
|
||||||
task.get();
|
task.get();
|
||||||
assert false : "task should have failed";
|
fail("task should have failed");
|
||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
String trace = Throwables.getStackTraceAsString(e);
|
String trace = Throwables.getStackTraceAsString(e);
|
||||||
for (String requiredPhrase : requiredPhrases) {
|
for (String requiredPhrase : requiredPhrases) {
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
package org.jclouds.functions;
|
package org.jclouds.functions;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
|
@ -56,14 +57,14 @@ public class CacheLearningTest {
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
cache.get("foo");
|
cache.get("foo");
|
||||||
assert false : "expected exception on miss";
|
fail("expected exception on miss");
|
||||||
} catch (CacheLoader.InvalidCacheLoadException e) {
|
} catch (CacheLoader.InvalidCacheLoadException e) {
|
||||||
assertEquals(e.getMessage(), "CacheLoader returned null for key foo.");
|
assertEquals(e.getMessage(), "CacheLoader returned null for key foo.");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
cache.getUnchecked("foo");
|
cache.getUnchecked("foo");
|
||||||
assert false : "expected exception on miss";
|
fail("expected exception on miss");
|
||||||
} catch (CacheLoader.InvalidCacheLoadException e) {
|
} catch (CacheLoader.InvalidCacheLoadException e) {
|
||||||
assertEquals(e.getMessage(), "CacheLoader returned null for key foo.");
|
assertEquals(e.getMessage(), "CacheLoader returned null for key foo.");
|
||||||
}
|
}
|
||||||
|
@ -85,21 +86,21 @@ public class CacheLearningTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
cache.get("exception");
|
cache.get("exception");
|
||||||
assert false : "expected checked exception in loader to rethrow as ExecutionException";
|
fail("expected checked exception in loader to rethrow as ExecutionException");
|
||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
assertEquals(e.getMessage(), "java.lang.Exception: exception");
|
assertEquals(e.getMessage(), "java.lang.Exception: exception");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
cache.get("runtimeexception");
|
cache.get("runtimeexception");
|
||||||
assert false : "expected unchecked exception in loader to rethrow as UncheckedExecutionException";
|
fail("expected unchecked exception in loader to rethrow as UncheckedExecutionException");
|
||||||
} catch (UncheckedExecutionException e) {
|
} catch (UncheckedExecutionException e) {
|
||||||
assertEquals(e.getMessage(), "java.lang.RuntimeException: runtimeexception");
|
assertEquals(e.getMessage(), "java.lang.RuntimeException: runtimeexception");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
cache.getUnchecked("exception");
|
cache.getUnchecked("exception");
|
||||||
assert false : "expected checked exception in loader to rethrow as UncheckedExecutionException, when getUnchecked called";
|
fail("expected checked exception in loader to rethrow as UncheckedExecutionException, when getUnchecked called");
|
||||||
} catch (UncheckedExecutionException e) {
|
} catch (UncheckedExecutionException e) {
|
||||||
assertEquals(e.getMessage(), "java.lang.Exception: exception");
|
assertEquals(e.getMessage(), "java.lang.Exception: exception");
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
package org.jclouds.location.suppliers.implicit;
|
package org.jclouds.location.suppliers.implicit;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -55,7 +56,7 @@ public class FirstNetworkTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fn.get();
|
fn.get();
|
||||||
assert false;
|
fail("Expected NoSuchElementException");
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
assertEquals(e.getMessage(), "none of the locations are scope NETWORK: [servo:PROVIDER, servo-r:REGION]");
|
assertEquals(e.getMessage(), "none of the locations are scope NETWORK: [servo:PROVIDER, servo-r:REGION]");
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
package org.jclouds.location.suppliers.implicit;
|
package org.jclouds.location.suppliers.implicit;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -54,7 +55,7 @@ public class FirstRegionTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fn.get();
|
fn.get();
|
||||||
assert false;
|
fail("Expected NoSuchElementException");
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
assertEquals(e.getMessage(), "none to of the locations are scope REGION: [servo:PROVIDER, servo-z:ZONE]");
|
assertEquals(e.getMessage(), "none to of the locations are scope REGION: [servo:PROVIDER, servo-z:ZONE]");
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
package org.jclouds.location.suppliers.implicit;
|
package org.jclouds.location.suppliers.implicit;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -54,7 +55,7 @@ public class FirstZoneTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fn.get();
|
fn.get();
|
||||||
assert false;
|
fail("Expected NoSuchElementException");
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
assertEquals(e.getMessage(), "none to of the locations are scope ZONE: [servo:PROVIDER, servo-r:REGION]");
|
assertEquals(e.getMessage(), "none to of the locations are scope ZONE: [servo:PROVIDER, servo-r:REGION]");
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
package org.jclouds.location.suppliers.implicit;
|
package org.jclouds.location.suppliers.implicit;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -57,7 +58,7 @@ public class OnlyLocationOrFirstRegionOptionallyMatchingRegionIdTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fn.get();
|
fn.get();
|
||||||
assert false;
|
fail("Expected NoSuchElementException");
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
e.getMessage(),
|
e.getMessage(),
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
package org.jclouds.location.suppliers.implicit;
|
package org.jclouds.location.suppliers.implicit;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -54,7 +55,7 @@ public class OnlyLocationOrFirstZoneTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fn.get();
|
fn.get();
|
||||||
assert false;
|
fail("Expected NoSuchElementException");
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
assertEquals(e.getMessage(), "none to of the locations are scope ZONE: [servo:PROVIDER, servo-r:REGION]");
|
assertEquals(e.getMessage(), "none to of the locations are scope ZONE: [servo:PROVIDER, servo-r:REGION]");
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static org.easymock.EasyMock.expect;
|
||||||
import static org.easymock.EasyMock.replay;
|
import static org.easymock.EasyMock.replay;
|
||||||
import static org.easymock.EasyMock.verify;
|
import static org.easymock.EasyMock.verify;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import org.jclouds.http.HttpResponse;
|
import org.jclouds.http.HttpResponse;
|
||||||
import org.jclouds.http.HttpResponseException;
|
import org.jclouds.http.HttpResponseException;
|
||||||
|
@ -68,7 +69,7 @@ public class MapHttp4xxCodesToExceptionsTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
function.apply(responseException);
|
function.apply(responseException);
|
||||||
assert false;
|
fail();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
assertEquals(e.getClass(), expected);
|
assertEquals(e.getClass(), expected);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ import static org.jclouds.io.Payloads.newInputStreamPayload;
|
||||||
import static org.jclouds.io.Payloads.newStringPayload;
|
import static org.jclouds.io.Payloads.newStringPayload;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertNull;
|
import static org.testng.Assert.assertNull;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -278,7 +279,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
child.getInstance(AsyncCallee.class);
|
child.getInstance(AsyncCallee.class);
|
||||||
assert false : "Callee shouldn't be bound yet";
|
fail("Callee shouldn't be bound yet");
|
||||||
} catch (ConfigurationException e) {
|
} catch (ConfigurationException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -302,7 +303,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
child.getInstance(Callee.class);
|
child.getInstance(Callee.class);
|
||||||
assert false : "Callee shouldn't be bound yet";
|
fail("Callee shouldn't be bound yet");
|
||||||
} catch (ConfigurationException e) {
|
} catch (ConfigurationException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -327,7 +328,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
child.getInstance(AsyncCallee.class);
|
child.getInstance(AsyncCallee.class);
|
||||||
assert false : "Callee shouldn't be bound yet";
|
fail("Callee shouldn't be bound yet");
|
||||||
} catch (ConfigurationException e) {
|
} catch (ConfigurationException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -352,7 +353,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
child.getInstance(AsyncCallee.class);
|
child.getInstance(AsyncCallee.class);
|
||||||
assert false : "Callee shouldn't be bound yet";
|
fail("Callee shouldn't be bound yet");
|
||||||
} catch (ConfigurationException e) {
|
} catch (ConfigurationException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -376,7 +377,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
child.getInstance(AsyncCallee.class);
|
child.getInstance(AsyncCallee.class);
|
||||||
assert false : "Callee shouldn't be bound yet";
|
fail("Callee shouldn't be bound yet");
|
||||||
} catch (ConfigurationException e) {
|
} catch (ConfigurationException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -415,7 +416,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
child.getInstance(AsyncCallee.class);
|
child.getInstance(AsyncCallee.class);
|
||||||
assert false : "Callee shouldn't be bound yet";
|
fail("Callee shouldn't be bound yet");
|
||||||
} catch (ConfigurationException e) {
|
} catch (ConfigurationException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -440,7 +441,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
child.getInstance(Callee.class);
|
child.getInstance(Callee.class);
|
||||||
assert false : "Callee shouldn't be bound yet";
|
fail("Callee shouldn't be bound yet");
|
||||||
} catch (ConfigurationException e) {
|
} catch (ConfigurationException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ import static org.jclouds.compute.predicates.NodePredicates.runningInGroup;
|
||||||
import static org.jclouds.scriptbuilder.domain.Statements.exec;
|
import static org.jclouds.scriptbuilder.domain.Statements.exec;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertNotNull;
|
import static org.testng.Assert.assertNotNull;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -177,7 +178,7 @@ public class AWSKeyPairClientLiveTest extends BaseComputeServiceContextLiveTest
|
||||||
// try again to see if there's an error
|
// try again to see if there's an error
|
||||||
try {
|
try {
|
||||||
client.importKeyPairInRegion(null, keyName, myKey.get("public"));
|
client.importKeyPairInRegion(null, keyName, myKey.get("public"));
|
||||||
assert false;
|
fail("Expected IllegalStateException");
|
||||||
} catch (IllegalStateException e) {
|
} catch (IllegalStateException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static com.google.common.collect.Lists.newArrayList;
|
||||||
import static com.google.common.collect.Sets.newTreeSet;
|
import static com.google.common.collect.Sets.newTreeSet;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertNotNull;
|
import static org.testng.Assert.assertNotNull;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -106,7 +107,7 @@ public class PlacementGroupClientLiveTest extends BaseComputeServiceContextLiveT
|
||||||
if (!supportedRegions.contains(region))
|
if (!supportedRegions.contains(region))
|
||||||
try {
|
try {
|
||||||
client.getPlacementGroupServices().describePlacementGroupsInRegion(region);
|
client.getPlacementGroupServices().describePlacementGroupsInRegion(region);
|
||||||
assert false : "should be unsupported for region: " + region;
|
fail("should be unsupported for region: " + region);
|
||||||
} catch (UnsupportedOperationException e) {
|
} catch (UnsupportedOperationException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.jclouds.gogrid.services;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertTrue;
|
import static org.testng.Assert.assertTrue;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
|
@ -110,7 +111,7 @@ public class GridServerClientExpectTest extends BaseGoGridRestClientExpectTest {
|
||||||
GoGridClient clientWhenGridServersNotFound = requestSendsResponse(listGridServers, listGridServersResponse);
|
GoGridClient clientWhenGridServersNotFound = requestSendsResponse(listGridServers, listGridServersResponse);
|
||||||
try {
|
try {
|
||||||
clientWhenGridServersNotFound.getServerServices().getServerCredentials(11);
|
clientWhenGridServersNotFound.getServerServices().getServerCredentials(11);
|
||||||
assert false : "should have failed";
|
fail("should have failed");
|
||||||
} catch (ResourceNotFoundException e) {
|
} catch (ResourceNotFoundException e) {
|
||||||
assertEquals(e.getMessage(), "No object found that matches your input criteria.");
|
assertEquals(e.getMessage(), "No object found that matches your input criteria.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ package org.jclouds.softlayer.compute.options;
|
||||||
|
|
||||||
import static org.jclouds.softlayer.compute.options.SoftLayerTemplateOptions.Builder.domainName;
|
import static org.jclouds.softlayer.compute.options.SoftLayerTemplateOptions.Builder.domainName;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import org.jclouds.compute.options.TemplateOptions;
|
import org.jclouds.compute.options.TemplateOptions;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
@ -61,7 +62,7 @@ public class SoftLayerTemplateOptionsTest {
|
||||||
public void testDomainNameNullHasDecentMessage() {
|
public void testDomainNameNullHasDecentMessage() {
|
||||||
try {
|
try {
|
||||||
new SoftLayerTemplateOptions().domainName(null);
|
new SoftLayerTemplateOptions().domainName(null);
|
||||||
assert false : "should NPE";
|
fail("should NPE");
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
assertEquals(e.getMessage(), "domainName was null");
|
assertEquals(e.getMessage(), "domainName was null");
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertFalse;
|
import static org.testng.Assert.assertFalse;
|
||||||
import static org.testng.Assert.assertNotNull;
|
import static org.testng.Assert.assertNotNull;
|
||||||
import static org.testng.Assert.assertTrue;
|
import static org.testng.Assert.assertTrue;
|
||||||
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
@ -209,7 +210,7 @@ public class PCSClientLiveTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
connection.downloadFile(uriBuilderProvider.get().uri(objectURI).path("sad").build());
|
connection.downloadFile(uriBuilderProvider.get().uri(objectURI).path("sad").build());
|
||||||
assert false;
|
fail("Expected KeyNotFoundException");
|
||||||
} catch (KeyNotFoundException e) {
|
} catch (KeyNotFoundException e) {
|
||||||
}
|
}
|
||||||
// Test GET of object (including updated metadata)
|
// Test GET of object (including updated metadata)
|
||||||
|
|
Loading…
Reference in New Issue