Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.

Commit 68b0798

Browse files
author
Adam Lindenthal
committed
JERSEY-2410 - Code changes to fix jersey2-xdk hudson job
Same approach as for MOXy job fix (I641b200c) - security manager not used for xdk profile. Some tests have to be excluded from surefire (different than in MOXy case), described inline in surefire configuration (main pom.xml). SourceEntityProviderTest was fixed to take the xdk xml header format in account for all the testcases, the condition was missing on some places. Change-Id: I8437ca27ff504cef85eadb4df0ea5969d0b7f259
1 parent 8532bb8 commit 68b0798

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

core-common/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,16 @@
202202
</dependency>
203203
</dependencies>
204204

205+
<profiles>
206+
<profile>
207+
<id>xdk</id>
208+
<properties>
209+
<!-- do not use security manager for xdk -->
210+
<surefire.security.argline></surefire.security.argline>
211+
</properties>
212+
</profile>
213+
</profiles>
214+
205215
<properties>
206216
<surefire.security.argline>-Djava.security.manager -Djava.security.policy=${project.build.directory}/test-classes/surefire.policy</surefire.security.argline>
207217
</properties>

pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,11 @@
731731
<classpathDependencyExcludes>
732732
<classpathDependencyExcludes>xerces:xercesImpl</classpathDependencyExcludes>
733733
</classpathDependencyExcludes>
734+
<excludes>
735+
<exclude>**/ReflectionHelperTest.java</exclude><!-- security is off for moxy, skip -->
736+
<exclude>**/e2e/server/monitoring/*.java</exclude><!-- contains jdk7 only tests -->
737+
<exclude>**/EntityExpansionTest.java</exclude><!-- does not work with xdk SaxParser -->
738+
</excludes>
734739
</configuration>
735740
</plugin>
736741
</plugins>
@@ -763,7 +768,7 @@
763768
<excludes>
764769
<exclude>**/ReflectionHelperTest.java</exclude><!-- security is off for moxy, skip -->
765770
<exclude>**/e2e/server/monitoring/*.java</exclude><!-- contains jdk7 only tests -->
766-
<exclude>**/e2e/server/wadl/*.java</exclude>
771+
<exclude>**/e2e/server/wadl/*.java</exclude><!-- works, but unstable with moxy -->
767772
</excludes>
768773
</configuration>
769774
</plugin>

tests/e2e/pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,15 @@
209209
</plugins>
210210
</build>
211211
</profile>
212+
213+
<profile>
214+
<id>xdk</id>
215+
<properties>
216+
<!-- do not use security manager for xdk -->
217+
<surefire.security.argline></surefire.security.argline>
218+
</properties>
219+
</profile>
220+
212221
</profiles>
213222

214223
</project>

tests/e2e/src/test/java/org/glassfish/jersey/tests/api/SourceEntityProviderTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
33
*
4-
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
4+
* Copyright (c) 2012-2014 Oracle and/or its affiliates. All rights reserved.
55
*
66
* The contents of this file are subject to the terms of either the GNU
77
* General Public License Version 2 only ("GPL") or the Common Development
@@ -167,7 +167,7 @@ public void getSaxSourceTest() throws Exception {
167167
assertEquals(Status.OK.getStatusCode(), response.getStatus());
168168
String content = extractContent(response.readEntity(SAXSource.class));
169169
assertTrue("Content '" + content + "' does not start with the expected prefix '" + prefix + "'",
170-
content.startsWith(prefix));
170+
content.startsWith(prefix) || content.startsWith(xdkPrefix));
171171
}
172172

173173
@Test
@@ -176,7 +176,7 @@ public void getDomSourceTest() throws Exception {
176176
assertEquals(Status.OK.getStatusCode(), response.getStatus());
177177
String content = extractContent(response.readEntity(DOMSource.class));
178178
assertTrue("Content '" + content + "' does not start with the expected prefix '" + prefix + "'",
179-
content.startsWith(prefix));
179+
content.startsWith(prefix) || content.startsWith(xdkPrefix));
180180
}
181181

182182
private static SAXSource createSAXSource(String content) throws SAXException, ParserConfigurationException {

0 commit comments

Comments
 (0)