junit.framework.Assertorg.testng.Assert



Project Netflix/curator in file ....framework.recipes.queue.TestDistributedQueue.java (2011-12-06)
@@ -28,8 +28,8 @@ import com.netflix.curator.framework.recipes.BaseClassForTests;
 import com.netflix.curator.framework.state.ConnectionState;
 import com.netflix.curator.framework.state.ConnectionStateListener;
 import com.netflix.curator.retry.RetryOneTime;
-import junit.framework.Assert;
 import org.mockito.Mockito;
+import org.testng.Assert;
 import org.testng.annotations.Test;
 import java.util.List;
 import java.util.Set;
@@ -185,7 +185,7 @@ public class TestDistributedQueue extends BaseClassForTests
             }
 
             Assert.assertTrue(latch.await(10, TimeUnit.SECONDS));
-            Assert.assertTrue(duplicateMessages.toString(), duplicateMessages.size() == 0);
+            Assert.assertTrue(duplicateMessages.size() == 0, duplicateMessages.toString());
         }
         finally
         {
Project Netflix/curator in file ...om.netflix.curator.x.discovery.TestStrategies.java (2011-12-06)
@@ -23,8 +23,8 @@ import com.netflix.curator.x.discovery.details.InstanceProvider;
 import com.netflix.curator.x.discovery.strategies.RandomStrategy;
 import com.netflix.curator.x.discovery.strategies.RoundRobinStrategy;
 import com.netflix.curator.x.discovery.strategies.StickyStrategy;
-import junit.framework.Assert;
 import org.apache.commons.math.stat.descriptive.SummaryStatistics;
+import org.testng.Assert;
 import org.testng.annotations.Test;
 import java.util.List;
 
@@ -78,7 +78,7 @@ public class TestStrategies
         {
             statistic.addValue(counts[i]);
         }
-        Assert.assertTrue("" + statistic.getStandardDeviation(), statistic.getStandardDeviation() <= (QTY * 2)); // meager check for even distribution
+        Assert.assertTrue(statistic.getStandardDeviation() <= (QTY * 2), "" + statistic.getStandardDeviation()); // meager check for even distribution
     }
 
     @Test
Project orientechnologies/orientdb in file ...ient.core.storage.StorageModificationLockTest.java (2012-12-14)
 import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicLong;
 
-import junit.framework.Assert;
-
+import org.testng.Assert;
 import org.testng.annotations.Test;
 
 import com.orientechnologies.common.concur.lock.OModificationLock;
@@ -91,7 +90,7 @@ public class StorageModificationLockTest {
         if (n % 10 == 0)
           System.out
               .println("After prohibit  modifications " + beforeModification + " before allow modifications " + counter.get());
-        Assert.assertEquals(beforeModification, counter.get());
+        Assert.assertEquals(counter.get(), beforeModification);
         modificationLock.allowModifications();
         Thread.sleep(50);
       }
Project linkedin/rest.li in file ...ava.com.linkedin.restli.client.RestClientTest.java (2012-09-27)
@@ -36,9 +36,9 @@ import com.linkedin.restli.common.EmptyRecord;
 import com.linkedin.restli.common.ErrorResponse;
 import com.linkedin.restli.common.RestConstants;
 import com.linkedin.restli.internal.client.EntityResponseDecoder;
-import junit.framework.Assert;
 import org.easymock.Capture;
 import org.easymock.EasyMock;
+import org.testng.Assert;
 import org.testng.annotations.Test;
 
 import java.io.IOException;
@@ -185,7 +185,7 @@ public class RestClientTest
     catch (ExecutionException e)
     {
       Throwable cause = e.getCause();
-      Assert.assertTrue("Expected RestLiResponseException not " + cause.getClass().getName(), cause instanceof RestLiResponseException);
+      Assert.assertTrue(cause instanceof RestException, "Expected RestLiResponseException not " + cause.getClass().getName());
       RestLiResponseException rlre = (RestLiResponseException)cause;
       Assert.assertEquals(HTTP_CODE, rlre.getStatus());
       Assert.assertEquals(ERR_VALUE, rlre.getErrorDetails().get(ERR_KEY));
@@ -218,7 +218,7 @@ public class RestClientTest
     catch (ExecutionException e)
     {
       Throwable cause = e.getCause();
-      Assert.assertTrue("Expected RestException not " + cause.getClass().getName(), cause instanceof RestException);
+      Assert.assertTrue(cause instanceof RestException, "Expected RestException not " + cause.getClass().getName());
       RestException re = (RestException)cause;
       RestResponse r = re.getResponse();
 
Project orientechnologies/orientdb in file ...test.database.auto.RemoteProtocolCommandsTest.java (2014-07-23)
@@ -2,8 +2,8 @@ package com.orientechnologies.orient.test.database.auto;
 
 import java.util.Map;
 
-import junit.framework.Assert;
 
+import org.testng.Assert;
 import org.testng.annotations.Optional;
 import org.testng.annotations.Parameters;
 import org.testng.annotations.Test;
@@ -34,7 +34,7 @@ public class RemoteProtocolCommandsTest extends DocumentDBBaseTest {
 
     final Map<String, String> list = admin.listDatabases();
 
-    Assert.assertTrue("Check plocal db is in list", list.containsKey(plocalDatabaseName));
-    Assert.assertTrue("Check memory db is in list", list.containsKey(memoryDatabaseName));
+    Assert.assertTrue(list.containsKey(plocalDatabaseName), "Check plocal db is in list");
+    Assert.assertTrue(list.containsKey(memoryDatabaseName), "Check memory db is in list");
   }
 }