org.junit.matchers.JUnitMatchers.containsString-sorg.hamcrest.CoreMatchers.containsString-s



Project gocd/gocd in file ...o.domain.materials.perforce.P4CommandTestBase.java (2014-07-28)
@@ -31,11 +31,11 @@ import org.junit.Test;
 import org.mockito.Mockito;
 
 import static com.thoughtworks.go.util.command.ProcessOutputStreamConsumer.inMemoryConsumer;
+import static org.hamcrest.CoreMatchers.containsString;
 import static org.hamcrest.CoreMatchers.instanceOf;
 import static org.hamcrest.core.Is.is;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;
-import static org.junit.matchers.JUnitMatchers.containsString;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
@@ -119,7 +119,7 @@ public abstract class P4CommandTestBase extends PerforceFixture {
         try {
             p4.execute(line, "foo", outputStreamConsumer, true);
             fail("did't bomb for non zero return code");
-        } catch (Exception e) {
+        } catch (Exception ignored) {
         }
         verify(line).run(outputStreamConsumer, null, "foo");
     }
Project xamarin/XobotOS in file ...o.domain.materials.perforce.P4CommandTestBase.java (2014-07-28)
@@ -31,11 +31,11 @@ import org.junit.Test;
 import org.mockito.Mockito;
 
 import static com.thoughtworks.go.util.command.ProcessOutputStreamConsumer.inMemoryConsumer;
+import static org.hamcrest.CoreMatchers.containsString;
 import static org.hamcrest.CoreMatchers.instanceOf;
 import static org.hamcrest.core.Is.is;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;
-import static org.junit.matchers.JUnitMatchers.containsString;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
@@ -119,7 +119,7 @@ public abstract class P4CommandTestBase extends PerforceFixture {
         try {
             p4.execute(line, "foo", outputStreamConsumer, true);
             fail("did't bomb for non zero return code");
-        } catch (Exception e) {
+        } catch (Exception ignored) {
         }
         verify(line).run(outputStreamConsumer, null, "foo");
     }
Project neo4j/neo4j in file ....java.org.neo4j.kernel.DiagnosticsLoggingTest.java (2013-05-15)
@@ -19,8 +19,8 @@
  */
 package org.neo4j.kernel;
 
+import static org.hamcrest.CoreMatchers.containsString;
 import static org.junit.Assert.assertThat;
-import static org.junit.matchers.JUnitMatchers.containsString;
 
 import org.junit.Test;
 import org.neo4j.helpers.collection.Visitor;
@@ -36,7 +36,6 @@ public class DiagnosticsLoggingTest
     @Test
     public void shouldSeeHelloWorld()
     {
-        // We use an EmbeddedDatabase because Impermanent does not create the directory and returns 0 for disk space
         FakeDatabase db = new FakeDatabase();
         FakeLogger logger = db.getLogger();
         String messages = logger.getMessages();
@@ -61,7 +60,7 @@ public class DiagnosticsLoggingTest
         }
 
         @Override
-        public void logLongMessage( String msg, Visitor<LineLogger> source, boolean flush )
+        public void logLongMessage( String msg, Visitor<LineLogger, RuntimeException> source, boolean flush )
         {
             appendLine( msg );
             source.visit( new LineLogger()
Project jersey/jersey in file ...sey.examples.cdi.resources.PerRequestBeanTest.java (2013-03-22)
@@ -50,7 +50,8 @@ import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
 import static org.junit.Assert.assertThat;
-import static org.junit.matchers.JUnitMatchers.containsString;
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.startsWith;
 
 /**
  * Test for the request scoped managed bean resource.
@@ -92,5 +93,6 @@ public class PerRequestBeanTest extends CdiTest {
         assertThat(s, containsString("GET"));
         assertThat(s, containsString(String.format("c=%s", c)));
         assertThat(s, containsString(String.format("d=%s", d)));
+        assertThat(s, startsWith("INTERCEPTED"));
     }
 }
Project gocd/gocd in file ...s.go.domain.materials.mercurial.HgCommandTest.java (2014-07-28)
@@ -38,18 +38,17 @@ import org.junit.Test;
 
 import static com.thoughtworks.go.util.FileUtil.deleteFolder;
 import static com.thoughtworks.go.util.command.ProcessOutputStreamConsumer.inMemoryConsumer;
-import static junit.framework.Assert.fail;
+import static org.hamcrest.CoreMatchers.containsString;
 import static org.hamcrest.Matchers.not;
 import static org.hamcrest.core.Is.is;
 import static org.junit.Assert.assertThat;
-import static org.junit.matchers.JUnitMatchers.containsString;
+import static org.junit.Assert.fail;
 
 public class HgCommandTest {
     private static File serverRepo;
     private static File clientRepo;
 
     private HgCommand hgCommand;
-    private File anotherWorkingCopy;
 
     private List<File> foldersToDelete = new ArrayList<File>();
     private InMemoryStreamConsumer outputStreamConsumer = inMemoryConsumer();
@@ -63,7 +62,6 @@ public class HgCommandTest {
     public void setUp() throws IOException {
         serverRepo = createTmpFolder("testHgServerRepo");
         clientRepo = createTmpFolder("testHgClientRepo");
-        anotherWorkingCopy = createTmpFolder("connectfour");
         secondBranchWorkingCopy = createTmpFolder("second");
 
         setUpServerRepoFromHgBundle(serverRepo, new File("../common/test-resources/data/hgrepo.hgbundle"));