Skip to content

Commit d17fe38

Browse files
committed
Merged from branch 2.5.x.
1 parent 0fc8b20 commit d17fe38

9 files changed

Lines changed: 90 additions & 84 deletions

File tree

cometd-java/cometd-java-annotations/pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@
5555
</dependency>
5656
<dependency>
5757
<groupId>org.slf4j</groupId>
58-
<artifactId>slf4j-simple</artifactId>
58+
<artifactId>slf4j-log4j12</artifactId>
59+
<version>${slf4j-version}</version>
60+
<scope>test</scope>
5961
</dependency>
6062
<dependency>
6163
<groupId>org.cometd.java</groupId>

cometd-java/cometd-java-client/pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353
</dependency>
5454
<dependency>
5555
<groupId>org.slf4j</groupId>
56-
<artifactId>slf4j-simple</artifactId>
56+
<artifactId>slf4j-log4j12</artifactId>
57+
<version>${slf4j-version}</version>
58+
<scope>test</scope>
5759
</dependency>
5860
<dependency>
5961
<groupId>javax.servlet</groupId>

cometd-java/cometd-java-common/pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353
</dependency>
5454
<dependency>
5555
<groupId>org.slf4j</groupId>
56-
<artifactId>slf4j-simple</artifactId>
56+
<artifactId>slf4j-log4j12</artifactId>
57+
<version>${slf4j-version}</version>
58+
<scope>test</scope>
5759
</dependency>
5860
</dependencies>
5961

cometd-java/cometd-java-server/pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@
6060
</dependency>
6161
<dependency>
6262
<groupId>org.slf4j</groupId>
63-
<artifactId>slf4j-simple</artifactId>
63+
<artifactId>slf4j-log4j12</artifactId>
64+
<version>${slf4j-version}</version>
65+
<scope>test</scope>
6466
</dependency>
6567
<dependency>
6668
<groupId>org.eclipse.jetty</groupId>

cometd-java/cometd-java-server/src/test/java/org/cometd/server/BayeuxContextTest.java

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.util.EnumSet;
66
import java.util.concurrent.CountDownLatch;
77
import java.util.concurrent.TimeUnit;
8+
import javax.servlet.DispatcherType;
89
import javax.servlet.Filter;
910
import javax.servlet.FilterChain;
1011
import javax.servlet.FilterConfig;
@@ -15,9 +16,8 @@
1516

1617
import org.cometd.bayeux.server.BayeuxServer;
1718
import org.cometd.bayeux.server.ServerSession;
18-
import org.eclipse.jetty.client.ContentExchange;
19-
import org.eclipse.jetty.client.HttpExchange;
20-
import org.eclipse.jetty.server.DispatcherType;
19+
import org.eclipse.jetty.client.api.ContentResponse;
20+
import org.eclipse.jetty.client.api.Request;
2121
import org.eclipse.jetty.servlet.FilterHolder;
2222
import org.junit.Assert;
2323
import org.junit.Test;
@@ -42,15 +42,14 @@ public void sessionRemoved(ServerSession session, boolean timedout)
4242
}
4343
});
4444

45-
ContentExchange handshake = newBayeuxExchange("[{" +
45+
Request handshake = newBayeuxRequest("[{" +
4646
"\"channel\": \"/meta/handshake\"," +
4747
"\"version\": \"1.0\"," +
4848
"\"minimumVersion\": \"1.0\"," +
4949
"\"supportedConnectionTypes\": [\"long-polling\"]" +
5050
"}]");
51-
httpClient.send(handshake);
52-
Assert.assertEquals(HttpExchange.STATUS_COMPLETED, handshake.waitForDone());
53-
Assert.assertEquals(200, handshake.getResponseStatus());
51+
ContentResponse response = handshake.send();
52+
Assert.assertEquals(200, response.getStatus());
5453

5554
Assert.assertTrue(latch.await(5, TimeUnit.SECONDS));
5655
}
@@ -76,17 +75,16 @@ public void sessionRemoved(ServerSession session, boolean timedout)
7675
}
7776
});
7877

79-
ContentExchange handshake = newBayeuxExchange("[{" +
78+
Request handshake = newBayeuxRequest("[{" +
8079
"\"channel\": \"/meta/handshake\"," +
8180
"\"version\": \"1.0\"," +
8281
"\"minimumVersion\": \"1.0\"," +
8382
"\"supportedConnectionTypes\": [\"long-polling\"]" +
8483
"}]");
85-
handshake.addRequestHeader(name, value1);
86-
handshake.addRequestHeader(name, value2);
87-
httpClient.send(handshake);
88-
Assert.assertEquals(HttpExchange.STATUS_COMPLETED, handshake.waitForDone());
89-
Assert.assertEquals(200, handshake.getResponseStatus());
84+
handshake.header(name, value1);
85+
handshake.header(name, value2);
86+
ContentResponse response = handshake.send();
87+
Assert.assertEquals(200, response.getStatus());
9088

9189
Assert.assertTrue(latch.await(5, TimeUnit.SECONDS));
9290
}
@@ -131,15 +129,14 @@ public void sessionRemoved(ServerSession session, boolean timedout)
131129
}
132130
});
133131

134-
ContentExchange handshake = newBayeuxExchange("[{" +
132+
Request handshake = newBayeuxRequest("[{" +
135133
"\"channel\": \"/meta/handshake\"," +
136134
"\"version\": \"1.0\"," +
137135
"\"minimumVersion\": \"1.0\"," +
138136
"\"supportedConnectionTypes\": [\"long-polling\"]" +
139137
"}]");
140-
httpClient.send(handshake);
141-
Assert.assertEquals(HttpExchange.STATUS_COMPLETED, handshake.waitForDone());
142-
Assert.assertEquals(200, handshake.getResponseStatus());
138+
ContentResponse response = handshake.send();
139+
Assert.assertEquals(200, response.getStatus());
143140

144141
Assert.assertTrue(latch.await(5, TimeUnit.SECONDS));
145142
}
@@ -186,15 +183,14 @@ public void sessionRemoved(ServerSession session, boolean timedout)
186183
}
187184
});
188185

189-
ContentExchange handshake = newBayeuxExchange("[{" +
186+
Request handshake = newBayeuxRequest("[{" +
190187
"\"channel\": \"/meta/handshake\"," +
191188
"\"version\": \"1.0\"," +
192189
"\"minimumVersion\": \"1.0\"," +
193190
"\"supportedConnectionTypes\": [\"long-polling\"]" +
194191
"}]");
195-
httpClient.send(handshake);
196-
Assert.assertEquals(HttpExchange.STATUS_COMPLETED, handshake.waitForDone());
197-
Assert.assertEquals(200, handshake.getResponseStatus());
192+
ContentResponse response = handshake.send();
193+
Assert.assertEquals(200, response.getStatus());
198194

199195
Assert.assertTrue(latch.await(5, TimeUnit.SECONDS));
200196
}
@@ -216,15 +212,14 @@ public void sessionRemoved(ServerSession session, boolean timedout)
216212
}
217213
});
218214

219-
ContentExchange handshake = newBayeuxExchange("[{" +
215+
Request handshake = newBayeuxRequest("[{" +
220216
"\"channel\": \"/meta/handshake\"," +
221217
"\"version\": \"1.0\"," +
222218
"\"minimumVersion\": \"1.0\"," +
223219
"\"supportedConnectionTypes\": [\"long-polling\"]" +
224220
"}]");
225-
httpClient.send(handshake);
226-
Assert.assertEquals(HttpExchange.STATUS_COMPLETED, handshake.waitForDone());
227-
Assert.assertEquals(200, handshake.getResponseStatus());
221+
ContentResponse response = handshake.send();
222+
Assert.assertEquals(200, response.getStatus());
228223

229224
Assert.assertTrue(latch.await(5, TimeUnit.SECONDS));
230225
}

cometd-java/cometd-java-server/src/test/java/org/cometd/server/SweepTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
import java.util.concurrent.TimeUnit;
2020

21-
import junit.framework.Assert;
2221
import org.cometd.bayeux.server.LocalSession;
2322
import org.cometd.bayeux.server.ServerTransport;
23+
import org.junit.Assert;
2424
import org.junit.Test;
2525

2626
public class SweepTest

cometd-java/cometd-java-server/src/test/resources/applicationContext.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<beans xmlns="http://www.springframework.org/schema/beans"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
4+
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
55

66
<bean id="logLevel" class="java.lang.String">
77
<constructor-arg value="1" />

cometd-java/cometd-jetty-websocket/cometd-jetty-websocket-server/src/test/resources/applicationContext-websocket.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<beans xmlns="http://www.springframework.org/schema/beans"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
4+
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
55

66
<bean id="bayeux" class="org.cometd.server.BayeuxServerImpl" init-method="start" destroy-method="stop">
77
<property name="transports">

pom.xml

Lines changed: 55 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@
147147
</goals>
148148
<configuration>
149149
<rules>
150+
<requireJavaVersion>
151+
<version>[1.7,)</version>
152+
</requireJavaVersion>
150153
<requireMavenVersion>
151154
<version>[3.0,)</version>
152155
</requireMavenVersion>
@@ -165,58 +168,58 @@
165168
<compilerArgument>-Xlint:all,-serial,-unchecked</compilerArgument>
166169
</configuration>
167170
</plugin>
168-
<plugin>
169-
<groupId>org.apache.felix</groupId>
170-
<artifactId>maven-bundle-plugin</artifactId>
171-
<extensions>true</extensions>
172-
<configuration>
173-
<archive>
174-
<addMavenDescriptor>true</addMavenDescriptor>
175-
</archive>
176-
<supportedProjectTypes>
177-
<supportedProjectType>jar</supportedProjectType>
178-
<supportedProjectType>war</supportedProjectType>
179-
</supportedProjectTypes>
180-
<instructions>
181-
<Bundle-Vendor>${project.organization.name}</Bundle-Vendor>
182-
<Bundle-ContactAddress>${project.url}</Bundle-ContactAddress>
183-
<Bundle-Description>${project.description}</Bundle-Description>
184-
<Bundle-DocURL>http://docs.cometd.org</Bundle-DocURL>
185-
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
186-
<Bundle-Version>${project.version}</Bundle-Version>
187-
<Import-Package>org.eclipse.jetty.*;version="[7.6,9)",*</Import-Package>
188-
<mode>development</mode>
189-
<url>${project.url}</url>
190-
<implementation-version>${project.version}</implementation-version>
191-
<package>org.cometd</package>
192-
</instructions>
193-
</configuration>
194-
<executions>
195-
<execution>
196-
<id>osgi</id>
197-
<goals>
198-
<goal>manifest</goal>
199-
</goals>
200-
<inherited>true</inherited>
201-
</execution>
202-
</executions>
203-
</plugin>
204-
<plugin>
205-
<artifactId>maven-jar-plugin</artifactId>
206-
<configuration>
207-
<archive>
208-
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
209-
</archive>
210-
</configuration>
211-
</plugin>
212-
<plugin>
213-
<artifactId>maven-war-plugin</artifactId>
214-
<configuration>
215-
<archive>
216-
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
217-
</archive>
218-
</configuration>
219-
</plugin>
171+
<plugin>
172+
<groupId>org.apache.felix</groupId>
173+
<artifactId>maven-bundle-plugin</artifactId>
174+
<extensions>true</extensions>
175+
<configuration>
176+
<archive>
177+
<addMavenDescriptor>true</addMavenDescriptor>
178+
</archive>
179+
<supportedProjectTypes>
180+
<supportedProjectType>jar</supportedProjectType>
181+
<supportedProjectType>war</supportedProjectType>
182+
</supportedProjectTypes>
183+
<instructions>
184+
<Bundle-Vendor>${project.organization.name}</Bundle-Vendor>
185+
<Bundle-ContactAddress>${project.url}</Bundle-ContactAddress>
186+
<Bundle-Description>${project.description}</Bundle-Description>
187+
<Bundle-DocURL>http://docs.cometd.org</Bundle-DocURL>
188+
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
189+
<Bundle-Version>${project.version}</Bundle-Version>
190+
<Import-Package>org.eclipse.jetty.*;version="[7.6,9)",*</Import-Package>
191+
<mode>development</mode>
192+
<url>${project.url}</url>
193+
<implementation-version>${project.version}</implementation-version>
194+
<package>org.cometd</package>
195+
</instructions>
196+
</configuration>
197+
<executions>
198+
<execution>
199+
<id>osgi</id>
200+
<goals>
201+
<goal>manifest</goal>
202+
</goals>
203+
<inherited>true</inherited>
204+
</execution>
205+
</executions>
206+
</plugin>
207+
<plugin>
208+
<artifactId>maven-jar-plugin</artifactId>
209+
<configuration>
210+
<archive>
211+
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
212+
</archive>
213+
</configuration>
214+
</plugin>
215+
<plugin>
216+
<artifactId>maven-war-plugin</artifactId>
217+
<configuration>
218+
<archive>
219+
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
220+
</archive>
221+
</configuration>
222+
</plugin>
220223
<plugin>
221224
<artifactId>maven-release-plugin</artifactId>
222225
<configuration>

0 commit comments

Comments
 (0)