Skip to content

Commit a881773

Browse files
authored
Merge pull request #3835 from senivam/travisBuildProfile
Travis CI build script + fixes to pass the tests
2 parents 191d3ff + 86ad8fb commit a881773

File tree

11 files changed

+75
-5
lines changed

11 files changed

+75
-5
lines changed

.travis.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
language: java
2+
3+
jdk:
4+
- oraclejdk8
5+
6+
cache:
7+
directories:
8+
- .autoconf
9+
10+
install: true
11+
12+
script:
13+
- bash travis.sh

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
[//]: # " "
1313
[//]: # " SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 "
1414

15+
[![Build Status](https://travis-ci.org/eclipse-ee4j/jersey.svg?branch=master)](https://travis-ci.org/eclipse-ee4j/jersey)
16+
1517
### About Jersey
1618

1719
Jersey is a REST framework that provides JAX-RS Reference Implementation and more.

connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpConnection.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public void completed(HttpRequest result) {
127127
});
128128
}
129129

130-
synchronized void close() {
130+
void close() {
131131
if (state == State.CLOSED) {
132132
return;
133133
}
@@ -218,6 +218,9 @@ protected Filter<HttpRequest, HttpResponse, HttpRequest, HttpResponse> createFil
218218
}
219219

220220
private void changeState(State newState) {
221+
if (state == State.CLOSED) {
222+
return;
223+
}
221224
State old = state;
222225
state = newState;
223226

@@ -414,9 +417,11 @@ void processSslHandshakeCompleted() {
414417

415418
@Override
416419
void processConnectionClosed() {
417-
cancelAllTimeouts();
418-
changeState(State.CLOSED_BY_SERVER);
419-
HttpConnection.this.close();
420+
synchronized (HttpConnection.this) {
421+
cancelAllTimeouts();
422+
changeState(State.CLOSED_BY_SERVER);
423+
HttpConnection.this.close();
424+
}
420425
}
421426

422427
@Override

pom.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@
764764
<properties>
765765
<release.tests.args>-Dskip.tests=true</release.tests.args>
766766
<skip.tests>true</skip.tests>
767+
<skip.e2e>true</skip.e2e>
767768
</properties>
768769
</profile>
769770
<profile>
@@ -1172,6 +1173,37 @@
11721173
</pluginManagement>
11731174
</build>
11741175
</profile>
1176+
<profile>
1177+
<!--
1178+
Profile is aimed to run the build on travis
1179+
due to travis limitations for output (max 4MB) this profile is used along with grep which reduces
1180+
the output.
1181+
However some e2e tests produce output which is not grepped (thus is not visible) and run longer than
1182+
10 minutes which results in the whole build is being murdered by Travis because of death suspection
1183+
1184+
the whole build is run as clean install but excludes several e2e tests because of the not grepped output
1185+
-->
1186+
<id>travis_e2e_skip</id>
1187+
<properties>
1188+
<skip.e2e>true</skip.e2e>
1189+
</properties>
1190+
</profile>
1191+
<profile>
1192+
<!--
1193+
Profile is aimed to run the build on travis
1194+
due to travis limitations for output (max 4MB) this profile is used to run e2e tests only.
1195+
1196+
the only thing which is happen using throfile is run of e2e tests (without additional build or so)
1197+
everything is already build using travis_e2e_skip profile
1198+
1199+
the whole build is run as test -Ptravis_e2e
1200+
-->
1201+
<id>travis_e2e</id>
1202+
<properties>
1203+
<skip.e2e>false</skip.e2e>
1204+
<skip.tests>true</skip.tests>
1205+
</properties>
1206+
</profile>
11751207
</profiles>
11761208

11771209
<reporting>
@@ -1963,5 +1995,6 @@
19631995
<xerces.version>2.11.0</xerces.version>
19641996
<xmlunit.version>1.6</xmlunit.version>
19651997
<yasson.version>1.0.1</yasson.version>
1998+
<skip.e2e>false</skip.e2e>
19661999
</properties>
19672000
</project>

tests/e2e-client/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<forkCount>1</forkCount>
4242
<reuseForks>false</reuseForks>
4343
<enableAssertions>false</enableAssertions>
44+
<skipTests>${skip.e2e}</skipTests>
4445
</configuration>
4546
</plugin>
4647
</plugins>

tests/e2e-entity/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<forkCount>1</forkCount>
4242
<reuseForks>false</reuseForks>
4343
<enableAssertions>false</enableAssertions>
44+
<skipTests>${skip.e2e}</skipTests>
4445
</configuration>
4546
</plugin>
4647
</plugins>

tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/entity/filtering/EntityFilteringClientTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ public String post(final String value) {
7777

7878
@Test
7979
public void testEntityAnnotationsPrimaryView() throws Exception {
80-
final String fields = target()
80+
final ClientConfig config = new ClientConfig()
81+
.property(EntityFilteringFeature.ENTITY_FILTERING_SCOPE, PrimaryDetailedView.Factory.get());
82+
configureClient(config);
83+
84+
final String fields = ClientBuilder.newClient(config)
85+
.target(getBaseUri())
8186
.request()
8287
.post(Entity.entity(
8388
new OneFilteringOnClassEntity(),

tests/e2e-server/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<forkCount>1</forkCount>
4242
<reuseForks>false</reuseForks>
4343
<enableAssertions>false</enableAssertions>
44+
<skipTests>${skip.e2e}</skipTests>
4445
</configuration>
4546
</plugin>
4647
</plugins>

tests/e2e-testng/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<forkCount>1</forkCount>
4646
<reuseForks>false</reuseForks>
4747
<enableAssertions>false</enableAssertions>
48+
<skipTests>${skip.e2e}</skipTests>
4849
</configuration>
4950
<dependencies>
5051
<dependency>

tests/e2e/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<forkCount>1</forkCount>
4242
<reuseForks>false</reuseForks>
4343
<enableAssertions>false</enableAssertions>
44+
<skipTests>${skip.e2e}</skipTests>
4445
</configuration>
4546
</plugin>
4647
</plugins>

0 commit comments

Comments
 (0)