org.junit.matchers.JUnitMatchers.containsString-s



API Populatity

15 Client projects

Project: org.junit

Project unclebob/fitnesse in file ...9e10082705a/src.fitnesseMain.FitNesseMainTest.java (2013-04-01)
@@ -3,7 +3,7 @@
 package fitnesseMain;
 
 import static org.junit.Assert.*;
-import static org.junit.matchers.JUnitMatchers.containsString;
+import static org.hamcrest.Matchers.*;
 import static org.mockito.Mockito.*;
 
 import java.io.ByteArrayOutputStream;
Project junit-team/junit in file ...a.org.junit.tests.running.methods.TimeoutTest.java (2009-04-17)
@@ -5,6 +5,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+import static org.junit.matchers.JUnitMatchers.containsString;
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
@@ -127,7 +128,6 @@ public class TimeoutTest {
 		return totalTime;
 	}
 
-	@Ignore("We would like this behavior to work but it may not be possible")
 	@Test public void stalledThreadAppearsInStackTrace() throws Exception {
 		JUnitCore core= new JUnitCore();
 		Result result= core.run(InfiniteLoopTest.class);
@@ -137,7 +137,7 @@ public class TimeoutTest {
 		Writer buffer= new StringWriter();
 		PrintWriter writer= new PrintWriter(buffer);
 		exception.printStackTrace(writer);
-		assertTrue(writer.toString().contains("infiniteLoop")); // Make sure we have the stalled frame on the stack somewhere
+		assertThat(buffer.toString(), containsString("infiniteLoop")); // Make sure we have the stalled frame on the stack somewhere
 	}
 
 	@Test public void compatibility() {
Project junit-team/junit in file ...a.org.junit.tests.running.methods.TimeoutTest.java (2009-04-18)
@@ -5,6 +5,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+import static org.junit.matchers.JUnitMatchers.containsString;
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
@@ -127,7 +128,6 @@ public class TimeoutTest {
 		return totalTime;
 	}
 
-	@Ignore("We would like this behavior to work but it may not be possible")
 	@Test public void stalledThreadAppearsInStackTrace() throws Exception {
 		JUnitCore core= new JUnitCore();
 		Result result= core.run(InfiniteLoopTest.class);
@@ -137,7 +137,7 @@ public class TimeoutTest {
 		Writer buffer= new StringWriter();
 		PrintWriter writer= new PrintWriter(buffer);
 		exception.printStackTrace(writer);
-		assertTrue(writer.toString().contains("infiniteLoop")); // Make sure we have the stalled frame on the stack somewhere
+		assertThat(buffer.toString(), containsString("infiniteLoop")); // Make sure we have the stalled frame on the stack somewhere
 	}
 
 	@Test public void compatibility() {