mirror of https://github.com/apache/jclouds.git
removed junit test dependency
This commit is contained in:
parent
16daf5cd1b
commit
5a3f6011a2
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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> 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> imageExtension = computeService.getImageExtension();
|
||||
assertTrue("image extension was not present", imageExtension.isPresent());
|
||||
assertTrue(imageExtension.isPresent(), "image extension was not present");
|
||||
|
||||
Optional<? extends Image> optImage = getImage();
|
||||
|
||||
|
|
|
@ -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<Record> 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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue