|
| 1 | +package org.ocpsoft.rewrite.annotation.join; |
| 2 | + |
| 3 | +import static junit.framework.Assert.assertTrue; |
| 4 | +import static org.junit.Assert.assertEquals; |
| 5 | + |
| 6 | +import org.apache.http.client.methods.HttpGet; |
| 7 | +import org.jboss.arquillian.container.test.api.Deployment; |
| 8 | +import org.jboss.arquillian.junit.Arquillian; |
| 9 | +import org.jboss.shrinkwrap.api.asset.StringAsset; |
| 10 | +import org.jboss.shrinkwrap.api.spec.WebArchive; |
| 11 | +import org.junit.Test; |
| 12 | +import org.junit.runner.RunWith; |
| 13 | +import org.ocpsoft.rewrite.annotation.RewriteAnnotationTest; |
| 14 | +import org.ocpsoft.rewrite.test.HttpAction; |
| 15 | +import org.ocpsoft.rewrite.test.RewriteTest; |
| 16 | +import org.ocpsoft.rewrite.test.RewriteTestBase; |
| 17 | + |
| 18 | +@RunWith(Arquillian.class) |
| 19 | +public class JoinParameterTest extends RewriteTestBase |
| 20 | +{ |
| 21 | + |
| 22 | + @Deployment(testable = false) |
| 23 | + public static WebArchive getDeployment() |
| 24 | + { |
| 25 | + return RewriteTest |
| 26 | + .getDeployment() |
| 27 | + .addAsLibrary(RewriteAnnotationTest.getRewriteAnnotationArchive()) |
| 28 | + .addClass(JoinParameterBean.class) |
| 29 | + .addAsWebResource(new StringAsset("Value: [<%= request.getParameter(\"value\") %>]"), |
| 30 | + "join-parameter.jsp"); |
| 31 | + } |
| 32 | + |
| 33 | + @Test |
| 34 | + public void testPlainJoinWithAnnotations() throws Exception |
| 35 | + { |
| 36 | + |
| 37 | + HttpAction<HttpGet> action = get("/join/test/"); |
| 38 | + assertEquals(200, action.getStatusCode()); |
| 39 | + assertTrue(action.getResponseContent().contains("Value: [test]")); |
| 40 | + } |
| 41 | + |
| 42 | +} |
0 commit comments