Skip to content

Commit

Permalink
ISPN-4023 RESTCertSecurityTest.testSecuredReadWriteOperations random …
Browse files Browse the repository at this point in the history
…failures
  • Loading branch information
mgencur authored and pruivo committed Mar 21, 2014
1 parent f3d17e7 commit 458fd61
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
11 changes: 10 additions & 1 deletion server/integration/testsuite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,17 @@
<testResource>
<directory>${project.basedir}/src/test/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>*.jks</exclude>
<exclude>*.keystore</exclude>
</excludes>
</testResource>
<testResource>
<directory>${project.basedir}/src/test/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/*</include>
<include>*.jks</include>
<include>*.keystore</include>
</includes>
</testResource>
</testResources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
* Tests CLIENT-CERT security for REST endpoint as is configured via "auth-method" attribute on "rest-connector" element
* in datagrid subsystem.
* <p/>
* In order to configure CLIENT-CERT security in AS7 properly, we add a new security-domain in the security subsystem
* In order to configure CLIENT-CERT security, we add a new security-domain in the security subsystem
* and a new https connector in the web subsystem. This is done via XSL transformations.
* <p/>
* Client authenticates himself with client.keystore file. Server contains jsse.keystore file in security subsystem as a
Expand All @@ -82,7 +82,6 @@
*
* @author Martin Gencur
*/
@Category(UnstableTest.class) // See ISPN-4023
@RunWith(Arquillian.class)
public class RESTCertSecurityTest {

Expand Down Expand Up @@ -163,18 +162,18 @@ public void testSecuredReadWriteOperations() throws Exception {

private String keyAddress(String key) {
return "https://" + server1.getRESTEndpoint().getInetAddress().getHostName() + ":8443"
+ server1.getRESTEndpoint().getContextPath() + "/___defaultcache/" + key;
+ server1.getRESTEndpoint().getContextPath() + "/default/" + key;
}

private String keyAddressUnsecured(String key) {
return "http://" + server1.getRESTEndpoint().getInetAddress().getHostName() + ":8080"
+ server1.getRESTEndpoint().getContextPath() + "/___defaultcache/" + key;
+ server1.getRESTEndpoint().getContextPath() + "/default/" + key;
}

private HttpResponse put(CloseableHttpClient httpClient, String uri, int expectedCode) throws Exception {
HttpResponse response;
HttpPut put = new HttpPut(uri);
put.setEntity(new StringEntity("data", "application/text", "UTF-8"));
put.setEntity(new StringEntity("data", "UTF-8"));
response = httpClient.execute(put);
assertEquals(expectedCode, response.getStatusLine().getStatusCode());
return response;
Expand All @@ -184,7 +183,7 @@ private HttpResponse post(CloseableHttpClient httpClient, String uri, int expect
HttpResponse response;

HttpPost post = new HttpPost(uri);
post.setEntity(new StringEntity("data", "application/text", "UTF-8"));
post.setEntity(new StringEntity("data", "UTF-8"));
response = httpClient.execute(post);
assertEquals(expectedCode, response.getStatusLine().getStatusCode());
return response;
Expand Down

0 comments on commit 458fd61

Please sign in to comment.