Skip to content

Commit 77042ea

Browse files
committed
Removed @ignore from several tests, and added some notes to the tests that are not passing.
1 parent ea85b0a commit 77042ea

11 files changed

Lines changed: 78 additions & 34 deletions

File tree

‎api-tests/src/test/java/org/ocpsoft/rewrite/param/ParameterizedPatternInterceptorTest.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
import org.ocpsoft.rewrite.mock.MockRewrite;
2727

2828
/**
29-
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
29+
* This test case was intended to begin mocking out an i18n API.
3030
*
31+
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
3132
*/
3233
public class ParameterizedPatternInterceptorTest
3334
{

‎config-annotations/src/test/java/org/ocpsoft/rewrite/annotation/param/ParameterTest.java‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,13 @@
77
import org.jboss.shrinkwrap.api.asset.StringAsset;
88
import org.jboss.shrinkwrap.api.spec.WebArchive;
99
import org.junit.Assert;
10-
import org.junit.Ignore;
1110
import org.junit.Test;
1211
import org.junit.runner.RunWith;
1312
import org.ocpsoft.rewrite.annotation.RewriteAnnotationTest;
1413
import org.ocpsoft.rewrite.test.HttpAction;
1514
import org.ocpsoft.rewrite.test.RewriteTest;
1615
import org.ocpsoft.rewrite.test.RewriteTestBase;
1716

18-
// FIXME this results in sporadic failure. needs review
19-
@Ignore
2017
@RunWith(Arquillian.class)
2118
public class ParameterTest extends RewriteTestBase
2219
{

‎config-prettyfaces-tests/src/test/java/org/ocpsoft/rewrite/prettyfaces/encoding/EncodingBean.java‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ public class EncodingBean
99
{
1010
private String pathText;
1111
private String queryText;
12+
private String param0;
13+
private String param1;
14+
15+
public String action()
16+
{
17+
return "";
18+
}
1219

1320
public String getPathText()
1421
{
@@ -29,4 +36,24 @@ public void setQueryText(final String queryText)
2936
{
3037
this.queryText = queryText;
3138
}
39+
40+
public String getParam0()
41+
{
42+
return param0;
43+
}
44+
45+
public void setParam0(String param0)
46+
{
47+
this.param0 = param0;
48+
}
49+
50+
public String getParam1()
51+
{
52+
return param1;
53+
}
54+
55+
public void setParam1(String param1)
56+
{
57+
this.param1 = param1;
58+
}
3259
}

‎config-prettyfaces-tests/src/test/java/org/ocpsoft/rewrite/prettyfaces/encoding/URLEncodingTest.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,14 @@ public void testEncodedURLMatchesNonEncodedPattern() throws Exception
168168
Assert.assertNotNull(browser.findElement(By.id("form")));
169169
}
170170

171+
@Test
171172
public void testNoDecodeOnSubmitDoesNotCrash() throws Exception
172173
{
173174
browser.get(getBaseURL() + getContextPath() + "/decodequery");
174175

175-
Assert.assertTrue(browser.getPageSource().contains("viewId=encoding.jsf"));
176+
Assert.assertTrue(browser.getPageSource().contains("viewId=/encoding.xhtml"));
176177
browser.findElement(By.id("input1")).sendKeys("%");
177178
browser.findElement(By.id("submit")).click();
178-
Assert.assertTrue(browser.getPageSource().contains("viewId=encoding.jsf"));
179+
Assert.assertTrue(browser.getPageSource().contains("viewId=/encoding.xhtml"));
179180
}
180181
}

‎config-prettyfaces-tests/src/test/resources/encoding/encoding-pretty-config.xml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,10 @@
4242
<pattern value="/virtuální"></pattern>
4343
<view-id>/encoding.jsf</view-id>
4444
</url-mapping>
45+
46+
<url-mapping id="decodequery">
47+
<pattern value="/decodequery"></pattern>
48+
<view-id>/encoding.jsf</view-id>
49+
</url-mapping>
4550

4651
</pretty-config>

‎config-prettyfaces-tests/src/test/resources/encoding/encoding.xhtml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
<h1><h:outputText value="Pretty Decode Page" /></h1>
1919
<h:form id="form" prependId="false">
2020
<h:outputText value="Enter a value: will be decoded" /><br />
21-
<h:inputText id="input0" value="#{exampleBean.param0}" /><br /><br />
21+
<h:inputText id="input0" value="#{encodingBean.param0}" /><br /><br />
2222

2323
<h:outputText value="Enter a value: will not be decoded" /><br />
24-
<h:inputText id="input1" value="#{exampleBean.param1}" />
25-
<h:commandButton id="submit" action="#{exampleBean.handleDecode}" value="Submit" /><br />
24+
<h:inputText id="input1" value="#{encodingBean.param1}" />
25+
<h:commandButton id="submit" action="#{encodingBean.action}" value="Submit" /><br />
2626
</h:form>
2727

2828
beanPathText=#{encodingBean.pathText}

‎config-servlet/src/test/java/org/ocpsoft/rewrite/servlet/config/RequestQueryStringTest.java‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.jboss.arquillian.junit.Arquillian;
2121
import org.jboss.shrinkwrap.api.spec.WebArchive;
2222
import org.junit.Assert;
23-
import org.junit.Ignore;
2423
import org.junit.Test;
2524
import org.junit.runner.RunWith;
2625
import org.ocpsoft.rewrite.config.ConfigurationProvider;
@@ -51,8 +50,6 @@ public void testCanParseEmptyQueryString() throws Exception
5150
}
5251

5352
@Test
54-
// TODO: fix this bug
55-
@Ignore
5653
public void testCanParseAmpersandCharactersInParameterValue() throws Exception
5754
{
5855
/*
@@ -61,9 +58,8 @@ public void testCanParseAmpersandCharactersInParameterValue() throws Exception
6158
HttpAction<HttpGet> action = get("/ampersand?param=foo%26bar"); // foo&bar
6259

6360
/*
64-
* Rule #1 should match. But actually HttpInboundRewriteImpl.getURL() decodes the query string to
65-
* '?param=foo&bar' which QueryStringBuilder cannot parse any more. Therefore rule #2 matches which
66-
* is not correct!
61+
* Rule #1 should match. HttpInboundRewriteImpl.getURL() used to decode the query string to '?param=foo&bar' which
62+
* QueryStringBuilder could not parse. Therefore rule #2 matched, which was not correct!
6763
*/
6864
Assert.assertEquals(209, action.getResponse().getStatusLine().getStatusCode());
6965

‎impl-servlet-tests/src/test/java/org/ocpsoft/rewrite/servlet/config/ConfigurationDeploymentTest.java‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.jboss.arquillian.junit.Arquillian;
2121
import org.jboss.shrinkwrap.api.asset.StringAsset;
2222
import org.jboss.shrinkwrap.api.spec.WebArchive;
23-
import org.junit.Ignore;
2423
import org.junit.Test;
2524
import org.junit.runner.RunWith;
2625
import org.ocpsoft.rewrite.servlet.ServletRoot;
@@ -30,7 +29,6 @@
3029
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
3130
*/
3231
@RunWith(Arquillian.class)
33-
@Ignore // @ShouldThrowException doesn't seem to work on Tomcat and Glassfish
3432
public class ConfigurationDeploymentTest
3533
{
3634
@Deployment(testable = false)
@@ -46,6 +44,7 @@ public static WebArchive getDeployment()
4644

4745
@Test
4846
public void testInvalidConfigProviderServiceFileFailsDeployment()
49-
{}
47+
{
48+
}
5049

5150
}

‎impl-servlet-tests/src/test/java/org/ocpsoft/rewrite/servlet/wrapper/WrappedResponseStreamTest.java‎

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import org.jboss.arquillian.junit.Arquillian;
3636
import org.jboss.shrinkwrap.api.asset.StringAsset;
3737
import org.jboss.shrinkwrap.api.spec.WebArchive;
38-
import org.junit.Ignore;
3938
import org.junit.Test;
4039
import org.junit.runner.RunWith;
4140
import org.ocpsoft.rewrite.config.ConfigurationProvider;
@@ -70,33 +69,41 @@ public void testWrappedResponseStreamToUppercase() throws Exception
7069
}
7170

7271
@Test
73-
@Ignore
7472
public void testWrappedResponseStreamToGZip() throws Exception
7573
{
7674

7775
DefaultHttpClient client = new DefaultHttpClient();
78-
client.addRequestInterceptor(new HttpRequestInterceptor() {
76+
client.addRequestInterceptor(new HttpRequestInterceptor()
77+
{
7978

79+
@Override
8080
public void process(final HttpRequest request, final HttpContext context) throws HttpException, IOException
8181
{
82-
if (!request.containsHeader("Accept-Encoding")) {
82+
if (!request.containsHeader("Accept-Encoding"))
83+
{
8384
request.addHeader("Accept-Encoding", "gzip");
8485
}
8586
}
8687

8788
});
8889

89-
client.addResponseInterceptor(new HttpResponseInterceptor() {
90+
client.addResponseInterceptor(new HttpResponseInterceptor()
91+
{
9092

93+
@Override
9194
public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException
9295
{
9396
HttpEntity entity = response.getEntity();
94-
if (entity != null) {
97+
if (entity != null)
98+
{
9599
Header header = entity.getContentEncoding();
96-
if (header != null) {
100+
if (header != null)
101+
{
97102
HeaderElement[] codecs = header.getElements();
98-
for (int i = 0; i < codecs.length; i++) {
99-
if (codecs[i].getName().equalsIgnoreCase("gzip")) {
103+
for (int i = 0; i < codecs.length; i++)
104+
{
105+
if (codecs[i].getName().equalsIgnoreCase("gzip"))
106+
{
100107
response.setEntity(new GzipDecompressingEntity(response.getEntity()));
101108
return;
102109
}

‎integration-faces/src/test/java/org/ocpsoft/rewrite/faces/el/ExpressionLanguageTest.java‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.jboss.arquillian.junit.Arquillian;
2121
import org.jboss.shrinkwrap.api.spec.WebArchive;
2222
import org.junit.Assert;
23-
import org.junit.Ignore;
2423
import org.junit.Test;
2524
import org.junit.runner.RunWith;
2625
import org.ocpsoft.rewrite.config.ConfigurationProvider;
@@ -32,7 +31,6 @@
3231
/**
3332
* @author Christian Kaltepoth
3433
*/
35-
@Ignore // FIXME False negative on jetty sometimes for some reason
3634
@RunWith(Arquillian.class)
3735
public class ExpressionLanguageTest extends RewriteTest
3836
{

0 commit comments

Comments
 (0)