Skip to content

Commit 2db59eb

Browse files
committed
Moved assertContains() to RewriteTestBase
1 parent eb70f18 commit 2db59eb

3 files changed

Lines changed: 12 additions & 16 deletions

File tree

‎integration-faces-annotations/src/test/java/org/ocpsoft/rewrite/faces/annotation/action/DeferredActionsTest.java‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import org.jboss.arquillian.container.test.api.Deployment;
44
import org.jboss.arquillian.junit.Arquillian;
55
import org.jboss.shrinkwrap.api.spec.WebArchive;
6-
import org.junit.Assert;
76
import org.junit.Test;
87
import org.junit.runner.RunWith;
98
import org.ocpsoft.rewrite.faces.annotation.RewriteFacesAnnotationsTest;
@@ -42,11 +41,4 @@ public void testActionPhases() throws Exception
4241

4342
}
4443

45-
protected static void assertContains(String text, String s)
46-
{
47-
if (text == null || s == null || !text.contains(s)) {
48-
Assert.fail("Could not find [" + s + "] in text: " + text);
49-
}
50-
}
51-
5244
}

‎integration-faces-annotations/src/test/java/org/ocpsoft/rewrite/faces/annotation/action/IgnorePostbackTest.java‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import org.jboss.arquillian.container.test.api.Deployment;
44
import org.jboss.arquillian.junit.Arquillian;
55
import org.jboss.shrinkwrap.api.spec.WebArchive;
6-
import org.junit.Assert;
76
import org.junit.Test;
87
import org.junit.runner.RunWith;
98
import org.ocpsoft.rewrite.faces.annotation.RewriteFacesAnnotationsTest;
@@ -41,11 +40,4 @@ public void testActionPhases() throws Exception
4140

4241
}
4342

44-
protected static void assertContains(String text, String s)
45-
{
46-
if (text == null || s == null || !text.contains(s)) {
47-
Assert.fail("Could not find [" + s + "] in text: " + text);
48-
}
49-
}
50-
5143
}

‎test-harness/src/main/java/org/ocpsoft/rewrite/test/RewriteTestBase.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.jboss.shrinkwrap.api.GenericArchive;
2222
import org.jboss.shrinkwrap.resolver.api.DependencyResolvers;
2323
import org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver;
24+
import org.junit.Assert;
2425

2526
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
2627
import com.gargoylesoftware.htmlunit.WebClient;
@@ -149,4 +150,15 @@ protected HtmlAction getWebClient(String path) throws FailingHttpStatusCodeExcep
149150
throw new RuntimeException(e);
150151
}
151152
}
153+
154+
/**
155+
* Verifies that the given text contains the given string.
156+
*/
157+
protected static void assertContains(String text, String s)
158+
{
159+
if (text == null || s == null || !text.contains(s)) {
160+
Assert.fail("Could not find [" + s + "] in text: " + text);
161+
}
162+
}
163+
152164
}

0 commit comments

Comments
 (0)