org.junit.Assert.assertEquals-sorg.junit.Assert.assertTrue-s



Project alibaba/dubbo in file ...pc.cluster.support.FailSafeClusterInvokerTest.java (2012-05-30)
@@ -15,7 +15,7 @@
  */
 package com.alibaba.dubbo.rpc.cluster.support;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -123,7 +123,7 @@ public class FailSafeClusterInvokerTest {
         FailsafeClusterInvoker<DemoService> invoker = new FailsafeClusterInvoker<DemoService>(dic);
         LogUtil.start();
         invoker.invoke(invocation);
-        assertEquals(1,LogUtil.findMessage("No provider"));
+        assertTrue(LogUtil.findMessage("No provider") > 0);
         LogUtil.stop();
     }
 
Project cucumber/cucumber-jvm in file ...36fb/core.src.test.java.cucumber.cli.MainTest.java (2012-01-16)
@@ -2,12 +2,12 @@ package cucumber.cli;
 
 import org.junit.Test;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 public class MainTest {
     @Test
     public void has_version_from_properties_file() {
-        assertEquals("1.0.0.RC4", Main.VERSION);
+        assertTrue(Main.VERSION.startsWith("1.0"));
     }
 
 }
Project neo4j/neo4j in file ...a.org.neo4j.metatest.TestProcessStreamHandler.java (2012-04-19)
@@ -20,7 +20,7 @@
 package org.neo4j.metatest;
 
 import static java.lang.System.getProperty;
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import org.junit.Test;
@@ -42,6 +42,6 @@ public class TestProcessStreamHandler
         catch ( Exception e )
         {   // Good
         }
-        assertEquals( "Process should have been destroyed by now with exit code 1", 1, process.exitValue() );
+        assertTrue( "Process should have been destroyed by now", process.exitValue() != 0 );
     }
 }
Project ninjaframework/ninja in file ...lication.src.test.java.example.ExampleApiTest.java (2012-07-24)
@@ -1,6 +1,6 @@
 package example;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 import ninja.NinjaApiTest;
 import ninja.NinjaApiTestHelper;
 
@@ -15,8 +15,8 @@ public class ExampleApiTest extends NinjaApiTest {
 
 		String apiCallResult = NinjaApiTestHelper.makeJsonRequest(getServerAddress() + "/person");
 		
-		assertEquals("{\"name\":\"zeeess name\"}", apiCallResult);
-
+		assertTrue(apiCallResult.startsWith("{\"name\":\"zeeess name -"));
+		
 	}
 
 	
Project apache/hbase in file ...hadoop.hbase.io.encoding.TestChangingEncoding.java (2013-08-30)
@@ -16,7 +16,7 @@
  */
 package org.apache.hadoop.hbase.io.encoding;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -28,32 +28,29 @@ import java.util.Random;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HTableDescriptor;
-import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.LargeTests;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Durability;
 import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
-import org.apache.hadoop.hbase.client.Durability;
-import org.apache.hadoop.hbase.ipc.RpcClient;
-import org.apache.hadoop.hbase.ipc.RpcServer;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Threads;
-import org.apache.log4j.Level;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
-import org.apache.commons.logging.impl.Log4JLogger;
 
 /**
  * Tests changing data block encoding settings of a column family.
@@ -159,9 +156,8 @@ public class TestChangingEncoding {
       Get get = new Get(getRowKey(batchId, i));
       Result result = table.get(get);
       for (int j = 0; j < NUM_COLS_PER_ROW; ++j) {
-        KeyValue kv = result.getColumnLatest(CF_BYTES, getQualifier(j));
-        assertEquals(Bytes.toStringBinary(getValue(batchId, i, j)),
-            Bytes.toStringBinary(kv.getValue()));
+        Cell kv = result.getColumnLatest(CF_BYTES, getQualifier(j));
+        assertTrue(CellUtil.matchingValue(kv, getValue(batchId, i, j)));
       }
     }
     table.close();