diff --git a/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/predicates/GetImageWhenStatusActivePredicateWithResultExpectTest.java b/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/predicates/GetImageWhenStatusActivePredicateWithResultExpectTest.java index e479d22897..b026aaa0f3 100644 --- a/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/predicates/GetImageWhenStatusActivePredicateWithResultExpectTest.java +++ b/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/predicates/GetImageWhenStatusActivePredicateWithResultExpectTest.java @@ -18,8 +18,8 @@ */ package org.jclouds.cloudservers.compute.predicates; -import static junit.framework.Assert.assertFalse; -import static junit.framework.Assert.assertTrue; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertTrue; import java.net.URI; import java.util.Map; diff --git a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/GlobalVlanClientExpectTest.java b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/GlobalVlanClientExpectTest.java index 267fc90485..79d722dfef 100644 --- a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/GlobalVlanClientExpectTest.java +++ b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/GlobalVlanClientExpectTest.java @@ -18,7 +18,7 @@ */ package org.jclouds.cloudstack.features; -import static junit.framework.Assert.assertEquals; +import static org.testng.Assert.assertEquals; import java.net.URI; diff --git a/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/CloudWatchLiveTest.java b/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/CloudWatchLiveTest.java index cd635759cc..4bd451e4ee 100644 --- a/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/CloudWatchLiveTest.java +++ b/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/CloudWatchLiveTest.java @@ -22,7 +22,6 @@ import com.google.common.base.Predicate; import com.google.common.collect.Iterables; import com.google.common.collect.Sets; import com.google.common.reflect.TypeToken; -import junit.framework.Assert; import org.jclouds.apis.BaseContextLiveTest; import org.jclouds.cloudwatch.domain.Dimension; import org.jclouds.cloudwatch.domain.MetricDatum; @@ -30,6 +29,7 @@ import org.jclouds.cloudwatch.domain.Unit; import org.jclouds.cloudwatch.options.ListMetricsOptions; import org.jclouds.predicates.RetryablePredicate; import org.jclouds.rest.RestContext; +import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; diff --git a/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/binders/MetricDataBinderTest.java b/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/binders/MetricDataBinderTest.java index 554deab5ca..7c3bbd61f0 100644 --- a/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/binders/MetricDataBinderTest.java +++ b/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/binders/MetricDataBinderTest.java @@ -21,12 +21,12 @@ package org.jclouds.cloudwatch.binders; import com.google.common.collect.ImmutableSet; import com.google.inject.Guice; import com.google.inject.Injector; -import junit.framework.Assert; import org.jclouds.cloudwatch.domain.Dimension; import org.jclouds.cloudwatch.domain.MetricDatum; import org.jclouds.cloudwatch.domain.StatisticValues; import org.jclouds.cloudwatch.domain.Unit; import org.jclouds.http.HttpRequest; +import org.testng.Assert; import org.testng.annotations.Test; import java.net.URI; diff --git a/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/features/MetricClientLiveTest.java b/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/features/MetricClientLiveTest.java index e582f8ff49..9f91fbf94d 100644 --- a/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/features/MetricClientLiveTest.java +++ b/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/features/MetricClientLiveTest.java @@ -18,10 +18,14 @@ */ package org.jclouds.cloudwatch.features; -import com.google.common.base.Predicate; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Iterables; -import junit.framework.Assert; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + +import java.util.Calendar; +import java.util.Date; +import java.util.Set; +import java.util.concurrent.TimeUnit; + import org.jclouds.cloudwatch.domain.Datapoint; import org.jclouds.cloudwatch.domain.Dimension; import org.jclouds.cloudwatch.domain.EC2Constants; @@ -37,15 +41,12 @@ import org.jclouds.cloudwatch.domain.Unit; import org.jclouds.cloudwatch.internal.BaseCloudWatchClientLiveTest; import org.jclouds.cloudwatch.options.ListMetricsOptions; import org.jclouds.predicates.RetryablePredicate; +import org.testng.Assert; import org.testng.annotations.Test; -import java.util.Calendar; -import java.util.Date; -import java.util.Set; -import java.util.concurrent.TimeUnit; - -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; +import com.google.common.base.Predicate; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Iterables; /** * @author Jeremy Whitlock, Adrian Cole diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/compute/predicates/GetImageWhenStatusAvailablePredicateWithResultExpectTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/compute/predicates/GetImageWhenStatusAvailablePredicateWithResultExpectTest.java index 744119fba3..62e69f10c2 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/compute/predicates/GetImageWhenStatusAvailablePredicateWithResultExpectTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/compute/predicates/GetImageWhenStatusAvailablePredicateWithResultExpectTest.java @@ -19,8 +19,8 @@ package org.jclouds.ec2.compute.predicates; -import static junit.framework.Assert.assertFalse; -import static junit.framework.Assert.assertTrue; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertTrue; import java.net.URI; import java.util.Map; diff --git a/apis/filesystem/src/test/java/org/jclouds/filesystem/FilesystemAsyncBlobStoreTest.java b/apis/filesystem/src/test/java/org/jclouds/filesystem/FilesystemAsyncBlobStoreTest.java index 2d31ccf356..36ea8287cc 100644 --- a/apis/filesystem/src/test/java/org/jclouds/filesystem/FilesystemAsyncBlobStoreTest.java +++ b/apis/filesystem/src/test/java/org/jclouds/filesystem/FilesystemAsyncBlobStoreTest.java @@ -36,8 +36,6 @@ import java.util.Iterator; import java.util.Properties; import java.util.Set; -import junit.framework.Assert; - import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.jclouds.ContextBuilder; @@ -752,7 +750,7 @@ public class FilesystemAsyncBlobStoreTest { Blob blobRangeStartAt = blobStore.getBlob(containerName, blob.getMetadata().getName(), getOptionsRangeStartAt); is = blobRangeStartAt.getPayload().getInput(); try { - Assert.assertEquals("bcdefgh", IOUtils.toString(is)); + assertEquals("bcdefgh", IOUtils.toString(is)); } finally { Closeables.closeQuietly(is); } @@ -762,7 +760,7 @@ public class FilesystemAsyncBlobStoreTest { Blob blobRangeTail = blobStore.getBlob(containerName, blob.getMetadata().getName(), getOptionsRangeTail); is = blobRangeTail.getPayload().getInput(); try { - Assert.assertEquals("fgh", IOUtils.toString(is)); + assertEquals("fgh", IOUtils.toString(is)); } finally { Closeables.closeQuietly(is); } @@ -772,7 +770,7 @@ public class FilesystemAsyncBlobStoreTest { Blob blobFragment = blobStore.getBlob(containerName, blob.getMetadata().getName(), getOptionsFragment); is = blobFragment.getPayload().getInput(); try { - Assert.assertEquals("efg", IOUtils.toString(is)); + assertEquals("efg", IOUtils.toString(is)); } finally { Closeables.closeQuietly(is); } diff --git a/apis/nova/src/test/java/org/jclouds/openstack/nova/domain/ServerStatusTest.java b/apis/nova/src/test/java/org/jclouds/openstack/nova/domain/ServerStatusTest.java index 9a1613cfb5..03911f1a6c 100644 --- a/apis/nova/src/test/java/org/jclouds/openstack/nova/domain/ServerStatusTest.java +++ b/apis/nova/src/test/java/org/jclouds/openstack/nova/domain/ServerStatusTest.java @@ -18,9 +18,9 @@ */ package org.jclouds.openstack.nova.domain; -import static junit.framework.Assert.assertTrue; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertTrue; import java.util.Arrays; import java.util.List; diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v1_1/compute/predicates/GetImageWhenImageInZoneHasActiveStatusPredicateWithResultExpectTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v1_1/compute/predicates/GetImageWhenImageInZoneHasActiveStatusPredicateWithResultExpectTest.java index ccfaabcafb..00ae153070 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v1_1/compute/predicates/GetImageWhenImageInZoneHasActiveStatusPredicateWithResultExpectTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v1_1/compute/predicates/GetImageWhenImageInZoneHasActiveStatusPredicateWithResultExpectTest.java @@ -19,8 +19,8 @@ package org.jclouds.openstack.nova.v1_1.compute.predicates; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertTrue; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; import java.util.Map; diff --git a/compute/src/test/java/org/jclouds/compute/extensions/internal/BaseImageExtensionLiveTest.java b/compute/src/test/java/org/jclouds/compute/extensions/internal/BaseImageExtensionLiveTest.java index 9519832ef6..5e538f6011 100644 --- a/compute/src/test/java/org/jclouds/compute/extensions/internal/BaseImageExtensionLiveTest.java +++ b/compute/src/test/java/org/jclouds/compute/extensions/internal/BaseImageExtensionLiveTest.java @@ -19,8 +19,8 @@ package org.jclouds.compute.extensions.internal; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertTrue; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; @@ -96,7 +96,7 @@ public abstract class BaseImageExtensionLiveTest extends BaseComputeServiceConte Optional imageExtension = computeService.getImageExtension(); - assertTrue("image extension was not present", imageExtension.isPresent()); + assertTrue(imageExtension.isPresent(), "image extension was not present"); Template template = getNodeTemplate(); @@ -152,7 +152,7 @@ public abstract class BaseImageExtensionLiveTest extends BaseComputeServiceConte ComputeService computeService = view.getComputeService(); Optional imageExtension = computeService.getImageExtension(); - assertTrue("image extension was not present", imageExtension.isPresent()); + assertTrue(imageExtension.isPresent(), "image extension was not present"); Optional optImage = getImage(); diff --git a/core/src/test/java/org/jclouds/logging/BufferLogger.java b/core/src/test/java/org/jclouds/logging/BufferLogger.java index ffc9629ce3..134f8a69cc 100644 --- a/core/src/test/java/org/jclouds/logging/BufferLogger.java +++ b/core/src/test/java/org/jclouds/logging/BufferLogger.java @@ -23,8 +23,6 @@ import java.util.Collections; import java.util.List; import java.util.logging.Level; -import junit.framework.AssertionFailedError; - import com.google.common.base.Predicate; /** A logger implementation for use in testing; all log messages are remembered, \ @@ -65,31 +63,31 @@ public class BufferLogger extends BaseLogger { return messages; } - /** throws AssertionFailedError if the log does not contain the indicated fragment; + /** throws AssertionError if the log does not contain the indicated fragment; * otherwise returns a record which does satisfy the constraint */ public Record assertLogContains(String fragment) { for (Record r: messages) { if (r.getMessage()!=null && r.getMessage().contains(fragment)) return r; } - throw new AssertionFailedError("log did not contain expected '"+fragment+"'"); + throw new AssertionError("log did not contain expected '"+fragment+"'"); } /** fails if log _does_ contain the indicated fragment */ public void assertLogDoesntContain(String fragment) { for (Record r: messages) { if (r.getMessage()!=null && r.getMessage().contains(fragment)) - throw new AssertionFailedError("log contained unexpected '"+fragment+"'"); + throw new AssertionError("log contained unexpected '"+fragment+"'"); } } - /** throws AssertionFailedError if the log does not contain the indicated fragment; + /** throws AssertionError if the log does not contain the indicated fragment; * otherwise returns a record which does satisfy the constraint */ public Record assertLogContains(Predicate test) { for (Record r: messages) { if (r.getMessage()!=null && test.apply(r)) return r; } - throw new AssertionFailedError("log did not contain any records satisfying expected predicate"); + throw new AssertionError("log did not contain any records satisfying expected predicate"); } @Override diff --git a/labs/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/UserClientExpectTest.java b/labs/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/UserClientExpectTest.java index 58697da9e3..016b972b5c 100644 --- a/labs/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/UserClientExpectTest.java +++ b/labs/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/UserClientExpectTest.java @@ -19,9 +19,9 @@ package org.jclouds.openstack.keystone.v2_0; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertFalse; -import static junit.framework.Assert.assertNotNull; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertNotNull; import java.net.URI; import java.util.Set; diff --git a/labs/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/UserClientLiveTest.java b/labs/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/UserClientLiveTest.java index ab6ff41634..75788d0359 100644 --- a/labs/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/UserClientLiveTest.java +++ b/labs/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/UserClientLiveTest.java @@ -18,8 +18,8 @@ */ package org.jclouds.openstack.keystone.v2_0; -import static junit.framework.Assert.assertFalse; -import static junit.framework.Assert.assertNotNull; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertNotNull; import java.util.Set; diff --git a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/PreseedCfgServerTest.java b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/PreseedCfgServerTest.java index b882defcdf..659c1f84e2 100644 --- a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/PreseedCfgServerTest.java +++ b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/PreseedCfgServerTest.java @@ -18,7 +18,7 @@ */ package org.jclouds.virtualbox; -import static junit.framework.Assert.assertEquals; +import static org.testng.Assert.assertEquals; import java.net.URI; import java.net.URL; diff --git a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/compute/VirtualBoxComputeServiceAdapterLiveTest.java b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/compute/VirtualBoxComputeServiceAdapterLiveTest.java index ad5d2144a4..5f10e81b1e 100644 --- a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/compute/VirtualBoxComputeServiceAdapterLiveTest.java +++ b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/compute/VirtualBoxComputeServiceAdapterLiveTest.java @@ -19,7 +19,7 @@ package org.jclouds.virtualbox.compute; -import static junit.framework.Assert.assertTrue; +import static org.testng.Assert.assertTrue; import static org.jclouds.virtualbox.config.VirtualBoxConstants.VIRTUALBOX_NODE_PREFIX; import static org.testng.Assert.assertEquals; diff --git a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/compute/VirtualBoxExperimentLiveTest.java b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/compute/VirtualBoxExperimentLiveTest.java index e88cb47f87..881caa6d40 100644 --- a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/compute/VirtualBoxExperimentLiveTest.java +++ b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/compute/VirtualBoxExperimentLiveTest.java @@ -19,7 +19,7 @@ package org.jclouds.virtualbox.compute; -import static junit.framework.Assert.assertTrue; +import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertEquals; import java.util.Set; diff --git a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/CreateAndInstallVmLiveTest.java b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/CreateAndInstallVmLiveTest.java index b3b22ffc3a..aaf1b7ff6c 100644 --- a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/CreateAndInstallVmLiveTest.java +++ b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/CreateAndInstallVmLiveTest.java @@ -20,7 +20,7 @@ package org.jclouds.virtualbox.functions; import static com.google.common.base.Preconditions.checkState; -import static junit.framework.Assert.assertTrue; +import static org.testng.Assert.assertTrue; import static org.jclouds.virtualbox.config.VirtualBoxConstants.VIRTUALBOX_IMAGE_PREFIX; import static org.jclouds.virtualbox.config.VirtualBoxConstants.VIRTUALBOX_INSTALLATION_KEY_SEQUENCE; diff --git a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/IMachineToNodeMetadataTest.java b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/IMachineToNodeMetadataTest.java index adc755cbdf..27b58d1ebf 100644 --- a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/IMachineToNodeMetadataTest.java +++ b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/functions/IMachineToNodeMetadataTest.java @@ -19,7 +19,7 @@ package org.jclouds.virtualbox.functions; -import static junit.framework.Assert.assertEquals; +import static org.testng.Assert.assertEquals; import static org.easymock.EasyMock.createNiceMock; import static org.easymock.EasyMock.eq; import static org.easymock.EasyMock.expect; diff --git a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/statements/InstallGuestAdditionsLiveTest.java b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/statements/InstallGuestAdditionsLiveTest.java index 58ceeba796..dff4c41464 100644 --- a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/statements/InstallGuestAdditionsLiveTest.java +++ b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/statements/InstallGuestAdditionsLiveTest.java @@ -19,7 +19,7 @@ package org.jclouds.virtualbox.statements; -import static junit.framework.Assert.assertEquals; +import static org.testng.Assert.assertEquals; import org.jclouds.scriptbuilder.domain.OsFamily; import org.jclouds.virtualbox.BaseVirtualBoxClientLiveTest; diff --git a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/statements/SetIpAddressTest.java b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/statements/SetIpAddressTest.java index a8096ed437..8023fd1c77 100644 --- a/labs/virtualbox/src/test/java/org/jclouds/virtualbox/statements/SetIpAddressTest.java +++ b/labs/virtualbox/src/test/java/org/jclouds/virtualbox/statements/SetIpAddressTest.java @@ -19,7 +19,7 @@ package org.jclouds.virtualbox.statements; -import static junit.framework.Assert.assertEquals; +import static org.testng.Assert.assertEquals; import org.jclouds.scriptbuilder.domain.OsFamily; import org.jclouds.virtualbox.domain.NetworkAdapter;