Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2020-03-14 06:32:29 +0000
committerEike Stepper2020-03-21 06:21:26 +0000
commitef0b96be8946faa345d473c5f951d8debe540a0c (patch)
tree7c663ba4670aed2d67d254c6d4e086fcc1660518
parentfe707b44781f06373c894c62da3f4faa2db1ba59 (diff)
downloadcdo-ef0b96be8946faa345d473c5f951d8debe540a0c.tar.gz
cdo-ef0b96be8946faa345d473c5f951d8debe540a0c.tar.xz
cdo-ef0b96be8946faa345d473c5f951d8debe540a0c.zip
[561115] Implement a Websocket-based transport for Net4j
https://bugs.eclipse.org/bugs/show_bug.cgi?id=561115
-rw-r--r--features/org.eclipse.emf.cdo-feature/feature.xml2
-rw-r--r--features/org.eclipse.emf.cdo-feature/pom.xml2
-rw-r--r--features/org.eclipse.emf.cdo.all-feature/feature.xml2
-rw-r--r--features/org.eclipse.emf.cdo.all-feature/pom.xml2
-rw-r--r--features/org.eclipse.emf.cdo.epp-feature/feature.xml2
-rw-r--r--features/org.eclipse.emf.cdo.epp-feature/pom.xml2
-rw-r--r--features/org.eclipse.emf.cdo.sdk-feature/feature.xml2
-rw-r--r--features/org.eclipse.emf.cdo.sdk-feature/pom.xml2
-rw-r--r--features/org.eclipse.emf.cdo.server.embedded-feature/feature.xml2
-rw-r--r--features/org.eclipse.emf.cdo.server.embedded-feature/pom.xml2
-rw-r--r--features/org.eclipse.emf.cdo.tests-feature/feature.xml2
-rw-r--r--features/org.eclipse.emf.cdo.tests-feature/pom.xml2
-rw-r--r--features/org.eclipse.net4j-feature/feature.xml9
-rw-r--r--features/org.eclipse.net4j-feature/pom.xml2
-rw-r--r--features/org.eclipse.net4j.sdk-feature/feature.xml2
-rw-r--r--features/org.eclipse.net4j.sdk-feature/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/.settings/.api_filters8
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/META-INF/MANIFEST.MF14
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/plugin.xml13
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java18
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jViewProvider.java116
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF40
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/launches/CDO AllTests (WS).launch41
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/launches/CDO AllTests.launch3
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractCDOTest.java24
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsWS.java42
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/SessionTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TransactionTest.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ViewProviderTest.java72
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_241464_Test.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_329786_Test.java29
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_362270b_Test.java46
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_362270c_Test.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_395999_Test.java59
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_399470_Test.java19
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_400128_Test.java31
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_412767_Test.java48
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_414949_Test.java25
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_429659_Test.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_437817_Test.java44
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_443281_Test.java24
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_450880_Test.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_458149_Test.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_464590_Test.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_467075_Test.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_467593_Test.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_468268_Test.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IConstants.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/ISessionConfig.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/ConfigTestSuite.java21
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java240
-rw-r--r--plugins/org.eclipse.net4j.http.common/META-INF/MANIFEST.MF10
-rw-r--r--plugins/org.eclipse.net4j.http.common/pom.xml2
-rw-r--r--plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java4
-rw-r--r--plugins/org.eclipse.net4j.http.tests/src/org/eclipse/net4j/http/tests/HTTPTest.java6
-rw-r--r--plugins/org.eclipse.net4j.jvm/META-INF/MANIFEST.MF10
-rw-r--r--plugins/org.eclipse.net4j.jvm/pom.xml2
-rw-r--r--plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/JVMAcceptor.java2
-rw-r--r--plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/JVMConnector.java32
-rw-r--r--plugins/org.eclipse.net4j.tcp/.settings/org.eclipse.jdt.core.prefs43
-rw-r--r--plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF14
-rw-r--r--plugins/org.eclipse.net4j.tcp/pom.xml2
-rw-r--r--plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPAcceptor.java7
-rw-r--r--plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java9
-rw-r--r--plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ssl/SSLBuffer.java10
-rw-r--r--plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ssl/SSLServerConnector.java3
-rw-r--r--plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/tcp/TCPUtil.java19
-rw-r--r--plugins/org.eclipse.net4j.tests/META-INF/MANIFEST.MF18
-rw-r--r--plugins/org.eclipse.net4j.tests/Net4j AllTests.launch3
-rw-r--r--plugins/org.eclipse.net4j.tests/Net4j SSL AllTests.launch20
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractProtocolTest.java32
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java204
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AcceptorTest.java50
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllSSLTests.java37
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllTests.java50
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ChannelTest.java138
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ExceptionTest.java41
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/IdleTimeoutTest.java70
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/NegotiationTest.java238
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalMonitorTest.java244
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalStreamWrappingTest.java3
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java55
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPConnectorTest.java626
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TransportTest.java195
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_241463_Test.java85
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_259086_Test.java69
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_262875_Test.java7
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/config/AbstractConfigTest.java237
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/config/Net4jTestSuite.java143
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/config/TestConfig.java341
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java2
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/FastListTest.java6
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/RoundRobinBlockingQueueTest.java67
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SecurityTest.java22
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SynchronizingCorrelatorTest.java26
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/cache/Revision.java1
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/RoundRobinBlockingQueue.java2
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/SynchronizingCorrelator.java2
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/Lifecycle.java2
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java6
-rw-r--r--plugins/org.eclipse.net4j.ws/.classpath7
-rw-r--r--plugins/org.eclipse.net4j.ws/.options3
-rw-r--r--plugins/org.eclipse.net4j.ws/.project58
-rw-r--r--plugins/org.eclipse.net4j.ws/.settings/.api_filters11
-rw-r--r--plugins/org.eclipse.net4j.ws/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/org.eclipse.net4j.ws/.settings/org.eclipse.jdt.core.prefs452
-rw-r--r--plugins/org.eclipse.net4j.ws/.settings/org.eclipse.jdt.launching.prefs3
-rw-r--r--plugins/org.eclipse.net4j.ws/.settings/org.eclipse.jdt.ui.prefs119
-rw-r--r--plugins/org.eclipse.net4j.ws/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--plugins/org.eclipse.net4j.ws/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--plugins/org.eclipse.net4j.ws/.settings/org.eclipse.mylyn.team.ui.prefs3
-rw-r--r--plugins/org.eclipse.net4j.ws/.settings/org.eclipse.pde.api.tools.prefs95
-rw-r--r--plugins/org.eclipse.net4j.ws/.settings/org.eclipse.pde.prefs31
-rw-r--r--plugins/org.eclipse.net4j.ws/META-INF/MANIFEST.MF30
-rw-r--r--plugins/org.eclipse.net4j.ws/about.html28
-rw-r--r--plugins/org.eclipse.net4j.ws/build.properties25
-rw-r--r--plugins/org.eclipse.net4j.ws/plugin.properties11
-rw-r--r--plugins/org.eclipse.net4j.ws/plugin.xml28
-rw-r--r--plugins/org.eclipse.net4j.ws/pom.xml31
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSAcceptor.java93
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSAcceptorFactory.java60
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSAcceptorManager.java56
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSClientConnector.java194
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSConnector.java205
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSConnectorFactory.java73
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSServerConnector.java99
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/bundle/OM.java44
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/IWSAcceptor.java25
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/IWSAcceptorManager.java30
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/IWSConnector.java31
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/IWSNegotiationContext.java25
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/WSUtil.java81
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/jetty/Net4jWebSocket.java554
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/jetty/Net4jWebSocketServlet.java40
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/jetty/package-info.java15
-rw-r--r--plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/package-info.java15
-rw-r--r--plugins/org.eclipse.net4j/META-INF/MANIFEST.MF37
-rw-r--r--plugins/org.eclipse.net4j/pom.xml2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/Buffer.java66
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferUtil.java15
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/IBuffer.java10
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/IBufferHandler.java8
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Acceptor.java32
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Channel.java52
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/ChannelMultiplexer.java37
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Connector.java6
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/InternalChannelMultiplexer.java17
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/InverseCloseable.java (renamed from plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPUnitTest.java)19
-rw-r--r--releng/org.eclipse.emf.cdo.releng.parent/plugins/pom.xml1
-rw-r--r--releng/org.eclipse.emf.cdo.releng.parent/tp/org.eclipse.emf.cdo.releng.tp.target9
152 files changed, 5114 insertions, 2098 deletions
diff --git a/features/org.eclipse.emf.cdo-feature/feature.xml b/features/org.eclipse.emf.cdo-feature/feature.xml
index c95c254cc2..ec81cd6024 100644
--- a/features/org.eclipse.emf.cdo-feature/feature.xml
+++ b/features/org.eclipse.emf.cdo-feature/feature.xml
@@ -13,7 +13,7 @@
<feature
id="org.eclipse.emf.cdo"
label="%featureName"
- version="4.9.1.qualifier"
+ version="4.10.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.emf.cdo.license"
license-feature-version="0.0.0">
diff --git a/features/org.eclipse.emf.cdo-feature/pom.xml b/features/org.eclipse.emf.cdo-feature/pom.xml
index 814ae2c402..1d18f37b0a 100644
--- a/features/org.eclipse.emf.cdo-feature/pom.xml
+++ b/features/org.eclipse.emf.cdo-feature/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo.features</groupId>
<artifactId>org.eclipse.emf.cdo</artifactId>
- <version>4.9.1-SNAPSHOT</version>
+ <version>4.10.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/features/org.eclipse.emf.cdo.all-feature/feature.xml b/features/org.eclipse.emf.cdo.all-feature/feature.xml
index ad427374c3..0e61557baa 100644
--- a/features/org.eclipse.emf.cdo.all-feature/feature.xml
+++ b/features/org.eclipse.emf.cdo.all-feature/feature.xml
@@ -13,7 +13,7 @@
<feature
id="org.eclipse.emf.cdo.all"
label="%featureName"
- version="4.9.1.qualifier"
+ version="4.10.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.emf.cdo.license"
license-feature-version="0.0.0">
diff --git a/features/org.eclipse.emf.cdo.all-feature/pom.xml b/features/org.eclipse.emf.cdo.all-feature/pom.xml
index aaad46e658..85ee711331 100644
--- a/features/org.eclipse.emf.cdo.all-feature/pom.xml
+++ b/features/org.eclipse.emf.cdo.all-feature/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo.features</groupId>
<artifactId>org.eclipse.emf.cdo.all</artifactId>
- <version>4.9.1-SNAPSHOT</version>
+ <version>4.10.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/features/org.eclipse.emf.cdo.epp-feature/feature.xml b/features/org.eclipse.emf.cdo.epp-feature/feature.xml
index b147f5ca29..527a60e881 100644
--- a/features/org.eclipse.emf.cdo.epp-feature/feature.xml
+++ b/features/org.eclipse.emf.cdo.epp-feature/feature.xml
@@ -12,7 +12,7 @@
<feature
id="org.eclipse.emf.cdo.epp"
label="%featureName"
- version="4.9.1.qualifier"
+ version="4.10.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.emf.cdo.license"
license-feature-version="0.0.0">
diff --git a/features/org.eclipse.emf.cdo.epp-feature/pom.xml b/features/org.eclipse.emf.cdo.epp-feature/pom.xml
index a2c747034d..1eb428fad2 100644
--- a/features/org.eclipse.emf.cdo.epp-feature/pom.xml
+++ b/features/org.eclipse.emf.cdo.epp-feature/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo.features</groupId>
<artifactId>org.eclipse.emf.cdo.epp</artifactId>
- <version>4.9.1-SNAPSHOT</version>
+ <version>4.10.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/features/org.eclipse.emf.cdo.sdk-feature/feature.xml b/features/org.eclipse.emf.cdo.sdk-feature/feature.xml
index 0ea1772cb8..ebb1648cad 100644
--- a/features/org.eclipse.emf.cdo.sdk-feature/feature.xml
+++ b/features/org.eclipse.emf.cdo.sdk-feature/feature.xml
@@ -12,7 +12,7 @@
<feature
id="org.eclipse.emf.cdo.sdk"
label="%featureName"
- version="5.2.1.qualifier"
+ version="5.3.0.qualifier"
provider-name="%providerName"
image="eclipse_update_120.jpg"
license-feature="org.eclipse.emf.cdo.license"
diff --git a/features/org.eclipse.emf.cdo.sdk-feature/pom.xml b/features/org.eclipse.emf.cdo.sdk-feature/pom.xml
index 0afdc16b76..8fad35760a 100644
--- a/features/org.eclipse.emf.cdo.sdk-feature/pom.xml
+++ b/features/org.eclipse.emf.cdo.sdk-feature/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo.features</groupId>
<artifactId>org.eclipse.emf.cdo.sdk</artifactId>
- <version>5.2.1-SNAPSHOT</version>
+ <version>5.3.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/features/org.eclipse.emf.cdo.server.embedded-feature/feature.xml b/features/org.eclipse.emf.cdo.server.embedded-feature/feature.xml
index fc2aeed411..715fcddc4f 100644
--- a/features/org.eclipse.emf.cdo.server.embedded-feature/feature.xml
+++ b/features/org.eclipse.emf.cdo.server.embedded-feature/feature.xml
@@ -12,7 +12,7 @@
<feature
id="org.eclipse.emf.cdo.server.embedded"
label="%featureName"
- version="4.9.1.qualifier"
+ version="4.10.0.qualifier"
provider-name="%providerName"
image="eclipse_update_120.jpg"
license-feature="org.eclipse.emf.cdo.license"
diff --git a/features/org.eclipse.emf.cdo.server.embedded-feature/pom.xml b/features/org.eclipse.emf.cdo.server.embedded-feature/pom.xml
index 7430a5d90e..a2fa92e888 100644
--- a/features/org.eclipse.emf.cdo.server.embedded-feature/pom.xml
+++ b/features/org.eclipse.emf.cdo.server.embedded-feature/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo.features</groupId>
<artifactId>org.eclipse.emf.cdo.server.embedded</artifactId>
- <version>4.9.1-SNAPSHOT</version>
+ <version>4.10.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/features/org.eclipse.emf.cdo.tests-feature/feature.xml b/features/org.eclipse.emf.cdo.tests-feature/feature.xml
index afacd1ae5c..288e60efea 100644
--- a/features/org.eclipse.emf.cdo.tests-feature/feature.xml
+++ b/features/org.eclipse.emf.cdo.tests-feature/feature.xml
@@ -12,7 +12,7 @@
<feature
id="org.eclipse.emf.cdo.tests"
label="%featureName"
- version="4.4.0.qualifier"
+ version="4.4.1.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.emf.cdo.license"
license-feature-version="0.0.0">
diff --git a/features/org.eclipse.emf.cdo.tests-feature/pom.xml b/features/org.eclipse.emf.cdo.tests-feature/pom.xml
index 8ec217a6e3..af80890224 100644
--- a/features/org.eclipse.emf.cdo.tests-feature/pom.xml
+++ b/features/org.eclipse.emf.cdo.tests-feature/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo.features</groupId>
<artifactId>org.eclipse.emf.cdo.tests</artifactId>
- <version>4.4.0-SNAPSHOT</version>
+ <version>4.4.1-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/features/org.eclipse.net4j-feature/feature.xml b/features/org.eclipse.net4j-feature/feature.xml
index 626eab3201..ecd7740cf3 100644
--- a/features/org.eclipse.net4j-feature/feature.xml
+++ b/features/org.eclipse.net4j-feature/feature.xml
@@ -12,7 +12,7 @@
<feature
id="org.eclipse.net4j"
label="%featureName"
- version="4.9.1.qualifier"
+ version="4.10.0.qualifier"
provider-name="%providerName"
image="eclipse_update_120.jpg"
license-feature="org.eclipse.emf.cdo.license"
@@ -95,4 +95,11 @@
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="org.eclipse.net4j.ws"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
</feature>
diff --git a/features/org.eclipse.net4j-feature/pom.xml b/features/org.eclipse.net4j-feature/pom.xml
index 98999bda50..e0bbabffd0 100644
--- a/features/org.eclipse.net4j-feature/pom.xml
+++ b/features/org.eclipse.net4j-feature/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo.features</groupId>
<artifactId>org.eclipse.net4j</artifactId>
- <version>4.9.1-SNAPSHOT</version>
+ <version>4.10.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/features/org.eclipse.net4j.sdk-feature/feature.xml b/features/org.eclipse.net4j.sdk-feature/feature.xml
index fe94306df2..747c3dc9f6 100644
--- a/features/org.eclipse.net4j.sdk-feature/feature.xml
+++ b/features/org.eclipse.net4j.sdk-feature/feature.xml
@@ -12,7 +12,7 @@
<feature
id="org.eclipse.net4j.sdk"
label="%featureName"
- version="4.9.1.qualifier"
+ version="4.10.0.qualifier"
provider-name="%providerName"
image="eclipse_update_120.jpg"
license-feature="org.eclipse.emf.cdo.license"
diff --git a/features/org.eclipse.net4j.sdk-feature/pom.xml b/features/org.eclipse.net4j.sdk-feature/pom.xml
index 5a088bbf66..1cd6d68709 100644
--- a/features/org.eclipse.net4j.sdk-feature/pom.xml
+++ b/features/org.eclipse.net4j.sdk-feature/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo.features</groupId>
<artifactId>org.eclipse.net4j.sdk</artifactId>
- <version>4.9.1-SNAPSHOT</version>
+ <version>4.10.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/plugins/org.eclipse.emf.cdo.net4j/.settings/.api_filters b/plugins/org.eclipse.emf.cdo.net4j/.settings/.api_filters
index d6ff76681e..c70540e5f4 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/.settings/.api_filters
+++ b/plugins/org.eclipse.emf.cdo.net4j/.settings/.api_filters
@@ -64,6 +64,14 @@
</message_arguments>
</filter>
</resource>
+ <resource path="src/org/eclipse/emf/cdo/net4j/CDONet4jViewProvider.java" type="org.eclipse.emf.cdo.net4j.CDONet4jViewProvider$WS">
+ <filter id="572522506">
+ <message_arguments>
+ <message_argument value="InvalidURIException"/>
+ <message_argument value="WS"/>
+ </message_arguments>
+ </filter>
+ </resource>
<resource path="src/org/eclipse/emf/cdo/net4j/CDOSessionRecoveryEvent.java" type="org.eclipse.emf.cdo.net4j.CDOSessionRecoveryEvent">
<filter id="571473929">
<message_arguments>
diff --git a/plugins/org.eclipse.emf.cdo.net4j/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.net4j/META-INF/MANIFEST.MF
index 1d98ef6bf4..ed9205f03a 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.net4j/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.cdo.net4j; singleton:=true
-Bundle-Version: 4.2.0.qualifier
+Bundle-Version: 4.3.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -10,11 +10,11 @@ Bundle-Activator: org.eclipse.emf.cdo.internal.net4j.bundle.OM$Activator
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.emf.cdo;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
org.eclipse.net4j;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
-Export-Package: org.eclipse.emf.cdo.internal.net4j;version="4.2.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.ui,org.eclipse.emf.cdo.examples",
- org.eclipse.emf.cdo.internal.net4j.bundle;version="4.2.0";x-friends:="org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.net4j.messages;version="4.2.0";x-internal:=true,
- org.eclipse.emf.cdo.internal.net4j.protocol;version="4.2.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.ui,org.eclipse.emf.cdo.examples",
- org.eclipse.emf.cdo.internal.net4j.testrecorder;version="4.2.0";x-internal:=true,
- org.eclipse.emf.cdo.net4j;version="4.2.0"
+Export-Package: org.eclipse.emf.cdo.internal.net4j;version="4.3.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.ui,org.eclipse.emf.cdo.examples",
+ org.eclipse.emf.cdo.internal.net4j.bundle;version="4.3.0";x-friends:="org.eclipse.emf.cdo.tests",
+ org.eclipse.emf.cdo.internal.net4j.messages;version="4.3.0";x-internal:=true,
+ org.eclipse.emf.cdo.internal.net4j.protocol;version="4.3.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.ui,org.eclipse.emf.cdo.examples",
+ org.eclipse.emf.cdo.internal.net4j.testrecorder;version="4.3.0";x-internal:=true,
+ org.eclipse.emf.cdo.net4j;version="4.3.0"
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: org.eclipse.emf.cdo.net4j
diff --git a/plugins/org.eclipse.emf.cdo.net4j/plugin.xml b/plugins/org.eclipse.emf.cdo.net4j/plugin.xml
index 7ee1bcbd5d..b949b96469 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.net4j/plugin.xml
@@ -35,18 +35,25 @@
point="org.eclipse.emf.ecore.protocol_parser">
<parser
class="org.eclipse.emf.cdo.eresource.impl.CDOResourceFactoryImpl"
+ protocolName="cdo.net4j.jvm"/>
+ <parser
+ class="org.eclipse.emf.cdo.eresource.impl.CDOResourceFactoryImpl"
protocolName="cdo.net4j.tcp"/>
<parser
class="org.eclipse.emf.cdo.eresource.impl.CDOResourceFactoryImpl"
protocolName="cdo.net4j.ssl"/>
<parser
class="org.eclipse.emf.cdo.eresource.impl.CDOResourceFactoryImpl"
- protocolName="cdo.net4j.jvm"/>
+ protocolName="cdo.net4j.ws"/>
</extension>
<extension
point="org.eclipse.emf.cdo.viewProviders">
<viewProvider
+ class="org.eclipse.emf.cdo.net4j.CDONet4jViewProvider$JVM"
+ priority="500"
+ regex="cdo\.net4j\.jvm://.*"/>
+ <viewProvider
class="org.eclipse.emf.cdo.net4j.CDONet4jViewProvider$TCP"
priority="500"
regex="cdo\.net4j\.tcp://.*"/>
@@ -55,9 +62,9 @@
priority="500"
regex="cdo\.net4j\.ssl://.*"/>
<viewProvider
- class="org.eclipse.emf.cdo.net4j.CDONet4jViewProvider$JVM"
+ class="org.eclipse.emf.cdo.net4j.CDONet4jViewProvider$WS"
priority="500"
- regex="cdo\.net4j\.jvm://.*"/>
+ regex="cdo\.net4j\.ws://.*"/>
</extension>
</plugin>
diff --git a/plugins/org.eclipse.emf.cdo.net4j/pom.xml b/plugins/org.eclipse.emf.cdo.net4j/pom.xml
index 6673617f47..0397d8e160 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/pom.xml
+++ b/plugins/org.eclipse.emf.cdo.net4j/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo</groupId>
<artifactId>org.eclipse.emf.cdo.net4j</artifactId>
- <version>4.2.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java
index 1dc4c8a34e..e0d6d9fc7f 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java
@@ -41,6 +41,12 @@ import java.util.Map;
*/
public final class CDONet4jUtil
{
+
+ /**
+ * @since 4.0
+ */
+ public static final String PROTOCOL_JVM = "cdo.net4j.jvm";
+
/**
* @since 4.0
*/
@@ -52,9 +58,9 @@ public final class CDONet4jUtil
public static final String PROTOCOL_SSL = "cdo.net4j.ssl";
/**
- * @since 4.0
+ * @since 4.3
*/
- public static final String PROTOCOL_JVM = "cdo.net4j.jvm";
+ public static final String PROTOCOL_WS = "cdo.net4j.ws";
static
{
@@ -75,15 +81,21 @@ public final class CDONet4jUtil
map.put(PROTOCOL_SSL, CDOResourceFactory.INSTANCE);
}
+ if (!map.containsKey(PROTOCOL_WS))
+ {
+ map.put(PROTOCOL_WS, CDOResourceFactory.INSTANCE);
+ }
+
if (!map.containsKey(PROTOCOL_JVM))
{
map.put(PROTOCOL_JVM, CDOResourceFactory.INSTANCE);
}
int priority = CDOViewProvider.DEFAULT_PRIORITY - 100;
+ CDOViewProviderRegistry.INSTANCE.addViewProvider(new CDONet4jViewProvider.JVM(priority));
CDOViewProviderRegistry.INSTANCE.addViewProvider(new CDONet4jViewProvider.TCP(priority));
CDOViewProviderRegistry.INSTANCE.addViewProvider(new CDONet4jViewProvider.SSL(priority));
- CDOViewProviderRegistry.INSTANCE.addViewProvider(new CDONet4jViewProvider.JVM(priority));
+ CDOViewProviderRegistry.INSTANCE.addViewProvider(new CDONet4jViewProvider.WS(priority));
}
}
catch (RuntimeException ex)
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jViewProvider.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jViewProvider.java
index dba1e0a162..4437bcba0f 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jViewProvider.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jViewProvider.java
@@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.net4j;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.util.CDOURIData;
+import org.eclipse.emf.cdo.util.InvalidURIException;
import org.eclipse.emf.cdo.view.AbstractCDOViewProvider;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.cdo.view.CDOViewProvider;
@@ -30,6 +31,7 @@ import org.eclipse.net4j.util.security.PasswordCredentialsProvider;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import java.text.SimpleDateFormat;
@@ -43,7 +45,10 @@ import java.util.Date;
*/
public abstract class CDONet4jViewProvider extends AbstractCDOViewProvider
{
- private String transport;
+ /**
+ * @since 4.3
+ */
+ protected final String transport;
public CDONet4jViewProvider(String transport, int priority)
{
@@ -54,7 +59,7 @@ public abstract class CDONet4jViewProvider extends AbstractCDOViewProvider
@Override
public CDOView getView(URI uri, ResourceSet resourceSet)
{
- CDOURIData data = new CDOURIData(uri);
+ CDOURIData data = createURIData(uri);
IConnector connector = getConnector(data.getAuthority());
CDONet4jSession session = getNet4jSession(connector, data.getUserName(), data.getPassWord(), data.getRepositoryName());
@@ -91,7 +96,7 @@ public abstract class CDONet4jViewProvider extends AbstractCDOViewProvider
@Override
public URI getViewURI(URI uri)
{
- CDOURIData uriData = new CDOURIData(uri);
+ CDOURIData uriData = createURIData(uri);
uriData.setResourcePath(null);
uriData.setExtraParameters(null);
return uriData.toURI();
@@ -129,6 +134,7 @@ public abstract class CDONet4jViewProvider extends AbstractCDOViewProvider
{
return null;
}
+
IConnector connector = (IConnector)channel.getMultiplexer();
String repositoryName = session.getRepositoryInfo().getName();
append(builder, connector, repositoryName);
@@ -173,6 +179,14 @@ public abstract class CDONet4jViewProvider extends AbstractCDOViewProvider
return URI.createURI(builder.toString());
}
+ /**
+ * @since 4.3
+ */
+ protected CDOURIData createURIData(URI uri)
+ {
+ return new CDOURIData(uri);
+ }
+
protected String getURIAuthority(IConnector connector)
{
String url = connector.getURL().toString();
@@ -281,6 +295,24 @@ public abstract class CDONet4jViewProvider extends AbstractCDOViewProvider
}
/**
+ * A JVM-based {@link CDONet4jViewProvider view provider}.
+ *
+ * @author Eike Stepper
+ */
+ public static class JVM extends CDONet4jViewProvider
+ {
+ public JVM(int priority)
+ {
+ super("jvm", priority);
+ }
+
+ public JVM()
+ {
+ this(DEFAULT_PRIORITY);
+ }
+ }
+
+ /**
* A TCP-based {@link CDONet4jViewProvider view provider}.
*
* @author Eike Stepper
@@ -319,20 +351,88 @@ public abstract class CDONet4jViewProvider extends AbstractCDOViewProvider
}
/**
- * A JVM-based {@link CDONet4jViewProvider view provider}.
+ * A WS-based {@link CDONet4jViewProvider view provider}.
*
* @author Eike Stepper
+ * @since 4.3
*/
- public static class JVM extends CDONet4jViewProvider
+ public static class WS extends CDONet4jViewProvider
{
- public JVM(int priority)
+ public static final String ACCEPTOR_NAME_PREFIX = "@";
+
+ public WS(int priority)
{
- super("jvm", priority);
+ super("ws", priority);
}
- public JVM()
+ public WS()
{
this(DEFAULT_PRIORITY);
}
+
+ @Override
+ public String getPath(URI uri)
+ {
+ IPath path = new Path(uri.path());
+
+ int index = getAcceptorSegmentIndex(path);
+ if (index == -1)
+ {
+ throw new InvalidURIException(uri);
+ }
+
+ return path.makeAbsolute().removeFirstSegments(index + 2).toString();
+ }
+
+ @Override
+ protected String getURIAuthority(IConnector connector)
+ {
+ String url = connector.getURL().toString();
+
+ String prefix = transport + "://";
+ if (url.startsWith(prefix))
+ {
+ url = url.substring(prefix.length());
+ }
+
+ return url;
+ }
+
+ @Override
+ protected CDOURIData createURIData(URI uri)
+ {
+ CDOURIData data = super.createURIData(uri);
+ IPath path = new Path(data.getRepositoryName()).append(data.getResourcePath());
+
+ int index = getAcceptorSegmentIndex(path);
+ if (index == -1)
+ {
+ throw new InvalidURIException(uri);
+ }
+
+ String authority = data.getAuthority();
+ for (int j = 0; j <= index; j++)
+ {
+ authority += "/" + path.segment(j);
+ }
+
+ data.setAuthority(authority);
+ data.setRepositoryName(path.segment(index + 1));
+ data.setResourcePath(path.removeFirstSegments(index + 2));
+ return data;
+ }
+
+ protected int getAcceptorSegmentIndex(IPath path)
+ {
+ for (int i = 0; i < path.segmentCount(); i++)
+ {
+ if (path.segment(i).startsWith(ACCEPTOR_NAME_PREFIX))
+ {
+ return i;
+ }
+ }
+
+ return -1;
+ }
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF
index 17678fc2c4..acfbaaf048 100644
--- a/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.tests;singleton:=true
-Bundle-Version: 4.1.0.qualifier
+Bundle-Version: 4.1.1.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -38,7 +38,21 @@ Require-Bundle: org.eclipse.net4j.tests;bundle-version="[4.0.0,5.0.0)";visibilit
org.eclipse.ocl.ecore;bundle-version="[3.0.0,4.0.0)",
org.apache.log4j;bundle-version="[1.2.0,2.0.0)",
com.google.guava;bundle-version="[15.0.0,28.0.0)",
- org.eclipse.emf.cdo.server.db;bundle-version="[4.0.0,5.0.0)"
+ org.eclipse.emf.cdo.server.db;bundle-version="[4.0.0,5.0.0)",
+ org.eclipse.jetty.server;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.servlet;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.security;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.client;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.http;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.util;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.io;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.websocket.common;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.websocket.servlet;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.websocket.server;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.websocket.client;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.websocket.api;bundle-version="[9.0.0,10.0.0)"
+Import-Package: javax.servlet;version="[2.3.0,4.0.0)",
+ javax.servlet.http;version="[2.3.0,4.0.0)"
Export-Package: base;version="4.0.200",
base.impl;version="4.0.200",
base.util;version="4.0.200",
@@ -48,17 +62,17 @@ Export-Package: base;version="4.0.200",
interface_;version="4.0.200",
interface_.impl;version="4.0.200",
interface_.util;version="4.0.200",
- org.eclipse.emf.cdo.tests;version="4.1.0",
- org.eclipse.emf.cdo.tests.bugzilla;version="4.1.0",
- org.eclipse.emf.cdo.tests.bundle;version="4.1.0";x-internal:=true,
- org.eclipse.emf.cdo.tests.config;version="4.1.0",
- org.eclipse.emf.cdo.tests.config.impl;version="4.1.0",
- org.eclipse.emf.cdo.tests.extra;version="4.1.0",
- org.eclipse.emf.cdo.tests.offline;version="4.1.0",
- org.eclipse.emf.cdo.tests.performance;version="4.1.0",
- org.eclipse.emf.cdo.tests.performance.framework;version="4.1.0",
- org.eclipse.emf.cdo.tests.revisioncache;version="4.1.0",
- org.eclipse.emf.cdo.tests.util;version="4.1.0",
+ org.eclipse.emf.cdo.tests;version="4.1.1",
+ org.eclipse.emf.cdo.tests.bugzilla;version="4.1.1",
+ org.eclipse.emf.cdo.tests.bundle;version="4.1.1";x-internal:=true,
+ org.eclipse.emf.cdo.tests.config;version="4.1.1",
+ org.eclipse.emf.cdo.tests.config.impl;version="4.1.1",
+ org.eclipse.emf.cdo.tests.extra;version="4.1.1",
+ org.eclipse.emf.cdo.tests.offline;version="4.1.1",
+ org.eclipse.emf.cdo.tests.performance;version="4.1.1",
+ org.eclipse.emf.cdo.tests.performance.framework;version="4.1.1",
+ org.eclipse.emf.cdo.tests.revisioncache;version="4.1.1",
+ org.eclipse.emf.cdo.tests.util;version="4.1.1",
reference;version="4.0.200",
reference.impl;version="4.0.200";
x-friends:="org.eclipse.emf.cdo.dawn.tests,
diff --git a/plugins/org.eclipse.emf.cdo.tests/launches/CDO AllTests (WS).launch b/plugins/org.eclipse.emf.cdo.tests/launches/CDO AllTests (WS).launch
new file mode 100644
index 0000000000..cccaa8c6bd
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/launches/CDO AllTests (WS).launch
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
+<booleanAttribute key="com.mountainminds.eclemma.core.INPLACE_INSTRUMENTATION" value="true"/>
+<listAttribute key="com.mountainminds.eclemma.core.INSTRUMENTATION_PATHS">
+<listEntry value="/org.eclipse.net4j.db.h2/bin"/>
+<listEntry value="/org.eclipse.net4j.http.server/bin"/>
+<listEntry value="/org.eclipse.emf.cdo.common/bin"/>
+<listEntry value="/org.eclipse.net4j.http/bin"/>
+<listEntry value="/org.eclipse.emf.cdo.net4j/bin"/>
+<listEntry value="/org.eclipse.emf.cdo/bin"/>
+<listEntry value="/org.eclipse.emf.cdo.common.db/bin"/>
+<listEntry value="/org.eclipse.net4j.tcp/bin"/>
+<listEntry value="/org.eclipse.net4j/bin"/>
+<listEntry value="/org.eclipse.net4j.util/bin"/>
+<listEntry value="/org.eclipse.net4j.jvm/bin"/>
+<listEntry value="/org.eclipse.net4j.db/bin"/>
+<listEntry value="/org.eclipse.emf.cdo.server/bin"/>
+<listEntry value="/org.eclipse.net4j.http.common/bin"/>
+<listEntry value="/org.eclipse.net4j.db.derby/bin"/>
+<listEntry value="/org.eclipse.emf.cdo.server.net4j/bin"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsWS.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
+<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.AllTestsWS"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.tests"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m&#13;&#10;-Xmx4g&#13;&#10;-Dorg.eclipse.net4j.util.om.trace.disable=true&#13;&#10;-Dorg.eclipse.emf.cdo.tests.config.impl.RepositoryConfig.enableServerBrowser=false&#13;&#10;&#10;-Dorg.eclipse.net4j.db.close.noisy=true"/>
+<stringAttribute key="yk-options" value="&#13;&#10;additional-options=&#13;&#10;snapshots-dir=&#13;&#10;"/>
+</launchConfiguration>
diff --git a/plugins/org.eclipse.emf.cdo.tests/launches/CDO AllTests.launch b/plugins/org.eclipse.emf.cdo.tests/launches/CDO AllTests.launch
index c85e814d7c..6c3bede6db 100644
--- a/plugins/org.eclipse.emf.cdo.tests/launches/CDO AllTests.launch
+++ b/plugins/org.eclipse.emf.cdo.tests/launches/CDO AllTests.launch
@@ -33,8 +33,9 @@
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
+<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.AllTests"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.tests"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m&#13;&#10;-Xmx1g&#13;&#10;-Dorg.eclipse.net4j.util.om.trace.disable=true&#13;&#10;-Dorg.eclipse.emf.cdo.tests.config.impl.RepositoryConfig.enableServerBrowser=false&#10;-Dorg.eclipse.net4j.db.close.noisy=true"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m&#13;&#10;-Xmx4g&#13;&#10;-Dorg.eclipse.net4j.util.om.trace.disable=true&#13;&#10;-Dorg.eclipse.emf.cdo.tests.config.impl.RepositoryConfig.enableServerBrowser=false&#13;&#10;-Dorg.eclipse.net4j.db.close.noisy=true"/>
<stringAttribute key="yk-options" value="&#13;&#10;additional-options=&#13;&#10;snapshots-dir=&#13;&#10;"/>
</launchConfiguration>
diff --git a/plugins/org.eclipse.emf.cdo.tests/pom.xml b/plugins/org.eclipse.emf.cdo.tests/pom.xml
index 4ae32d0881..21c48d1524 100644
--- a/plugins/org.eclipse.emf.cdo.tests/pom.xml
+++ b/plugins/org.eclipse.emf.cdo.tests/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo</groupId>
<artifactId>org.eclipse.emf.cdo.tests</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.1-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractCDOTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractCDOTest.java
index ceead49edf..411bc77154 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractCDOTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractCDOTest.java
@@ -23,6 +23,7 @@ import org.eclipse.emf.cdo.common.revision.CDOIDAndBranch;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.net4j.CDONet4jUtil;
import org.eclipse.emf.cdo.server.IView;
import org.eclipse.emf.cdo.session.CDORepositoryInfo;
import org.eclipse.emf.cdo.session.CDOSession;
@@ -40,6 +41,7 @@ import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.internal.cdo.object.CDOLegacyWrapper;
+import org.eclipse.net4j.util.ReflectUtil;
import org.eclipse.net4j.util.StringUtil;
import org.eclipse.net4j.util.concurrent.RWOLockManager.LockState;
import org.eclipse.net4j.util.concurrent.TimeoutRuntimeException;
@@ -56,8 +58,11 @@ import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceFactoryRegistryImpl;
import org.eclipse.emf.spi.cdo.FSMUtil;
+import java.lang.reflect.Field;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -66,6 +71,25 @@ import java.util.Map;
*/
public abstract class AbstractCDOTest extends ConfigTest
{
+ static
+ {
+ // Make sure that the Net4j resource factories are registered before registrations become impossible.
+ CDONet4jUtil.createNet4jSessionConfiguration();
+
+ makeUnmodifiable("protocolToFactoryMap");
+ makeUnmodifiable("extensionToFactoryMap");
+ makeUnmodifiable("contentTypeIdentifierToFactoryMap");
+ }
+
+ private static void makeUnmodifiable(String fieldName)
+ {
+ Field field = ReflectUtil.getField(ResourceFactoryRegistryImpl.class, fieldName);
+
+ @SuppressWarnings("unchecked")
+ Map<String, Object> map = (Map<String, Object>)ReflectUtil.getValue(field, Resource.Factory.Registry.INSTANCE);
+ ReflectUtil.setValue(field, Resource.Factory.Registry.INSTANCE, Collections.unmodifiableMap(map));
+ }
+
@Override
protected void doSetUp() throws Exception
{
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsWS.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsWS.java
new file mode 100644
index 0000000000..ef10492eef
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsWS.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2006-2013 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.tests;
+
+import org.eclipse.emf.cdo.tests.config.impl.SessionConfig;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author Eike Stepper
+ */
+public class AllTestsWS extends AllConfigs
+{
+ public static Test suite()
+ {
+ return new AllTestsWS().getTestSuite();
+ }
+
+ @Override
+ protected void initConfigSuites(TestSuite parent)
+ {
+ SessionConfig sessionConfig = WS;
+
+ addScenario(parent, MEM, sessionConfig, NATIVE);
+ addScenario(parent, MEM_AUDITS, sessionConfig, NATIVE);
+ addScenario(parent, MEM_BRANCHES, sessionConfig, NATIVE);
+ addScenario(parent, MEM_BRANCHES_UUIDS, sessionConfig, NATIVE);
+
+ addScenario(parent, MEM, sessionConfig, LEGACY);
+ addScenario(parent, MEM_AUDITS, sessionConfig, LEGACY);
+ addScenario(parent, MEM_BRANCHES, sessionConfig, LEGACY);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/SessionTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/SessionTest.java
index ff1f379c02..129ad305f7 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/SessionTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/SessionTest.java
@@ -473,7 +473,7 @@ public class SessionTest extends AbstractCDOTest
}
assertEquals(null, session);
- sleep(700);
+ sleep(500);
Net4j sessionConfig = (Net4j)getSessionConfig();
IAcceptor acceptor = sessionConfig.getAcceptor();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TransactionTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TransactionTest.java
index 59faefd5d9..7a4915099e 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TransactionTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TransactionTest.java
@@ -238,7 +238,6 @@ public class TransactionTest extends AbstractCDOTest
{
final int RUNS = 1;
final int THREADS = 100;
- final int TIMEOUT = 10; // Minutes.
final boolean pessimistic = true;
CDOSession session = openSession();
@@ -262,8 +261,6 @@ public class TransactionTest extends AbstractCDOTest
for (int thread = 0; thread < THREADS; thread++)
{
final CDOTransaction transaction = session.openTransaction();
- // transaction.options().setCommitInfoTimeout(1000000);
-
final Company company = transaction.getObject(initialCompany);
final Customer newCustomer = Model1Factory.eINSTANCE.createCustomer();
@@ -274,7 +271,7 @@ public class TransactionTest extends AbstractCDOTest
{
if (pessimistic)
{
- CDOUtil.getCDOObject(company).cdoWriteLock().lock(TIMEOUT, TimeUnit.MINUTES);
+ CDOUtil.getCDOObject(company).cdoWriteLock().lock(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS);
}
company.getCustomers().add(newCustomer);
@@ -288,11 +285,7 @@ public class TransactionTest extends AbstractCDOTest
thread.start();
}
- if (!latch.await(TIMEOUT, TimeUnit.MINUTES))
- {
- fail("Timeout after " + TIMEOUT + " seconds");
- }
-
+ await(latch);
signalCounter.dump(IOUtil.OUT(), true);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ViewProviderTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ViewProviderTest.java
index 1a71d40747..328aaed598 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ViewProviderTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ViewProviderTest.java
@@ -44,42 +44,6 @@ public class ViewProviderTest extends AbstractCDOTest
private URI uri;
- private void checkURI(String uri, boolean valid)
- {
- URI uri1 = URI.createURI(uri);
- CDOURIData data = new CDOURIData(uri1);
- URI uri2 = data.toURI();
- if (valid)
- {
- assertEquals(uri1, uri2);
- }
- else
- {
- assertNotSame(uri1, uri2);
- }
- }
-
- public void testURIs() throws Exception
- {
- checkURI("cdo.net4j.tcp://eike:passw@127.0.0.1:2042/repo/folder/resource", true);
- checkURI("cdo.net4j.tcp://eike@127.0.0.1:2042/repo/folder/resource", true);
- checkURI("cdo.net4j.tcp://127.0.0.1:2042/repo/folder/resource", true);
- checkURI("cdo.net4j.tcp://127.0.0.1:2042/repo/resource", true);
- checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource", true);
- checkURI("cdo.net4j.xyz://127.0.0.1/repo/resource", true);
-
- checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource?branch=MAIN/team1", true);
- checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource?branch=MAIN/team1&time=12345678987", true);
- checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource?branch=MAIN/team1&transactional=true", true);
-
- checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource?branch=MAIN/team1&time=12345&transactional=false", false);
- checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource?branch=MAIN/team1&transactional=false", false);
- checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource?branch=MAIN/team1&time=HEAD", false);
- checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource?branch=MAIN", false);
- checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource?branch=MAIN&time=HEAD", false);
-
- }
-
private void init() throws CommitException
{
Product1 product = getModel1Factory().createProduct1();
@@ -148,4 +112,40 @@ public class ViewProviderTest extends AbstractCDOTest
msg(xmi);
assertEquals(true, xmi.indexOf(uri.toString()) != -1);
}
+
+ public void testURIs() throws Exception
+ {
+ checkURI("cdo.net4j.tcp://eike:passw@127.0.0.1:2042/repo/folder/resource", true);
+ checkURI("cdo.net4j.tcp://eike@127.0.0.1:2042/repo/folder/resource", true);
+ checkURI("cdo.net4j.tcp://127.0.0.1:2042/repo/folder/resource", true);
+ checkURI("cdo.net4j.tcp://127.0.0.1:2042/repo/resource", true);
+ checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource", true);
+ checkURI("cdo.net4j.xyz://127.0.0.1/repo/resource", true);
+
+ checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource?branch=MAIN/team1", true);
+ checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource?branch=MAIN/team1&time=12345678987", true);
+ checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource?branch=MAIN/team1&transactional=true", true);
+
+ checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource?branch=MAIN/team1&time=12345&transactional=false", false);
+ checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource?branch=MAIN/team1&transactional=false", false);
+ checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource?branch=MAIN/team1&time=HEAD", false);
+ checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource?branch=MAIN", false);
+ checkURI("cdo.net4j.tcp://127.0.0.1/repo/resource?branch=MAIN&time=HEAD", false);
+
+ }
+
+ private static void checkURI(String uri, boolean valid)
+ {
+ URI uri1 = URI.createURI(uri);
+ CDOURIData data = new CDOURIData(uri1);
+ URI uri2 = data.toURI();
+ if (valid)
+ {
+ assertEquals(uri1, uri2);
+ }
+ else
+ {
+ assertNotSame(uri1, uri2);
+ }
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_241464_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_241464_Test.java
index 136e7ec80a..37c14a60ce 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_241464_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_241464_Test.java
@@ -53,9 +53,10 @@ public class Bugzilla_241464_Test extends AbstractCDOTest
CDOTransaction transaction = session.openTransaction();
CDOResource resource = transaction.getResource(getResourcePath("/test1"));
+ ((org.eclipse.emf.cdo.net4j.CDONet4jSession)session).options().getNet4jProtocol().setTimeout(2000L);
+
TestRevisionManager revisionManager = (TestRevisionManager)getRepository().getRevisionManager();
revisionManager.setGetRevisionsDelay(10000L); // Make the protocol time out
- ((org.eclipse.emf.cdo.net4j.CDONet4jSession)session).options().getNet4jProtocol().setTimeout(2000L);
try
{
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_329786_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_329786_Test.java
index d30cb0d9f8..afbf5f52ca 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_329786_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_329786_Test.java
@@ -43,25 +43,13 @@ public class Bugzilla_329786_Test extends AbstractCDOTest
{
getRepository();
- Registry registry = Resource.Factory.Registry.INSTANCE;
- registry.getProtocolToFactoryMap().put(CDONet4jUtil.PROTOCOL_TCP, CDOResourceFactory.INSTANCE);
- registry.getExtensionToFactoryMap().put("model1", new XMIResourceFactoryImpl());
-
- try
- {
- URI localURI = createLocalAndRemoteResource();
- accessRemoteObjectByLocalReferences(localURI);
- }
- finally
- {
- registry.getProtocolToFactoryMap().remove(CDONet4jUtil.PROTOCOL_TCP);
- registry.getExtensionToFactoryMap().remove("model1");
- }
+ URI localURI = createLocalAndRemoteResource();
+ accessRemoteObjectByLocalReferences(localURI);
}
private URI createLocalAndRemoteResource() throws Exception
{
- ResourceSet resourceSet = new ResourceSetImpl();
+ ResourceSet resourceSet = createResourceSet();
URI sharedURI = URI.createURI(CDONet4jUtil.PROTOCOL_TCP + "://localhost:2036/" + RepositoryConfig.REPOSITORY_NAME + getResourcePath("/sharedResource"))
.appendQuery(CDOURIData.TRANSACTIONAL_PARAMETER + "=true");
@@ -118,7 +106,7 @@ public class Bugzilla_329786_Test extends AbstractCDOTest
private void accessRemoteObjectByLocalReferences(URI localURI)
{
- ResourceSet resourceSet = new ResourceSetImpl();
+ ResourceSet resourceSet = createResourceSet();
Resource localResource = resourceSet.getResource(localURI, true);
assertEquals(true, localResource.getContents().get(0) instanceof Company);
@@ -137,4 +125,13 @@ public class Bugzilla_329786_Test extends AbstractCDOTest
PurchaseOrder sharedPurchaseOrder = localSupplier.getPurchaseOrders().get(0);
assertEquals(true, sharedPurchaseOrder.eResource() instanceof CDOResource);
}
+
+ private static ResourceSet createResourceSet()
+ {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ Registry registry = resourceSet.getResourceFactoryRegistry();
+ registry.getProtocolToFactoryMap().put(CDONet4jUtil.PROTOCOL_TCP, CDOResourceFactory.INSTANCE);
+ registry.getExtensionToFactoryMap().put("model1", new XMIResourceFactoryImpl());
+ return resourceSet;
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_362270b_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_362270b_Test.java
index ee211f71c0..1f036bf839 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_362270b_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_362270b_Test.java
@@ -11,7 +11,6 @@
package org.eclipse.emf.cdo.tests.bugzilla;
import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.eresource.CDOResourceFactory;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.tests.AbstractCDOTest;
import org.eclipse.emf.cdo.tests.model4.ContainedElementNoOpposite;
@@ -25,6 +24,7 @@ import org.eclipse.emf.internal.cdo.object.CDOLegacyAdapter;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.ECrossReferenceAdapter;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
@@ -36,7 +36,9 @@ import java.util.Collections;
*/
public class Bugzilla_362270b_Test extends AbstractCDOTest
{
- private static final String REMOTE_RESOURCE_PATH = "sharedResource.model1";
+ private static final String EXTENSION = "model1";
+
+ private static final String REMOTE_RESOURCE_PATH = "sharedResource." + EXTENSION;
private CDOTransaction cdoTransaction;
@@ -48,23 +50,22 @@ public class Bugzilla_362270b_Test extends AbstractCDOTest
private RefSingleNonContainedNPL refSingleNonContainedNPL2;
+ private void registerResourceFactories(ResourceSet resourceSet)
+ {
+ Resource.Factory.Registry registry = resourceSet.getResourceFactoryRegistry();
+ registry.getExtensionToFactoryMap().put(EXTENSION, new XMIResourceFactoryImpl());
+ }
+
@Override
public void setUp() throws Exception
{
super.setUp();
- Resource.Factory.Registry registry = Resource.Factory.Registry.INSTANCE;
- registry.getProtocolToFactoryMap().put("cdo.net4j.tcp", CDOResourceFactory.INSTANCE);
- registry.getExtensionToFactoryMap().put("model1", new XMIResourceFactoryImpl());
-
CDOSession session = openSession();
cdoTransaction = session.openTransaction();
- init(cdoTransaction);
- }
+ registerResourceFactories(cdoTransaction.getResourceSet());
- private void init(CDOTransaction cdoTransaction) throws Exception
- {
- URI localResourceURI = URI.createFileURI(createTempFile(getName(), ".model1").getCanonicalPath());
+ URI localResourceURI = URI.createFileURI(createTempFile(getName(), "." + EXTENSION).getCanonicalPath());
Resource remoteResource = cdoTransaction.createResource(getResourcePath(REMOTE_RESOURCE_PATH));
Resource localResource = cdoTransaction.getResourceSet().createResource(localResourceURI);
@@ -90,6 +91,17 @@ public class Bugzilla_362270b_Test extends AbstractCDOTest
genRefMultiContained.eAdapters().add(new ECrossReferenceAdapter());
}
+ @Override
+ public void tearDown() throws Exception
+ {
+ cdoTransaction = null;
+ containedElementNoOpposite1 = null;
+ containedElementNoOpposite2 = null;
+ refSingleNonContainedNPL1 = null;
+ refSingleNonContainedNPL2 = null;
+ super.tearDown();
+ }
+
public void testRollback() throws Exception
{
RemoteUser remoteUser = new RemoteUser();
@@ -123,6 +135,7 @@ public class Bugzilla_362270b_Test extends AbstractCDOTest
{
CDOSession session = openSession();
transaction = session.openTransaction();
+ registerResourceFactories(transaction.getResourceSet());
sharedResource = transaction.getResource(getResourcePath(REMOTE_RESOURCE_PATH));
}
@@ -132,15 +145,4 @@ public class Bugzilla_362270b_Test extends AbstractCDOTest
genRefMultiContained.eAdapters().add(new ECrossReferenceAdapter());
}
}
-
- @Override
- public void tearDown() throws Exception
- {
- cdoTransaction = null;
- containedElementNoOpposite1 = null;
- containedElementNoOpposite2 = null;
- refSingleNonContainedNPL1 = null;
- refSingleNonContainedNPL2 = null;
- super.tearDown();
- }
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_362270c_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_362270c_Test.java
index d9f4639630..0b37888cd4 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_362270c_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_362270c_Test.java
@@ -44,7 +44,6 @@ import org.eclipse.core.runtime.Status;
import java.io.File;
import java.util.Collections;
import java.util.HashSet;
-import java.util.Map;
import java.util.Set;
/**
@@ -59,6 +58,7 @@ public class Bugzilla_362270c_Test extends AbstractCDOTest
{
TransactionalEditingDomain domain = TransactionalEditingDomain.Factory.INSTANCE.createEditingDomain();
ResourceSet resourceSet = domain.getResourceSet();
+ configureResourceSet(resourceSet);
// 1. Create the CDOResource
Company obeoCompany = getModel1Factory().createCompany();
@@ -76,10 +76,6 @@ public class Bugzilla_362270c_Test extends AbstractCDOTest
resource.save(Collections.emptyMap());
// 2. Create the local XMI resource
- Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
- Map<String, Object> m = reg.getExtensionToFactoryMap();
- m.put("model1", new XMIResourceFactoryImpl());
-
Company martinCompany = getModel1Factory().createCompany();
martinCompany.setName("Martin");
martinCompany.setCity("Berlin");
@@ -89,7 +85,9 @@ public class Bugzilla_362270c_Test extends AbstractCDOTest
File localResourceFile = createTempFile(getName(), ".model1");
URI localResourceURI = URI.createFileURI(localResourceFile.getAbsolutePath());
- Resource localResource = new ResourceSetImpl().createResource(localResourceURI);
+ ResourceSet localResourceSet = new ResourceSetImpl();
+ configureResourceSet(localResourceSet);
+ Resource localResource = localResourceSet.createResource(localResourceURI);
localResource.getContents().add(martinCompany);
localResource.save(Collections.emptyMap());
@@ -133,6 +131,12 @@ public class Bugzilla_362270c_Test extends AbstractCDOTest
}
}
+ private static void configureResourceSet(ResourceSet resourceSet)
+ {
+ Resource.Factory.Registry registry = resourceSet.getResourceFactoryRegistry();
+ registry.getExtensionToFactoryMap().put("model1", new XMIResourceFactoryImpl());
+ }
+
/**
* @author Esteban Dugueperoux
*/
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_395999_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_395999_Test.java
index f80faf4cdb..6f739758ef 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_395999_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_395999_Test.java
@@ -30,65 +30,36 @@ public class Bugzilla_395999_Test extends AbstractCDOTest
{
public void testTwiceGetCDOResourceOnResourceSetImpl() throws Exception
{
- Resource.Factory.Registry registry = Resource.Factory.Registry.INSTANCE;
- Object oldFactory = registry.getProtocolToFactoryMap().put(getURIProtocol(), CDOResourceFactory.INSTANCE);
+ URI uri = URI.createURI(getURIPrefix() + "/" + getRepository().getName() + getResourcePath("/res1") + "?transactional=true");
- try
- {
- URI uri = URI.createURI(getURIPrefix() + "/" + getRepository().getName() + getResourcePath("/res1") + "?transactional=true");
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(getURIProtocol(), CDOResourceFactory.INSTANCE);
- ResourceSet resourceSet = new ResourceSetImpl();
- Resource resource = resourceSet.createResource(uri);
- resource.save(Collections.emptyMap());
+ Resource resource = resourceSet.createResource(uri);
+ resource.save(Collections.emptyMap());
- loadTwiceAndSaveResource(uri);
- }
- finally
- {
- if (oldFactory == null)
- {
- registry.getExtensionToFactoryMap().remove(getURIProtocol());
- }
- else
- {
- registry.getExtensionToFactoryMap().put(getURIProtocol(), oldFactory);
- }
- }
+ loadTwiceAndSaveResource(uri);
}
public void testTwiceGetXMIResourceOnResourceSetImpl() throws Exception
{
- Resource.Factory.Registry registry = Resource.Factory.Registry.INSTANCE;
- Object oldFactory = registry.getExtensionToFactoryMap().put("model1", new XMIResourceFactoryImpl());
-
- try
- {
- ResourceSet resourceSet = new ResourceSetImpl();
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("model1", new XMIResourceFactoryImpl());
- URI uri = URI.createFileURI(createTempFile(getName(), ".model1").getCanonicalPath());
- Resource resource = resourceSet.createResource(uri);
- resource.save(Collections.emptyMap());
+ URI uri = URI.createFileURI(createTempFile(getName(), ".model1").getCanonicalPath());
+ Resource resource = resourceSet.createResource(uri);
+ resource.save(Collections.emptyMap());
- loadTwiceAndSaveResource(uri);
- }
- finally
- {
- if (oldFactory == null)
- {
- registry.getExtensionToFactoryMap().remove("model1");
- }
- else
- {
- registry.getExtensionToFactoryMap().put("model1", oldFactory);
- }
- }
+ loadTwiceAndSaveResource(uri);
}
private void loadTwiceAndSaveResource(URI resourceURI) throws Exception
{
ResourceSet resourceSet = new ResourceSetImpl();
- Resource resource = resourceSet.getResource(resourceURI, true);
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(getURIProtocol(), CDOResourceFactory.INSTANCE);
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("model1", new XMIResourceFactoryImpl());
+ Resource resource = resourceSet.getResource(resourceURI, true);
assertEquals("The ResourceSetImpl should returns the same Resource as in the first call", resource, resourceSet.getResource(resourceURI, true));
resource.save(Collections.emptyMap());
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_399470_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_399470_Test.java
index 2c0c508466..80115d6195 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_399470_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_399470_Test.java
@@ -36,21 +36,15 @@ import java.io.File;
*/
public class Bugzilla_399470_Test extends AbstractCDOTest
{
- @Override
- public void setUp() throws Exception
- {
- super.setUp();
-
- Resource.Factory.Registry registry = Resource.Factory.Registry.INSTANCE;
- registry.getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
- }
-
public void testUnload() throws Exception
{
String folder = new File("./ecore/").getCanonicalPath();
URI metamodelResourceURI = URI.createFileURI(new File(folder + "/component.ecore").getCanonicalPath());
URI modelResourceURI = URI.createFileURI(new File(folder + "/component.xmi").getCanonicalPath());
+
ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
+
Resource metamodelResource = resourceSet.createResource(metamodelResourceURI);
EPackage ePackage = EcoreFactory.eINSTANCE.createEPackage();
ePackage.setName("component");
@@ -63,6 +57,7 @@ public class Bugzilla_399470_Test extends AbstractCDOTest
Resource modelResource = resourceSet.createResource(modelResourceURI);
EObject eObject = EcoreUtil.create(eClass);
modelResource.getContents().add(eObject);
+
Copier copier = new Copier();
copier.copyAll(metamodelResource.getContents());
copier.copyAll(modelResource.getContents());
@@ -70,20 +65,24 @@ public class Bugzilla_399470_Test extends AbstractCDOTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
+ transaction.getResourceSet().getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION,
+ new XMIResourceFactoryImpl());
+
CDOResource sharedMetamodelResource = transaction.createResource(getResourcePath(metamodelResourceURI.lastSegment()));
for (EObject content : metamodelResource.getContents())
{
EObject copy = copier.get(content);
sharedMetamodelResource.getContents().add(copy);
}
+
CDOResource sharedModelResource = transaction.createResource(getResourcePath(modelResourceURI.lastSegment()));
for (EObject content : modelResource.getContents())
{
EObject copy = copier.get(content);
sharedModelResource.getContents().add(copy);
}
+
transaction.commit();
metamodelResource.unload();
}
-
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_400128_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_400128_Test.java
index b0fef24f7e..eedb739022 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_400128_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_400128_Test.java
@@ -27,7 +27,6 @@ import org.eclipse.emf.ecore.util.ECrossReferenceAdapter;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import java.util.Collections;
-import java.util.Map;
/**
* @author Esteban Dugueperoux
@@ -41,34 +40,26 @@ public class Bugzilla_400128_Test extends AbstractCDOTest
public void testUnload() throws Exception
{
- Map<String, Object> extensionToFactoryMap = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap();
- extensionToFactoryMap.put("model1", new XMIResourceFactoryImpl());
+ initModelWithCrossReferenceFromCDO2XMI();
- try
- {
- initModelWithCrossReferenceFromCDO2XMI();
-
- ResourceSet resourceSet = new ResourceSetImpl();
- resourceSet.eAdapters().add(new ECrossReferenceAdapter());
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("model1", new XMIResourceFactoryImpl());
+ resourceSet.eAdapters().add(new ECrossReferenceAdapter());
- CDOSession session = openSession();
- CDOTransaction transaction = session.openTransaction(resourceSet);
- CDOResource cdoResource = transaction.getResource(getResourcePath(RESOURCE_PATH));
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction(resourceSet);
+ CDOResource cdoResource = transaction.getResource(getResourcePath(RESOURCE_PATH));
- Resource xmiResource = resourceSet.getResource(xmiURI, true);
+ Resource xmiResource = resourceSet.getResource(xmiURI, true);
- cdoResource.cdoView().close(); // Closes the transaction
- xmiResource.unload();
- }
- finally
- {
- extensionToFactoryMap.remove("model1");
- }
+ cdoResource.cdoView().close(); // Closes the transaction
+ xmiResource.unload();
}
private void initModelWithCrossReferenceFromCDO2XMI() throws Exception
{
ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("model1", new XMIResourceFactoryImpl());
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction(resourceSet);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_412767_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_412767_Test.java
index 0b66b75460..e32db06e53 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_412767_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_412767_Test.java
@@ -28,7 +28,6 @@ import org.eclipse.emf.cdo.util.CDOURIData;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.Resource.Factory.Registry;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
@@ -46,47 +45,34 @@ public class Bugzilla_412767_Test extends AbstractCDOTest
{
getRepository();
- Registry registry = Resource.Factory.Registry.INSTANCE;
- registry.getProtocolToFactoryMap().put(CDONet4jUtil.PROTOCOL_TCP, CDOResourceFactory.INSTANCE);
-
- try
- {
- URI sharedResourceURI = createRemoteResource();
- URI sharedResourceURIWithPrefetch = sharedResourceURI.appendQuery(sharedResourceURI.query() + "&" + CDOResource.PREFETCH_PARAMETER + "=true");
- ResourceSet resourceSet = new ResourceSetImpl();
- CDOResource sharedResource = (CDOResource)resourceSet.getResource(sharedResourceURIWithPrefetch, true);
- assertEquals(CDOState.PROXY, sharedResource.cdoState());
- }
- finally
- {
- registry.getProtocolToFactoryMap().remove(CDONet4jUtil.PROTOCOL_TCP);
- }
+ URI sharedResourceURI = createRemoteResource();
+ URI sharedResourceURIWithPrefetch = sharedResourceURI.appendQuery(sharedResourceURI.query() + "&" + CDOResource.PREFETCH_PARAMETER + "=true");
+
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getProtocolToFactoryMap().put(CDONet4jUtil.PROTOCOL_TCP, CDOResourceFactory.INSTANCE);
+
+ CDOResource sharedResource = (CDOResource)resourceSet.getResource(sharedResourceURIWithPrefetch, true);
+ assertEquals(CDOState.PROXY, sharedResource.cdoState());
}
public void testConnectionAwareURIWithPrefetchAfter() throws Exception
{
getRepository();
- Registry registry = Resource.Factory.Registry.INSTANCE;
- registry.getProtocolToFactoryMap().put(CDONet4jUtil.PROTOCOL_TCP, CDOResourceFactory.INSTANCE);
-
- try
- {
- URI sharedResourceURI = createRemoteResource();
- ResourceSet resourceSet = new ResourceSetImpl();
- CDOResource sharedResource = (CDOResource)resourceSet.getResource(sharedResourceURI, true);
- sharedResource.cdoPrefetch(CDORevision.DEPTH_INFINITE);
- assertEquals(CDOState.PROXY, sharedResource.cdoState());
- }
- finally
- {
- registry.getProtocolToFactoryMap().remove(CDONet4jUtil.PROTOCOL_TCP);
- }
+ URI sharedResourceURI = createRemoteResource();
+
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getProtocolToFactoryMap().put(CDONet4jUtil.PROTOCOL_TCP, CDOResourceFactory.INSTANCE);
+
+ CDOResource sharedResource = (CDOResource)resourceSet.getResource(sharedResourceURI, true);
+ sharedResource.cdoPrefetch(CDORevision.DEPTH_INFINITE);
+ assertEquals(CDOState.PROXY, sharedResource.cdoState());
}
private URI createRemoteResource() throws Exception
{
ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getProtocolToFactoryMap().put(CDONet4jUtil.PROTOCOL_TCP, CDOResourceFactory.INSTANCE);
URI sharedResourceURI = URI
.createURI(CDONet4jUtil.PROTOCOL_TCP + "://localhost:2036/" + RepositoryConfig.REPOSITORY_NAME + getResourcePath("/sharedResource"))
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_414949_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_414949_Test.java
index 6a6ce7b0e6..24e6da03c3 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_414949_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_414949_Test.java
@@ -45,8 +45,6 @@ public class Bugzilla_414949_Test extends AbstractCDOTest
private Resource localResource;
- private Object oldResourceFactory;
-
@Override
protected void doSetUp() throws Exception
{
@@ -68,7 +66,7 @@ public class Bugzilla_414949_Test extends AbstractCDOTest
dDiagram.getOtherNodes().add(filterDescription1);
ResourceSet resourceSet = new ResourceSetImpl();
- oldResourceFactory = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl());
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl());
String path = new File("./" + LOCAL_RESOURCE_NAME).getCanonicalPath();
URI localResourceURI = URI.createFileURI(path);
localResource = resourceSet.createResource(localResourceURI);
@@ -82,23 +80,22 @@ public class Bugzilla_414949_Test extends AbstractCDOTest
sharedResource.save(Collections.emptyMap());
}
- public void testEcoreUtilGetURIWithCDOLegacyWrapperBug() throws Exception
+ @Override
+ protected void doTearDown() throws Exception
{
+ localResource.delete(Collections.emptyMap());
+ localResource = null;
+ super.doTearDown();
+ }
+ public void testEcoreUtilGetURIWithCDOLegacyWrapperBug() throws Exception
+ {
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
+ transaction.getResourceSet().getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl());
+
CDOResource resource = transaction.getResource(getResourcePath(SHARED_RESOURCE_NAME));
EList<EObject> contents = resource.getContents();
contents.get(0);
}
-
- @Override
- protected void doTearDown() throws Exception
- {
- localResource.delete(Collections.emptyMap());
- localResource = null;
- Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*", oldResourceFactory);
- oldResourceFactory = null;
- super.doTearDown();
- }
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_429659_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_429659_Test.java
index 4e5054294a..2853eef3d4 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_429659_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_429659_Test.java
@@ -109,8 +109,9 @@ public class Bugzilla_429659_Test extends AbstractCDOTest
private Resource getXMIResource() throws Exception
{
- Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl());
ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl());
+
URI localURI = URI.createFileURI(createTempFile().getCanonicalPath());
Resource localResource = resourceSet.createResource(localURI);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_437817_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_437817_Test.java
index 69b48b8f00..cb814ccd9c 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_437817_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_437817_Test.java
@@ -22,7 +22,6 @@ import org.eclipse.emf.cdo.util.CDOURIData;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.Resource.Factory.Registry;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
@@ -36,38 +35,28 @@ import org.junit.Assert;
@Requires(ISessionConfig.CAPABILITY_NET4J_TCP)
public class Bugzilla_437817_Test extends AbstractCDOTest
{
-
public void testConnectionAwareURITwiceCDOResourceCreation() throws Exception
{
getRepository();
- Registry registry = Resource.Factory.Registry.INSTANCE;
- registry.getProtocolToFactoryMap().put(CDONet4jUtil.PROTOCOL_TCP, CDOResourceFactory.INSTANCE);
-
- try
- {
- ResourceSet resourceSet = new ResourceSetImpl();
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getProtocolToFactoryMap().put(CDONet4jUtil.PROTOCOL_TCP, CDOResourceFactory.INSTANCE);
- URI sharedResource1URI = URI
- .createURI(CDONet4jUtil.PROTOCOL_TCP + "://localhost:2036/" + RepositoryConfig.REPOSITORY_NAME + getResourcePath("/sharedResource1"))
- .appendQuery(CDOURIData.TRANSACTIONAL_PARAMETER + "=true");
- URI sharedResource2URI = URI
- .createURI(CDONet4jUtil.PROTOCOL_TCP + "://localhost:2036/" + RepositoryConfig.REPOSITORY_NAME + getResourcePath("/sharedResource2"))
- .appendQuery(CDOURIData.TRANSACTIONAL_PARAMETER + "=true");
- Resource sharedResource1 = resourceSet.createResource(sharedResource1URI);
- Resource sharedResource2 = resourceSet.createResource(sharedResource2URI);
+ URI sharedResource1URI = URI
+ .createURI(CDONet4jUtil.PROTOCOL_TCP + "://localhost:2036/" + RepositoryConfig.REPOSITORY_NAME + getResourcePath("/sharedResource1"))
+ .appendQuery(CDOURIData.TRANSACTIONAL_PARAMETER + "=true");
+ URI sharedResource2URI = URI
+ .createURI(CDONet4jUtil.PROTOCOL_TCP + "://localhost:2036/" + RepositoryConfig.REPOSITORY_NAME + getResourcePath("/sharedResource2"))
+ .appendQuery(CDOURIData.TRANSACTIONAL_PARAMETER + "=true");
+ Resource sharedResource1 = resourceSet.createResource(sharedResource1URI);
+ Resource sharedResource2 = resourceSet.createResource(sharedResource2URI);
- Assert.assertTrue(sharedResource1 instanceof CDOResource);
- Assert.assertTrue(sharedResource2 instanceof CDOResource);
- CDOResource sharedCDOResource1 = (CDOResource)sharedResource1;
- CDOResource sharedCDOResource2 = (CDOResource)sharedResource2;
- assertEquals("Both CDOResources should have the same CDOView as they have the same ResourceSet and use content from the same repository",
- sharedCDOResource1.cdoView(), sharedCDOResource2.cdoView());
- }
- finally
- {
- registry.getProtocolToFactoryMap().remove(CDONet4jUtil.PROTOCOL_TCP);
- }
+ Assert.assertTrue(sharedResource1 instanceof CDOResource);
+ Assert.assertTrue(sharedResource2 instanceof CDOResource);
+ CDOResource sharedCDOResource1 = (CDOResource)sharedResource1;
+ CDOResource sharedCDOResource2 = (CDOResource)sharedResource2;
+ assertEquals("Both CDOResources should have the same CDOView as they have the same ResourceSet and use content from the same repository",
+ sharedCDOResource1.cdoView(), sharedCDOResource2.cdoView());
}
public void testConnectionAwareURITwiceCDOResourceCreationWithUUID() throws Exception
@@ -75,5 +64,4 @@ public class Bugzilla_437817_Test extends AbstractCDOTest
getTestProperties().put(Props.OVERRIDE_UUID, RepositoryConfig.REPOSITORY_NAME + "UUID");
testConnectionAwareURITwiceCDOResourceCreation();
}
-
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_443281_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_443281_Test.java
index ff807bf444..715361d41c 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_443281_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_443281_Test.java
@@ -20,6 +20,7 @@ import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
@@ -32,16 +33,21 @@ import java.io.File;
*/
public class Bugzilla_443281_Test extends AbstractCDOTest
{
- private Object oldResourceFactory;
-
- private ResourceSetImpl resourceSet;
+ private ResourceSet resourceSet;
@Override
public void setUp() throws Exception
{
super.setUp();
- oldResourceFactory = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl());
resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl());
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ resourceSet = null;
+ super.tearDown();
}
public void testCDOResource_setURI() throws Exception
@@ -94,14 +100,4 @@ public class Bugzilla_443281_Test extends AbstractCDOTest
assertEquals(uri, notification.getOldValue());
assertEquals(newURI, notification.getNewValue());
}
-
- @Override
- public void tearDown() throws Exception
- {
- resourceSet = null;
- Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*", oldResourceFactory);
- oldResourceFactory = null;
- resourceSet = null;
- super.tearDown();
- }
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_450880_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_450880_Test.java
index c7f19e0a8c..510294a361 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_450880_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_450880_Test.java
@@ -60,11 +60,12 @@ public class Bugzilla_450880_Test extends AbstractCDOTest
public void testCDODeltaNotificationGetValueWithEnumTypedAttributeOnXMIResource() throws Exception
{
- Resource.Factory.Registry registry = Resource.Factory.Registry.INSTANCE;
- registry.getExtensionToFactoryMap().put("model1", new XMIResourceFactoryImpl());
ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("model1", new XMIResourceFactoryImpl());
+
URI localMainResourceURI = URI.createFileURI(createTempFile(getName(), ".model1").getCanonicalPath());
Resource resource1 = resourceSet.createResource(localMainResourceURI);
+
testCDODeltaNotificationGetValueWithEnumTypedAttribute(resource1);
}
@@ -81,5 +82,4 @@ public class Bugzilla_450880_Test extends AbstractCDOTest
assertEquals(getModel1Package().getProduct1_OtherVATs().getDefaultValue(), notification.getOldValue());
assertEquals(newValue, notification.getNewValue());
}
-
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_458149_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_458149_Test.java
index a49156d873..3ca8fd5022 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_458149_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_458149_Test.java
@@ -62,9 +62,8 @@ public class Bugzilla_458149_Test extends AbstractCDOTest
*/
public void testXMIResource_getURI() throws Exception
{
- Resource.Factory.Registry registry = Resource.Factory.Registry.INSTANCE;
- registry.getExtensionToFactoryMap().put("model1", new XMIResourceFactoryImpl());
ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("model1", new XMIResourceFactoryImpl());
URI localResourceURI = URI.createFileURI(createTempFile(getName(), ".model1").getCanonicalPath());
Resource localResource = resourceSet.createResource(localResourceURI);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_464590_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_464590_Test.java
index 46a38c412e..37610f54c6 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_464590_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_464590_Test.java
@@ -39,13 +39,14 @@ public class Bugzilla_464590_Test extends AbstractCDOTest
*/
public void testEObjectEIsSetWithXMIResource() throws Exception
{
- Resource.Factory.Registry registry = Resource.Factory.Registry.INSTANCE;
- registry.getExtensionToFactoryMap().put("model6", new XMIResourceFactoryImpl());
ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("model6", new XMIResourceFactoryImpl());
resourceSet.eAdapters().add(new NonResolvingECrossReferenceAdapter());
+
URI localFragmentResourceURI = URI.createFileURI(createTempFile("fragment", ".model6").getCanonicalPath());
- URI localMainResourceURI = URI.createFileURI(createTempFile("main", ".model6").getCanonicalPath());
Resource localFragmentResource = resourceSet.createResource(localFragmentResourceURI);
+
+ URI localMainResourceURI = URI.createFileURI(createTempFile("main", ".model6").getCanonicalPath());
Resource localMainResource = resourceSet.createResource(localMainResourceURI);
ContainmentObject mainContainmentObject = getModel6Factory().createContainmentObject();
@@ -72,9 +73,11 @@ public class Bugzilla_464590_Test extends AbstractCDOTest
}
+ /**
+ * @author Eike Stepper
+ */
private static class NonResolvingECrossReferenceAdapter extends ECrossReferenceAdapter
{
-
@Override
protected boolean resolve()
{
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_467075_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_467075_Test.java
index 21c9138e01..cde2753917 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_467075_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_467075_Test.java
@@ -50,9 +50,8 @@ public class Bugzilla_467075_Test extends AbstractCDOTest
Company company = getModel1Factory().createCompany();
ECrossReferenceAdapter adapter = createAdapter();
- Resource.Factory.Registry registry = Resource.Factory.Registry.INSTANCE;
- registry.getExtensionToFactoryMap().put("model1", new XMIResourceFactoryImpl());
ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("model1", new XMIResourceFactoryImpl());
URI uri = URI.createFileURI(createTempFile("resource", ".model1").getCanonicalPath());
Resource resource = resourceSet.createResource(uri);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_467593_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_467593_Test.java
index 91b425c723..6bf2157d67 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_467593_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_467593_Test.java
@@ -45,11 +45,12 @@ public class Bugzilla_467593_Test extends AbstractCDOTest
public void testEListHashCodeOnRefBeforeCommitWithXMIResource() throws Exception
{
- Resource.Factory.Registry registry = Resource.Factory.Registry.INSTANCE;
- registry.getExtensionToFactoryMap().put("model6", new XMIResourceFactoryImpl());
ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("model6", new XMIResourceFactoryImpl());
+
URI localMainResourceURI = URI.createFileURI(createTempFile("main", ".model6").getCanonicalPath());
Resource resource1 = resourceSet.createResource(localMainResourceURI);
+
testEListHashCodeOnRefBeforeCommit(resource1);
}
@@ -63,5 +64,4 @@ public class Bugzilla_467593_Test extends AbstractCDOTest
resource.save(Collections.emptyMap());
myEnum.hashCode();
}
-
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_468268_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_468268_Test.java
index 0cd33831ad..2f6f46716b 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_468268_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_468268_Test.java
@@ -35,9 +35,9 @@ public class Bugzilla_468268_Test extends AbstractCDOTest
{
public void testHashCodeCallOnAllFields() throws Exception
{
- Resource.Factory.Registry registry = Resource.Factory.Registry.INSTANCE;
- registry.getExtensionToFactoryMap().put("model6", new XMIResourceFactoryImpl());
ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("model6", new XMIResourceFactoryImpl());
+
URI localResourceURI = URI.createFileURI(createTempFile("main", ".model6").getCanonicalPath());
Resource localResource = resourceSet.createResource(localResourceURI);
@@ -47,12 +47,12 @@ public class Bugzilla_468268_Test extends AbstractCDOTest
testHashCodeOnAllFieds(mainContainmentObject);
localResource.save(Collections.emptyMap());
testHashCodeOnAllFieds(mainContainmentObject);
-
}
private void testHashCodeOnAllFieds(EObject eObject) throws Exception
{
Set<Field> fields = getFields(eObject);
+
for (Field field : fields)
{
Object value = getValue(field, eObject);
@@ -67,6 +67,7 @@ public class Bugzilla_468268_Test extends AbstractCDOTest
{
Object value;
final boolean oldAccessible = field.isAccessible();
+
try
{
field.setAccessible(true);
@@ -76,6 +77,7 @@ public class Bugzilla_468268_Test extends AbstractCDOTest
{
field.setAccessible(oldAccessible);
}
+
return value;
}
@@ -85,13 +87,14 @@ public class Bugzilla_468268_Test extends AbstractCDOTest
Field[] fields = eObject.getClass().getDeclaredFields();
allFields.addAll(Arrays.asList(fields));
Class<?> currentClass = eObject.getClass().getSuperclass();
+
while (currentClass != Object.class)
{
fields = currentClass.getDeclaredFields();
allFields.addAll(Arrays.asList(fields));
currentClass = currentClass.getSuperclass();
}
+
return allFields;
}
-
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IConstants.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IConstants.java
index ee8f9db65e..36d74540f2 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IConstants.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IConstants.java
@@ -43,6 +43,8 @@ public interface IConstants
public static final SessionConfig SSL = Net4j.SSL.INSTANCE;
+ public static final SessionConfig WS = Net4j.WS.INSTANCE;
+
public static final ModelConfig NATIVE = ModelConfig.Native.INSTANCE;
public static final ModelConfig LEGACY = ModelConfig.Legacy.INSTANCE;
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/ISessionConfig.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/ISessionConfig.java
index 5a5c96a003..0c76520e68 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/ISessionConfig.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/ISessionConfig.java
@@ -30,6 +30,8 @@ public interface ISessionConfig extends IConfig
public static final String CAPABILITY_NET4J_SSL = "session.net4j.ssl";
+ public static final String CAPABILITY_NET4J_WS = "session.net4j.ws";
+
public static final String CAPABILITY_NET4J_EMBEDDED = "session.net4j.embedded";
public IManagedContainer getClientContainer();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/ConfigTestSuite.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/ConfigTestSuite.java
index f4c76f1e9a..b1b0b14882 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/ConfigTestSuite.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/ConfigTestSuite.java
@@ -272,18 +272,25 @@ public abstract class ConfigTestSuite implements IConstants
List<String> names = new ArrayList<>();
- superClass = theClass;
- while (Test.class.isAssignableFrom(superClass))
+ try
{
- for (Method method : superClass.getDeclaredMethods())
+ superClass = theClass;
+ while (Test.class.isAssignableFrom(superClass))
{
- if (validateConstraints(method, capabilities))
+ for (Method method : superClass.getDeclaredMethods())
{
- addTestMethod(method, names, theClass, suite, tests);
+ if (validateConstraints(method, capabilities))
+ {
+ addTestMethod(method, names, theClass, suite, tests);
+ }
}
- }
- superClass = superClass.getSuperclass();
+ superClass = superClass.getSuperclass();
+ }
+ }
+ catch (Throwable ex)
+ {
+ tests.add(warning(ex.getMessage()));
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java
index 4a2da488c9..6824b30b46 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java
@@ -46,11 +46,20 @@ import org.eclipse.net4j.util.lifecycle.ILifecycle;
import org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.security.IPasswordCredentialsProvider;
+import org.eclipse.net4j.ws.WSUtil;
+import org.eclipse.net4j.ws.jetty.Net4jWebSocketServlet;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
+
import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
@@ -449,6 +458,127 @@ public abstract class SessionConfig extends Config implements ISessionConfig
/**
* @author Eike Stepper
*/
+ public static class JVM extends SessionConfig.Net4j
+ {
+ public static final String NAME = "JVM";
+
+ public static final JVM INSTANCE = new JVM();
+
+ public static final String ACCEPTOR_NAME = "default";
+
+ private static final long serialVersionUID = 1L;
+
+ public JVM(String name)
+ {
+ super(name);
+ }
+
+ public JVM()
+ {
+ this(NAME);
+ }
+
+ @Override
+ public void initCapabilities(Set<String> capabilities)
+ {
+ super.initCapabilities(capabilities);
+ capabilities.add(CAPABILITY_NET4J_JVM);
+ }
+
+ @Override
+ public String getURIPrefix()
+ {
+ return getURIProtocol() + "://" + ACCEPTOR_NAME;
+ }
+
+ @Override
+ public IAcceptor getAcceptor()
+ {
+ return JVMUtil.getAcceptor(getServerContainer(), ACCEPTOR_NAME);
+ }
+
+ @Override
+ public IConnector getConnector()
+ {
+ return JVMUtil.getConnector(getClientContainer(), ACCEPTOR_NAME);
+ }
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ JVMUtil.prepareContainer(getClientContainer());
+ }
+
+ @Override
+ protected boolean usesServerContainer()
+ {
+ return true;
+ }
+
+ @Override
+ public CDOViewProvider createViewProvider(final IManagedContainer container)
+ {
+ return new CDONet4jViewProvider.JVM()
+ {
+ @Override
+ protected IManagedContainer getContainer()
+ {
+ return container;
+ }
+ };
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class Embedded extends SessionConfig.Net4j.JVM
+ {
+ public static final String NAME = "JVMEmbedded";
+
+ public static final Embedded INSTANCE = new Embedded();
+
+ private static final long serialVersionUID = 1L;
+
+ public Embedded()
+ {
+ super(NAME);
+ }
+
+ @Override
+ public void initCapabilities(Set<String> capabilities)
+ {
+ super.initCapabilities(capabilities);
+ capabilities.add(CAPABILITY_NET4J_EMBEDDED);
+ }
+
+ @Override
+ public CDOSessionConfiguration createSessionConfiguration(String repositoryName)
+ {
+ InternalRepository repository = getCurrentTest().getRepository(repositoryName);
+ CDOBranchManager branchManager = new ClientBranchManager(repository.getBranchManager());
+ CDORevisionManager revisionManager = new ClientRevisionManager(repository.getRevisionManager());
+
+ CDONet4jSessionConfiguration configuration = (CDONet4jSessionConfiguration)super.createSessionConfiguration(repositoryName);
+ configuration.setBranchManager(branchManager);
+ configuration.setRevisionManager(revisionManager);
+ configuration.setSignalTimeout(Integer.MAX_VALUE);
+
+ return configuration;
+ }
+
+ @Override
+ public void configureSession(CDOSession session)
+ {
+ super.configureSession(session);
+ ((CDONet4jSession)session).options().setCommitTimeout(Integer.MAX_VALUE);
+ }
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
public static final class TCP extends SessionConfig.Net4j
{
public static final String NAME = "TCP";
@@ -587,73 +717,101 @@ public abstract class SessionConfig extends Config implements ISessionConfig
/**
* @author Eike Stepper
*/
- public static class JVM extends SessionConfig.Net4j
+ public static final class WS extends SessionConfig.Net4j
{
- public static final String NAME = "JVM";
+ public static final String NAME = "WS";
- public static final JVM INSTANCE = new JVM();
+ public static final WS INSTANCE = new WS();
+
+ public static final int HTTP_PORT = 8087;
+
+ public static final String SERVICE_URI = "ws://localhost:" + HTTP_PORT + "/net4j";
public static final String ACCEPTOR_NAME = "default";
private static final long serialVersionUID = 1L;
- public JVM(String name)
- {
- super(name);
- }
+ private static Server server;
- public JVM()
+ public WS()
{
- this(NAME);
+ super(NAME);
}
@Override
public void initCapabilities(Set<String> capabilities)
{
super.initCapabilities(capabilities);
- capabilities.add(CAPABILITY_NET4J_JVM);
+ capabilities.add(CAPABILITY_NET4J_WS);
}
@Override
public String getURIPrefix()
{
- return getURIProtocol() + "://" + ACCEPTOR_NAME;
+ return getURIProtocol() + "://localhost:" + HTTP_PORT + "/net4j/@" + ACCEPTOR_NAME;
}
@Override
public IAcceptor getAcceptor()
{
- return JVMUtil.getAcceptor(getServerContainer(), ACCEPTOR_NAME);
+ return WSUtil.getAcceptor(getServerContainer(), ACCEPTOR_NAME);
}
@Override
public IConnector getConnector()
{
- return JVMUtil.getConnector(getClientContainer(), ACCEPTOR_NAME);
+ try
+ {
+ return WSUtil.getConnector(getClientContainer(), new URI(SERVICE_URI), ACCEPTOR_NAME);
+ }
+ catch (URISyntaxException ex)
+ {
+ throw new RuntimeException(ex);
+ }
}
@Override
public void setUp() throws Exception
{
super.setUp();
+ WSUtil.prepareContainer(getClientContainer());
+
if (!usesServerContainer())
{
- JVMUtil.prepareContainer(getServerContainer());
+ WSUtil.prepareContainer(getServerContainer());
}
- JVMUtil.prepareContainer(getClientContainer());
+ if (server == null)
+ {
+ System.out.println("Starting Jetty...");
+ server = new Server();
+
+ ServerConnector connector = new ServerConnector(server);
+ connector.setPort(HTTP_PORT);
+ server.addConnector(connector);
+
+ ServletContextHandler handler = new ServletContextHandler(ServletContextHandler.SESSIONS);
+ handler.setContextPath("/");
+ handler.addServlet(new ServletHolder("net4j", Net4jWebSocketServlet.class), "/net4j");
+ server.setHandler(handler);
+ server.start();
+ }
}
@Override
- protected boolean usesServerContainer()
+ public void mainSuiteFinished() throws Exception
{
- return true;
+ super.mainSuiteFinished();
+
+ System.out.println("Stopping Jetty...");
+ server.stop();
+ server = null;
}
@Override
public CDOViewProvider createViewProvider(final IManagedContainer container)
{
- return new CDONet4jViewProvider.JVM()
+ return new CDONet4jViewProvider.WS()
{
@Override
protected IManagedContainer getContainer()
@@ -662,52 +820,6 @@ public abstract class SessionConfig extends Config implements ISessionConfig
}
};
}
-
- /**
- * @author Eike Stepper
- */
- public static final class Embedded extends SessionConfig.Net4j.JVM
- {
- public static final String NAME = "JVMEmbedded";
-
- public static final Embedded INSTANCE = new Embedded();
-
- private static final long serialVersionUID = 1L;
-
- public Embedded()
- {
- super(NAME);
- }
-
- @Override
- public void initCapabilities(Set<String> capabilities)
- {
- super.initCapabilities(capabilities);
- capabilities.add(CAPABILITY_NET4J_EMBEDDED);
- }
-
- @Override
- public CDOSessionConfiguration createSessionConfiguration(String repositoryName)
- {
- InternalRepository repository = getCurrentTest().getRepository(repositoryName);
- CDOBranchManager branchManager = new ClientBranchManager(repository.getBranchManager());
- CDORevisionManager revisionManager = new ClientRevisionManager(repository.getRevisionManager());
-
- CDONet4jSessionConfiguration configuration = (CDONet4jSessionConfiguration)super.createSessionConfiguration(repositoryName);
- configuration.setBranchManager(branchManager);
- configuration.setRevisionManager(revisionManager);
- configuration.setSignalTimeout(Integer.MAX_VALUE);
-
- return configuration;
- }
-
- @Override
- public void configureSession(CDOSession session)
- {
- super.configureSession(session);
- ((CDONet4jSession)session).options().setCommitTimeout(Integer.MAX_VALUE);
- }
- }
}
}
}
diff --git a/plugins/org.eclipse.net4j.http.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.http.common/META-INF/MANIFEST.MF
index 1336efa438..f00ab8eb3a 100644
--- a/plugins/org.eclipse.net4j.http.common/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.http.common/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.net4j.http.common
-Bundle-Version: 4.1.0.qualifier
+Bundle-Version: 4.1.1.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -11,11 +11,11 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
org.eclipse.net4j;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
-Export-Package: org.eclipse.net4j.http.common;version="4.1.0";uses:="org.eclipse.net4j.connector",
- org.eclipse.net4j.http.internal.common;version="4.1.0";
+Export-Package: org.eclipse.net4j.http.common;version="4.1.1";uses:="org.eclipse.net4j.connector",
+ org.eclipse.net4j.http.internal.common;version="4.1.1";
x-friends:="org.eclipse.net4j.http,
org.eclipse.net4j.http.server,
org.eclipse.net4j.http.tests",
- org.eclipse.net4j.http.internal.common.bundle;version="4.1.0";x-friends:="org.eclipse.net4j.http,org.eclipse.net4j.http.server,org.eclipse.net4j.http.tests",
- org.eclipse.net4j.http.internal.common.messages;version="4.1.0";x-internal:=true
+ org.eclipse.net4j.http.internal.common.bundle;version="4.1.1";x-friends:="org.eclipse.net4j.http,org.eclipse.net4j.http.server,org.eclipse.net4j.http.tests",
+ org.eclipse.net4j.http.internal.common.messages;version="4.1.1";x-internal:=true
Automatic-Module-Name: org.eclipse.net4j.http.common
diff --git a/plugins/org.eclipse.net4j.http.common/pom.xml b/plugins/org.eclipse.net4j.http.common/pom.xml
index 1e1693ff37..65463b0877 100644
--- a/plugins/org.eclipse.net4j.http.common/pom.xml
+++ b/plugins/org.eclipse.net4j.http.common/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo</groupId>
<artifactId>org.eclipse.net4j.http.common</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.1-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java
index 6cbc461bb3..f6036e7d04 100644
--- a/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java
+++ b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java
@@ -100,8 +100,8 @@ public abstract class HTTPConnector extends Connector implements IHTTPConnector
HTTPChannel httpChannel = (HTTPChannel)channel;
synchronized (httpChannel)
{
- Queue<IBuffer> channelQueue = httpChannel.getSendQueue();
- buffer = channelQueue.poll();
+ Queue<IBuffer> channelSendQueue = httpChannel.getSendQueue();
+ buffer = channelSendQueue.poll();
outputOperationCount = httpChannel.getOutputOperationCount();
httpChannel.increaseOutputOperationCount();
}
diff --git a/plugins/org.eclipse.net4j.http.tests/src/org/eclipse/net4j/http/tests/HTTPTest.java b/plugins/org.eclipse.net4j.http.tests/src/org/eclipse/net4j/http/tests/HTTPTest.java
index 51a222f6f8..91d3235871 100644
--- a/plugins/org.eclipse.net4j.http.tests/src/org/eclipse/net4j/http/tests/HTTPTest.java
+++ b/plugins/org.eclipse.net4j.http.tests/src/org/eclipse/net4j/http/tests/HTTPTest.java
@@ -13,7 +13,7 @@ package org.eclipse.net4j.http.tests;
import org.eclipse.net4j.Net4jUtil;
import org.eclipse.net4j.http.HTTPUtil;
import org.eclipse.net4j.internal.http.HTTPClientConnector;
-import org.eclipse.net4j.tests.AbstractTransportTest;
+import org.eclipse.net4j.tests.config.AbstractConfigTest;
import org.eclipse.net4j.tests.signal.IntRequest;
import org.eclipse.net4j.tests.signal.TestSignalProtocol;
import org.eclipse.net4j.util.WrappedException;
@@ -31,7 +31,7 @@ import java.io.OutputStream;
/**
* @author Eike Stepper
*/
-public class HTTPTest extends AbstractTransportTest
+public class HTTPTest extends AbstractConfigTest
{
public HTTPTest()
{
@@ -132,7 +132,7 @@ public class HTTPTest extends AbstractTransportTest
private HTTPClientConnector getHTTPConnector()
{
- return (HTTPClientConnector)Net4jUtil.getConnector(container, "http", //$NON-NLS-1$
+ return (HTTPClientConnector)Net4jUtil.getConnector(acceptorContainer, "http", //$NON-NLS-1$
"http://localhost:8080/net4j"); //$NON-NLS-1$
}
}
diff --git a/plugins/org.eclipse.net4j.jvm/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.jvm/META-INF/MANIFEST.MF
index 776f34323e..19c7f9ee2c 100644
--- a/plugins/org.eclipse.net4j.jvm/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.jvm/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.net4j.jvm;singleton:=true
-Bundle-Version: 4.2.0.qualifier
+Bundle-Version: 4.2.1.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -12,8 +12,8 @@ Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
org.eclipse.net4j;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
Import-Package: org.osgi.framework;version="[1.3.0,2.0.0)";resolution:=optional
-Export-Package: org.eclipse.net4j.internal.jvm;version="4.2.0";x-friends:="org.eclipse.net4j.tests,org.eclipse.net4j.ui",
- org.eclipse.net4j.internal.jvm.bundle;version="4.2.0";x-internal:=true,
- org.eclipse.net4j.internal.jvm.messages;version="4.2.0";x-internal:=true,
- org.eclipse.net4j.jvm;version="4.2.0"
+Export-Package: org.eclipse.net4j.internal.jvm;version="4.2.1";x-friends:="org.eclipse.net4j.tests,org.eclipse.net4j.ui",
+ org.eclipse.net4j.internal.jvm.bundle;version="4.2.1";x-internal:=true,
+ org.eclipse.net4j.internal.jvm.messages;version="4.2.1";x-internal:=true,
+ org.eclipse.net4j.jvm;version="4.2.1"
Automatic-Module-Name: org.eclipse.net4j.jvm
diff --git a/plugins/org.eclipse.net4j.jvm/pom.xml b/plugins/org.eclipse.net4j.jvm/pom.xml
index a3c1a1e4fb..0f08c431ac 100644
--- a/plugins/org.eclipse.net4j.jvm/pom.xml
+++ b/plugins/org.eclipse.net4j.jvm/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo</groupId>
<artifactId>org.eclipse.net4j.jvm</artifactId>
- <version>4.2.0-SNAPSHOT</version>
+ <version>4.2.1-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/JVMAcceptor.java b/plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/JVMAcceptor.java
index 739322ddcc..51cac6fbf4 100644
--- a/plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/JVMAcceptor.java
+++ b/plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/JVMAcceptor.java
@@ -42,8 +42,8 @@ public class JVMAcceptor extends Acceptor implements IJVMAcceptor
public JVMServerConnector handleAccept(JVMClientConnector client)
{
JVMServerConnector connector = new JVMServerConnector(this, client);
+ prepareConnector(connector);
connector.setName(client.getName());
- connector.setConfig(getConfig());
connector.activate();
addConnector(connector);
return connector;
diff --git a/plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/JVMConnector.java b/plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/JVMConnector.java
index 5d326cfd54..db0916dd82 100644
--- a/plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/JVMConnector.java
+++ b/plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/JVMConnector.java
@@ -22,15 +22,14 @@ import org.eclipse.net4j.util.security.INegotiationContext;
import org.eclipse.spi.net4j.Connector;
import org.eclipse.spi.net4j.InternalChannel;
-
-import java.util.Queue;
+import org.eclipse.spi.net4j.InternalChannelMultiplexer.BufferMultiplexer;
/**
* TODO Remove peer channels
*
* @author Eike Stepper
*/
-public abstract class JVMConnector extends Connector implements IJVMConnector
+public abstract class JVMConnector extends Connector implements IJVMConnector, BufferMultiplexer
{
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, JVMConnector.class);
@@ -70,35 +69,26 @@ public abstract class JVMConnector extends Connector implements IJVMConnector
}
@Override
- public void multiplexChannel(InternalChannel localChannel)
+ public void multiplexBuffer(InternalChannel channel, IBuffer buffer)
{
- short channelID = localChannel.getID();
- InternalChannel peerChannel = peer.getChannel(channelID);
- if (peerChannel == null)
- {
- throw new IllegalStateException("peerChannel == null"); //$NON-NLS-1$
- }
-
- Queue<IBuffer> localQueue = localChannel.getSendQueue();
- IBuffer buffer = localQueue.poll();
-
- if (buffer.getPosition() == IBuffer.HEADER_SIZE)
- {
- // Just release this empty buffer has been written
- buffer.release();
- return;
- }
-
if (TRACER.isEnabled())
{
TRACER.trace("Multiplexing " + buffer.formatContent(true)); //$NON-NLS-1$
}
buffer.flip();
+
+ InternalChannel peerChannel = ((JVMChannel)channel).getPeer();
peerChannel.handleBufferFromMultiplexer(buffer);
}
@Override
+ public void multiplexChannel(InternalChannel localChannel)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
protected INegotiationContext createNegotiationContext()
{
throw new UnsupportedOperationException();
diff --git a/plugins/org.eclipse.net4j.tcp/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.net4j.tcp/.settings/org.eclipse.jdt.core.prefs
index c2d0341c93..97144f555d 100644
--- a/plugins/org.eclipse.net4j.tcp/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/org.eclipse.net4j.tcp/.settings/org.eclipse.jdt.core.prefs
@@ -17,6 +17,15 @@ org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
@@ -26,6 +35,7 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
@@ -36,7 +46,9 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@@ -55,7 +67,9 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
@@ -65,36 +79,58 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=ignore
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
@@ -104,8 +140,13 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+<<<<<<< websockets
+=======
+org.eclipse.jdt.core.compiler.release=enabled
+>>>>>>> c1ed48e [561115] Implement a Websocket-based transport for Net4j
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,HIGH,LOW,LOW,LOW,LOW,LOW
diff --git a/plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF
index 74532cdd0e..cdd1a74458 100644
--- a/plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.net4j.tcp;singleton:=true
-Bundle-Version: 4.2.0.qualifier
+Bundle-Version: 4.2.1.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -12,13 +12,13 @@ Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
org.eclipse.net4j;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
Import-Package: org.osgi.framework;version="[1.3.0,2.0.0)";resolution:=optional
-Export-Package: org.eclipse.net4j.internal.tcp;version="4.2.0";
+Export-Package: org.eclipse.net4j.internal.tcp;version="4.2.1";
x-friends:="org.eclipse.net4j.tests,
org.eclipse.emf.cdo.examples,
org.eclipse.net4j.ui",
- org.eclipse.net4j.internal.tcp.bundle;version="4.2.0";x-internal:=true,
- org.eclipse.net4j.internal.tcp.messages;version="4.2.0";x-internal:=true,
- org.eclipse.net4j.internal.tcp.ssl;version="4.2.0";x-friends:="org.eclipse.net4j.tests,org.eclipse.emf.cdo.examples",
- org.eclipse.net4j.tcp;version="4.2.0",
- org.eclipse.net4j.tcp.ssl;version="4.2.0"
+ org.eclipse.net4j.internal.tcp.bundle;version="4.2.1";x-internal:=true,
+ org.eclipse.net4j.internal.tcp.messages;version="4.2.1";x-internal:=true,
+ org.eclipse.net4j.internal.tcp.ssl;version="4.2.1";x-friends:="org.eclipse.net4j.tests,org.eclipse.emf.cdo.examples",
+ org.eclipse.net4j.tcp;version="4.2.1",
+ org.eclipse.net4j.tcp.ssl;version="4.2.1"
Automatic-Module-Name: org.eclipse.net4j.tcp
diff --git a/plugins/org.eclipse.net4j.tcp/pom.xml b/plugins/org.eclipse.net4j.tcp/pom.xml
index 4079e5e843..4ae1683b9f 100644
--- a/plugins/org.eclipse.net4j.tcp/pom.xml
+++ b/plugins/org.eclipse.net4j.tcp/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo</groupId>
<artifactId>org.eclipse.net4j.tcp</artifactId>
- <version>4.2.0-SNAPSHOT</version>
+ <version>4.2.1-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPAcceptor.java b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPAcceptor.java
index 408f377cea..d4d281398e 100644
--- a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPAcceptor.java
+++ b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPAcceptor.java
@@ -268,7 +268,12 @@ public class TCPAcceptor extends Acceptor implements ITCPAcceptor, ITCPPassiveSe
cancelSelectionKey();
- IOUtil.closeSilent(serverSocketChannel);
+ Exception ex = IOUtil.closeSilent(serverSocketChannel);
+ if (ex != null && TRACER.isEnabled())
+ {
+ TRACER.trace(ex);
+ }
+
serverSocketChannel = null;
super.doDeactivate();
}
diff --git a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java
index 7aa47c9e37..8d44405277 100644
--- a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java
+++ b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java
@@ -311,6 +311,7 @@ public abstract class TCPConnector extends Connector implements ITCPConnector, I
IBuffer buffer = channelSendQueue.peek();
if (buffer != null)
{
+ // The CCAM flag must be remembered *before* the buffer.write() call below!
boolean closeChannelAfterMe = buffer.isCCAM();
if (buffer.write(socketChannel))
@@ -318,11 +319,11 @@ public abstract class TCPConnector extends Connector implements ITCPConnector, I
writeQueue.poll();
channelSendQueue.poll();
buffer.release();
- }
- if (closeChannelAfterMe)
- {
- channel.close();
+ if (closeChannelAfterMe)
+ {
+ channel.close();
+ }
}
}
}
diff --git a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ssl/SSLBuffer.java b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ssl/SSLBuffer.java
index e5c0fd394a..87a2d59709 100644
--- a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ssl/SSLBuffer.java
+++ b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ssl/SSLBuffer.java
@@ -88,8 +88,6 @@ public class SSLBuffer extends Buffer
payloadSize = (short)-payloadSize;
}
- payloadSize -= MAKE_PAYLOAD_SIZE_NON_ZERO;
-
setPosition(IBuffer.HEADER_SIZE);
setState(BufferState.READING_HEADER);
@@ -118,7 +116,6 @@ public class SSLBuffer extends Buffer
{
try
{
-
if (sslEngineManager.getPacketSendBuf().position() > 0)
{
sslEngineManager.handleWrite(socketChannel);
@@ -146,8 +143,9 @@ public class SSLBuffer extends Buffer
throw new IllegalStateException("channelID == NO_CHANNEL"); //$NON-NLS-1$
}
- int payloadSize = getPosition() - IBuffer.HEADER_SIZE + MAKE_PAYLOAD_SIZE_NON_ZERO;
- if (isEOS())
+ int payloadSize = getPosition() - HEADER_SIZE;
+ boolean eos = isEOS();
+ if (eos)
{
payloadSize = -payloadSize;
}
@@ -155,7 +153,7 @@ public class SSLBuffer extends Buffer
if (TRACER.isEnabled())
{
TRACER.trace("Writing " + (Math.abs(payloadSize) - 1) + " bytes" //$NON-NLS-1$ //$NON-NLS-2$
- + (isEOS() ? " (EOS)" : "") + StringUtil.NL + formatContent(false)); //$NON-NLS-1$ //$NON-NLS-2$
+ + (eos ? " (EOS)" : "") + StringUtil.NL + formatContent(false)); //$NON-NLS-1$ //$NON-NLS-2$
}
getByteBuffer().flip();
diff --git a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ssl/SSLServerConnector.java b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ssl/SSLServerConnector.java
index cba4e86790..3cd031ef23 100644
--- a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ssl/SSLServerConnector.java
+++ b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ssl/SSLServerConnector.java
@@ -11,6 +11,7 @@
*/
package org.eclipse.net4j.internal.tcp.ssl;
+import org.eclipse.net4j.connector.IServerConnector;
import org.eclipse.net4j.internal.tcp.bundle.OM;
import org.eclipse.net4j.tcp.ITCPSelector;
@@ -25,7 +26,7 @@ import java.text.MessageFormat;
* @author Caspar De Groot (No Magic Asia Ltd.)
* @since 4.0
*/
-public class SSLServerConnector extends SSLConnector
+public class SSLServerConnector extends SSLConnector implements IServerConnector
{
private SSLAcceptor acceptor;
diff --git a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/tcp/TCPUtil.java b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/tcp/TCPUtil.java
index ce77146327..c8f879439f 100644
--- a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/tcp/TCPUtil.java
+++ b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/tcp/TCPUtil.java
@@ -18,8 +18,8 @@ import org.eclipse.net4j.util.StringUtil;
import org.eclipse.net4j.util.container.IManagedContainer;
import org.eclipse.net4j.util.factory.ProductCreationException;
-import java.net.MalformedURLException;
-import java.net.URL;
+import java.net.URI;
+import java.net.URISyntaxException;
/**
* A utility class with static convenience methods.
@@ -222,12 +222,12 @@ public final class TCPUtil
{
try
{
- URL url = parse(description);
- userID = url.getUserInfo();
- host = url.getHost();
- port = url.getPort();
+ URI uri = parse(description);
+ userID = uri.getUserInfo();
+ host = uri.getHost();
+ port = uri.getPort();
}
- catch (MalformedURLException ex)
+ catch (URISyntaxException ex)
{
throw new ProductCreationException(ex);
}
@@ -338,10 +338,9 @@ public final class TCPUtil
return result;
}
- private static URL parse(String description) throws MalformedURLException
+ private static URI parse(String description) throws URISyntaxException
{
- // Scheme "tcp://" would be rejected!
- return new URL("http://" + description); // TODO Don't use URL
+ return new URI("tcp://" + description);
}
}
}
diff --git a/plugins/org.eclipse.net4j.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.tests/META-INF/MANIFEST.MF
index 6bd81eb0ed..5e225bd360 100644
--- a/plugins/org.eclipse.net4j.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.tests/META-INF/MANIFEST.MF
@@ -10,16 +10,32 @@ Bundle-Activator: org.eclipse.net4j.tests.bundle.OM$Activator
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";visibility:=reexport,
+ org.eclipse.net4j.ws;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
org.eclipse.net4j.tcp;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
org.eclipse.net4j.jvm;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
org.eclipse.net4j.http;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
org.eclipse.net4j.http.server;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
org.apache.log4j;bundle-version="[1.2.0,2.0.0)",
- org.junit;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
+ org.junit;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
+ org.eclipse.jetty.server;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.servlet;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.security;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.client;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.http;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.util;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.io;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.websocket.common;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.websocket.servlet;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.websocket.server;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.websocket.client;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.websocket.api;bundle-version="[9.0.0,10.0.0)"
+Import-Package: javax.servlet;version="[2.3.0,4.0.0)",
+ javax.servlet.http;version="[2.3.0,4.0.0)"
Export-Package: org.eclipse.net4j.tests;version="4.2.1",
org.eclipse.net4j.tests.apps;version="4.2.1",
org.eclipse.net4j.tests.bugzilla;version="4.2.1",
org.eclipse.net4j.tests.bundle;version="4.2.1";x-internal:=true,
+ org.eclipse.net4j.tests.config;version="4.2.1",
org.eclipse.net4j.tests.data;version="4.2.1",
org.eclipse.net4j.tests.signal;version="4.2.1",
org.eclipse.net4j.util.tests;version="4.1.500",
diff --git a/plugins/org.eclipse.net4j.tests/Net4j AllTests.launch b/plugins/org.eclipse.net4j.tests/Net4j AllTests.launch
index 4a82821baf..eeeca679cf 100644
--- a/plugins/org.eclipse.net4j.tests/Net4j AllTests.launch
+++ b/plugins/org.eclipse.net4j.tests/Net4j AllTests.launch
@@ -14,7 +14,8 @@
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
+<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.net4j.tests.AllTests"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.net4j.tests"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Ddebug=true"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx4g&#13;&#10;-Ddebug=true"/>
</launchConfiguration>
diff --git a/plugins/org.eclipse.net4j.tests/Net4j SSL AllTests.launch b/plugins/org.eclipse.net4j.tests/Net4j SSL AllTests.launch
deleted file mode 100644
index aecf0e80e6..0000000000
--- a/plugins/org.eclipse.net4j.tests/Net4j SSL AllTests.launch
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
-<stringAttribute key="bad_container_name" value="\org.eclipse.net4.tests"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllSSLTests.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
-<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;sourceLookupDirector&gt;&#13;&#10;&lt;sourceContainers duplicates=&quot;false&quot;&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;org.eclipse.emf.cdo&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10;&lt;/sourceContainers&gt;&#13;&#10;&lt;/sourceLookupDirector&gt;&#13;&#10;"/>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.net4j.tests.AllSSLTests"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.net4j.tests"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx700m -Ddebug=true -Dorg.eclipse.net4j.tcp.ssl.passphrase=ab987c -Dorg.eclipse.net4j.tcp.ssl.trust=file:///${workspace_loc:org.eclipse.net4j.tests}/sslKey/testTrust -Dorg.eclipse.net4j.tcp.ssl.key=file:///${workspace_loc:org.eclipse.net4j.tests}/sslKey/testKeys&#13;&#10;-Djavax.net.debug=all -Dcheck.validity.certificate=false"/>
-</launchConfiguration>
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractProtocolTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractProtocolTest.java
deleted file mode 100644
index 3da29486df..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractProtocolTest.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2008, 2011, 2012, 2015 Eike Stepper (Loehne, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.tests;
-
-import org.eclipse.net4j.tests.signal.TestSignalProtocol;
-import org.eclipse.net4j.util.container.IManagedContainer;
-
-/**
- * @author Eike Stepper
- */
-public abstract class AbstractProtocolTest extends AbstractTransportTest
-{
- protected AbstractProtocolTest()
- {
- }
-
- @Override
- protected IManagedContainer createContainer()
- {
- IManagedContainer container = super.createContainer();
- container.registerFactory(new TestSignalProtocol.Factory());
- return container;
- }
-}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java
deleted file mode 100644
index 8a4f031083..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTransportTest.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright (c) 2007-2009, 2011, 2012, 2015 Eike Stepper (Loehne, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - SSL
- */
-package org.eclipse.net4j.tests;
-
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.acceptor.IAcceptor;
-import org.eclipse.net4j.connector.IConnector;
-import org.eclipse.net4j.jvm.JVMUtil;
-import org.eclipse.net4j.tcp.TCPUtil;
-import org.eclipse.net4j.tcp.ssl.SSLUtil;
-import org.eclipse.net4j.util.container.ContainerUtil;
-import org.eclipse.net4j.util.container.IManagedContainer;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import org.eclipse.net4j.util.tests.AbstractOMTest;
-
-/**
- * @author Eike Stepper
- * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
- */
-public abstract class AbstractTransportTest extends AbstractOMTest
-{
- protected static final String HOST = "localhost"; //$NON-NLS-1$
-
- protected IManagedContainer container;
-
- // SSL, the server and client need separate container in order to operate handshake.
- protected IManagedContainer separateContainer;
-
- private IAcceptor acceptor;
-
- private IConnector connector;
-
- protected AbstractTransportTest()
- {
- }
-
- @Override
- protected void doSetUp() throws Exception
- {
- super.doSetUp();
- // create container for JVM or TCP only.
- container = createContainer();
- LifecycleUtil.activate(container);
-
- if (!useJVMTransport() && useSSLTransport())
- {
- // the SSL need separate container between client and server
- separateContainer = createContainer();
- LifecycleUtil.activate(separateContainer);
- }
- }
-
- @Override
- protected void doTearDown() throws Exception
- {
- try
- {
- sleep(20);
- LifecycleUtil.deactivate(container);
- }
- finally
- {
- connector = null;
- acceptor = null;
- container = null;
- if (!useJVMTransport() && useSSLTransport())
- {
- separateContainer = null;
- }
- super.doTearDown();
- }
- }
-
- protected boolean useJVMTransport()
- {
- return false;
- }
-
- protected boolean useSSLTransport()
- {
- return false;
- }
-
- protected IManagedContainer createContainer()
- {
- IManagedContainer container = ContainerUtil.createContainer();
- Net4jUtil.prepareContainer(container);
- if (useJVMTransport())
- {
- JVMUtil.prepareContainer(container);
- }
- else
- {
- if (useSSLTransport())
- {
- SSLUtil.prepareContainer(container);
- }
- else
- {
- TCPUtil.prepareContainer(container);
- }
- }
-
- return container;
- }
-
- protected IAcceptor getAcceptor()
- {
- if (acceptor == null)
- {
- if (useJVMTransport())
- {
- acceptor = JVMUtil.getAcceptor(container, "default"); //$NON-NLS-1$
- }
- else
- {
- if (useSSLTransport())
- {
- acceptor = SSLUtil.getAcceptor(container, null);
- }
- else
- {
- acceptor = TCPUtil.getAcceptor(container, null);
- }
- }
- }
-
- return acceptor;
- }
-
- protected IConnector getConnector()
- {
- if (connector == null)
- {
- if (useJVMTransport())
- {
- connector = JVMUtil.getConnector(container, "default"); //$NON-NLS-1$
- }
- else
- {
- if (useSSLTransport())
- {
- // cannot use same container with the acceptor.
- connector = SSLUtil.getConnector(separateContainer, HOST);
- }
- else
- {
- connector = TCPUtil.getConnector(container, HOST);
- }
- }
- }
-
- return connector;
- }
-
- protected void startTransport() throws Exception
- {
- if (container != null)
- {
- IAcceptor acceptor = getAcceptor();
- LifecycleUtil.activate(acceptor);
-
- IConnector connector = getConnector();
- LifecycleUtil.activate(connector);
- }
- }
-
- protected void stopTransport() throws Exception
- {
- connector.close();
- connector = null;
-
- acceptor.close();
- acceptor = null;
- }
-
- protected void restartContainer() throws Exception
- {
- msg("RESTARTING CONTAINER"); //$NON-NLS-1$
- stopTransport();
-
- LifecycleUtil.deactivate(container);
- container = createContainer();
- LifecycleUtil.activate(container);
-
- if (!useJVMTransport() && useSSLTransport())
- {
- LifecycleUtil.deactivate(separateContainer);
- separateContainer = createContainer();
- LifecycleUtil.activate(separateContainer);
- }
- startTransport();
- msg("RESTARTING CONTAINER - FINISHED"); //$NON-NLS-1$
- }
-}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AcceptorTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AcceptorTest.java
new file mode 100644
index 0000000000..e39b99b868
--- /dev/null
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AcceptorTest.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008-2012, 2015 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.tests;
+
+import org.eclipse.net4j.connector.IConnector;
+import org.eclipse.net4j.tests.config.AbstractConfigTest;
+import org.eclipse.net4j.util.io.IOUtil;
+
+import org.eclipse.spi.net4j.Acceptor;
+import org.eclipse.spi.net4j.Acceptor.ConnectorPreparer;
+import org.eclipse.spi.net4j.InternalConnector;
+
+/**
+ * @author Eike Stepper
+ */
+public class AcceptorTest extends AbstractConfigTest
+{
+ public void testDeferredAccept() throws Exception
+ {
+ for (int i = 0; i < 5; i++)
+ {
+ IOUtil.OUT().println(" RUN = " + i); //$NON-NLS-1$
+
+ Acceptor acceptor = (Acceptor)getAcceptor();
+ acceptor.setConnectorPreparer(new ConnectorPreparer()
+ {
+ @Override
+ public void prepareConnector(InternalConnector connector)
+ {
+ sleep(500);
+ }
+ });
+
+ IConnector connector = getConnector();
+ connector.waitForConnection(DEFAULT_TIMEOUT);
+ assertEquals(false, connector.isClosed());
+
+ stopTransport();
+ sleep(1000);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllSSLTests.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllSSLTests.java
deleted file mode 100644
index 15d352dbba..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllSSLTests.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, 2015 Eike Stepper (Loehne, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - initial API and implementation
- */
-package org.eclipse.net4j.tests;
-
-import org.eclipse.net4j.tests.bugzilla.Bugzilla_241463_Test;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
- */
-public class AllSSLTests
-{
- public static Test suite()
- {
- TestSuite suite = new TestSuite("Tests for SSL Net4j"); //$NON-NLS-1$
- suite.addTestSuite(ChannelTest.SSL.class);
- suite.addTestSuite(TCPConnectorTest.SSL.class);
- suite.addTestSuite(TransportTest.SSL.class);
- suite.addTestSuite(SignalTest.SSL.class);
- suite.addTestSuite(SignalMonitorTest.SSL.class);
- suite.addTestSuite(ExceptionTest.SSL.class);
- // Bugzillas
- suite.addTestSuite(Bugzilla_241463_Test.SSL.class);
-
- return suite;
- }
-}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllTests.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllTests.java
index ba2b464269..5b20fc74b7 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllTests.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllTests.java
@@ -13,11 +13,17 @@ package org.eclipse.net4j.tests;
import org.eclipse.net4j.tests.bugzilla.Bugzilla_241463_Test;
import org.eclipse.net4j.tests.bugzilla.Bugzilla_259086_Test;
import org.eclipse.net4j.tests.bugzilla.Bugzilla_262875_Test;
+import org.eclipse.net4j.tests.config.Net4jTestSuite;
+import org.eclipse.net4j.tests.config.TestConfig.JVM;
+import org.eclipse.net4j.tests.config.TestConfig.SSL;
+import org.eclipse.net4j.tests.config.TestConfig.TCP;
+import org.eclipse.net4j.tests.config.TestConfig.WS;
import org.eclipse.net4j.util.tests.ExecutorWorkSerializerTest;
import org.eclipse.net4j.util.tests.ExpectedIOTest;
import org.eclipse.net4j.util.tests.ExtendedIOTest;
import org.eclipse.net4j.util.tests.MultiMapTest;
import org.eclipse.net4j.util.tests.RollingLogTest;
+import org.eclipse.net4j.util.tests.RoundRobinBlockingQueueTest;
import org.eclipse.net4j.util.tests.SecurityTest;
import org.eclipse.net4j.util.tests.SortedFileMapTest;
import org.eclipse.net4j.util.tests.StringCompressorTest;
@@ -34,7 +40,15 @@ public class AllTests
{
public static Test suite()
{
- TestSuite suite = new TestSuite("Tests for Net4j"); //$NON-NLS-1$
+ @SuppressWarnings("unchecked")
+ TestSuite suite = new Net4jTestSuite(AllTests.class.getName(), JVM.class, TCP.class, SSL.class, WS.class);
+ populateSuite(suite);
+ return suite;
+ }
+
+ static void populateSuite(TestSuite suite)
+ {
+ // Normal tests
suite.addTestSuite(UUIDGeneratorTest.class);
suite.addTestSuite(MultiMapTest.class);
suite.addTestSuite(SortedFileMapTest.class);
@@ -42,33 +56,23 @@ public class AllTests
suite.addTestSuite(BufferPoolTest.class);
suite.addTestSuite(ExtendedIOTest.class);
suite.addTestSuite(StringCompressorTest.class);
- suite.addTestSuite(ChannelTest.JVM.class);
- suite.addTestSuite(ChannelTest.TCP.class);
- suite.addTestSuite(TCPConnectorTest.TCP.class);
- suite.addTestSuite(TransportTest.JVM.class);
- suite.addTestSuite(TransportTest.TCP.class);
- suite.addTestSuite(SignalTest.TCP.class);
- suite.addTestSuite(SignalMonitorTest.TCP.class);
- suite.addTestSuite(ExceptionTest.TCP.class);
suite.addTestSuite(SecurityTest.class);
suite.addTestSuite(ExecutorWorkSerializerTest.class);
+ suite.addTestSuite(RoundRobinBlockingQueueTest.class);
suite.addTestSuite(ExpectedIOTest.class);
suite.addTestSuite(RollingLogTest.class);
-
- // Bugzillas
- suite.addTestSuite(Bugzilla_241463_Test.JVM.class);
- suite.addTestSuite(Bugzilla_241463_Test.TCP.class);
suite.addTestSuite(Bugzilla_262875_Test.class);
- suite.addTestSuite(Bugzilla_259086_Test.JVM.class);
- suite.addTestSuite(Bugzilla_259086_Test.TCP.class);
-
- // Defs
- // suite.addTestSuite(TestDefTest.class);
- // suite.addTestSuite(TCPAcceptorDefImplTest.class);
- // suite.addTestSuite(TCPConnectorDefImplTest.class);
- // suite.addTestSuite(JVMAcceptorDefImplTest.class);
- // suite.addTestSuite(JVMConnectorDefImplTest.class);
- return suite;
+ // Config tests
+ suite.addTestSuite(NegotiationTest.class);
+ suite.addTestSuite(AcceptorTest.class);
+ suite.addTestSuite(ChannelTest.class);
+ suite.addTestSuite(TransportTest.class);
+ suite.addTestSuite(SignalTest.class);
+ suite.addTestSuite(SignalMonitorTest.class);
+ suite.addTestSuite(IdleTimeoutTest.class);
+ suite.addTestSuite(ExceptionTest.class);
+ suite.addTestSuite(Bugzilla_241463_Test.class);
+ suite.addTestSuite(Bugzilla_259086_Test.class);
}
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ChannelTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ChannelTest.java
index 7e9a8b42d9..e4766e8f72 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ChannelTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ChannelTest.java
@@ -13,17 +13,19 @@ package org.eclipse.net4j.tests;
import org.eclipse.net4j.ITransportConfigAware;
import org.eclipse.net4j.channel.IChannel;
+import org.eclipse.net4j.connector.IConnector;
+import org.eclipse.net4j.tests.config.AbstractConfigTest;
import org.eclipse.net4j.tests.data.HugeData;
import org.eclipse.net4j.tests.data.TinyData;
import org.eclipse.net4j.tests.signal.ArrayRequest;
import org.eclipse.net4j.tests.signal.TestSignalProtocol;
-import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
import org.eclipse.net4j.util.concurrent.MonitoredThread;
import org.eclipse.net4j.util.concurrent.MonitoredThread.MultiThreadMonitor;
import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.net4j.util.lifecycle.ILifecycle;
import org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter;
+import org.eclipse.spi.net4j.InternalChannel;
import org.eclipse.spi.net4j.InternalConnector;
import java.util.ArrayList;
@@ -36,7 +38,7 @@ import java.util.Set;
/**
* @author Eike Stepper
*/
-public abstract class ChannelTest extends AbstractProtocolTest
+public class ChannelTest extends AbstractConfigTest
{
private static final long TIMEOUT = 20000;
@@ -44,10 +46,6 @@ public abstract class ChannelTest extends AbstractProtocolTest
private List<TestSignalProtocol> protocols;
- public ChannelTest()
- {
- }
-
public void testAllBufferSizes() throws Exception
{
disableConsole();
@@ -55,8 +53,10 @@ public abstract class ChannelTest extends AbstractProtocolTest
TestSignalProtocol protocol = openTestSignalProtocol();
assertActive(protocol);
+ short bufferCapacity = ((ITransportConfigAware)getConnector()).getConfig().getBufferProvider().getBufferCapacity();
+
byte[] data = HugeData.getBytes();
- assertEquals(true, data.length > 2 * ((ITransportConfigAware)getConnector()).getConfig().getBufferProvider().getBufferCapacity());
+ assertEquals(true, data.length > 2 * bufferCapacity);
for (int i = 1; i < data.length; i++)
{
@@ -133,7 +133,7 @@ public abstract class ChannelTest extends AbstractProtocolTest
disableConsole();
for (int i = 0; i < 100; i++)
{
- IOUtil.OUT().println(Thread.currentThread().getName() + ": " + i); //$NON-NLS-1$
+ log(Thread.currentThread().getName() + ": " + i); //$NON-NLS-1$
testSingleThreadNoData();
}
}
@@ -156,11 +156,31 @@ public abstract class ChannelTest extends AbstractProtocolTest
disableConsole();
for (int i = 0; i < 100; i++)
{
- IOUtil.OUT().println(Thread.currentThread().getName() + ": " + i); //$NON-NLS-1$
+ log(Thread.currentThread().getName() + ": " + i); //$NON-NLS-1$
testSingleThreadTinyData();
}
}
+ public void testSingleThreadHugeDataLong() throws Exception
+ {
+ TestSignalProtocol protocol = openTestSignalProtocol();
+ assertActive(protocol);
+
+ byte[] data = HugeData.getBytes();
+ for (int i = 0; i < 10000; i++)
+ {
+ byte[] result = new ArrayRequest(protocol, data).send();
+ assertEquals(true, Arrays.equals(data, result));
+ }
+
+ InternalChannel channel = (InternalChannel)protocol.getChannel();
+ log("Sent buffers: " + channel.getSentBuffers());
+ log("Received buffers: " + channel.getReceivedBuffers());
+
+ protocol.close();
+ assertInactive(protocol);
+ }
+
public void testMultiThreadNoData() throws Exception
{
MultiThreadMonitor threadMonitor = new MultiThreadMonitor(TIMEOUT);
@@ -173,7 +193,7 @@ public abstract class ChannelTest extends AbstractProtocolTest
{
for (int i = 0; i < 100; i++)
{
- IOUtil.OUT().println(Thread.currentThread().getName() + ": " + i); //$NON-NLS-1$
+ log(Thread.currentThread().getName() + ": " + i); //$NON-NLS-1$
TestSignalProtocol protocol = openTestSignalProtocol();
assertActive(protocol);
@@ -203,7 +223,7 @@ public abstract class ChannelTest extends AbstractProtocolTest
{
for (int i = 0; i < 100; i++)
{
- IOUtil.OUT().println(Thread.currentThread().getName() + ": " + i); //$NON-NLS-1$
+ log(Thread.currentThread().getName() + ": " + i); //$NON-NLS-1$
TestSignalProtocol protocol = openTestSignalProtocol();
assertActive(protocol);
heartBeat();
@@ -228,7 +248,7 @@ public abstract class ChannelTest extends AbstractProtocolTest
public void testMultiThreadDataLoop() throws Exception
{
- MultiThreadMonitor threadMonitor = new MultiThreadMonitor(TIMEOUT, 10L);
+ MultiThreadMonitor threadMonitor = new MultiThreadMonitor(1000 * TIMEOUT, 10L);
for (int i = 0; i < THREADS; i++)
{
threadMonitor.addThread(new MonitoredThread("TEST-THREAD-" + i, threadMonitor) //$NON-NLS-1$
@@ -249,13 +269,12 @@ public abstract class ChannelTest extends AbstractProtocolTest
assertEquals(true, Arrays.equals(data, result));
heartBeat();
- ConcurrencyUtil.sleep(10L);
}
protocol.close();
assertInactive(protocol);
long stop = System.currentTimeMillis();
- IOUtil.OUT().println(Thread.currentThread().getName() + ": " + i + " (" + (stop - start) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ log(Thread.currentThread().getName() + ": " + i + " (" + (stop - start) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
});
@@ -267,9 +286,6 @@ public abstract class ChannelTest extends AbstractProtocolTest
}
@Override
- protected abstract boolean useJVMTransport();
-
- @Override
protected void doSetUp() throws Exception
{
super.doSetUp();
@@ -281,20 +297,35 @@ public abstract class ChannelTest extends AbstractProtocolTest
@Override
protected void doTearDown() throws Exception
{
- for (TestSignalProtocol protocol : protocols)
+ try
{
- protocol.close();
- }
+ if (protocols != null)
+ {
+ for (TestSignalProtocol protocol : new ArrayList<TestSignalProtocol>(protocols))
+ {
+ protocol.close();
+ }
- protocols = null;
+ protocols = null;
+ }
- getConnector().close();
- super.doTearDown();
+ if (connector != null)
+ {
+ connector.close();
+ connector = null;
+ }
+ }
+ finally
+ {
+ super.doTearDown();
+ }
}
private TestSignalProtocol openTestSignalProtocol()
{
- final TestSignalProtocol protocol = new TestSignalProtocol(getConnector());
+ IConnector connector = getConnector();
+ final TestSignalProtocol protocol = new TestSignalProtocol(connector);
+
synchronized (protocols)
{
protocols.add(protocol);
@@ -316,6 +347,11 @@ public abstract class ChannelTest extends AbstractProtocolTest
return protocol;
}
+ private static void log(String message)
+ {
+ IOUtil.OUT().println(message);
+ }
+
/**
* @author Eike Stepper
*/
@@ -342,58 +378,4 @@ public abstract class ChannelTest extends AbstractProtocolTest
}
}
}
-
- /**
- * @author Eike Stepper
- */
- public static final class JVM extends ChannelTest
- {
- @Override
- protected boolean useJVMTransport()
- {
- return true;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return false;
- }
- }
-
- /**
- * @author Eike Stepper
- */
- public static final class TCP extends ChannelTest
- {
- @Override
- protected boolean useJVMTransport()
- {
- return false;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return false;
- }
- }
-
- /**
- * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
- */
- public static final class SSL extends ChannelTest
- {
- @Override
- protected boolean useJVMTransport()
- {
- return false;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return true;
- }
- }
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ExceptionTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ExceptionTest.java
index 52dd20bb88..513f81af42 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ExceptionTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ExceptionTest.java
@@ -12,6 +12,7 @@
package org.eclipse.net4j.tests;
import org.eclipse.net4j.signal.RemoteException;
+import org.eclipse.net4j.tests.config.AbstractConfigTest;
import org.eclipse.net4j.tests.signal.ExceptionRequest;
import org.eclipse.net4j.tests.signal.TestSignalProtocol;
import org.eclipse.net4j.util.io.IOUtil;
@@ -22,13 +23,13 @@ import java.rmi.AlreadyBoundException;
/**
* @author Eike Stepper
*/
-public class ExceptionTest extends AbstractProtocolTest
+public class ExceptionTest extends AbstractConfigTest
{
public ExceptionTest()
{
}
- public void testExceptionInIRequesting() throws Exception
+ public void testExceptionInRequesting() throws Exception
{
exceptionInPhase(1, false);
}
@@ -128,40 +129,4 @@ public class ExceptionTest extends AbstractProtocolTest
}
}
}
-
- /**
- * @author Eike Stepper
- */
- public static final class TCP extends ExceptionTest
- {
- @Override
- protected boolean useJVMTransport()
- {
- return false;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return false;
- }
- }
-
- /**
- * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
- */
- public static final class SSL extends ExceptionTest
- {
- @Override
- protected boolean useJVMTransport()
- {
- return false;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return true;
- }
- }
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/IdleTimeoutTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/IdleTimeoutTest.java
new file mode 100644
index 0000000000..a392f84abf
--- /dev/null
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/IdleTimeoutTest.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2008, 2009, 2011, 2012, 2015, 2016, 2019 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - SSL
+ */
+package org.eclipse.net4j.tests;
+
+import org.eclipse.net4j.connector.IConnector;
+import org.eclipse.net4j.tests.config.AbstractConfigTest;
+import org.eclipse.net4j.tests.config.Net4jTestSuite.ExcludedConfig;
+import org.eclipse.net4j.tests.config.TestConfig.JVM;
+import org.eclipse.net4j.tests.config.TestConfig.SSL;
+import org.eclipse.net4j.tests.config.TestConfig.TCP;
+import org.eclipse.net4j.tests.data.TinyData;
+import org.eclipse.net4j.tests.signal.ArrayRequest;
+import org.eclipse.net4j.tests.signal.TestSignalProtocol;
+import org.eclipse.net4j.util.io.IOUtil;
+
+import java.util.Arrays;
+
+/**
+ * @author Eike Stepper
+ */
+@ExcludedConfig({ JVM.class, TCP.class, SSL.class }) // Test only Websocket heartbeat pongs.
+public class IdleTimeoutTest extends AbstractConfigTest
+{
+ public void testSingleThreadTinyDataLongWithPause() throws Exception
+ {
+ startTransport();
+
+ IConnector connector = getConnector();
+ connector.setOpenChannelTimeout(20000);
+
+ TestSignalProtocol protocol = new TestSignalProtocol(connector);
+ assertActive(protocol);
+
+ byte[] data = TinyData.getBytes();
+
+ log("Sending 10000 signals...");
+ for (int i = 0; i < 10000; i++)
+ {
+ byte[] result = new ArrayRequest(protocol, data).send();
+ assertEquals(true, Arrays.equals(data, result));
+ }
+
+ log("Pausing 40 seconds ...");
+ sleep(40000); // Pause longer than the 30000 millisecond timeouts.
+
+ log("Sending 10000 signals...");
+ for (int i = 0; i < 10000; i++)
+ {
+ byte[] result = new ArrayRequest(protocol, data).send();
+ assertEquals(true, Arrays.equals(data, result));
+ }
+
+ protocol.close();
+ assertInactive(protocol);
+ }
+
+ private static void log(String message)
+ {
+ IOUtil.OUT().println(message);
+ }
+}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/NegotiationTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/NegotiationTest.java
new file mode 100644
index 0000000000..c3b0a2b0a1
--- /dev/null
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/NegotiationTest.java
@@ -0,0 +1,238 @@
+/*
+ * Copyright (c) 2008-2012, 2015 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.tests;
+
+import org.eclipse.net4j.ITransportConfig;
+import org.eclipse.net4j.TransportInjector;
+import org.eclipse.net4j.acceptor.IAcceptor;
+import org.eclipse.net4j.channel.IChannel;
+import org.eclipse.net4j.connector.ConnectorException;
+import org.eclipse.net4j.connector.IConnector;
+import org.eclipse.net4j.tests.bundle.OM;
+import org.eclipse.net4j.tests.config.AbstractConfigTest;
+import org.eclipse.net4j.tests.config.Net4jTestSuite.ExcludedConfig;
+import org.eclipse.net4j.tests.config.TestConfig.JVM;
+import org.eclipse.net4j.util.container.IManagedContainer;
+import org.eclipse.net4j.util.io.IOUtil;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+import org.eclipse.net4j.util.security.ChallengeNegotiator;
+import org.eclipse.net4j.util.security.IPasswordCredentials;
+import org.eclipse.net4j.util.security.NegotiationException;
+import org.eclipse.net4j.util.security.PasswordCredentials;
+import org.eclipse.net4j.util.security.PasswordCredentialsProvider;
+import org.eclipse.net4j.util.security.Randomizer;
+import org.eclipse.net4j.util.security.ResponseNegotiator;
+import org.eclipse.net4j.util.security.UserManager;
+
+import org.eclipse.spi.net4j.Connector;
+import org.eclipse.spi.net4j.InternalAcceptor;
+import org.eclipse.spi.net4j.InternalConnector;
+
+/**
+ * @author Eike Stepper
+ */
+@ExcludedConfig(JVM.class)
+public class NegotiationTest extends AbstractConfigTest
+{
+ private static final String USER_ID = "stepper"; //$NON-NLS-1$
+
+ private static final String INVALID_USER_ID = "invalid"; //$NON-NLS-1$
+
+ private static final char[] PASSWORD = "eike2008".toCharArray(); //$NON-NLS-1$
+
+ private static final char[] INVALID_PASSWORD = "invalid".toCharArray(); //$NON-NLS-1$
+
+ private static final PasswordCredentials CREDENTIALS = new PasswordCredentials(USER_ID, PASSWORD);
+
+ public void testNegotiationSuccess() throws Exception
+ {
+ acceptorContainer.addPostProcessor(new AcceptorNegotiatorInjector(USER_ID, PASSWORD));
+ connectorContainer.addPostProcessor(new ConnectorNegotiatorInjector(CREDENTIALS));
+
+ for (int i = 0; i < 5; i++)
+ {
+ IOUtil.OUT().println(" RUN = " + i); //$NON-NLS-1$
+
+ IAcceptor acceptor = getAcceptor();
+
+ IConnector connector = getConnector();
+ connector.waitForConnection(DEFAULT_TIMEOUT);
+
+ IChannel clientChannel = connector.openChannel();
+ assertEquals(USER_ID, clientChannel.getUserID());
+
+ IConnector serverConnector = acceptor.getElements()[0];
+ IChannel serverChannel = serverConnector.getElements()[0];
+ assertEquals(USER_ID, serverChannel.getUserID());
+
+ stopTransport();
+ sleep(1000);
+ }
+ }
+
+ public void testInvalidUser() throws Exception
+ {
+ acceptorContainer.addPostProcessor(new AcceptorNegotiatorInjector(INVALID_USER_ID, PASSWORD));
+ connectorContainer.addPostProcessor(new ConnectorNegotiatorInjector(CREDENTIALS));
+
+ getAcceptor();
+
+ IConnector connector = getConnector(false);
+
+ try
+ {
+ connector.connectAsync();
+ connector.waitForConnection(DEFAULT_TIMEOUT_EXPECTED);
+ fail("ConnectorException expected"); //$NON-NLS-1$
+ }
+ catch (ConnectorException ex)
+ {
+ OM.LOG.info("Expected ConnectorException:", ex); //$NON-NLS-1$
+ assertEquals(true, ex.getCause() instanceof NegotiationException);
+ }
+ }
+
+ public void testInvalidPassword() throws Exception
+ {
+ acceptorContainer.addPostProcessor(new AcceptorNegotiatorInjector(USER_ID, INVALID_PASSWORD));
+ connectorContainer.addPostProcessor(new ConnectorNegotiatorInjector(CREDENTIALS));
+
+ getAcceptor();
+
+ IConnector connector = getConnector(false);
+
+ try
+ {
+ connector.connectAsync();
+ connector.waitForConnection(DEFAULT_TIMEOUT_EXPECTED);
+ fail("ConnectorException expected"); //$NON-NLS-1$
+ }
+ catch (ConnectorException ex)
+ {
+ OM.LOG.info("Expected ConnectorException:", ex); //$NON-NLS-1$
+ assertEquals(true, ex.getCause() instanceof NegotiationException);
+ }
+ }
+
+ public void testNoNegotiator() throws Exception
+ {
+ getAcceptor();
+
+ Connector connector = (Connector)getConnector(false);
+ connector.setUserID("SHOULD_FAIL_LATER"); //$NON-NLS-1$
+
+ try
+ {
+ connector.connect();
+ fail("ConnectorException expected"); //$NON-NLS-1$
+ }
+ catch (ConnectorException ex)
+ {
+ OM.LOG.info("Expected ConnectorException:", ex); //$NON-NLS-1$
+ assertEquals(true, ex.getCause() instanceof IllegalStateException);
+ }
+ }
+
+ public void testNegotiatorTooLate() throws Exception
+ {
+ getAcceptor();
+ Connector connector = (Connector)getConnector();
+
+ try
+ {
+ connector.getConfig().setNegotiator(new ResponseNegotiator());
+ fail("IllegalStateException expected"); //$NON-NLS-1$
+ }
+ catch (IllegalStateException ex)
+ {
+ OM.LOG.info("Expected IllegalStateException:", ex); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class AcceptorNegotiatorInjector extends TransportInjector
+ {
+ private Randomizer randomizer;
+
+ private UserManager userManager;
+
+ private ChallengeNegotiator challengeNegotiator;
+
+ public AcceptorNegotiatorInjector(String userID, char[] password)
+ {
+ randomizer = new Randomizer();
+ randomizer.activate();
+
+ userManager = new UserManager();
+ userManager.activate();
+ userManager.addUser(userID, password);
+
+ challengeNegotiator = new ChallengeNegotiator();
+ challengeNegotiator.setRandomizer(randomizer);
+ challengeNegotiator.setUserManager(userManager);
+ challengeNegotiator.activate();
+ }
+
+ @Override
+ protected void processAcceptor(IManagedContainer container, String factoryType, String description, InternalAcceptor acceptor)
+ {
+ ITransportConfig config = acceptor.getConfig();
+ if (config.getNegotiator() == null)
+ {
+ config.setNegotiator(challengeNegotiator);
+ }
+ }
+
+ @Override
+ protected void processConnector(IManagedContainer container, String factoryType, String description, InternalConnector connector)
+ {
+ // Do nothing.
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class ConnectorNegotiatorInjector extends TransportInjector
+ {
+ private PasswordCredentialsProvider credentialsProvider;
+
+ private ResponseNegotiator responseNegotiator;
+
+ public ConnectorNegotiatorInjector(IPasswordCredentials credentials)
+ {
+ credentialsProvider = new PasswordCredentialsProvider(credentials);
+ LifecycleUtil.activate(credentialsProvider);
+
+ responseNegotiator = new ResponseNegotiator();
+ responseNegotiator.setCredentialsProvider(credentialsProvider);
+ responseNegotiator.activate();
+ }
+
+ @Override
+ protected void processAcceptor(IManagedContainer container, String factoryType, String description, InternalAcceptor acceptor)
+ {
+ // Do nothing.
+ }
+
+ @Override
+ protected void processConnector(IManagedContainer container, String factoryType, String description, InternalConnector connector)
+ {
+ ITransportConfig config = connector.getConfig();
+ if (config.getNegotiator() == null)
+ {
+ config.setNegotiator(responseNegotiator);
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalMonitorTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalMonitorTest.java
index 94599daec5..3c04e286fd 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalMonitorTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalMonitorTest.java
@@ -15,6 +15,7 @@ import org.eclipse.net4j.signal.IndicationWithMonitoring;
import org.eclipse.net4j.signal.RequestWithMonitoring;
import org.eclipse.net4j.signal.SignalProtocol;
import org.eclipse.net4j.signal.SignalReactor;
+import org.eclipse.net4j.tests.config.AbstractConfigTest;
import org.eclipse.net4j.util.container.IManagedContainer;
import org.eclipse.net4j.util.factory.ProductCreationException;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
@@ -28,7 +29,7 @@ import org.eclipse.spi.net4j.ServerProtocolFactory;
/**
* @author Eike Stepper
*/
-public class SignalMonitorTest extends AbstractTransportTest
+public class SignalMonitorTest extends AbstractConfigTest
{
public static final String PROTOCOL_TYPE = "protocol"; //$NON-NLS-1$
@@ -45,98 +46,7 @@ public class SignalMonitorTest extends AbstractTransportTest
@Override
public Object create(String description) throws ProductCreationException
{
- return new SignalProtocol<Object>(PROTOCOL_TYPE)
- {
- @Override
- protected SignalReactor createSignalReactor(short signalID)
- {
- switch (signalID)
- {
- case SIGNAL_1:
- return new IndicationWithMonitoring(this, SIGNAL_1)
- {
- @Override
- protected void indicating(ExtendedDataInputStream in, OMMonitor monitor) throws Exception
- {
- monitor.begin(1 + 100);
-
- try
- {
- in.readBoolean();
- monitor.worked();
-
- for (int i = 0; i < 100; i++)
- {
- sleep(100);
- monitor.worked();
- }
- }
- finally
- {
- monitor.done();
- }
- }
-
- @Override
- protected void responding(ExtendedDataOutputStream out, OMMonitor monitor) throws Exception
- {
- monitor.begin();
-
- try
- {
- out.writeBoolean(true);
- monitor.worked();
- }
- finally
- {
- monitor.done();
- }
- }
- };
-
- case SIGNAL_2:
- return new IndicationWithMonitoring(this, SIGNAL_2)
- {
- @Override
- protected void indicating(ExtendedDataInputStream in, OMMonitor monitor) throws Exception
- {
- monitor.begin();
-
- try
- {
- Async async = in.readBoolean() ? monitor.forkAsync() : null;
-
- try
- {
- long sleep = in.readLong();
- Thread.sleep(sleep);
- }
- finally
- {
- if (async != null)
- {
- async.stop();
- }
- }
- }
- finally
- {
- monitor.done();
- }
- }
-
- @Override
- protected void responding(ExtendedDataOutputStream out, OMMonitor monitor) throws Exception
- {
- out.writeBoolean(true);
- }
- };
-
- default:
- return super.createSignalReactor(signalID);
- }
- }
- };
+ return new ServerProtocol();
}
});
@@ -146,6 +56,7 @@ public class SignalMonitorTest extends AbstractTransportTest
public void testMonitorProgress() throws Exception
{
startTransport();
+
SignalProtocol<Object> protocol = new ClientProtocol();
protocol.open(getConnector());
@@ -223,86 +134,133 @@ public class SignalMonitorTest extends AbstractTransportTest
/**
* @author Eike Stepper
*/
- public static final class ClientProtocol extends SignalProtocol<Object>
+ private static final class ServerProtocol extends SignalProtocol<Object>
{
- public ClientProtocol()
+ private ServerProtocol()
{
super(PROTOCOL_TYPE);
}
- }
- /**
- * @author Eike Stepper
- */
- private static final class TestMonitor extends Monitor
- {
@Override
- public OMMonitor begin(double totalWork)
+ protected SignalReactor createSignalReactor(short signalID)
{
- super.begin(totalWork);
- System.out.println("totalWork: " + getTotalWork()); //$NON-NLS-1$
- return this;
- }
+ switch (signalID)
+ {
+ case SIGNAL_1:
+ return new IndicationWithMonitoring(this, SIGNAL_1)
+ {
+ @Override
+ protected void indicating(ExtendedDataInputStream in, OMMonitor monitor) throws Exception
+ {
+ monitor.begin(1 + 100);
- @Override
- public void worked(double work)
- {
- super.worked(work);
- System.out.println("work: " + getWork()); //$NON-NLS-1$
- }
- }
+ try
+ {
+ in.readBoolean();
+ monitor.worked();
- /**
- * @author Eike Stepper
- */
- public static final class JVM extends SignalMonitorTest
- {
- @Override
- protected boolean useJVMTransport()
- {
- return true;
- }
+ for (int i = 0; i < 100; i++)
+ {
+ sleep(100);
+ monitor.worked();
+ }
+ }
+ finally
+ {
+ monitor.done();
+ }
+ }
- @Override
- protected boolean useSSLTransport()
- {
- return false;
+ @Override
+ protected void responding(ExtendedDataOutputStream out, OMMonitor monitor) throws Exception
+ {
+ monitor.begin();
+
+ try
+ {
+ out.writeBoolean(true);
+ monitor.worked();
+ }
+ finally
+ {
+ monitor.done();
+ }
+ }
+ };
+
+ case SIGNAL_2:
+ return new IndicationWithMonitoring(this, SIGNAL_2)
+ {
+ @Override
+ protected void indicating(ExtendedDataInputStream in, OMMonitor monitor) throws Exception
+ {
+ monitor.begin();
+
+ try
+ {
+ Async async = in.readBoolean() ? monitor.forkAsync() : null;
+
+ try
+ {
+ long sleep = in.readLong();
+ Thread.sleep(sleep);
+ }
+ finally
+ {
+ if (async != null)
+ {
+ async.stop();
+ }
+ }
+ }
+ finally
+ {
+ monitor.done();
+ }
+ }
+
+ @Override
+ protected void responding(ExtendedDataOutputStream out, OMMonitor monitor) throws Exception
+ {
+ out.writeBoolean(true);
+ }
+ };
+
+ default:
+ return super.createSignalReactor(signalID);
+ }
}
}
/**
* @author Eike Stepper
*/
- public static final class TCP extends SignalMonitorTest
+ private static final class ClientProtocol extends SignalProtocol<Object>
{
- @Override
- protected boolean useJVMTransport()
- {
- return false;
- }
-
- @Override
- protected boolean useSSLTransport()
+ public ClientProtocol()
{
- return false;
+ super(PROTOCOL_TYPE);
}
}
/**
- * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
+ * @author Eike Stepper
*/
- public static final class SSL extends SignalMonitorTest
+ private static final class TestMonitor extends Monitor
{
@Override
- protected boolean useJVMTransport()
+ public OMMonitor begin(double totalWork)
{
- return false;
+ super.begin(totalWork);
+ System.out.println("totalWork: " + getTotalWork()); //$NON-NLS-1$
+ return this;
}
@Override
- protected boolean useSSLTransport()
+ public void worked(double work)
{
- return true;
+ super.worked(work);
+ System.out.println("work: " + getWork()); //$NON-NLS-1$
}
}
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalStreamWrappingTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalStreamWrappingTest.java
index abd13e7bd2..fe3390eb6e 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalStreamWrappingTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalStreamWrappingTest.java
@@ -11,6 +11,7 @@
package org.eclipse.net4j.tests;
import org.eclipse.net4j.signal.wrapping.XORStreamWrapperInjector;
+import org.eclipse.net4j.tests.config.AbstractConfigTest;
import org.eclipse.net4j.tests.data.HugeData;
import org.eclipse.net4j.tests.data.TinyData;
import org.eclipse.net4j.tests.signal.ArrayRequest;
@@ -23,7 +24,7 @@ import java.util.Arrays;
/**
* @author Eike Stepper
*/
-public class SignalStreamWrappingTest extends AbstractProtocolTest
+public class SignalStreamWrappingTest extends AbstractConfigTest
{
private static final int[] KEY = { 1, 2, 3, 4, 5 };
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java
index 425df0990d..2c565e6a8b 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java
@@ -11,26 +11,22 @@
*/
package org.eclipse.net4j.tests;
-import org.eclipse.net4j.internal.tcp.TCPConnector;
+import org.eclipse.net4j.tests.config.AbstractConfigTest;
import org.eclipse.net4j.tests.data.TinyData;
import org.eclipse.net4j.tests.signal.ArrayRequest;
import org.eclipse.net4j.tests.signal.AsyncRequest;
import org.eclipse.net4j.tests.signal.IntRequest;
import org.eclipse.net4j.tests.signal.StringRequest;
import org.eclipse.net4j.tests.signal.TestSignalProtocol;
-import org.eclipse.net4j.util.ReflectUtil;
import org.eclipse.net4j.util.lifecycle.ILifecycle;
import org.eclipse.net4j.util.om.OMPlatform;
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.nio.channels.SocketChannel;
import java.util.Arrays;
/**
* @author Eike Stepper
*/
-public class SignalTest extends AbstractProtocolTest
+public class SignalTest extends AbstractConfigTest
{
public void testInteger() throws Exception
{
@@ -101,7 +97,7 @@ public class SignalTest extends AbstractProtocolTest
}
}
- public void testCloseSocketChannel() throws Exception
+ public void testCloseUnderlyingConnection() throws Exception
{
TestSignalProtocol protocol = null;
@@ -111,7 +107,7 @@ public class SignalTest extends AbstractProtocolTest
protocol = new TestSignalProtocol(getConnector());
final ILifecycle lifecycle = protocol;
- closeSocketChannel((TCPConnector)getAcceptor().getAcceptedConnectors()[0]);
+ config.closeUnderlyingConnection(getServerConnector());
new PollingTimeOuter()
{
@Override
@@ -129,47 +125,4 @@ public class SignalTest extends AbstractProtocolTest
}
}
}
-
- private static void closeSocketChannel(TCPConnector connector) throws IOException
- {
- Field field = ReflectUtil.getField(TCPConnector.class, "socketChannel");
- SocketChannel socketChannel = (SocketChannel)ReflectUtil.getValue(field, connector);
- socketChannel.close();
- }
-
- /**
- * @author Eike Stepper
- */
- public static final class TCP extends SignalTest
- {
- @Override
- protected boolean useJVMTransport()
- {
- return false;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return false;
- }
- }
-
- /**
- * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
- */
- public static final class SSL extends SignalTest
- {
- @Override
- protected boolean useJVMTransport()
- {
- return false;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return true;
- }
- }
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPConnectorTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPConnectorTest.java
deleted file mode 100644
index 045b7f0713..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPConnectorTest.java
+++ /dev/null
@@ -1,626 +0,0 @@
-/*
- * Copyright (c) 2008-2012, 2015, 2019 Eike Stepper (Loehne, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- * Teerawat Chaiyakijpichet (No Magic Asia Ltd.) - SSL
- */
-package org.eclipse.net4j.tests;
-
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.buffer.IBufferPool;
-import org.eclipse.net4j.channel.IChannel;
-import org.eclipse.net4j.connector.ConnectorException;
-import org.eclipse.net4j.connector.IConnector;
-import org.eclipse.net4j.internal.tcp.TCPAcceptor;
-import org.eclipse.net4j.internal.tcp.TCPAcceptorFactory;
-import org.eclipse.net4j.internal.tcp.TCPClientConnector;
-import org.eclipse.net4j.internal.tcp.TCPConnector;
-import org.eclipse.net4j.internal.tcp.TCPConnectorFactory;
-import org.eclipse.net4j.internal.tcp.TCPSelector;
-import org.eclipse.net4j.internal.tcp.ssl.SSLAcceptor;
-import org.eclipse.net4j.internal.tcp.ssl.SSLAcceptorFactory;
-import org.eclipse.net4j.internal.tcp.ssl.SSLClientConnector;
-import org.eclipse.net4j.internal.tcp.ssl.SSLConnectorFactory;
-import org.eclipse.net4j.tcp.ITCPSelector;
-import org.eclipse.net4j.tcp.TCPUtil;
-import org.eclipse.net4j.tests.bundle.OM;
-import org.eclipse.net4j.util.collection.RoundRobinBlockingQueue;
-import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
-import org.eclipse.net4j.util.concurrent.ThreadPool;
-import org.eclipse.net4j.util.io.IOUtil;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import org.eclipse.net4j.util.security.ChallengeNegotiator;
-import org.eclipse.net4j.util.security.NegotiationException;
-import org.eclipse.net4j.util.security.PasswordCredentials;
-import org.eclipse.net4j.util.security.PasswordCredentialsProvider;
-import org.eclipse.net4j.util.security.Randomizer;
-import org.eclipse.net4j.util.security.ResponseNegotiator;
-import org.eclipse.net4j.util.security.UserManager;
-
-import org.eclipse.spi.net4j.Channel;
-import org.eclipse.spi.net4j.InternalChannel;
-
-import java.nio.channels.ServerSocketChannel;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.ExecutorService;
-
-/**
- * @author Eike Stepper
- * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
- */
-public class TCPConnectorTest extends AbstractTransportTest
-{
- private static final int TIMEOUT = 10000;
-
- private static final int PORT = 2040;
-
- private static final String USER_ID = "stepper"; //$NON-NLS-1$
-
- private static final String INVALID_USER_ID = "invalid"; //$NON-NLS-1$
-
- private static final char[] PASSWORD = "eike2008".toCharArray(); //$NON-NLS-1$
-
- private static final char[] INVALID_PASSWORD = "invalid".toCharArray(); //$NON-NLS-1$
-
- private static final PasswordCredentials CREDENTIALS = new PasswordCredentials(USER_ID, PASSWORD);
-
- private ExecutorService threadPool;
-
- private IBufferPool bufferPool;
-
- private TCPSelector selector;
-
- private TCPAcceptor acceptor;
-
- private TCPConnector connector;
-
- private Randomizer randomizer;
-
- private UserManager userManager;
-
- private ChallengeNegotiator challengeNegotiator;
-
- private PasswordCredentialsProvider credentialsProvider;
-
- private ResponseNegotiator responseNegotiator;
-
- @Override
- protected void doTearDown() throws Exception
- {
- cleanup();
- super.doTearDown();
- }
-
- private void cleanup() throws Exception
- {
- sleep(100);
-
- if (connector != null)
- {
- connector.close();
- connector = null;
- }
-
- if (responseNegotiator != null)
- {
- LifecycleUtil.deactivate(responseNegotiator);
- responseNegotiator = null;
- }
-
- if (credentialsProvider != null)
- {
- LifecycleUtil.deactivate(credentialsProvider);
- credentialsProvider = null;
- }
-
- if (acceptor != null)
- {
- acceptor.close();
- acceptor = null;
- }
-
- if (challengeNegotiator != null)
- {
- LifecycleUtil.deactivate(challengeNegotiator);
- challengeNegotiator = null;
- }
-
- if (userManager != null)
- {
- LifecycleUtil.deactivate(userManager);
- userManager = null;
- }
-
- if (randomizer != null)
- {
- LifecycleUtil.deactivate(randomizer);
- randomizer = null;
- }
-
- if (selector != null)
- {
- LifecycleUtil.deactivate(selector);
- selector = null;
- }
-
- if (bufferPool != null)
- {
- LifecycleUtil.deactivate(bufferPool);
- bufferPool = null;
- }
-
- if (threadPool != null)
- {
- LifecycleUtil.deactivate(threadPool);
- threadPool = null;
- }
- }
-
- private void provideTransport()
- {
- selector = new TCPSelector();
-
- if (useSSLTransport())
- {
- acceptor = new SSLAcceptor();
- container.putElement(SSLAcceptorFactory.PRODUCT_GROUP, SSLAcceptorFactory.TYPE, null, acceptor);
-
- // cannot use same container with the acceptor.
- connector = new SSLClientConnector();
- separateContainer.putElement(SSLConnectorFactory.PRODUCT_GROUP, SSLConnectorFactory.TYPE, null, acceptor);
- }
- else
- {
- acceptor = new TCPAcceptor();
- container.putElement(TCPAcceptorFactory.PRODUCT_GROUP, TCPUtil.FACTORY_TYPE, null, acceptor);
-
- connector = new TCPClientConnector();
- container.putElement(TCPConnectorFactory.PRODUCT_GROUP, TCPConnectorFactory.TYPE, null, acceptor);
- }
- }
-
- private void provideTransport(final long increaseDelayAcceptor)
- {
- selector = new TCPSelector();
-
- if (useSSLTransport())
- {
- acceptor = new SSLAcceptor()
- {
- @Override
- public void handleAccept(ITCPSelector selector, ServerSocketChannel serverSocketChannel)
- {
- ConcurrencyUtil.sleep(increaseDelayAcceptor);
- super.handleAccept(selector, serverSocketChannel);
- }
- };
-
- connector = new SSLClientConnector();
- }
- else
- {
- acceptor = new TCPAcceptor()
- {
- @Override
- public void handleAccept(ITCPSelector selector, ServerSocketChannel serverSocketChannel)
- {
- ConcurrencyUtil.sleep(increaseDelayAcceptor);
- super.handleAccept(selector, serverSocketChannel);
- }
- };
-
- connector = new TCPClientConnector();
- }
- }
-
- public void testDeferredActivation() throws Exception
- {
- final long DELAY = 500L;
- threadPool = ThreadPool.create();
- bufferPool = Net4jUtil.createBufferPool();
- LifecycleUtil.activate(bufferPool);
-
- provideTransport(DELAY);
-
- selector.activate();
-
- acceptor.setStartSynchronously(true);
- acceptor.setSynchronousStartTimeout(TIMEOUT);
- acceptor.getConfig().setBufferProvider(bufferPool);
- acceptor.getConfig().setReceiveExecutor(threadPool);
- acceptor.setSelector(selector);
- acceptor.setAddress("0.0.0.0"); //$NON-NLS-1$
- acceptor.setPort(PORT);
- acceptor.activate();
-
- connector.getConfig().setBufferProvider(bufferPool);
- connector.getConfig().setReceiveExecutor(threadPool);
- connector.setSelector(selector);
- connector.setHost("localhost"); //$NON-NLS-1$
- connector.setPort(PORT);
- connector.activate();
- // Can fail due to timing variations: assertEquals(false, connector.isActive());
-
- connector.waitForConnection(DEFAULT_TIMEOUT);
- assertEquals(true, connector.isActive());
- }
-
- public void testDeferredActivation10() throws Exception
- {
- for (int i = 0; i < 10; i++)
- {
- IOUtil.OUT().println();
- IOUtil.OUT().println();
- IOUtil.OUT().println();
- IOUtil.OUT().println("#####################################################"); //$NON-NLS-1$
- IOUtil.OUT().println(" RUN = " + i); //$NON-NLS-1$
- IOUtil.OUT().println("#####################################################"); //$NON-NLS-1$
- IOUtil.OUT().println();
- IOUtil.OUT().println();
- IOUtil.OUT().println();
- testDeferredActivation();
- cleanup();
- }
- }
-
- public void testNegotiationSuccess() throws Exception
- {
- threadPool = ThreadPool.create();
- bufferPool = Net4jUtil.createBufferPool();
- LifecycleUtil.activate(bufferPool);
-
- randomizer = new Randomizer();
- randomizer.activate();
-
- userManager = new UserManager();
- userManager.activate();
- userManager.addUser(USER_ID, PASSWORD);
-
- challengeNegotiator = new ChallengeNegotiator();
- challengeNegotiator.setRandomizer(randomizer);
- challengeNegotiator.setUserManager(userManager);
- challengeNegotiator.activate();
-
- provideTransport();
-
- selector.activate();
-
- acceptor.setStartSynchronously(true);
- acceptor.setSynchronousStartTimeout(TIMEOUT);
- acceptor.getConfig().setBufferProvider(bufferPool);
- acceptor.getConfig().setReceiveExecutor(threadPool);
- acceptor.getConfig().setNegotiator(challengeNegotiator);
- acceptor.setSelector(selector);
- acceptor.setAddress("0.0.0.0"); //$NON-NLS-1$
- acceptor.setPort(PORT);
- acceptor.activate();
-
- credentialsProvider = new PasswordCredentialsProvider(CREDENTIALS);
- LifecycleUtil.activate(credentialsProvider);
-
- responseNegotiator = new ResponseNegotiator();
- responseNegotiator.setCredentialsProvider(credentialsProvider);
- responseNegotiator.activate();
-
- connector.getConfig().setBufferProvider(bufferPool);
- connector.getConfig().setReceiveExecutor(threadPool);
- connector.getConfig().setNegotiator(responseNegotiator);
- connector.setSelector(selector);
- connector.setHost("localhost"); //$NON-NLS-1$
- connector.setPort(PORT);
- connector.activate();
-
- connector.waitForConnection(DEFAULT_TIMEOUT);
-
- InternalChannel clientChannel = connector.openChannel();
- assertEquals(USER_ID, clientChannel.getUserID());
-
- IConnector serverConnector = acceptor.getElements()[0];
- IChannel serverChannel = serverConnector.getElements()[0];
- assertEquals(USER_ID, serverChannel.getUserID());
-
- System.out.println(serverChannel);
- }
-
- public void testNegotiationSuccess10() throws Exception
- {
- for (int i = 0; i < 10; i++)
- {
- IOUtil.OUT().println();
- IOUtil.OUT().println();
- IOUtil.OUT().println();
- IOUtil.OUT().println("#####################################################"); //$NON-NLS-1$
- IOUtil.OUT().println(" RUN = " + i); //$NON-NLS-1$
- IOUtil.OUT().println("#####################################################"); //$NON-NLS-1$
- IOUtil.OUT().println();
- IOUtil.OUT().println();
- IOUtil.OUT().println();
- testNegotiationSuccess();
- cleanup();
- }
- }
-
- public void testInvalidUser() throws Exception
- {
- threadPool = ThreadPool.create();
- bufferPool = Net4jUtil.createBufferPool();
- LifecycleUtil.activate(bufferPool);
-
- randomizer = new Randomizer();
- randomizer.activate();
-
- userManager = new UserManager();
- userManager.activate();
- userManager.addUser(INVALID_USER_ID, PASSWORD);
-
- challengeNegotiator = new ChallengeNegotiator();
- challengeNegotiator.setRandomizer(randomizer);
- challengeNegotiator.setUserManager(userManager);
- challengeNegotiator.activate();
-
- provideTransport();
-
- selector.activate();
-
- acceptor.setStartSynchronously(true);
- acceptor.setSynchronousStartTimeout(TIMEOUT);
- acceptor.getConfig().setBufferProvider(bufferPool);
- acceptor.getConfig().setReceiveExecutor(threadPool);
- acceptor.getConfig().setNegotiator(challengeNegotiator);
- acceptor.setSelector(selector);
- acceptor.setAddress("0.0.0.0"); //$NON-NLS-1$
- acceptor.setPort(PORT);
- acceptor.activate();
-
- credentialsProvider = new PasswordCredentialsProvider(CREDENTIALS);
- LifecycleUtil.activate(credentialsProvider);
-
- responseNegotiator = new ResponseNegotiator();
- responseNegotiator.setCredentialsProvider(credentialsProvider);
- responseNegotiator.activate();
-
- connector.getConfig().setBufferProvider(bufferPool);
- connector.getConfig().setReceiveExecutor(threadPool);
- connector.getConfig().setNegotiator(responseNegotiator);
- connector.setSelector(selector);
- connector.setHost("localhost"); //$NON-NLS-1$
- connector.setPort(PORT);
-
- try
- {
- connector.connectAsync();
- connector.waitForConnection(DEFAULT_TIMEOUT_EXPECTED);
- fail("ConnectorException expected"); //$NON-NLS-1$
- }
- catch (ConnectorException ex)
- {
- OM.LOG.info("Expected ConnectorException:", ex); //$NON-NLS-1$
- assertEquals(true, ex.getCause() instanceof NegotiationException);
- }
- }
-
- public void testInvalidPassword() throws Exception
- {
- threadPool = ThreadPool.create();
- bufferPool = Net4jUtil.createBufferPool();
- LifecycleUtil.activate(bufferPool);
-
- randomizer = new Randomizer();
- randomizer.activate();
-
- userManager = new UserManager();
- userManager.activate();
- userManager.addUser(USER_ID, INVALID_PASSWORD);
-
- challengeNegotiator = new ChallengeNegotiator();
- challengeNegotiator.setRandomizer(randomizer);
- challengeNegotiator.setUserManager(userManager);
- challengeNegotiator.activate();
-
- provideTransport();
-
- selector.activate();
-
- acceptor.setStartSynchronously(true);
- acceptor.setSynchronousStartTimeout(TIMEOUT);
- acceptor.getConfig().setBufferProvider(bufferPool);
- acceptor.getConfig().setReceiveExecutor(threadPool);
- acceptor.getConfig().setNegotiator(challengeNegotiator);
- acceptor.setSelector(selector);
- acceptor.setAddress("0.0.0.0"); //$NON-NLS-1$
- acceptor.setPort(PORT);
- acceptor.activate();
-
- credentialsProvider = new PasswordCredentialsProvider(CREDENTIALS);
- LifecycleUtil.activate(credentialsProvider);
-
- responseNegotiator = new ResponseNegotiator();
- responseNegotiator.setCredentialsProvider(credentialsProvider);
- responseNegotiator.activate();
-
- connector.getConfig().setBufferProvider(bufferPool);
- connector.getConfig().setReceiveExecutor(threadPool);
- connector.getConfig().setNegotiator(responseNegotiator);
- connector.setSelector(selector);
- connector.setHost("localhost"); //$NON-NLS-1$
- connector.setPort(PORT);
-
- try
- {
- connector.connectAsync();
- connector.waitForConnection(DEFAULT_TIMEOUT_EXPECTED);
- fail("ConnectorException expected"); //$NON-NLS-1$
- }
- catch (ConnectorException ex)
- {
- OM.LOG.info("Expected ConnectorException:", ex); //$NON-NLS-1$
- assertEquals(true, ex.getCause() instanceof NegotiationException);
- }
- }
-
- public void testNoNegotiator() throws Exception
- {
- threadPool = ThreadPool.create();
- bufferPool = Net4jUtil.createBufferPool();
- LifecycleUtil.activate(bufferPool);
-
- provideTransport();
-
- selector.activate();
-
- acceptor.setStartSynchronously(true);
- acceptor.setSynchronousStartTimeout(TIMEOUT);
- acceptor.getConfig().setBufferProvider(bufferPool);
- acceptor.getConfig().setReceiveExecutor(threadPool);
- acceptor.setSelector(selector);
- acceptor.setAddress("0.0.0.0"); //$NON-NLS-1$
- acceptor.setPort(PORT);
- acceptor.activate();
-
- connector.getConfig().setBufferProvider(bufferPool);
- connector.getConfig().setReceiveExecutor(threadPool);
- connector.setSelector(selector);
- connector.setHost("localhost"); //$NON-NLS-1$
- connector.setPort(PORT);
- connector.setUserID("SHOULD_FAIL_LATER"); //$NON-NLS-1$
-
- try
- {
- connector.connect();
- fail("ConnectorException expected"); //$NON-NLS-1$
- }
- catch (ConnectorException ex)
- {
- OM.LOG.info("Expected ConnectorException:", ex); //$NON-NLS-1$
- assertEquals(true, ex.getCause() instanceof IllegalStateException);
- }
- }
-
- public void testNegotiatorTooLate() throws Exception
- {
- threadPool = ThreadPool.create();
- bufferPool = Net4jUtil.createBufferPool();
- LifecycleUtil.activate(bufferPool);
-
- provideTransport();
-
- selector.activate();
-
- acceptor.setStartSynchronously(true);
- acceptor.setSynchronousStartTimeout(TIMEOUT);
- acceptor.getConfig().setBufferProvider(bufferPool);
- acceptor.getConfig().setReceiveExecutor(threadPool);
- acceptor.setSelector(selector);
- acceptor.setAddress("0.0.0.0"); //$NON-NLS-1$
- acceptor.setPort(PORT);
- acceptor.activate();
-
- connector.getConfig().setBufferProvider(bufferPool);
- connector.getConfig().setReceiveExecutor(threadPool);
- connector.setSelector(selector);
- connector.setHost("localhost"); //$NON-NLS-1$
- connector.setPort(PORT);
- connector.connect();
-
- credentialsProvider = new PasswordCredentialsProvider(CREDENTIALS);
- LifecycleUtil.activate(credentialsProvider);
-
- responseNegotiator = new ResponseNegotiator();
- responseNegotiator.setCredentialsProvider(credentialsProvider);
- responseNegotiator.activate();
-
- try
- {
- connector.getConfig().setNegotiator(responseNegotiator);
- fail("IllegalStateException expected"); //$NON-NLS-1$
- }
- catch (IllegalStateException ex)
- {
- OM.LOG.info("Expected IllegalStateException:", ex); //$NON-NLS-1$
- }
- }
-
- public void testRoundRobinBlockingQueue() throws Exception
- {
- BlockingQueue<IChannel> queue = new RoundRobinBlockingQueue<>();
-
- Channel[] channels = new Channel[3];
-
- for (int i = 0; i < channels.length; i++)
- {
- Channel c = new Channel();
- c.setID((short)i);
- channels[i] = c;
- }
-
- assertEquals(true, queue.isEmpty());
- assertNull(queue.peek());
- assertNull(queue.poll());
-
- // Order will be 0000...1111...2222...
- for (int i = 0; i < channels.length; i++)
- {
- for (int j = 0; j < 10; j++)
- {
- queue.put(channels[i]);
- }
- }
-
- for (int i = 0; i < 30; i++)
- {
- IChannel peek1 = queue.peek();
- IChannel peek2 = queue.peek();
- assertSame(peek1, peek2);
-
- IChannel poll = queue.poll();
- // The order should be 012012012012...
- assertEquals(i % 3, poll.getID());
- assertSame(peek1, poll);
- }
-
- assertEquals(true, queue.isEmpty());
- assertNull(queue.peek());
- assertNull(queue.poll());
- }
-
- /**
- * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
- */
- public static final class TCP extends TCPConnectorTest
- {
- @Override
- protected boolean useJVMTransport()
- {
- return false;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return false;
- }
- }
-
- /**
- * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
- */
- public static final class SSL extends TCPConnectorTest
- {
- @Override
- protected boolean useJVMTransport()
- {
- return false;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return true;
- }
- }
-}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TransportTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TransportTest.java
index 95e096c9dc..fd6c2642c4 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TransportTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TransportTest.java
@@ -11,24 +11,25 @@
*/
package org.eclipse.net4j.tests;
-import org.eclipse.net4j.Net4jUtil;
+import org.eclipse.net4j.ITransportConfigAware;
import org.eclipse.net4j.buffer.IBuffer;
import org.eclipse.net4j.buffer.IBufferProvider;
+import org.eclipse.net4j.channel.ChannelException;
import org.eclipse.net4j.channel.ChannelInputStream;
import org.eclipse.net4j.channel.ChannelOutputStream;
import org.eclipse.net4j.channel.IChannel;
import org.eclipse.net4j.connector.IConnector;
+import org.eclipse.net4j.tests.config.AbstractConfigTest;
import org.eclipse.net4j.tests.data.HugeData;
import org.eclipse.net4j.util.container.IContainerDelta;
import org.eclipse.net4j.util.container.IContainerEvent;
import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.net4j.util.event.IListener;
-import org.eclipse.net4j.util.factory.IFactory;
import org.eclipse.net4j.util.factory.ProductCreationException;
import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.spi.net4j.ClientProtocolFactory;
-import org.eclipse.spi.net4j.Connector;
+import org.eclipse.spi.net4j.InternalChannelMultiplexer;
import org.eclipse.spi.net4j.Protocol;
import org.eclipse.spi.net4j.ServerProtocolFactory;
@@ -46,64 +47,25 @@ import java.util.concurrent.TimeUnit;
/**
* @author Eike Stepper
*/
-public abstract class TransportTest extends AbstractProtocolTest
+public class TransportTest extends AbstractConfigTest
{
public TransportTest()
{
}
- @Override
- protected abstract boolean useJVMTransport();
-
protected IBuffer provideBuffer()
{
return provideBuffer(null);
}
- protected IBuffer provideBuffer(IConnector iConnector)
- {
- IBuffer buffer = null;
- if (!useJVMTransport() && useSSLTransport())
- {
- // cannot use buffer provider from net4j need to use SSL Buffer inside the SSLConnector.
- buffer = ((Connector)iConnector).provideBuffer();
- }
- else
- {
- IBufferProvider bufferProvider = Net4jUtil.getBufferProvider(container);
- buffer = bufferProvider.provideBuffer();
- }
-
- return buffer;
- }
-
- private void registerClientFactory(IFactory factory)
+ protected IBuffer provideBuffer(IConnector connector)
{
- if (!useJVMTransport() && useSSLTransport())
- {
- // need separate container between client and server for SSL.
- separateContainer.registerFactory(factory);
- }
- else
- {
- container.registerFactory(factory);
- }
+ return ((InternalChannelMultiplexer)connector).provideBuffer();
}
- protected IBufferProvider provideBufferProvider(IConnector iConnector)
+ protected IBufferProvider provideBufferProvider(IConnector connector)
{
- IBufferProvider bufferProvider = null;
- if (!useJVMTransport() && useSSLTransport())
- {
- // cannot use buffer provider from net4j need to use SSL Buffer inside the SSLConnector.
- bufferProvider = ((Connector)iConnector).getConfig().getBufferProvider();
- }
- else
- {
- bufferProvider = Net4jUtil.getBufferProvider(container);
- }
-
- return bufferProvider;
+ return ((ITransportConfigAware)connector).getConfig().getBufferProvider();
}
public void testConnect() throws Exception
@@ -114,11 +76,11 @@ public abstract class TransportTest extends AbstractProtocolTest
public void testSendBuffer() throws Exception
{
startTransport();
- IConnector connecter = getConnector();
- IChannel channel = connecter.openChannel();
+ IConnector connector = getConnector();
+ IChannel channel = connector.openChannel();
for (int i = 0; i < 3; i++)
{
- IBuffer buffer = provideBuffer(connecter);
+ IBuffer buffer = provideBuffer(connector);
ByteBuffer byteBuffer = buffer.startPutting(channel.getID());
byteBuffer.putInt(1970);
@@ -129,25 +91,31 @@ public abstract class TransportTest extends AbstractProtocolTest
public void testSendEmptyBuffer() throws Exception
{
startTransport();
- IConnector connecter = getConnector();
- IChannel channel = connecter.openChannel();
+ IConnector connector = getConnector();
+ IChannel channel = connector.openChannel();
for (int i = 0; i < 3; i++)
{
- IBuffer buffer = provideBuffer(connecter);
+ IBuffer buffer = provideBuffer(connector);
buffer.startPutting(channel.getID());
channel.sendBuffer(buffer);
}
}
- public void testSendEmptyBuffer2() throws Exception
+ public void testSendEmptyBufferWithoutStartPutting() throws Exception
{
startTransport();
- IConnector connecter = getConnector();
- IChannel channel = connecter.openChannel();
- for (int i = 0; i < 3; i++)
+ IConnector connector = getConnector();
+ IChannel channel = connector.openChannel();
+ IBuffer buffer = provideBuffer(connector);
+
+ try
{
- IBuffer buffer = provideBuffer(connecter);
channel.sendBuffer(buffer);
+ fail("ChannelException expected because buffer is not in state PUTTING");
+ }
+ catch (ChannelException expected)
+ {
+ // SUCCESS
}
}
@@ -155,15 +123,14 @@ public abstract class TransportTest extends AbstractProtocolTest
{
final int COUNT = 3;
final CountDownLatch counter = new CountDownLatch(COUNT);
- container.registerFactory(new TestProtocol.ServerFactory(counter));
- // need to handle about separating container between client and server for SSL.
- registerClientFactory(new TestProtocol.ClientFactory());
+ acceptorContainer.registerFactory(new TestProtocol.ServerFactory(counter));
+ connectorContainer.registerFactory(new TestProtocol.ClientFactory());
startTransport();
- IConnector iConnecter = getConnector();
- IChannel channel = iConnecter.openChannel(TestProtocol.ClientFactory.TYPE, null);
+ IConnector connector = getConnector();
+ IChannel channel = connector.openChannel(TransportTest.TestProtocol.TYPE, null);
for (int i = 0; i < COUNT; i++)
{
- IBuffer buffer = provideBuffer(iConnecter);
+ IBuffer buffer = provideBuffer(connector);
ByteBuffer byteBuffer = buffer.startPutting(channel.getID());
byteBuffer.putInt(1970);
channel.sendBuffer(buffer);
@@ -177,43 +144,47 @@ public abstract class TransportTest extends AbstractProtocolTest
{
final int COUNT = 3;
final CountDownLatch counter = new CountDownLatch(COUNT);
- container.registerFactory(new TestProtocol.ServerFactory(counter));
- // need to handle about separating container between client and server for SSL.
- registerClientFactory(new TestProtocol.ClientFactory());
+ acceptorContainer.registerFactory(new TestProtocol.ServerFactory(counter));
+ connectorContainer.registerFactory(new TestProtocol.ClientFactory());
startTransport();
- IConnector connecter = getConnector();
- IChannel channel = connecter.openChannel(TestProtocol.ClientFactory.TYPE, null);
+ IConnector connector = getConnector();
+ IChannel channel = connector.openChannel(TransportTest.TestProtocol.TYPE, null);
for (int i = 0; i < COUNT; i++)
{
- IBuffer buffer = provideBuffer(connecter);
+ IBuffer buffer = provideBuffer(connector);
buffer.startPutting(channel.getID());
channel.sendBuffer(buffer);
- sleep(50);
}
+ sleep(100);
+
+ // Assert that no buffer was received.
assertEquals(COUNT, counter.getCount());
}
- public void testHandleEmptyBuffer2() throws Exception
+ public void testHandleEmptyBufferWithEOS() throws Exception
{
final int COUNT = 3;
final CountDownLatch counter = new CountDownLatch(COUNT);
- container.registerFactory(new TestProtocol.ServerFactory(counter));
- // need to handle about separating container between client and server for SSL.
- registerClientFactory(new TestProtocol.ClientFactory());
+ acceptorContainer.registerFactory(new TestProtocol.ServerFactory(counter));
+ connectorContainer.registerFactory(new TestProtocol.ClientFactory());
startTransport();
- IConnector connecter = getConnector();
- IChannel channel = connecter.openChannel(TestProtocol.ClientFactory.TYPE, null);
+ IConnector connector = getConnector();
+ IChannel channel = connector.openChannel(TransportTest.TestProtocol.TYPE, null);
for (int i = 0; i < COUNT; i++)
{
- IBuffer buffer = provideBuffer(connecter);
+ IBuffer buffer = provideBuffer(connector);
+ buffer.startPutting(channel.getID());
+ buffer.setEOS(true);
channel.sendBuffer(buffer);
- sleep(50);
}
- assertEquals(COUNT, counter.getCount());
+ sleep(100);
+
+ // Assert that all buffers were received.
+ assertEquals(0, counter.getCount());
}
public void testStreaming() throws Exception
@@ -268,7 +239,7 @@ public abstract class TransportTest extends AbstractProtocolTest
String line;
while ((line = reader.readLine()) != null)
{
- msg(line);
+ System.out.println(line);
}
isr.close();
@@ -501,9 +472,11 @@ public abstract class TransportTest extends AbstractProtocolTest
*/
public static final class TestProtocol extends Protocol<CountDownLatch>
{
+ public static final String TYPE = "test.protocol"; //$NON-NLS-1$
+
public TestProtocol(CountDownLatch counter)
{
- super(ServerFactory.TYPE);
+ super(TestProtocol.TYPE);
setInfraStructure(counter);
}
@@ -520,8 +493,6 @@ public abstract class TransportTest extends AbstractProtocolTest
*/
public static class ServerFactory extends ServerProtocolFactory
{
- public static final String TYPE = "test.protocol"; //$NON-NLS-1$
-
private CountDownLatch counter;
public ServerFactory(CountDownLatch counter)
@@ -542,8 +513,6 @@ public abstract class TransportTest extends AbstractProtocolTest
*/
public static class ClientFactory extends ClientProtocolFactory
{
- public static final String TYPE = ServerFactory.TYPE;
-
public ClientFactory()
{
super(TYPE);
@@ -556,58 +525,4 @@ public abstract class TransportTest extends AbstractProtocolTest
}
}
}
-
- /**
- * @author Eike Stepper
- */
- public static final class TCP extends TransportTest
- {
- @Override
- protected boolean useJVMTransport()
- {
- return false;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return false;
- }
- }
-
- /**
- * @author Eike Stepper
- */
- public static final class JVM extends TransportTest
- {
- @Override
- protected boolean useJVMTransport()
- {
- return true;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return false;
- }
- }
-
- /**
- * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
- */
- public static final class SSL extends TransportTest
- {
- @Override
- protected boolean useJVMTransport()
- {
- return false;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return true;
- }
- }
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_241463_Test.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_241463_Test.java
index 83a703c7e2..9719d35202 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_241463_Test.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_241463_Test.java
@@ -11,7 +11,6 @@
*/
package org.eclipse.net4j.tests.bugzilla;
-import org.eclipse.net4j.Net4jUtil;
import org.eclipse.net4j.internal.jvm.JVMAcceptor;
import org.eclipse.net4j.internal.jvm.JVMAcceptorFactory;
import org.eclipse.net4j.internal.jvm.JVMClientConnector;
@@ -22,15 +21,14 @@ import org.eclipse.net4j.internal.tcp.TCPServerConnector;
import org.eclipse.net4j.internal.tcp.ssl.SSLAcceptor;
import org.eclipse.net4j.internal.tcp.ssl.SSLAcceptorFactory;
import org.eclipse.net4j.internal.tcp.ssl.SSLServerConnector;
-import org.eclipse.net4j.jvm.JVMUtil;
+import org.eclipse.net4j.internal.ws.WSAcceptor;
+import org.eclipse.net4j.internal.ws.WSAcceptorFactory;
+import org.eclipse.net4j.internal.ws.WSServerConnector;
import org.eclipse.net4j.tcp.ITCPAcceptor;
import org.eclipse.net4j.tcp.ITCPSelector;
-import org.eclipse.net4j.tcp.TCPUtil;
-import org.eclipse.net4j.tcp.ssl.SSLUtil;
-import org.eclipse.net4j.tests.AbstractTransportTest;
+import org.eclipse.net4j.tests.config.AbstractConfigTest;
import org.eclipse.net4j.tests.signal.TestSignalProtocol;
import org.eclipse.net4j.util.container.IManagedContainer;
-import org.eclipse.net4j.util.container.ManagedContainer;
import org.eclipse.spi.net4j.InternalChannel;
@@ -43,22 +41,16 @@ import java.nio.channels.SocketChannel;
*
* @author Eike Stepper
*/
-public class Bugzilla_241463_Test extends AbstractTransportTest
+public class Bugzilla_241463_Test extends AbstractConfigTest
{
@Override
protected IManagedContainer createContainer()
{
- IManagedContainer container = new ManagedContainer();
- Net4jUtil.prepareContainer(container);
- JVMUtil.prepareContainer(container);
- TCPUtil.prepareContainer(container);
- SSLUtil.prepareContainer(container);
-
+ IManagedContainer container = super.createContainer();
container.registerFactory(new FakeJVMAcceptorFactory());
container.registerFactory(new FakeTCPAcceptorFactory());
container.registerFactory(new FakeSSLAcceptorFactory());
-
- container.registerFactory(new TestSignalProtocol.Factory());
+ container.registerFactory(new FakeWSAcceptorFactory());
return container;
}
@@ -99,8 +91,8 @@ public class Bugzilla_241463_Test extends AbstractTransportTest
}
};
+ prepareConnector(connector);
connector.setName(client.getName());
- connector.setConfig(getConfig());
connector.activate();
addConnector(connector);
return connector;
@@ -197,54 +189,27 @@ public class Bugzilla_241463_Test extends AbstractTransportTest
/**
* @author Eike Stepper
*/
- public static final class JVM extends Bugzilla_241463_Test
- {
- @Override
- protected boolean useJVMTransport()
- {
- return true;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return false;
- }
- }
-
- /**
- * @author Eike Stepper
- */
- public static final class TCP extends Bugzilla_241463_Test
- {
- @Override
- protected boolean useJVMTransport()
- {
- return false;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return false;
- }
- }
-
- /**
- * @author Teerawat Chaiyakijpichet (No Magic Asia Ltd.)
- */
- public static final class SSL extends Bugzilla_241463_Test
+ private static final class FakeWSAcceptorFactory extends WSAcceptorFactory
{
@Override
- protected boolean useJVMTransport()
+ protected WSAcceptor createAcceptor()
{
- return false;
- }
+ return new WSAcceptor()
+ {
+ @Override
+ protected WSServerConnector createConnector()
+ {
+ return new WSServerConnector(this)
+ {
- @Override
- protected boolean useSSLTransport()
- {
- return true;
+ @Override
+ public InternalChannel inverseOpenChannel(short channelID, String protocolID, int protocolVersion)
+ {
+ throw new RuntimeException("Simulated problem"); //$NON-NLS-1$
+ }
+ };
+ }
+ };
}
}
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_259086_Test.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_259086_Test.java
index 3628f32525..3bd2b257cf 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_259086_Test.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_259086_Test.java
@@ -10,31 +10,22 @@
*/
package org.eclipse.net4j.tests.bugzilla;
-import org.eclipse.net4j.Net4jUtil;
import org.eclipse.net4j.connector.IConnector;
-import org.eclipse.net4j.jvm.JVMUtil;
-import org.eclipse.net4j.tcp.TCPUtil;
-import org.eclipse.net4j.tcp.ssl.SSLUtil;
-import org.eclipse.net4j.tests.AbstractTransportTest;
+import org.eclipse.net4j.tests.config.AbstractConfigTest;
import org.eclipse.net4j.tests.signal.TestSignalProtocol;
import org.eclipse.net4j.util.container.IManagedContainer;
-import org.eclipse.net4j.util.container.ManagedContainer;
/**
* @author Eike Stepper
*/
-public class Bugzilla_259086_Test extends AbstractTransportTest
+public class Bugzilla_259086_Test extends AbstractConfigTest
{
private static final int SERVER_PROTOCOL_VERSION = 4711;
@Override
protected IManagedContainer createContainer()
{
- IManagedContainer container = new ManagedContainer();
- Net4jUtil.prepareContainer(container);
- JVMUtil.prepareContainer(container);
- TCPUtil.prepareContainer(container);
- SSLUtil.prepareContainer(container);
+ IManagedContainer container = super.createContainer();
container.registerFactory(new TestSignalProtocol.Factory(SERVER_PROTOCOL_VERSION));
return container;
}
@@ -84,58 +75,4 @@ public class Bugzilla_259086_Test extends AbstractTransportTest
expected.printStackTrace();
}
}
-
- /**
- * @author Eike Stepper
- */
- public static final class JVM extends Bugzilla_259086_Test
- {
- @Override
- protected boolean useJVMTransport()
- {
- return true;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return false;
- }
- }
-
- /**
- * @author Eike Stepper
- */
- public static final class TCP extends Bugzilla_259086_Test
- {
- @Override
- protected boolean useJVMTransport()
- {
- return false;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return false;
- }
- }
-
- /**
- * @author Eike Stepper
- */
- public static final class SSL extends Bugzilla_259086_Test
- {
- @Override
- protected boolean useJVMTransport()
- {
- return false;
- }
-
- @Override
- protected boolean useSSLTransport()
- {
- return true;
- }
- }
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_262875_Test.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_262875_Test.java
index ccd23dacef..1627e8cca3 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_262875_Test.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla_262875_Test.java
@@ -12,6 +12,7 @@
package org.eclipse.net4j.tests.bugzilla;
import org.eclipse.net4j.Net4jUtil;
+import org.eclipse.net4j.buffer.IBuffer;
import org.eclipse.net4j.connector.IConnector;
import org.eclipse.net4j.jvm.JVMUtil;
import org.eclipse.net4j.signal.IndicationWithResponse;
@@ -39,8 +40,10 @@ import java.util.concurrent.atomic.AtomicBoolean;
*/
public class Bugzilla_262875_Test extends AbstractOMTest
{
- /** the length of the metadata sent in a buffer: channelID, correlationID */
- private static final short BUFFER_METADATA_LENTGH = 10;
+ /**
+ * The length of the metadata sent in a buffer: channelID + payloadSize + correlationID + signalID
+ */
+ private static final short BUFFER_METADATA_LENTGH = IBuffer.HEADER_SIZE + Integer.BYTES + Short.BYTES;
private IManagedContainer container;
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/config/AbstractConfigTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/config/AbstractConfigTest.java
new file mode 100644
index 0000000000..ffd52bf742
--- /dev/null
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/config/AbstractConfigTest.java
@@ -0,0 +1,237 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.tests.config;
+
+import org.eclipse.net4j.Net4jUtil;
+import org.eclipse.net4j.acceptor.IAcceptor;
+import org.eclipse.net4j.connector.IConnector;
+import org.eclipse.net4j.connector.IServerConnector;
+import org.eclipse.net4j.tests.config.TestConfig.TCP;
+import org.eclipse.net4j.tests.signal.TestSignalProtocol;
+import org.eclipse.net4j.util.container.ContainerUtil;
+import org.eclipse.net4j.util.container.IManagedContainer;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+import org.eclipse.net4j.util.tests.AbstractOMTest;
+
+import org.eclipse.spi.net4j.InternalAcceptor;
+import org.eclipse.spi.net4j.InternalConnector;
+
+/**
+ * @author Eike Stepper
+ */
+public abstract class AbstractConfigTest extends AbstractOMTest
+{
+ protected TestConfig config;
+
+ protected IManagedContainer acceptorContainer;
+
+ // SSL, the server and client need separate container in order to operate handshake.
+ protected IManagedContainer connectorContainer;
+
+ protected InternalAcceptor acceptor;
+
+ protected InternalConnector connector;
+
+ protected AbstractConfigTest()
+ {
+ }
+
+ protected TestConfig.Factory getDefaultFactory()
+ {
+ return new TCP();
+ }
+
+ public TestConfig getConfig()
+ {
+ return config;
+ }
+
+ public void setConfig(TestConfig config)
+ {
+ this.config = config;
+ }
+
+ @Override
+ public String toString()
+ {
+ return super.toString() + " [" + (config == null ? getDefaultFactory().getClass().getSimpleName() : config) + "]";
+ }
+
+ @Override
+ protected void doSetUp() throws Exception
+ {
+ super.doSetUp();
+
+ if (config == null)
+ {
+ config = getDefaultFactory().createConfig();
+ }
+
+ config.setUp();
+ initContainers();
+ }
+
+ @Override
+ protected void doTearDown() throws Exception
+ {
+ try
+ {
+ sleep(20);
+ LifecycleUtil.deactivate(connectorContainer);
+ LifecycleUtil.deactivate(acceptorContainer);
+ }
+ finally
+ {
+ connector = null;
+ acceptor = null;
+ acceptorContainer = null;
+ connectorContainer = null;
+
+ try
+ {
+ config.tearDown();
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+
+ super.doTearDown();
+ }
+ }
+
+ private void initContainers()
+ {
+ acceptorContainer = createContainer();
+ LifecycleUtil.activate(acceptorContainer);
+
+ if (config.needsSeparateContainers())
+ {
+ // the SSL need separate container between client and server
+ connectorContainer = createContainer();
+ LifecycleUtil.activate(connectorContainer);
+ }
+ else
+ {
+ connectorContainer = acceptorContainer;
+ }
+ }
+
+ protected IManagedContainer createContainer()
+ {
+ IManagedContainer container = ContainerUtil.createContainer();
+ container.registerFactory(new TestSignalProtocol.Factory());
+
+ Net4jUtil.prepareContainer(container);
+ config.prepareContainer(container);
+
+ return container;
+ }
+
+ protected IAcceptor getAcceptor()
+ {
+ return getAcceptor(true);
+ }
+
+ protected IAcceptor getAcceptor(boolean activate)
+ {
+ if (acceptor == null)
+ {
+ acceptor = (InternalAcceptor)config.getAcceptor(acceptorContainer, activate);
+ }
+
+ return acceptor;
+ }
+
+ protected IConnector getConnector()
+ {
+ return getConnector(true);
+ }
+
+ protected IConnector getConnector(boolean activate)
+ {
+ if (connector == null)
+ {
+ connector = (InternalConnector)config.getConnector(connectorContainer, activate);
+ }
+
+ return connector;
+ }
+
+ protected IServerConnector getServerConnector()
+ {
+ if (acceptor != null)
+ {
+ IConnector[] serverConnectors = acceptor.getAcceptedConnectors();
+ if (serverConnectors.length > 1)
+ {
+ throw new IllegalStateException("More than one server connector!");
+ }
+
+ if (connector == null)
+ {
+ if (serverConnectors.length != 0)
+ {
+ throw new IllegalStateException("More is an unexpected server connector!");
+ }
+
+ return null;
+ }
+
+ return (IServerConnector)serverConnectors[0];
+ }
+
+ return null;
+ }
+
+ protected void startTransport() throws Exception
+ {
+ if (acceptorContainer != null)
+ {
+ IAcceptor acceptor = getAcceptor();
+ LifecycleUtil.activate(acceptor);
+
+ if (connectorContainer != null)
+ {
+ IConnector connector = getConnector();
+ LifecycleUtil.activate(connector);
+ }
+ }
+ }
+
+ protected void stopTransport() throws Exception
+ {
+ if (connector != null)
+ {
+ connector.close();
+ connector = null;
+ }
+
+ if (acceptor != null)
+ {
+ acceptor.close();
+ acceptor = null;
+ }
+ }
+
+ protected void restartContainer() throws Exception
+ {
+ msg("RESTARTING CONTAINER"); //$NON-NLS-1$
+ stopTransport();
+
+ LifecycleUtil.deactivate(connectorContainer);
+ LifecycleUtil.deactivate(acceptorContainer);
+ initContainers();
+
+ startTransport();
+ msg("RESTARTING CONTAINER - FINISHED"); //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/config/Net4jTestSuite.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/config/Net4jTestSuite.java
new file mode 100644
index 0000000000..d73c461dad
--- /dev/null
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/config/Net4jTestSuite.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.tests.config;
+
+import org.eclipse.net4j.tests.config.TestConfig.Factory;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.reflect.Constructor;
+import java.util.HashSet;
+import java.util.Set;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+/**
+ * @author Eike Stepper
+ */
+public class Net4jTestSuite extends TestSuite
+{
+ private final Class<? extends Factory>[] configTypes;
+
+ public Net4jTestSuite(String name, @SuppressWarnings("unchecked") Class<? extends Factory>... configTypes)
+ {
+ super(name);
+ this.configTypes = configTypes;
+ }
+
+ @Override
+ public void addTestSuite(Class<? extends TestCase> testClass)
+ {
+ if (AbstractConfigTest.class.isAssignableFrom(testClass))
+ {
+ Set<Class<? extends Factory>> excluded = getExcludedConfigs(testClass);
+ for (Class<? extends Factory> configType : configTypes)
+ {
+ if (excluded.contains(configType))
+ {
+ continue;
+ }
+
+ Constructor<? extends Factory> constructor;
+
+ try
+ {
+ constructor = configType.getConstructor();
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ continue;
+ }
+
+ TestConfig.Factory factory;
+
+ try
+ {
+ factory = constructor.newInstance();
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ continue;
+ }
+
+ addTest(new ConfigTestSuite(testClass, factory));
+ }
+ }
+ else
+ {
+ addTest(new TestSuite(testClass));
+ }
+ }
+
+ public static Set<Class<? extends Factory>> getExcludedConfigs(Class<?> theClass)
+ {
+ Set<Class<? extends Factory>> result = new HashSet<>();
+ Net4jTestSuite.ExcludedConfig[] annotations = theClass.getAnnotationsByType(Net4jTestSuite.ExcludedConfig.class);
+ if (annotations.length > 0)
+ {
+ for (Net4jTestSuite.ExcludedConfig annotation : annotations)
+ {
+ Class<? extends Factory>[] types = annotation.value();
+ for (Class<? extends Factory> type : types)
+ {
+ result.add(type);
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ @Inherited
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(ElementType.TYPE)
+ public @interface ExcludedConfig
+ {
+ Class<? extends TestConfig.Factory>[] value();
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static class ConfigTestSuite extends TestSuite
+ {
+ private final TestConfig.Factory configFactory;
+
+ public ConfigTestSuite(Class<?> theClass, TestConfig.Factory configFactory)
+ {
+ super(theClass);
+ this.configFactory = configFactory;
+ setName(theClass.getName() + " [" + configFactory.getClass().getSimpleName() + "]");
+ }
+
+ @Override
+ public void runTest(Test test, TestResult result)
+ {
+ if (test instanceof AbstractConfigTest)
+ {
+ ((AbstractConfigTest)test).setConfig(configFactory.createConfig());
+ }
+
+ super.runTest(test, result);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/config/TestConfig.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/config/TestConfig.java
new file mode 100644
index 0000000000..4a32a71f09
--- /dev/null
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/config/TestConfig.java
@@ -0,0 +1,341 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.tests.config;
+
+import org.eclipse.net4j.acceptor.IAcceptor;
+import org.eclipse.net4j.connector.IConnector;
+import org.eclipse.net4j.internal.jvm.JVMAcceptorFactory;
+import org.eclipse.net4j.internal.jvm.JVMConnectorFactory;
+import org.eclipse.net4j.internal.tcp.TCPAcceptorFactory;
+import org.eclipse.net4j.internal.tcp.TCPConnector;
+import org.eclipse.net4j.internal.tcp.TCPConnectorFactory;
+import org.eclipse.net4j.internal.tcp.ssl.SSLAcceptorFactory;
+import org.eclipse.net4j.internal.tcp.ssl.SSLConnector;
+import org.eclipse.net4j.internal.tcp.ssl.SSLConnectorFactory;
+import org.eclipse.net4j.internal.ws.WSAcceptorFactory;
+import org.eclipse.net4j.internal.ws.WSConnector;
+import org.eclipse.net4j.internal.ws.WSConnectorFactory;
+import org.eclipse.net4j.jvm.IJVMAcceptor;
+import org.eclipse.net4j.jvm.IJVMConnector;
+import org.eclipse.net4j.jvm.JVMUtil;
+import org.eclipse.net4j.tcp.ITCPAcceptor;
+import org.eclipse.net4j.tcp.ITCPConnector;
+import org.eclipse.net4j.tcp.TCPUtil;
+import org.eclipse.net4j.tcp.ssl.SSLUtil;
+import org.eclipse.net4j.util.container.IManagedContainer;
+import org.eclipse.net4j.util.io.IOUtil;
+import org.eclipse.net4j.ws.IWSAcceptor;
+import org.eclipse.net4j.ws.IWSConnector;
+import org.eclipse.net4j.ws.WSUtil;
+import org.eclipse.net4j.ws.jetty.Net4jWebSocketServlet;
+
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+/**
+ * @author Eike Stepper
+ */
+public abstract class TestConfig
+{
+ public abstract boolean needsSeparateContainers();
+
+ public abstract void prepareContainer(IManagedContainer container);
+
+ public IAcceptor getAcceptor(IManagedContainer container)
+ {
+ return getAcceptor(container, true);
+ }
+
+ public abstract IAcceptor getAcceptor(IManagedContainer container, boolean activate);
+
+ public IConnector getConnector(IManagedContainer container)
+ {
+ return getConnector(container, true);
+ }
+
+ public abstract IConnector getConnector(IManagedContainer container, boolean activate);
+
+ public void closeUnderlyingConnection(IConnector connector) throws IOException
+ {
+ // Underlying connection is unknown on this generic level.
+ // Let subclasses decide if there are special opportunities.
+ connector.close();
+ }
+
+ public void setUp() throws Exception
+ {
+ // Do nothing.
+ }
+
+ public void tearDown() throws Exception
+ {
+ // Do nothing.
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public interface Factory
+ {
+ public TestConfig createConfig();
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static class JVM implements Factory
+ {
+ public static final String NAME = "default";
+
+ @Override
+ public TestConfig createConfig()
+ {
+ return new TestConfig()
+ {
+ @Override
+ public boolean needsSeparateContainers()
+ {
+ return false;
+ }
+
+ @Override
+ public void prepareContainer(IManagedContainer container)
+ {
+ JVMUtil.prepareContainer(container);
+ }
+
+ @Override
+ public IAcceptor getAcceptor(IManagedContainer container, boolean activate)
+ {
+ return (IJVMAcceptor)container.getElement(JVMAcceptorFactory.PRODUCT_GROUP, JVMAcceptorFactory.TYPE, NAME, activate);
+ }
+
+ @Override
+ public IConnector getConnector(IManagedContainer container, boolean activate)
+ {
+ return (IJVMConnector)container.getElement(JVMConnectorFactory.PRODUCT_GROUP, JVMConnectorFactory.TYPE, NAME, activate);
+ }
+
+ @Override
+ public String toString()
+ {
+ return JVM.class.getSimpleName();
+ }
+ };
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static class TCP implements Factory
+ {
+ public static final String HOST = "localhost";
+
+ @Override
+ public TestConfig createConfig()
+ {
+ return new TestConfig()
+ {
+ @Override
+ public boolean needsSeparateContainers()
+ {
+ return false;
+ }
+
+ @Override
+ public void prepareContainer(IManagedContainer container)
+ {
+ TCPUtil.prepareContainer(container);
+ }
+
+ @Override
+ public IAcceptor getAcceptor(IManagedContainer container, boolean activate)
+ {
+ return (ITCPAcceptor)container.getElement(TCPAcceptorFactory.PRODUCT_GROUP, TCPUtil.FACTORY_TYPE, null, activate);
+ }
+
+ @Override
+ public IConnector getConnector(IManagedContainer container, boolean activate)
+ {
+ return (ITCPConnector)container.getElement(TCPConnectorFactory.PRODUCT_GROUP, TCPUtil.FACTORY_TYPE, HOST, activate);
+ }
+
+ @Override
+ public void closeUnderlyingConnection(IConnector connector) throws IOException
+ {
+ ((TCPConnector)connector).getSocketChannel().close();
+ }
+
+ @Override
+ public String toString()
+ {
+ return TCP.class.getSimpleName();
+ }
+ };
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static class SSL implements Factory
+ {
+ public static final String HOST = "localhost";
+
+ static
+ {
+ System.setProperty("org.eclipse.net4j.tcp.ssl.passphrase", "ab987c");
+ System.setProperty("org.eclipse.net4j.tcp.ssl.trust", "file:sslKey/testTrust");
+ System.setProperty("org.eclipse.net4j.tcp.ssl.key", "file:sslKey/testKeys");
+ System.setProperty("check.validity.certificate", "false");
+ // System.setProperty("javax.net.debug", "all");
+ }
+
+ @Override
+ public TestConfig createConfig()
+ {
+ return new TestConfig()
+ {
+ @Override
+ public boolean needsSeparateContainers()
+ {
+ return true;
+ }
+
+ @Override
+ public void prepareContainer(IManagedContainer container)
+ {
+ SSLUtil.prepareContainer(container);
+ }
+
+ @Override
+ public IAcceptor getAcceptor(IManagedContainer container, boolean activate)
+ {
+ return (ITCPAcceptor)container.getElement(TCPAcceptorFactory.PRODUCT_GROUP, SSLAcceptorFactory.TYPE, null, activate);
+ }
+
+ @Override
+ public IConnector getConnector(IManagedContainer container, boolean activate)
+ {
+ return (ITCPConnector)container.getElement(TCPConnectorFactory.PRODUCT_GROUP, SSLConnectorFactory.TYPE, HOST, activate);
+ }
+
+ @Override
+ public void closeUnderlyingConnection(IConnector connector) throws IOException
+ {
+ ((SSLConnector)connector).getSocketChannel().close();
+ }
+
+ @Override
+ public String toString()
+ {
+ return SSL.class.getSimpleName();
+ }
+ };
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static class WS implements Factory
+ {
+ public static final int HTTP_PORT = 8087;
+
+ public static final String SERVICE_URI = "ws://localhost:" + HTTP_PORT + "/net4j";
+
+ public static final String ACCEPTOR_NAME = "default";
+
+ @Override
+ public TestConfig createConfig()
+ {
+ return new TestConfig()
+ {
+ private Server server;
+
+ @Override
+ public boolean needsSeparateContainers()
+ {
+ return false;
+ }
+
+ @Override
+ public void prepareContainer(IManagedContainer container)
+ {
+ WSUtil.prepareContainer(container);
+ }
+
+ @Override
+ public IAcceptor getAcceptor(IManagedContainer container, boolean activate)
+ {
+ return (IWSAcceptor)container.getElement(WSAcceptorFactory.PRODUCT_GROUP, WSUtil.FACTORY_TYPE, ACCEPTOR_NAME, activate);
+ }
+
+ @Override
+ public IConnector getConnector(IManagedContainer container, boolean activate)
+ {
+ try
+ {
+ String description = WSUtil.getConnectorDescription(SERVICE_URI, ACCEPTOR_NAME);
+ return (IWSConnector)container.getElement(WSConnectorFactory.PRODUCT_GROUP, WSUtil.FACTORY_TYPE, description, activate);
+ }
+ catch (URISyntaxException ex)
+ {
+ throw new RuntimeException(ex);
+ }
+ }
+
+ @Override
+ public void closeUnderlyingConnection(IConnector connector) throws IOException
+ {
+ ((WSConnector)connector).getWebSocket().close();
+ }
+
+ @Override
+ public void setUp() throws Exception
+ {
+ IOUtil.OUT().println("Starting Jetty...");
+ server = new Server();
+
+ ServerConnector connector = new ServerConnector(server);
+ connector.setPort(HTTP_PORT);
+ server.addConnector(connector);
+
+ ServletContextHandler handler = new ServletContextHandler(ServletContextHandler.SESSIONS);
+ handler.setContextPath("/");
+ handler.addServlet(new ServletHolder("net4j", Net4jWebSocketServlet.class), "/net4j");
+ server.setHandler(handler);
+ server.start();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ IOUtil.OUT().println("Stopping Jetty...");
+ server.stop();
+ server = null;
+ }
+
+ @Override
+ public String toString()
+ {
+ return WS.class.getSimpleName();
+ }
+ };
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
index bf1c4821a6..51df3f79e0 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
@@ -692,7 +692,7 @@ public abstract class AbstractOMTest extends TestCase
{
if (!LifecycleUtil.isActive(object))
{
- timeOuter.countDown();
+ return;
}
timeOuter.assertNoTimeOut();
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/FastListTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/FastListTest.java
index f3f2a8e204..bff057f297 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/FastListTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/FastListTest.java
@@ -113,9 +113,9 @@ public class FastListTest extends AbstractOMTest
public void testRemoveMiddleOfThree()
{
TestList list = new TestList();
- Integer one = new Integer(1);
- Integer two = new Integer(2);
- Integer three = new Integer(3);
+ Integer one = Integer.valueOf(1);
+ Integer two = Integer.valueOf(2);
+ Integer three = Integer.valueOf(3);
list.add(one);
list.add(two);
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/RoundRobinBlockingQueueTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/RoundRobinBlockingQueueTest.java
new file mode 100644
index 0000000000..29c3538075
--- /dev/null
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/RoundRobinBlockingQueueTest.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2008-2012, 2015 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.util.tests;
+
+import org.eclipse.net4j.channel.IChannel;
+import org.eclipse.net4j.util.collection.RoundRobinBlockingQueue;
+
+import org.eclipse.spi.net4j.Channel;
+
+import java.util.concurrent.BlockingQueue;
+
+/**
+ * @author Eike Stepper
+ */
+public class RoundRobinBlockingQueueTest extends AbstractOMTest
+{
+ public void testRoundRobinBlockingQueue() throws Exception
+ {
+ BlockingQueue<IChannel> queue = new RoundRobinBlockingQueue<IChannel>();
+
+ Channel[] channels = new Channel[3];
+
+ for (int i = 0; i < channels.length; i++)
+ {
+ Channel c = new Channel();
+ c.setID((short)i);
+ channels[i] = c;
+ }
+
+ assertEquals(true, queue.isEmpty());
+ assertNull(queue.peek());
+ assertNull(queue.poll());
+
+ // Order will be 0000...1111...2222...
+ for (int i = 0; i < channels.length; i++)
+ {
+ for (int j = 0; j < 10; j++)
+ {
+ queue.put(channels[i]);
+ }
+ }
+
+ for (int i = 0; i < 30; i++)
+ {
+ IChannel peek1 = queue.peek();
+ IChannel peek2 = queue.peek();
+ assertSame(peek1, peek2);
+
+ IChannel poll = queue.poll();
+ // The order should be 012012012012...
+ assertEquals(i % 3, poll.getID());
+ assertSame(peek1, poll);
+ }
+
+ assertEquals(true, queue.isEmpty());
+ assertNull(queue.peek());
+ assertNull(queue.poll());
+ }
+}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SecurityTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SecurityTest.java
index ee52ef6372..25326b3da1 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SecurityTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SecurityTest.java
@@ -64,13 +64,13 @@ public class SecurityTest extends AbstractOMTest
PeerNegotiationContext challengeContext = new PeerNegotiationContext();
PeerNegotiationContext responseContext = new PeerNegotiationContext();
- // Prepare challenge context
challengeContext.setPeer(responseContext);
+ responseContext.setPeer(challengeContext);
+
+ // Start negotiation threads
Thread challengeThread = new Thread(challengeContext, "challengeThread"); //$NON-NLS-1$
challengeThread.start();
- // Prepare response context
- responseContext.setPeer(challengeContext);
Thread responseThread = new Thread(responseContext, "responseThread"); //$NON-NLS-1$
responseThread.start();
@@ -116,13 +116,13 @@ public class SecurityTest extends AbstractOMTest
PeerNegotiationContext challengeContext = new PeerNegotiationContext();
PeerNegotiationContext responseContext = new PeerNegotiationContext();
- // Prepare challenge context
challengeContext.setPeer(responseContext);
+ responseContext.setPeer(challengeContext);
+
+ // Start negotiation threads
Thread challengeThread = new Thread(challengeContext, "challengeThread"); //$NON-NLS-1$
challengeThread.start();
- // Prepare response context
- responseContext.setPeer(challengeContext);
Thread responseThread = new Thread(responseContext, "responseThread"); //$NON-NLS-1$
responseThread.start();
@@ -158,13 +158,13 @@ public class SecurityTest extends AbstractOMTest
*/
private final class PeerNegotiationContext extends NegotiationContext implements Runnable
{
- private PeerNegotiationContext peer;
+ private final BlockingQueue<ByteBuffer> queue = new LinkedBlockingQueue<>();
- private String userID;
+ private volatile PeerNegotiationContext peer;
- private BlockingQueue<ByteBuffer> queue = new LinkedBlockingQueue<>();
+ private volatile String userID;
- private boolean running;
+ private volatile boolean running;
public PeerNegotiationContext()
{
@@ -226,7 +226,7 @@ public class SecurityTest extends AbstractOMTest
try
{
- buffer = queue.poll(20, TimeUnit.MILLISECONDS);
+ buffer = queue.poll(50, TimeUnit.MILLISECONDS);
}
catch (InterruptedException ex)
{
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SynchronizingCorrelatorTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SynchronizingCorrelatorTest.java
index adb59b2d15..b55f9397b2 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SynchronizingCorrelatorTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SynchronizingCorrelatorTest.java
@@ -13,6 +13,8 @@ package org.eclipse.net4j.util.tests;
import org.eclipse.net4j.util.concurrent.ISynchronizer;
import org.eclipse.net4j.util.concurrent.SynchronizingCorrelator;
+import java.util.concurrent.CountDownLatch;
+
/**
* @author Eike Stepper
*/
@@ -20,30 +22,34 @@ public class SynchronizingCorrelatorTest extends AbstractOMTest
{
public void testPutConsumerFirst() throws Exception
{
+ final SynchronizingCorrelator<String, Boolean> correlator = new SynchronizingCorrelator<String, Boolean>();
+ final CountDownLatch correlationEstablished = new CountDownLatch(1);
final Boolean[] result = { false };
- final SynchronizingCorrelator<String, Boolean> correlator = new SynchronizingCorrelator<>();
+
final Thread consumer = new Thread()
{
@Override
public void run()
{
ISynchronizer<Boolean> eike = correlator.correlate("eike"); //$NON-NLS-1$
+ correlationEstablished.countDown();
+
result[0] = eike.get(5000);
msg("RESULT: " + result[0]); //$NON-NLS-1$
}
};
consumer.start();
- sleep(100);
+ await(correlationEstablished);
correlator.put("eike", true, DEFAULT_TIMEOUT); //$NON-NLS-1$
consumer.join(DEFAULT_TIMEOUT);
assertEquals(Boolean.TRUE, result[0]);
}
- public void testPutConsumerFirst10() throws Exception
+ public void testPutConsumerFirst1000() throws Exception
{
- for (int i = 0; i < 10; i++)
+ for (int i = 0; i < 1000; i++)
{
testPutConsumerFirst();
}
@@ -51,21 +57,25 @@ public class SynchronizingCorrelatorTest extends AbstractOMTest
public void testBlockingPutConsumerFirst() throws Exception
{
+ final SynchronizingCorrelator<String, Boolean> correlator = new SynchronizingCorrelator<String, Boolean>();
+ final CountDownLatch correlationEstablished = new CountDownLatch(1);
final Boolean[] result = { false };
- final SynchronizingCorrelator<String, Boolean> correlator = new SynchronizingCorrelator<>();
+
final Thread consumer = new Thread()
{
@Override
public void run()
{
ISynchronizer<Boolean> eike = correlator.correlate("eike"); //$NON-NLS-1$
+ correlationEstablished.countDown();
+
result[0] = eike.get(5000);
msg("RESULT: " + result[0]); //$NON-NLS-1$
}
};
consumer.start();
- Thread.sleep(10);
+ await(correlationEstablished);
boolean consumed = correlator.put("eike", true, 1000); //$NON-NLS-1$
msg("Consumed: " + consumed); //$NON-NLS-1$
@@ -75,9 +85,9 @@ public class SynchronizingCorrelatorTest extends AbstractOMTest
assertEquals(Boolean.TRUE, result[0]);
}
- public void testBlockingPutConsumerFirst10() throws Exception
+ public void testBlockingPutConsumerFirst1000() throws Exception
{
- for (int i = 0; i < 10; i++)
+ for (int i = 0; i < 1000; i++)
{
testBlockingPutConsumerFirst();
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/cache/Revision.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/cache/Revision.java
index 4ddc929a4d..78d7ba5b64 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/cache/Revision.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/cache/Revision.java
@@ -59,6 +59,7 @@ public class Revision
}
@Override
+ @Deprecated
protected void finalize() throws Throwable
{
IOUtil.ERR().println("FINALIZE " + this); //$NON-NLS-1$
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/RoundRobinBlockingQueue.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/RoundRobinBlockingQueue.java
index 61e81bcb3f..4db8fc3411 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/RoundRobinBlockingQueue.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/RoundRobinBlockingQueue.java
@@ -26,7 +26,7 @@ import java.util.concurrent.TimeUnit;
*/
public class RoundRobinBlockingQueue<E> implements BlockingQueue<E>
{
- private BlockingQueue<Entry<E>> list = new LinkedBlockingQueue<>();
+ private final BlockingQueue<Entry<E>> list = new LinkedBlockingQueue<>();
public RoundRobinBlockingQueue()
{
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/SynchronizingCorrelator.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/SynchronizingCorrelator.java
index 46971bcd50..c67562e418 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/SynchronizingCorrelator.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/SynchronizingCorrelator.java
@@ -18,7 +18,7 @@ import java.util.concurrent.ConcurrentMap;
*/
public class SynchronizingCorrelator<CORRELATION, RESULT> implements ICorrelator<CORRELATION, ISynchronizer<RESULT>>
{
- private ConcurrentMap<CORRELATION, ISynchronizer<RESULT>> map = new ConcurrentHashMap<>(0);
+ private final ConcurrentMap<CORRELATION, ISynchronizer<RESULT>> map = new ConcurrentHashMap<>(0);
/**
* @since 3.0
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/Lifecycle.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/Lifecycle.java
index d6fac6347f..a3991d2699 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/Lifecycle.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/Lifecycle.java
@@ -130,6 +130,8 @@ public class Lifecycle extends Notifier implements ILifecycle, DeferrableActivat
lifecycleState = LifecycleState.INACTIVE;
unlock();
+ // Get listeners again because they could have changed since the first call to getListeners().
+ listeners = getListeners();
if (listeners != null)
{
fireEvent(new LifecycleEvent(this, ILifecycleEvent.Kind.DEACTIVATED), listeners);
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java
index 6250dd5f91..1a0542d257 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java
@@ -234,7 +234,8 @@ public final class LifecycleUtil
{
return ((IDeactivateable)object).deactivate();
}
- else if (object != null && useAnnotation)
+
+ if (object != null && useAnnotation)
{
// TODO Handle evtl. return value (exception)
invokeAnnotation(object, Deactivator.class);
@@ -267,7 +268,8 @@ public final class LifecycleUtil
{
throw (RuntimeException)ex;
}
- else if (ex != null)
+
+ if (ex != null)
{
throw new LifecycleException(ex);
}
diff --git a/plugins/org.eclipse.net4j.ws/.classpath b/plugins/org.eclipse.net4j.ws/.classpath
new file mode 100644
index 0000000000..eca7bdba8f
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.net4j.ws/.options b/plugins/org.eclipse.net4j.ws/.options
new file mode 100644
index 0000000000..fb0da0d5e9
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/.options
@@ -0,0 +1,3 @@
+# Debugging and tracing options
+
+org.eclipse.net4j.ws/debug = true
diff --git a/plugins/org.eclipse.net4j.ws/.project b/plugins/org.eclipse.net4j.ws/.project
new file mode 100644
index 0000000000..183be3a2f6
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/.project
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.net4j.ws</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.oomph.version.VersionBuilder</name>
+ <arguments>
+ <dictionary>
+ <key>check.maven.pom</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>ignore.lower.bound.dependency.ranges</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>release.path</key>
+ <value>/org.eclipse.emf.cdo.releng/versions/release.xml</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ <nature>org.eclipse.oomph.version.VersionNature</nature>
+ </natures>
+ <filteredResources>
+ <filter>
+ <id>1396938000000</id>
+ <name></name>
+ <type>10</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-projectRelativePath-matches-true-false-target</arguments>
+ </matcher>
+ </filter>
+ </filteredResources>
+</projectDescription>
diff --git a/plugins/org.eclipse.net4j.ws/.settings/.api_filters b/plugins/org.eclipse.net4j.ws/.settings/.api_filters
new file mode 100644
index 0000000000..a79409ff71
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/.settings/.api_filters
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.net4j.ws" version="2">
+ <resource path="src/org/eclipse/net4j/ws/IWSConnector.java" type="org.eclipse.net4j.ws.IWSConnector">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="IConnector"/>
+ <message_argument value="IWSConnector"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
diff --git a/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000000..0b2e6360d0
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Mon Jul 04 12:56:34 CEST 2011
+eclipse.preferences.version=1
+
diff --git a/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..5fb3408474
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,452 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch,*.ucls,doc-files/,package.html,package-info.java
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.APILeak=warning
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=ignore
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,HIGH,LOW,LOW,LOW,LOW,LOW
+org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,PERF,MEM,POLISH,@generated NOT,@ADDED
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=2
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=160
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=2
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.jdt.launching.prefs b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.jdt.launching.prefs
new file mode 100644
index 0000000000..556ed07a3c
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.jdt.launching.prefs
@@ -0,0 +1,3 @@
+#Fri Sep 02 05:38:34 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=ignore
diff --git a/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..222aec0421
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,119 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=true
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=true
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=false
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=true
+cleanup.use_this_for_non_static_field_access=true
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=true
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_EMFT
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_EMFT
+formatter_settings_version=12
+org.eclipse.jdt.ui.exception.name=ex
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=org.eclipse.emf.cdo;org.eclipse.emf.internal.cdo;org.eclipse.net4j;org.eclipse.internal.net4j;org.eclipse.emf;org.eclipse;com;org;javax;java;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment"/><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment"/><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment"/><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * Copyright (c) 2004-2018 Eike Stepper (Loehne, Germany) and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n * \r\n * Contributors\:\r\n * Eike Stepper - initial API and implementation\r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author Eike Stepper\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment"/><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment"/><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=false
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=true
+sp_cleanup.use_this_for_non_static_field_access=true
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=true
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.ltk.core.refactoring.prefs b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.ltk.core.refactoring.prefs
new file mode 100644
index 0000000000..864e30fe5d
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.ltk.core.refactoring.prefs
@@ -0,0 +1,3 @@
+#Thu Feb 04 09:44:24 CET 2010
+eclipse.preferences.version=1
+org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.mylyn.tasks.ui.prefs b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 0000000000..b050639a54
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Thu Feb 04 09:44:24 CET 2010
+eclipse.preferences.version=1
+project.repository.kind=bugzilla
+project.repository.url=https\://bugs.eclipse.org/bugs
diff --git a/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.mylyn.team.ui.prefs b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.mylyn.team.ui.prefs
new file mode 100644
index 0000000000..97c11e6725
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Thu Feb 04 09:44:24 CET 2010
+commit.comment.template=[${task.id}] ${task.description}\r\n\r\n${task.url}
+eclipse.preferences.version=1
diff --git a/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.pde.api.tools.prefs b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.pde.api.tools.prefs
new file mode 100644
index 0000000000..0c17d59e45
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.pde.api.tools.prefs
@@ -0,0 +1,95 @@
+#Thu Feb 04 09:44:24 CET 2010
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Ignore
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Error
+MISSING_EE_DESCRIPTIONS=Warning
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Ignore
+automatically_removed_unused_problem_filters=Disabled
+eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
diff --git a/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.pde.prefs b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000000..fe01bb701d
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,31 @@
+#Thu Feb 04 09:44:24 CET 2010
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=2
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=1
+compilers.p.missing-version-import-package=1
+compilers.p.missing-version-require-bundle=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/plugins/org.eclipse.net4j.ws/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.ws/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..d9769033e4
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/META-INF/MANIFEST.MF
@@ -0,0 +1,30 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.net4j.ws;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Name: %pluginName
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.eclipse.net4j.internal.ws.bundle.OM$Activator
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ClassPath: .
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
+ org.eclipse.net4j;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
+ org.eclipse.jetty.websocket.servlet;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.websocket.common;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.websocket.client;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.websocket.api;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.servlet;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.client;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.http;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.util;bundle-version="[9.0.0,10.0.0)",
+ org.eclipse.jetty.io;bundle-version="[9.0.0,10.0.0)"
+Import-Package: org.osgi.framework;version="[1.3.0,2.0.0)";resolution:=optional,
+ javax.servlet;version="[2.3.0,4.0.0)",
+ javax.servlet.http;version="[2.3.0,4.0.0)"
+Export-Package: org.eclipse.net4j.internal.ws;version="1.0.0";x-friends:="org.eclipse.net4j.tests,org.eclipse.emf.cdo.examples,org.eclipse.net4j.ui",
+ org.eclipse.net4j.internal.ws.bundle;version="1.0.0";x-internal:=true,
+ org.eclipse.net4j.ws;version="1.0.0",
+ org.eclipse.net4j.ws.jetty;version="1.0.0"
+Automatic-Module-Name: org.eclipse.net4j.ws
diff --git a/plugins/org.eclipse.net4j.ws/about.html b/plugins/org.eclipse.net4j.ws/about.html
new file mode 100644
index 0000000000..d35d5aed64
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/plugins/org.eclipse.net4j.ws/build.properties b/plugins/org.eclipse.net4j.ws/build.properties
new file mode 100644
index 0000000000..7bc37d1857
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/build.properties
@@ -0,0 +1,25 @@
+# Copyright (c) 2007, 2009-2012, 2017 Eike Stepper (Loehne, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Eike Stepper - initial API and implementation
+
+# NLS_MESSAGEFORMAT_VAR
+
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ .options,\
+ plugin.properties,\
+ plugin.xml,\
+ about.html
+src.includes = about.html,\
+ pom.xml
+
+doc.project = org.eclipse.net4j.doc
+
+generateSourceReferences = true
diff --git a/plugins/org.eclipse.net4j.ws/plugin.properties b/plugins/org.eclipse.net4j.ws/plugin.properties
new file mode 100644
index 0000000000..0d3bb286f0
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/plugin.properties
@@ -0,0 +1,11 @@
+# Copyright (c) 2007-2010, 2012, 2013 Eike Stepper (Loehne, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Eike Stepper - initial API and implementation
+
+pluginName = Net4j Signalling Platform TCP
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.net4j.ws/plugin.xml b/plugins/org.eclipse.net4j.ws/plugin.xml
new file mode 100644
index 0000000000..5ba3143ab2
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/plugin.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<!--
+ Copyright (c) 2007, 2011, 2012 Eike Stepper (Loehne, Germany) and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Eike Stepper - initial API and implementation
+-->
+
+<plugin>
+
+ <extension
+ point="org.eclipse.net4j.util.factories">
+ <factory
+ class="org.eclipse.net4j.internal.ws.WSAcceptorFactory"
+ productGroup="org.eclipse.net4j.acceptors"
+ type="ws"/>
+ <factory
+ class="org.eclipse.net4j.internal.ws.WSConnectorFactory"
+ productGroup="org.eclipse.net4j.connectors"
+ type="ws"/>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.net4j.ws/pom.xml b/plugins/org.eclipse.net4j.ws/pom.xml
new file mode 100644
index 0000000000..f90b36ab2f
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/pom.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2017 Eike Stepper (Loehne, Germany) and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Eike Stepper - initial API and implementation
+-->
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.emf.cdo</groupId>
+ <artifactId>org.eclipse.emf.cdo.plugins</artifactId>
+ <version>4.7.0-SNAPSHOT</version>
+ <relativePath>../../releng/org.eclipse.emf.cdo.releng.parent/plugins</relativePath>
+ </parent>
+
+ <groupId>org.eclipse.emf.cdo</groupId>
+ <artifactId>org.eclipse.net4j.ws</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+</project>
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSAcceptor.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSAcceptor.java
new file mode 100644
index 0000000000..96523923e4
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSAcceptor.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.internal.ws;
+
+import org.eclipse.net4j.util.StringUtil;
+import org.eclipse.net4j.util.concurrent.Worker;
+import org.eclipse.net4j.ws.IWSAcceptor;
+import org.eclipse.net4j.ws.jetty.Net4jWebSocket;
+
+import org.eclipse.spi.net4j.Acceptor;
+
+import java.text.MessageFormat;
+
+/**
+ * @author Eike Stepper
+ */
+public class WSAcceptor extends Acceptor implements IWSAcceptor
+{
+ public static final boolean DEFAULT_START_SYNCHRONOUSLY = true;
+
+ public static final long DEFAULT_SYNCHRONOUS_START_TIMEOUT = Worker.DEFAULT_TIMEOUT;
+
+ private String name;
+
+ public WSAcceptor()
+ {
+ }
+
+ @Override
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ checkInactive();
+ this.name = name;
+ }
+
+ public WSServerConnector handleAccept(Net4jWebSocket webSocket)
+ {
+ WSServerConnector connector = createConnector();
+ prepareConnector(connector);
+ connector.setWebSocket(webSocket);
+ connector.activate();
+ addConnector(connector);
+ return connector;
+ }
+
+ @Override
+ public String toString()
+ {
+ return MessageFormat.format("WSAcceptor[{0}]", name); //$NON-NLS-1$
+ }
+
+ protected WSServerConnector createConnector()
+ {
+ return new WSServerConnector(this);
+ }
+
+ @Override
+ protected void doBeforeActivate() throws Exception
+ {
+ super.doBeforeActivate();
+ if (StringUtil.isEmpty(name))
+ {
+ throw new IllegalStateException("name is null or empty"); //$NON-NLS-1$
+ }
+ }
+
+ @Override
+ protected void doActivate() throws Exception
+ {
+ super.doActivate();
+ WSAcceptorManager.INSTANCE.registerAcceptor(this);
+ }
+
+ @Override
+ protected void doDeactivate() throws Exception
+ {
+ WSAcceptorManager.INSTANCE.deregisterAcceptor(this);
+ super.doDeactivate();
+ }
+}
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSAcceptorFactory.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSAcceptorFactory.java
new file mode 100644
index 0000000000..cd2c9a8520
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSAcceptorFactory.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.internal.ws;
+
+import org.eclipse.net4j.ws.IWSAcceptor;
+import org.eclipse.net4j.ws.WSUtil;
+
+import org.eclipse.spi.net4j.AcceptorFactory;
+
+/**
+ * @author Eike Stepper
+ */
+public class WSAcceptorFactory extends AcceptorFactory
+{
+ public WSAcceptorFactory()
+ {
+ super(WSUtil.FACTORY_TYPE);
+ }
+
+ /**
+ * Allows derived classes to override the TYPE identifier
+ */
+ protected WSAcceptorFactory(String type)
+ {
+ super(type);
+ }
+
+ @Override
+ public WSAcceptor create(String description)
+ {
+ WSAcceptor acceptor = createAcceptor();
+ acceptor.setName(description);
+ return acceptor;
+ }
+
+ protected WSAcceptor createAcceptor()
+ {
+ return new WSAcceptor();
+ }
+
+ @Override
+ public String getDescriptionFor(Object object)
+ {
+ if (object instanceof IWSAcceptor)
+ {
+ IWSAcceptor acceptor = (IWSAcceptor)object;
+ return acceptor.getName();
+ }
+
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSAcceptorManager.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSAcceptorManager.java
new file mode 100644
index 0000000000..c5e67980ce
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSAcceptorManager.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.internal.ws;
+
+import org.eclipse.net4j.util.registry.HashMapRegistry;
+import org.eclipse.net4j.util.registry.IRegistry;
+import org.eclipse.net4j.ws.IWSAcceptor;
+import org.eclipse.net4j.ws.IWSAcceptorManager;
+
+/**
+ * @author Eike Stepper
+ */
+public class WSAcceptorManager implements IWSAcceptorManager
+{
+ // @Singleton
+ public static final WSAcceptorManager INSTANCE = new WSAcceptorManager();
+
+ private IRegistry<String, IWSAcceptor> acceptorRegistry = new HashMapRegistry<>();
+
+ @Override
+ public IRegistry<String, IWSAcceptor> getAcceptorRegistry()
+ {
+ return acceptorRegistry;
+ }
+
+ @Override
+ public WSAcceptor getAcceptor(String name)
+ {
+ return (WSAcceptor)acceptorRegistry.get(name);
+ }
+
+ public boolean registerAcceptor(WSAcceptor acceptor)
+ {
+ String name = acceptor.getName();
+ if (!acceptorRegistry.containsKey(name))
+ {
+ acceptorRegistry.put(name, acceptor);
+ return true;
+ }
+
+ return false;
+ }
+
+ public boolean deregisterAcceptor(WSAcceptor acceptor)
+ {
+ return acceptorRegistry.remove(acceptor.getName()) != null;
+ }
+}
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSClientConnector.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSClientConnector.java
new file mode 100644
index 0000000000..402980c538
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSClientConnector.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.internal.ws;
+
+import org.eclipse.net4j.util.om.OMPlatform;
+import org.eclipse.net4j.ws.jetty.Net4jWebSocket;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jetty.websocket.api.Session;
+import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
+import org.eclipse.jetty.websocket.client.WebSocketClient;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.text.MessageFormat;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author Eike Stepper
+ */
+public class WSClientConnector extends WSConnector
+{
+ private static final long CLIENT_IDLE_TIMEOUT = OMPlatform.INSTANCE.getProperty("org.eclipse.net4j.internal.ws.WSClientConnector.clientIdleTimeout", 30000);
+
+ private WebSocketClient client;
+
+ private boolean ownedClient;
+
+ private long connectTimeout = 5000;
+
+ private String url;
+
+ private URI serviceURI;
+
+ private String acceptorName;
+
+ public WSClientConnector()
+ {
+ }
+
+ @Override
+ public Location getLocation()
+ {
+ return Location.CLIENT;
+ }
+
+ public WebSocketClient getClient()
+ {
+ return client;
+ }
+
+ public void setClient(WebSocketClient client)
+ {
+ checkInactive();
+ this.client = client;
+ }
+
+ public long getConnectTimeout()
+ {
+ return connectTimeout;
+ }
+
+ public void setConnectTimeout(long connectTimeout)
+ {
+ checkInactive();
+ this.connectTimeout = connectTimeout;
+ }
+
+ @Override
+ public URI getServiceURI()
+ {
+ return serviceURI;
+ }
+
+ @Override
+ public String getAcceptorName()
+ {
+ return acceptorName;
+ }
+
+ @Override
+ public String getURL()
+ {
+ return url;
+ }
+
+ public void setURL(String url) throws URISyntaxException
+ {
+ checkInactive();
+ this.url = url;
+
+ URI uri = new URI(url);
+ IPath path = new Path(uri.getPath());
+
+ int index = getAcceptorSegmentIndex(path);
+ if (index == -1)
+ {
+ throw new URISyntaxException(url, "Acceptor name prefix '" + ACCEPTOR_NAME_PREFIX + "' not found");
+ }
+
+ String serviceURIString = uri.getScheme() + "://" + uri.getAuthority(); //$NON-NLS-1$
+ for (int i = 0; i < index; i++)
+ {
+ serviceURIString += "/" + path.segment(i); //$NON-NLS-1$
+ }
+
+ serviceURI = new URI(serviceURIString);
+ acceptorName = path.segment(index).substring(ACCEPTOR_NAME_PREFIX.length());
+ }
+
+ @Override
+ public String toString()
+ {
+ return MessageFormat.format("WSClientConnector[{0}]", getURL()); //$NON-NLS-1$
+ }
+
+ protected int getAcceptorSegmentIndex(IPath path)
+ {
+ for (int i = 0; i < path.segmentCount(); i++)
+ {
+ if (path.segment(i).startsWith(ACCEPTOR_NAME_PREFIX))
+ {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ @Override
+ protected void doBeforeActivate() throws Exception
+ {
+ if (client == null)
+ {
+ client = new WebSocketClient();
+ ownedClient = true;
+ }
+
+ super.doBeforeActivate();
+
+ if (serviceURI == null)
+ {
+ throw new IllegalStateException("serviceURI is null"); //$NON-NLS-1$
+ }
+
+ if (acceptorName == null || acceptorName.length() == 0)
+ {
+ throw new IllegalStateException("acceptorName is null or empty"); //$NON-NLS-1$
+ }
+ }
+
+ @Override
+ protected void doActivate() throws Exception
+ {
+ if (ownedClient)
+ {
+ client.getPolicy().setIdleTimeout(CLIENT_IDLE_TIMEOUT);
+ client.start();
+ }
+
+ super.doActivate();
+
+ Net4jWebSocket webSocket = new Net4jWebSocket(this);
+ setWebSocket(webSocket);
+
+ ClientUpgradeRequest request = new ClientUpgradeRequest();
+ request.setHeader(ACCEPTOR_NAME_HEADER, acceptorName);
+
+ Future<Session> result = client.connect(webSocket, serviceURI, request);
+ result.get(connectTimeout, TimeUnit.MILLISECONDS);
+ }
+
+ @Override
+ protected void doDeactivate() throws Exception
+ {
+ super.doDeactivate();
+
+ if (ownedClient)
+ {
+ client.stop();
+ client = null;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSConnector.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSConnector.java
new file mode 100644
index 0000000000..89dc4c43e2
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSConnector.java
@@ -0,0 +1,205 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.internal.ws;
+
+import org.eclipse.net4j.buffer.IBuffer;
+import org.eclipse.net4j.channel.ChannelException;
+import org.eclipse.net4j.connector.ConnectorState;
+import org.eclipse.net4j.internal.ws.bundle.OM;
+import org.eclipse.net4j.protocol.IProtocol;
+import org.eclipse.net4j.util.security.INegotiationContext;
+import org.eclipse.net4j.util.security.NegotiationContext;
+import org.eclipse.net4j.util.security.NegotiationException;
+import org.eclipse.net4j.ws.IWSConnector;
+import org.eclipse.net4j.ws.IWSNegotiationContext;
+import org.eclipse.net4j.ws.jetty.Net4jWebSocket;
+
+import org.eclipse.spi.net4j.Connector;
+import org.eclipse.spi.net4j.InternalChannel;
+import org.eclipse.spi.net4j.InternalChannelMultiplexer.BufferMultiplexer;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+/**
+ * @author Eike Stepper
+ */
+public abstract class WSConnector extends Connector implements IWSConnector, BufferMultiplexer
+{
+ public static final String ACCEPTOR_NAME_HEADER = "Net4jAcceptor"; //$NON-NLS-1$
+
+ private Net4jWebSocket webSocket;
+
+ public WSConnector()
+ {
+ }
+
+ public Net4jWebSocket getWebSocket()
+ {
+ return webSocket;
+ }
+
+ public void setWebSocket(Net4jWebSocket webSocket)
+ {
+ this.webSocket = webSocket;
+ }
+
+ /**
+ * Override to make the method publicly visible.
+ */
+ @Override
+ public void setNegotiationException(NegotiationException negotiationException)
+ {
+ super.setNegotiationException(negotiationException);
+ }
+
+ /**
+ * Override to make the method publicly visible.
+ */
+ @Override
+ public void leaveConnecting()
+ {
+ super.leaveConnecting();
+ }
+
+ public void multiplexBuffer(InternalChannel channel, IBuffer buffer)
+ {
+ boolean closeChannelAfterMe = buffer.isCCAM();
+
+ webSocket.sendBuffer(buffer);
+
+ // The buffer is released through a WriteCallback in Net4jWebSocket.sendBytes()!!!
+ // buffer.release();
+
+ if (closeChannelAfterMe)
+ {
+ if (channel != null)
+ {
+ // TODO With Net4jWebSocket.ASYNC==true this can be before the buffer is actually written!
+ channel.close();
+ }
+ }
+ }
+
+ @Override
+ public void multiplexChannel(InternalChannel channel)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ protected void registerChannelWithPeer(short channelID, long timeout, IProtocol<?> protocol) throws ChannelException
+ {
+ try
+ {
+ webSocket.registerChannel(channelID, timeout, protocol);
+ }
+ catch (IOException ex)
+ {
+ throw new ChannelException(ex);
+ }
+ }
+
+ @Override
+ protected void deregisterChannelFromPeer(InternalChannel channel) throws ChannelException
+ {
+ if (channel != null)
+ {
+ try
+ {
+ webSocket.deregisterChannel(channel.getID());
+ }
+ catch (IOException ex)
+ {
+ throw new ChannelException(ex);
+ }
+ }
+ }
+
+ @Override
+ protected INegotiationContext createNegotiationContext()
+ {
+ return new WSNegotiationContext();
+ }
+
+ @Override
+ protected void doDeactivate() throws Exception
+ {
+ webSocket.close();
+ super.doDeactivate();
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private final class WSNegotiationContext extends NegotiationContext implements IWSNegotiationContext
+ {
+ private IBuffer buffer;
+
+ private boolean failed;
+
+ public WSNegotiationContext()
+ {
+ }
+
+ @Override
+ public WSConnector getConnector()
+ {
+ return WSConnector.this;
+ }
+
+ @Override
+ public void setUserID(String userID)
+ {
+ WSConnector.this.setUserID(userID);
+ }
+
+ @Override
+ public ByteBuffer getBuffer()
+ {
+ buffer = getConfig().getBufferProvider().provideBuffer();
+ ByteBuffer byteBuffer = buffer.startPutting(Net4jWebSocket.CONTROL_CHANNEL_ID);
+ byteBuffer.put(Net4jWebSocket.OPCODE_NEGOTIATION);
+ return byteBuffer;
+ }
+
+ @Override
+ public void transmitBuffer(ByteBuffer byteBuffer)
+ {
+ if (buffer.getByteBuffer() != byteBuffer)
+ {
+ throw new IllegalArgumentException("The passed buffer is not the last that was produced"); //$NON-NLS-1$
+ }
+
+ webSocket.sendBuffer(buffer);
+ if (failed)
+ {
+ deactivate();
+ }
+ }
+
+ @Override
+ public void setFinished(boolean success)
+ {
+ if (success)
+ {
+ WSConnector.this.setState(ConnectorState.CONNECTED);
+ }
+ else
+ {
+ OM.LOG.error("Connector negotiation failed: " + WSConnector.this); //$NON-NLS-1$
+ failed = true;
+ }
+
+ super.setFinished(success);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSConnectorFactory.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSConnectorFactory.java
new file mode 100644
index 0000000000..457f92b457
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSConnectorFactory.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.internal.ws;
+
+import org.eclipse.net4j.util.factory.ProductCreationException;
+
+import org.eclipse.spi.net4j.ConnectorFactory;
+
+import java.net.URISyntaxException;
+
+/**
+ * @author Eike Stepper
+ */
+public class WSConnectorFactory extends ConnectorFactory
+{
+ public static final String TYPE = "ws"; //$NON-NLS-1$
+
+ public WSConnectorFactory()
+ {
+ super(TYPE);
+ }
+
+ /**
+ * Allows derived classes to override the TYPE identifier
+ */
+ protected WSConnectorFactory(String type)
+ {
+ super(type);
+ }
+
+ @Override
+ public WSClientConnector create(String description) throws ProductCreationException
+ {
+ WSClientConnector connector = createConnector();
+
+ try
+ {
+ connector.setURL(getType() + "://" + description); //$NON-NLS-1$
+ }
+ catch (URISyntaxException ex)
+ {
+ throw new ProductCreationException(ex);
+ }
+
+ return connector;
+
+ }
+
+ protected WSClientConnector createConnector()
+ {
+ return new WSClientConnector();
+ }
+
+ @Override
+ public String getDescriptionFor(Object object)
+ {
+ if (object instanceof WSConnector)
+ {
+ WSConnector connector = (WSConnector)object;
+ return connector.getURL();
+ }
+
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSServerConnector.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSServerConnector.java
new file mode 100644
index 0000000000..89f2b3f579
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/WSServerConnector.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.internal.ws;
+
+import org.eclipse.net4j.connector.IServerConnector;
+
+import java.net.URI;
+import java.text.MessageFormat;
+
+/**
+ * @author Eike Stepper
+ */
+public class WSServerConnector extends WSConnector implements IServerConnector
+{
+ private WSAcceptor acceptor;
+
+ public WSServerConnector(WSAcceptor acceptor)
+ {
+ this.acceptor = acceptor;
+ }
+
+ @Override
+ public Location getLocation()
+ {
+ return Location.SERVER;
+ }
+
+ @Override
+ public URI getServiceURI()
+ {
+ try
+ {
+ return getWebSocket().getSession().getUpgradeRequest().getRequestURI();
+ }
+ catch (Exception ex)
+ {
+ return null;
+ }
+ }
+
+ @Override
+ public String getAcceptorName()
+ {
+ try
+ {
+ return acceptor.getName();
+ }
+ catch (Exception ex)
+ {
+ return null;
+ }
+ }
+
+ @Override
+ public WSAcceptor getAcceptor()
+ {
+ return acceptor;
+ }
+
+ @Override
+ public String getURL()
+ {
+ try
+ {
+ String serviceURI = getServiceURI().toString();
+ if (!serviceURI.endsWith("/")) //$NON-NLS-1$
+ {
+ serviceURI += "/"; //$NON-NLS-1$
+ }
+
+ return serviceURI + ACCEPTOR_NAME_PREFIX + getAcceptorName();
+ }
+ catch (Exception ex)
+ {
+ return null;
+ }
+ }
+
+ @Override
+ public String toString()
+ {
+ return MessageFormat.format("WSServerConnector[{0}]", getURL()); //$NON-NLS-1$
+ }
+
+ @Override
+ protected void doActivate() throws Exception
+ {
+ super.doActivate();
+ leaveConnecting();
+ }
+}
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/bundle/OM.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/bundle/OM.java
new file mode 100644
index 0000000000..64c8959a45
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/internal/ws/bundle/OM.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.internal.ws.bundle;
+
+import org.eclipse.net4j.util.om.OMBundle;
+import org.eclipse.net4j.util.om.OMPlatform;
+import org.eclipse.net4j.util.om.OSGiActivator;
+import org.eclipse.net4j.util.om.log.OMLogger;
+import org.eclipse.net4j.util.om.trace.OMTracer;
+
+/**
+ * The <em>Operations & Maintenance</em> class of this bundle.
+ *
+ * @author Eike Stepper
+ */
+public abstract class OM
+{
+ public static final String BUNDLE_ID = "org.eclipse.net4j.ws"; //$NON-NLS-1$
+
+ public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class);
+
+ public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$
+
+ public static final OMLogger LOG = BUNDLE.logger();
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class Activator extends OSGiActivator
+ {
+ public Activator()
+ {
+ super(BUNDLE);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/IWSAcceptor.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/IWSAcceptor.java
new file mode 100644
index 0000000000..b7a603b26b
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/IWSAcceptor.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.ws;
+
+import org.eclipse.net4j.acceptor.IAcceptor;
+
+/**
+ * An {@link IAcceptor acceptor} that implements Websockets-based transport.
+ *
+ * @author Eike Stepper
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IWSAcceptor extends IAcceptor
+{
+ public String getName();
+}
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/IWSAcceptorManager.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/IWSAcceptorManager.java
new file mode 100644
index 0000000000..33f1e49d8c
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/IWSAcceptorManager.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.ws;
+
+import org.eclipse.net4j.internal.ws.WSAcceptorManager;
+import org.eclipse.net4j.util.registry.IRegistry;
+
+/**
+ * A singleton that manages all {@link IWSAcceptor WS acceptors} in the current JVM.
+ *
+ * @author Eike Stepper
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IWSAcceptorManager
+{
+ public static final IWSAcceptorManager INSTANCE = WSAcceptorManager.INSTANCE;
+
+ public IRegistry<String, IWSAcceptor> getAcceptorRegistry();
+
+ public IWSAcceptor getAcceptor(String name);
+}
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/IWSConnector.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/IWSConnector.java
new file mode 100644
index 0000000000..a7f762563c
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/IWSConnector.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.ws;
+
+import org.eclipse.net4j.connector.IConnector;
+
+import java.net.URI;
+
+/**
+ * A {@link IConnector connector} that implements Websockets-based transport.
+ *
+ * @author Eike Stepper
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IWSConnector extends IConnector
+{
+ public static final String ACCEPTOR_NAME_PREFIX = "@";
+
+ public URI getServiceURI();
+
+ public String getAcceptorName();
+}
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/IWSNegotiationContext.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/IWSNegotiationContext.java
new file mode 100644
index 0000000000..807d59eecc
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/IWSNegotiationContext.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.ws;
+
+import org.eclipse.net4j.util.security.INegotiationContext;
+
+/**
+ * A {@link INegotiationContext negotiation context} that is used in Websocket transport.
+ *
+ * @author Eike Stepper
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IWSNegotiationContext extends INegotiationContext
+{
+ public IWSConnector getConnector();
+}
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/WSUtil.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/WSUtil.java
new file mode 100644
index 0000000000..745bf3d5f3
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/WSUtil.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.ws;
+
+import org.eclipse.net4j.internal.ws.WSAcceptorFactory;
+import org.eclipse.net4j.internal.ws.WSConnectorFactory;
+import org.eclipse.net4j.util.container.IManagedContainer;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ * A utility class with static convenience methods.
+ *
+ * @author Eike Stepper
+ */
+public final class WSUtil
+{
+ public static final String FACTORY_TYPE = "ws"; //$NON-NLS-1$
+
+ private WSUtil()
+ {
+ }
+
+ public static void prepareContainer(IManagedContainer container)
+ {
+ container.registerFactory(new WSAcceptorFactory());
+ container.registerFactory(new WSConnectorFactory());
+ }
+
+ public static IWSAcceptor getAcceptor(IManagedContainer container, String acceptorName)
+ {
+ return (IWSAcceptor)container.getElement(WSAcceptorFactory.PRODUCT_GROUP, FACTORY_TYPE, acceptorName);
+ }
+
+ public static IWSConnector getConnector(IManagedContainer container, String description)
+ {
+ return (IWSConnector)container.getElement(WSConnectorFactory.PRODUCT_GROUP, FACTORY_TYPE, description);
+ }
+
+ public static IWSConnector getConnector(IManagedContainer container, URI serviceURI, String acceptorName)
+ {
+ String description = getConnectorDescription(serviceURI, acceptorName);
+ return getConnector(container, description);
+ }
+
+ public static String getConnectorDescription(String serviceURI, String acceptorName) throws URISyntaxException
+ {
+ return getConnectorDescription(new URI(serviceURI), acceptorName);
+ }
+
+ public static String getConnectorDescription(URI serviceURI, String acceptorName)
+ {
+ String string = serviceURI.toString();
+ if (!string.endsWith("/")) //$NON-NLS-1$
+ {
+ string += "/"; //$NON-NLS-1$
+
+ try
+ {
+ serviceURI = new URI(string);
+ }
+ catch (URISyntaxException ex)
+ {
+ // This can't realistically happen.
+ throw new RuntimeException(ex);
+ }
+ }
+
+ URI uri = serviceURI.resolve(IWSConnector.ACCEPTOR_NAME_PREFIX + acceptorName);
+ return uri.getAuthority() + uri.getPath();
+ }
+}
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/jetty/Net4jWebSocket.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/jetty/Net4jWebSocket.java
new file mode 100644
index 0000000000..967cb8dbfe
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/jetty/Net4jWebSocket.java
@@ -0,0 +1,554 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.ws.jetty;
+
+import org.eclipse.net4j.Net4jUtil;
+import org.eclipse.net4j.buffer.IBuffer;
+import org.eclipse.net4j.channel.ChannelException;
+import org.eclipse.net4j.connector.ConnectorException;
+import org.eclipse.net4j.internal.ws.WSAcceptor;
+import org.eclipse.net4j.internal.ws.WSAcceptorManager;
+import org.eclipse.net4j.internal.ws.WSClientConnector;
+import org.eclipse.net4j.internal.ws.WSConnector;
+import org.eclipse.net4j.internal.ws.bundle.OM;
+import org.eclipse.net4j.protocol.IProtocol;
+import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
+import org.eclipse.net4j.util.concurrent.ISynchronizer;
+import org.eclipse.net4j.util.concurrent.SynchronizingCorrelator;
+import org.eclipse.net4j.util.concurrent.TimeoutRuntimeException;
+import org.eclipse.net4j.util.om.OMPlatform;
+import org.eclipse.net4j.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.security.INegotiationContext;
+import org.eclipse.net4j.util.security.INegotiationContext.Receiver;
+import org.eclipse.net4j.util.security.NegotiationException;
+import org.eclipse.net4j.ws.IWSConnector;
+
+import org.eclipse.jetty.websocket.api.Session;
+import org.eclipse.jetty.websocket.api.WebSocketListener;
+import org.eclipse.jetty.websocket.api.WriteCallback;
+import org.eclipse.spi.net4j.InternalChannel;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.text.MessageFormat;
+import java.util.Timer;
+import java.util.TimerTask;
+
+/**
+ * @author Eike Stepper
+ */
+public class Net4jWebSocket implements WebSocketListener
+{
+ public static final short CONTROL_CHANNEL_ID = 0;
+
+ public static final byte OPCODE_NEGOTIATION = 1;
+
+ public static final byte OPCODE_REGISTRATION = 2;
+
+ public static final byte OPCODE_REGISTRATION_ACK = 3;
+
+ public static final byte OPCODE_DEREGISTRATION = 4;
+
+ private static final long SESSION_IDLE_TIMEOUT = OMPlatform.INSTANCE.getProperty("org.eclipse.net4j.ws.jetty.Net4jWebSocket.sessionIdleTimeout", 30000);
+
+ private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, Net4jWebSocket.class);
+
+ private static final String SUCCESS = "Success";
+
+ private static Timer timer;
+
+ private static int timerClients;
+
+ private final SynchronizingCorrelator<Short, String> acknowledgements = new SynchronizingCorrelator<Short, String>();
+
+ private volatile WSConnector connector;
+
+ private volatile Session session;
+
+ private TimerTask pongTask;
+
+ /**
+ * Called by {@link Net4jWebSocketServlet}.
+ */
+ public Net4jWebSocket()
+ {
+ }
+
+ /**
+ * Called by {@link WSClientConnector}.
+ */
+ public Net4jWebSocket(IWSConnector connector)
+ {
+ this.connector = (WSConnector)connector;
+ }
+
+ public IWSConnector getConnector()
+ {
+ return connector;
+ }
+
+ public Session getSession()
+ {
+ return session;
+ }
+
+ public boolean isClient()
+ {
+ return pongTask != null;
+ }
+
+ @Override
+ public void onWebSocketConnect(Session session)
+ {
+ this.session = session;
+ session.setIdleTimeout(SESSION_IDLE_TIMEOUT);
+
+ boolean client = connector != null;
+ if (client)
+ {
+ pongTask = new TimerTask()
+ {
+ @Override
+ public void run()
+ {
+ try
+ {
+ Session session = getSession();
+ if (session != null)
+ {
+ session.getRemote().sendPong(null);
+ }
+ }
+ catch (IOException ex)
+ {
+ OM.LOG.warn(ex);
+ // TODO Close the connector?
+ }
+ }
+ };
+
+ acquireTimer().scheduleAtFixedRate(pongTask, 20000, 20000);
+ connector.leaveConnecting();
+ }
+ else
+ {
+ // Only create/wire a WSConnector on the server side.
+ String acceptorName = session.getUpgradeRequest().getHeader(WSConnector.ACCEPTOR_NAME_HEADER);
+ WSAcceptor acceptor = WSAcceptorManager.INSTANCE.getAcceptor(acceptorName);
+ if (acceptor == null)
+ {
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Acceptor {0} not found", acceptorName); //$NON-NLS-1$
+ }
+
+ session.close(1011, "Acceptor not found");
+ return;
+ }
+
+ connector = acceptor.handleAccept(this);
+ }
+
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Connection established: {0}", connector); //$NON-NLS-1$
+ }
+ }
+
+ public void close()
+ {
+ if (session != null)
+ {
+ session.close();
+ session = null;
+ }
+ }
+
+ @Override
+ public void onWebSocketClose(int statusCode, String reason)
+ {
+ session = null;
+
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Connection closed: {0}", connector); //$NON-NLS-1$
+ }
+
+ if (pongTask != null)
+ {
+ pongTask.cancel();
+ pongTask = null;
+
+ releaseTimer();
+ }
+
+ if (connector != null)
+ {
+ connector.inverseClose();
+ connector = null;
+ }
+ }
+
+ private synchronized Timer acquireTimer()
+ {
+ if (timer == null)
+ {
+ timer = new Timer(true);
+ }
+
+ ++timerClients;
+ return timer;
+ }
+
+ private synchronized void releaseTimer()
+ {
+ if (--timerClients == 0)
+ {
+ timer.cancel();
+ timer = null;
+ }
+ }
+
+ private synchronized void sendBytes(IBuffer buffer)
+ {
+ ByteBuffer byteBuffer = buffer.getByteBuffer();
+ session.getRemote().sendBytes(byteBuffer, new WriteCallback()
+ {
+ @Override
+ public void writeSuccess()
+ {
+ buffer.release();
+ }
+
+ @Override
+ public void writeFailed(Throwable ex)
+ {
+ OM.LOG.error(ex);
+ buffer.release();
+ connector.deactivate();
+ }
+ });
+ }
+
+ public void registerChannel(short channelID, long timeout, IProtocol<?> protocol) throws IOException
+ {
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Registering channel {0} with protocol {1}", channelID, protocol); //$NON-NLS-1$
+ }
+
+ assertValidChannelID(channelID);
+ ISynchronizer<String> acknowledgement = acknowledgements.correlate(channelID);
+
+ int protocolVersion = Net4jUtil.getProtocolVersion(protocol);
+ String protocolID = Net4jUtil.getProtocolID(protocol);
+
+ IBuffer buffer = provideBuffer();
+ ByteBuffer byteBuffer = buffer.startPutting(CONTROL_CHANNEL_ID);
+ byteBuffer.put(OPCODE_REGISTRATION);
+ byteBuffer.putShort(channelID);
+ byteBuffer.putInt(protocolVersion);
+ org.eclipse.internal.net4j.buffer.BufferUtil.putString(byteBuffer, protocolID, false);
+ sendBuffer(buffer);
+
+ String error = acknowledgement.get(timeout);
+ if (error == null)
+ {
+ throw new TimeoutRuntimeException(MessageFormat.format("Registration timeout after {0} milliseconds", timeout)); //$NON-NLS-1$
+ }
+
+ if (error != SUCCESS)
+ {
+ throw new ChannelException("Failed to register channel with peer: " + error); //$NON-NLS-1$
+ }
+ }
+
+ private void onRegistration(short channelID, int protocolVersion, String protocolID)
+ {
+ assertConnected();
+ assertValidChannelID(channelID);
+ String error = "";
+
+ try
+ {
+ InternalChannel channel = connector.inverseOpenChannel(channelID, protocolID, protocolVersion);
+ if (channel == null)
+ {
+ throw new ConnectorException("Could not open channel");
+ }
+ }
+ catch (Exception ex)
+ {
+ error = ex.getMessage();
+ if (error == null)
+ {
+ error = "Unknown error";
+ }
+
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Problem during channel registration", ex); //$NON-NLS-1$
+ }
+ }
+
+ acknowledgeRegistration(channelID, error);
+ }
+
+ private void acknowledgeRegistration(short channelID, String error)
+ {
+ IBuffer buffer = provideBuffer();
+ ByteBuffer byteBuffer = buffer.startPutting(CONTROL_CHANNEL_ID);
+ byteBuffer.put(OPCODE_REGISTRATION_ACK);
+ byteBuffer.putShort(channelID);
+ org.eclipse.internal.net4j.buffer.BufferUtil.putString(byteBuffer, error, true);
+ sendBuffer(buffer);
+ }
+
+ private void onRegistrationAck(short channelID, String error)
+ {
+ assertConnected();
+ assertValidChannelID(channelID);
+
+ if (error != null && error.isEmpty())
+ {
+ error = SUCCESS;
+ }
+
+ acknowledgements.put(channelID, error);
+ }
+
+ public void deregisterChannel(short channelID) throws IOException
+ {
+ if (session == null)
+ {
+ // This is an inverse deregistration.
+ return;
+ }
+
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Deregistering channel {0}", channelID); //$NON-NLS-1$
+ }
+
+ assertValidChannelID(channelID);
+
+ IBuffer buffer = provideBuffer();
+ ByteBuffer byteBuffer = buffer.startPutting(CONTROL_CHANNEL_ID);
+ byteBuffer.put(OPCODE_DEREGISTRATION);
+ byteBuffer.putShort(channelID);
+ sendBuffer(buffer);
+ }
+
+ private void onDeregistration(short channelID)
+ {
+ try
+ {
+ assertConnected();
+ assertValidChannelID(channelID);
+ connector.inverseCloseChannel(channelID);
+ }
+ catch (Throwable ex)
+ {
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Problem during channel deregistration", ex); //$NON-NLS-1$
+ }
+ }
+ }
+
+ public void sendBuffer(IBuffer buffer)
+ {
+ ByteBuffer byteBuffer = buffer.getByteBuffer();
+ int position = byteBuffer.position();
+ if (position < IBuffer.HEADER_SIZE)
+ {
+ buffer.release();
+ throw new IllegalArgumentException("Illegal buffer size: " + position);
+ }
+
+ int payloadSize = position - IBuffer.HEADER_SIZE;
+ if (buffer.isEOS())
+ {
+ payloadSize = -payloadSize;
+ }
+
+ byteBuffer.putShort(IBuffer.CHANNEL_ID_POS, buffer.getChannelID());
+ byteBuffer.putShort(IBuffer.PAYLOAD_SIZE_POS, (short)payloadSize);
+ byteBuffer.flip();
+
+ sendBytes(buffer);
+ }
+
+ @Override
+ public void onWebSocketBinary(byte[] payload, int offset, int len)
+ {
+ if (len < IBuffer.HEADER_SIZE)
+ {
+ if (len != 0)
+ {
+ throw new IllegalArgumentException("Payload length: " + len);
+ }
+
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Received empty buffer!"); //$NON-NLS-1$
+ }
+
+ return;
+ }
+
+ IBuffer buffer = provideBuffer();
+ ByteBuffer byteBuffer = buffer.getByteBuffer();
+ byteBuffer.put(payload, offset, len);
+ byteBuffer.flip();
+
+ short channelID = byteBuffer.getShort();
+
+ if (channelID == CONTROL_CHANNEL_ID)
+ {
+ byteBuffer.position(IBuffer.HEADER_SIZE);
+
+ try
+ {
+ byte opcode = byteBuffer.get();
+ switch (opcode)
+ {
+ case OPCODE_NEGOTIATION:
+ {
+ assertNegotiating();
+
+ INegotiationContext negotiationContext = connector.getNegotiationContext();
+ while (negotiationContext == null)
+ {
+ ConcurrencyUtil.sleep(20);
+ negotiationContext = connector.getNegotiationContext();
+ }
+
+ Receiver receiver = negotiationContext.getReceiver();
+ receiver.receiveBuffer(negotiationContext, buffer.getByteBuffer());
+ break;
+ }
+
+ case OPCODE_REGISTRATION:
+ {
+ channelID = buffer.getShort();
+ int protocolVersion = buffer.getInt();
+ String protocolID = buffer.getString();
+ onRegistration(channelID, protocolVersion, protocolID);
+ break;
+ }
+
+ case OPCODE_REGISTRATION_ACK:
+ {
+ channelID = buffer.getShort();
+ String error = buffer.getString();
+ onRegistrationAck(channelID, error);
+ break;
+ }
+
+ case OPCODE_DEREGISTRATION:
+ {
+ channelID = buffer.getShort();
+ onDeregistration(channelID);
+ break;
+ }
+
+ default:
+ break;
+ }
+ }
+ catch (NegotiationException ex)
+ {
+ OM.LOG.error(ex);
+ connector.setNegotiationException(ex);
+ connector.deactivate();
+ }
+ finally
+ {
+ buffer.release();
+ }
+
+ return;
+ }
+
+ short payloadSize = byteBuffer.getShort();
+ if (payloadSize < 0)
+ {
+ buffer.setEOS(true);
+ }
+
+ ((org.eclipse.internal.net4j.buffer.Buffer)buffer).setChannelID(channelID);
+ ((org.eclipse.internal.net4j.buffer.Buffer)buffer).setState(org.eclipse.net4j.buffer.BufferState.PUTTING);
+ byteBuffer.position(IBuffer.HEADER_SIZE);
+
+ InternalChannel channel = connector.getChannel(channelID);
+ if (channel != null)
+ {
+ channel.handleBufferFromMultiplexer(buffer);
+ }
+ else
+ {
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Discarding buffer from unknown channel"); //$NON-NLS-1$
+ }
+
+ buffer.release();
+ }
+ }
+
+ @Override
+ public void onWebSocketText(String message)
+ {
+ // Do nothing.
+ }
+
+ @Override
+ public void onWebSocketError(Throwable cause)
+ {
+ OM.LOG.error(cause);
+
+ if (connector != null)
+ {
+ connector.deactivate();
+ }
+ }
+
+ private void assertNegotiating()
+ {
+ if (!connector.isNegotiating())
+ {
+ connector.deactivate();
+ throw new IllegalStateException("Connector is not negotiating");
+ }
+ }
+
+ private void assertConnected()
+ {
+ if (!connector.isConnected())
+ {
+ throw new IllegalStateException("Connector is not connected");
+ }
+ }
+
+ private void assertValidChannelID(short channelID)
+ {
+ if (channelID < 1)
+ {
+ throw new IllegalArgumentException("Bad channelID " + channelID);
+ }
+ }
+
+ private IBuffer provideBuffer()
+ {
+ return connector.getConfig().getBufferProvider().provideBuffer();
+ }
+}
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/jetty/Net4jWebSocketServlet.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/jetty/Net4jWebSocketServlet.java
new file mode 100644
index 0000000000..d31f402a1d
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/jetty/Net4jWebSocketServlet.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.ws.jetty;
+
+import org.eclipse.net4j.util.om.OMPlatform;
+
+import org.eclipse.jetty.websocket.servlet.WebSocketServlet;
+import org.eclipse.jetty.websocket.servlet.WebSocketServletFactory;
+
+/**
+ * @author Eike Stepper
+ */
+public class Net4jWebSocketServlet extends WebSocketServlet
+{
+ private static final long ASYNC_WRITE_TIMEOUT = OMPlatform.INSTANCE.getProperty("org.eclipse.net4j.ws.jetty.Net4jWebSocketServlet.asyncWriteTimeout", 30000);
+
+ private static final long IDLE_TIMEOUT = OMPlatform.INSTANCE.getProperty("org.eclipse.net4j.ws.jetty.Net4jWebSocketServlet.idleTimeout", 30000);
+
+ private static final long serialVersionUID = 1L;
+
+ public Net4jWebSocketServlet()
+ {
+ }
+
+ @Override
+ public void configure(WebSocketServletFactory factory)
+ {
+ factory.getPolicy().setAsyncWriteTimeout(ASYNC_WRITE_TIMEOUT);
+ factory.getPolicy().setIdleTimeout(IDLE_TIMEOUT);
+ factory.register(Net4jWebSocket.class);
+ }
+}
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/jetty/package-info.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/jetty/package-info.java
new file mode 100644
index 0000000000..0523a8cbff
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/jetty/package-info.java
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+
+/**
+ * Jetty-specific classes with support for Websocket connections.
+ */
+package org.eclipse.net4j.ws.jetty;
diff --git a/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/package-info.java b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/package-info.java
new file mode 100644
index 0000000000..e9f7782721
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ws/src/org/eclipse/net4j/ws/package-info.java
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+
+/**
+ * Transport layer extension with support for Websocket connections.
+ */
+package org.eclipse.net4j.ws;
diff --git a/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
index d9b9d307eb..a76ac5d709 100644
--- a/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.net4j;singleton:=true
-Bundle-Version: 4.9.0.qualifier
+Bundle-Version: 4.10.0.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -11,35 +11,38 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)";visibility:=reexport
-Export-Package: org.eclipse.internal.net4j;version="4.9.0";
+Export-Package: org.eclipse.internal.net4j;version="4.10.0";
x-friends:="org.eclipse.net4j.http.server,
org.eclipse.net4j.jvm,
org.eclipse.net4j.tcp,
+ org.eclipse.net4j.ws,
org.eclipse.net4j.http,
org.eclipse.net4j.http.common,
org.eclipse.net4j.http.tests,
- org.eclipse.net4j.tests",
- org.eclipse.internal.net4j.buffer;version="4.9.0";
+ org.eclipse.net4j.tests,
+ org.eclipse.net4j.trace",
+ org.eclipse.internal.net4j.buffer;version="4.10.0";
x-friends:="org.eclipse.net4j.http.server,
org.eclipse.net4j.jvm,
org.eclipse.net4j.tcp,
+ org.eclipse.net4j.ws,
org.eclipse.net4j.http,
org.eclipse.net4j.http.common,
org.eclipse.net4j.http.tests,
org.eclipse.net4j.tests,
org.eclipse.net4j.trace",
- org.eclipse.internal.net4j.bundle;version="4.9.0";x-internal:=true,
- org.eclipse.net4j;version="4.9.0",
- org.eclipse.net4j.acceptor;version="4.9.0",
- org.eclipse.net4j.buffer;version="4.9.0",
- org.eclipse.net4j.channel;version="4.9.0",
- org.eclipse.net4j.connector;version="4.9.0",
- org.eclipse.net4j.protocol;version="4.9.0",
- org.eclipse.net4j.signal;version="4.9.0",
- org.eclipse.net4j.signal.confirmation;version="4.9.0",
- org.eclipse.net4j.signal.heartbeat;version="4.9.0",
- org.eclipse.net4j.signal.security;version="4.9.0",
- org.eclipse.net4j.signal.wrapping;version="4.9.0",
- org.eclipse.spi.net4j;version="4.9.0"
+ org.eclipse.internal.net4j.bundle;version="4.10.0";x-internal:=true,
+ org.eclipse.net4j;version="4.10.0",
+ org.eclipse.net4j.acceptor;version="4.10.0",
+ org.eclipse.net4j.buffer;version="4.10.0",
+ org.eclipse.net4j.channel;version="4.10.0",
+ org.eclipse.net4j.connector;version="4.10.0",
+ org.eclipse.net4j.protocol;version="4.10.0",
+ org.eclipse.net4j.signal;version="4.10.0",
+ org.eclipse.net4j.signal.confirmation;version="4.10.0",
+ org.eclipse.net4j.signal.heartbeat;version="4.10.0",
+ org.eclipse.net4j.signal.security;version="4.10.0",
+ org.eclipse.net4j.signal.wrapping;version="4.10.0",
+ org.eclipse.spi.net4j;version="4.10.0"
Eclipse-BuddyPolicy: registered
Automatic-Module-Name: org.eclipse.net4j
diff --git a/plugins/org.eclipse.net4j/pom.xml b/plugins/org.eclipse.net4j/pom.xml
index 1f3be3a476..ae31170eaf 100644
--- a/plugins/org.eclipse.net4j/pom.xml
+++ b/plugins/org.eclipse.net4j/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo</groupId>
<artifactId>org.eclipse.net4j</artifactId>
- <version>4.9.0-SNAPSHOT</version>
+ <version>4.10.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/Buffer.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/Buffer.java
index ccbacd3321..d395c64b1c 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/Buffer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/Buffer.java
@@ -37,8 +37,6 @@ import java.util.concurrent.atomic.AtomicInteger;
*/
public class Buffer implements InternalBuffer
{
- public static final int MAKE_PAYLOAD_SIZE_NON_ZERO = 1;
-
private static final byte FLAG_EOS = 1 << 0;
private static final byte FLAG_CCAM = 1 << 1;
@@ -53,13 +51,13 @@ public class Buffer implements InternalBuffer
private IBufferProvider bufferProvider;
- private short channelID;
-
- private byte flags;
+ private ByteBuffer byteBuffer;
private BufferState state = BufferState.INITIAL;
- private ByteBuffer byteBuffer;
+ private short channelID;
+
+ private byte flags;
public Buffer(IBufferProvider provider, short capacity)
{
@@ -216,27 +214,31 @@ public class Buffer implements InternalBuffer
if (state == BufferState.READING_HEADER)
{
readChannel(socketChannel, byteBuffer);
+
if (byteBuffer.hasRemaining())
{
+ // Limit is set to HEADER_SIZE.
+ // Header is not fully received, yet.
return null;
}
- byteBuffer.flip();
- channelID = byteBuffer.getShort();
- short payloadSize = byteBuffer.getShort();
- if (payloadSize < 0)
+ // Header is fully received.
+ channelID = byteBuffer.getShort(CHANNEL_ID_POS);
+ short payloadSize = byteBuffer.getShort(PAYLOAD_SIZE_POS);
+
+ if (payloadSize == 0)
+ {
+ setEOS(true);
+ }
+ else if (payloadSize < 0)
{
setEOS(true);
payloadSize = (short)-payloadSize;
}
- payloadSize -= MAKE_PAYLOAD_SIZE_NON_ZERO;
-
- byteBuffer.clear();
-
try
{
- byteBuffer.limit(payloadSize);
+ byteBuffer.limit(HEADER_SIZE + payloadSize);
}
catch (IllegalArgumentException ex)
{
@@ -269,7 +271,7 @@ public class Buffer implements InternalBuffer
+ (isEOS() ? " (EOS)" : "") + StringUtil.NL + formatContent(false)); //$NON-NLS-1$ //$NON-NLS-2$
}
- byteBuffer.flip();
+ byteBuffer.position(HEADER_SIZE);
state = BufferState.GETTING;
return byteBuffer;
}
@@ -337,12 +339,6 @@ public class Buffer implements InternalBuffer
{
try
{
- if (byteBuffer.position() == HEADER_SIZE)
- {
- clear();
- return true; // *Pretend* that this empty buffer has been written
- }
-
if (state != BufferState.PUTTING && state != BufferState.WRITING)
{
throw new IllegalStateException(toString());
@@ -355,8 +351,7 @@ public class Buffer implements InternalBuffer
throw new IllegalStateException(toString() + ": channelID == NO_CHANNEL"); //$NON-NLS-1$
}
- int payloadSize = byteBuffer.position() - HEADER_SIZE + MAKE_PAYLOAD_SIZE_NON_ZERO;
-
+ int payloadSize = byteBuffer.position() - HEADER_SIZE;
boolean eos = isEOS();
if (eos)
{
@@ -590,11 +585,12 @@ public class Buffer implements InternalBuffer
}
}
- private void readChannel(SocketChannel socketChannel, ByteBuffer buffer) throws ClosedChannelException
+ private void readChannel(SocketChannel socketChannel, ByteBuffer byteBuffer) throws ClosedChannelException
{
try
{
- if (socketChannel.read(buffer) == -1)
+ int numBytes = socketChannel.read(byteBuffer);
+ if (numBytes == -1)
{
throw new IOException(toString() + ": Channel has reached end-of-stream");
}
@@ -643,8 +639,6 @@ public class Buffer implements InternalBuffer
eos = true;
}
- payloadSize -= MAKE_PAYLOAD_SIZE_NON_ZERO;
-
System.out.println("channelID: " + channelID);
System.out.println("payloadSize: " + payloadSize);
System.out.println("eos: " + eos);
@@ -667,6 +661,22 @@ public class Buffer implements InternalBuffer
System.out.println();
}
+ public static String dump(ByteBuffer byteBuffer)
+ {
+ final int position = byteBuffer.position();
+ final int limit = byteBuffer.limit();
+
+ StringBuilder builder = new StringBuilder();
+ for (int i = 0; i < limit; i++)
+ {
+ byte b = byteBuffer.get(i);
+ builder.append(' ');
+ builder.append(Byte.toString(b));
+ }
+
+ return "pos " + position + "/" + limit + ":" + builder;
+ }
+
public static void main(String[] args) throws Exception
{
decodeBuffer("0001ffea0000026b001a0000000101ff000000000000058d00");
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferUtil.java
index 155e4b508e..e89d7a9b53 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferUtil.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferUtil.java
@@ -10,6 +10,7 @@
*/
package org.eclipse.internal.net4j.buffer;
+import org.eclipse.net4j.util.StringUtil;
import org.eclipse.net4j.util.WrappedException;
import java.io.ByteArrayInputStream;
@@ -37,6 +38,8 @@ public final class BufferUtil
private static final byte TRUE = (byte)1;
+ private static final short NULL_STRING = -1;
+
private BufferUtil()
{
}
@@ -157,7 +160,7 @@ public final class BufferUtil
public static void putString(ByteBuffer byteBuffer, String str, boolean bestEffort)
{
int sizePosition = byteBuffer.position();
- byteBuffer.putShort((short)-1); // Placeholder for size
+ byteBuffer.putShort(NULL_STRING); // Placeholder for size
if (str != null)
{
@@ -186,7 +189,7 @@ public final class BufferUtil
if (max > 0)
{
str = str.substring(0, max);
- byteBuffer.position(start);
+ ((java.nio.Buffer)byteBuffer).position(start);
continue;
}
}
@@ -207,23 +210,23 @@ public final class BufferUtil
int end = byteBuffer.position();
short size = (short)Math.abs(end - start);
- byteBuffer.position(sizePosition);
+ ((java.nio.Buffer)byteBuffer).position(sizePosition);
byteBuffer.putShort(size);
- byteBuffer.position(end);
+ ((java.nio.Buffer)byteBuffer).position(end);
}
}
public static String getString(ByteBuffer byteBuffer)
{
short size = byteBuffer.getShort();
- if (size == -1)
+ if (size == NULL_STRING)
{
return null;
}
if (size == 0)
{
- return "";
+ return StringUtil.EMPTY;
}
byte[] bytes = new byte[size];
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/IBuffer.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/IBuffer.java
index 9e64ab67d8..1dd6a18020 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/IBuffer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/IBuffer.java
@@ -100,6 +100,16 @@ public interface IBuffer
public static final short HEADER_SIZE = CHANNEL_ID_BYTES + PAYLOAD_SIZE_BYTES;
/**
+ * @since 4.10
+ */
+ public static final int CHANNEL_ID_POS = 0;
+
+ /**
+ * @since 4.10
+ */
+ public static final int PAYLOAD_SIZE_POS = Short.BYTES;
+
+ /**
* Returns the {@link IBufferProvider} that has provided this buffer and that this buffer will be returned to when its
* {@link #release()} method is called.
*/
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/IBufferHandler.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/IBufferHandler.java
index c36acfcb5d..ee65ac6022 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/IBufferHandler.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/IBufferHandler.java
@@ -18,12 +18,14 @@ package org.eclipse.net4j.buffer;
public interface IBufferHandler
{
/**
- * Handles an {@link IBuffer} and optionally releases it. The implementor of this method takes over the ownership of
+ * Handles an {@link IBuffer} and possibly releases it.
+ * <p>
+ * The implementor of this method takes over the ownership of
* the buffer. Care must be taken to properly {@link IBuffer#release() release} the buffer if the ownership is not
- * explicitly passed to some further party.
+ * explicitly passed on to some further party.
*
* @param buffer
- * The buffer to be handled and otionally released.
+ * The buffer to be handled.
*/
public void handleBuffer(IBuffer buffer);
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Acceptor.java b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Acceptor.java
index c445e6ac96..2c8616db45 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Acceptor.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Acceptor.java
@@ -40,6 +40,8 @@ public abstract class Acceptor extends Container<IConnector> implements Internal
private ITransportConfig config;
+ private ConnectorPreparer connectorPreparer;
+
private transient IListener connectorListener = new LifecycleEventAdapter()
{
@Override
@@ -72,6 +74,22 @@ public abstract class Acceptor extends Container<IConnector> implements Internal
this.config = Net4jUtil.copyTransportConfig(this, config);
}
+ /**
+ * @since 4.10
+ */
+ public ConnectorPreparer getConnectorPreparer()
+ {
+ return connectorPreparer;
+ }
+
+ /**
+ * @since 4.10
+ */
+ public void setConnectorPreparer(ConnectorPreparer connectorPreparer)
+ {
+ this.connectorPreparer = connectorPreparer;
+ }
+
@Override
public INegotiator getNegotiator()
{
@@ -108,6 +126,11 @@ public abstract class Acceptor extends Container<IConnector> implements Internal
public void prepareConnector(InternalConnector connector)
{
connector.setConfig(getConfig());
+
+ if (connectorPreparer != null)
+ {
+ connectorPreparer.prepareConnector(connector);
+ }
}
public void addConnector(InternalConnector connector)
@@ -174,4 +197,13 @@ public abstract class Acceptor extends Container<IConnector> implements Internal
super.doDeactivate();
}
+
+ /**
+ * @author Eike Stepper
+ * @since 4.10
+ */
+ public interface ConnectorPreparer
+ {
+ public void prepareConnector(InternalConnector connector);
+ }
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Channel.java b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Channel.java
index a15c1e0f71..22fa8f1bf6 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Channel.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Channel.java
@@ -14,6 +14,7 @@ package org.eclipse.spi.net4j;
import org.eclipse.net4j.buffer.BufferState;
import org.eclipse.net4j.buffer.IBuffer;
import org.eclipse.net4j.buffer.IBufferHandler;
+import org.eclipse.net4j.channel.ChannelException;
import org.eclipse.net4j.channel.IChannelMultiplexer;
import org.eclipse.net4j.protocol.IProtocol;
import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
@@ -30,6 +31,7 @@ import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.internal.net4j.bundle.OM;
import org.eclipse.spi.net4j.InternalChannel.SendQueueEvent.Type;
+import org.eclipse.spi.net4j.InternalChannelMultiplexer.BufferMultiplexer;
import java.text.MessageFormat;
import java.util.Queue;
@@ -110,6 +112,7 @@ public class Channel extends Lifecycle implements InternalChannel, IExecutorServ
@Override
public void setMultiplexer(IChannelMultiplexer channelMultiplexer)
{
+ checkInactive();
this.channelMultiplexer = (InternalChannelMultiplexer)channelMultiplexer;
}
@@ -122,6 +125,7 @@ public class Channel extends Lifecycle implements InternalChannel, IExecutorServ
@Override
public void setID(short id)
{
+ checkInactive();
checkArg(id != IBuffer.NO_CHANNEL, "id == IBuffer.NO_CHANNEL"); //$NON-NLS-1$
this.id = id;
}
@@ -205,8 +209,7 @@ public class Channel extends Lifecycle implements InternalChannel, IExecutorServ
BufferState state = buffer.getState();
if (state != BufferState.PUTTING)
{
- OM.LOG.warn("Ignoring buffer in state == " + state + ": " + this); //$NON-NLS-1$ //$NON-NLS-2$
- return;
+ throw new ChannelException("Can't send buffer in state == " + state + ": " + this); //$NON-NLS-1$ //$NON-NLS-2$
}
if (TRACER.isEnabled())
@@ -214,21 +217,51 @@ public class Channel extends Lifecycle implements InternalChannel, IExecutorServ
TRACER.format("Handling buffer: {0} --> {1}", buffer, this); //$NON-NLS-1$
}
- if (sendQueue == null)
+ if (isClosed())
{
if (TRACER.isEnabled())
{
- TRACER.trace("Ignoring buffer because sendQueue == null: " + this); //$NON-NLS-1$
+ TRACER.trace("Ignoring buffer because channel is closed: " + this); //$NON-NLS-1$
}
buffer.release();
+ return;
}
- else
+
+ if (buffer.getPosition() == IBuffer.HEADER_SIZE && !buffer.isEOS())
+ {
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Ignoring empty buffer: " + this); //$NON-NLS-1$
+ }
+
+ if (buffer.isCCAM())
+ {
+ if (channelMultiplexer instanceof ChannelMultiplexer)
+ {
+ ((ChannelMultiplexer)channelMultiplexer).inverseCloseChannel(id);
+ }
+ else
+ {
+ deactivate();
+ }
+ }
+
+ buffer.release();
+ return;
+ }
+
+ ++sentBuffers;
+
+ if (sendQueue != null)
{
sendQueue.add(buffer);
- ++sentBuffers;
channelMultiplexer.multiplexChannel(this);
}
+ else
+ {
+ ((BufferMultiplexer)channelMultiplexer).multiplexBuffer(this, buffer);
+ }
}
/**
@@ -305,7 +338,12 @@ public class Channel extends Lifecycle implements InternalChannel, IExecutorServ
protected void doActivate() throws Exception
{
super.doActivate();
- sendQueue = new SendQueue();
+
+ if (!(channelMultiplexer instanceof BufferMultiplexer))
+ {
+ sendQueue = new SendQueue();
+ }
+
LifecycleUtil.activate(receiveSerializer);
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/ChannelMultiplexer.java b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/ChannelMultiplexer.java
index 321b204d25..d6dc8f09b9 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/ChannelMultiplexer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/ChannelMultiplexer.java
@@ -50,8 +50,10 @@ import java.util.concurrent.ExecutorService;
* @author Eike Stepper
* @since 2.0
*/
-public abstract class ChannelMultiplexer extends Container<IChannel> implements InternalChannelMultiplexer, IExecutorServiceProvider
+public abstract class ChannelMultiplexer extends Container<IChannel> implements InternalChannelMultiplexer, IExecutorServiceProvider, InverseCloseable
{
+ private static final ThreadLocal<Boolean> INVERSE_CLOSING = new ThreadLocal<>();
+
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_CONNECTOR, ChannelMultiplexer.class);
private ITransportConfig config;
@@ -235,14 +237,43 @@ public abstract class ChannelMultiplexer extends Container<IChannel> implements
public void closeChannel(InternalChannel channel) throws ChannelException
{
InternalChannel internalChannel = channel;
- deregisterChannelFromPeer(internalChannel);
+
+ if (INVERSE_CLOSING.get() == null)
+ {
+ deregisterChannelFromPeer(internalChannel);
+ }
+
removeChannel(internalChannel);
}
public void inverseCloseChannel(short channelID) throws ChannelException
{
InternalChannel channel = getChannel(channelID);
- LifecycleUtil.deactivate(channel);
+ INVERSE_CLOSING.set(Boolean.TRUE);
+
+ try
+ {
+ LifecycleUtil.deactivate(channel);
+ }
+ finally
+ {
+ INVERSE_CLOSING.remove();
+ }
+ }
+
+ @Override
+ public void inverseClose()
+ {
+ INVERSE_CLOSING.set(Boolean.TRUE);
+
+ try
+ {
+ LifecycleUtil.deactivateNoisy(this);
+ }
+ finally
+ {
+ INVERSE_CLOSING.remove();
+ }
}
protected InternalChannel createChannel()
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Connector.java b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Connector.java
index 9fdd94e828..1edd6e9470 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Connector.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Connector.java
@@ -149,8 +149,8 @@ public abstract class Connector extends ChannelMultiplexer implements InternalCo
break;
case NEGOTIATING:
- finishedConnecting.countDown();
negotiationContext = createNegotiationContext();
+ finishedConnecting.countDown();
getNegotiator().negotiate(negotiationContext);
break;
@@ -215,7 +215,7 @@ public abstract class Connector extends ChannelMultiplexer implements InternalCo
@Override
public void waitForConnection(long timeout) throws ConnectorException
{
- String message = "Connection timeout after " + timeout + " milliseconds";
+ long totalTimeout = timeout;
final long MAX_POLL_INTERVAL = 100L;
boolean withTimeout = timeout != NO_TIMEOUT;
@@ -253,7 +253,7 @@ public abstract class Connector extends ChannelMultiplexer implements InternalCo
if (!isConnected())
{
- throw new ConnectorException(message);
+ throw new ConnectorException("Connection timeout after " + totalTimeout + " milliseconds");
}
}
catch (ConnectorException ex)
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/InternalChannelMultiplexer.java b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/InternalChannelMultiplexer.java
index 511b45e0ac..f8453b8315 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/InternalChannelMultiplexer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/InternalChannelMultiplexer.java
@@ -11,6 +11,7 @@
package org.eclipse.spi.net4j;
import org.eclipse.net4j.ITransportConfigAware;
+import org.eclipse.net4j.buffer.IBuffer;
import org.eclipse.net4j.buffer.IBufferProvider;
import org.eclipse.net4j.channel.IChannel;
import org.eclipse.net4j.channel.IChannelMultiplexer;
@@ -34,8 +35,8 @@ public interface InternalChannelMultiplexer extends IChannelMultiplexer, IBuffer
public static final short RESERVED_CHANNEL = 0;
/**
- * Called by an {@link IChannel} each time a new buffer is available for multiplexing. This or another buffer can be
- * dequeued from the outputQueue of the {@link IChannel}.
+ * Called by a {@link IChannel channel} each time a new {@link IBuffer buffer} is available for multiplexing. This or another buffer can be
+ * dequeued from the {@link InternalChannel#getSendQueue() send queue} of the channel.
*/
public void multiplexChannel(InternalChannel channel);
@@ -43,4 +44,16 @@ public interface InternalChannelMultiplexer extends IChannelMultiplexer, IBuffer
* @since 2.0
*/
public void closeChannel(InternalChannel channel);
+
+ /**
+ * @author Eike Stepper
+ * @since 4.10
+ */
+ public interface BufferMultiplexer
+ {
+ /**
+ * Called by a {@link IChannel channel} each time a new {@link IBuffer buffer} is available for multiplexing.
+ */
+ public void multiplexBuffer(InternalChannel channel, IBuffer buffer);
+ }
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPUnitTest.java b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/InverseCloseable.java
index 6951c66812..809403a835 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPUnitTest.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/InverseCloseable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2009, 2011, 2012 Eike Stepper (Loehne, Germany) and others.
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,20 +8,15 @@
* Contributors:
* Eike Stepper - initial API and implementation
*/
-package org.eclipse.net4j.tests;
-
-import org.eclipse.net4j.util.tests.AbstractOMTest;
+package org.eclipse.spi.net4j;
/**
+ * If the meaning of this type isn't clear, there really should be more of a description here...
+ *
* @author Eike Stepper
+ * @since 4.10
*/
-public class TCPUnitTest extends AbstractOMTest
+public interface InverseCloseable
{
- public TCPUnitTest()
- {
- }
-
- public void test()
- {
- }
+ public void inverseClose();
}
diff --git a/releng/org.eclipse.emf.cdo.releng.parent/plugins/pom.xml b/releng/org.eclipse.emf.cdo.releng.parent/plugins/pom.xml
index 922bc32a8d..89b02411d3 100644
--- a/releng/org.eclipse.emf.cdo.releng.parent/plugins/pom.xml
+++ b/releng/org.eclipse.emf.cdo.releng.parent/plugins/pom.xml
@@ -141,6 +141,7 @@ Eike Stepper - initial API and implementation
<module>../../../plugins/org.eclipse.net4j.util</module>
<module>../../../plugins/org.eclipse.net4j.util.doc</module>
<module>../../../plugins/org.eclipse.net4j.util.ui</module>
+ <module>../../../plugins/org.eclipse.net4j.ws</module>
<module>../../../plugins/org.gastro.business</module>
<module>../../../plugins/org.gastro.business.edit</module>
<module>../../../plugins/org.gastro.inventory</module>
diff --git a/releng/org.eclipse.emf.cdo.releng.parent/tp/org.eclipse.emf.cdo.releng.tp.target b/releng/org.eclipse.emf.cdo.releng.parent/tp/org.eclipse.emf.cdo.releng.tp.target
index 6fcc07be6d..b63530a51a 100644
--- a/releng/org.eclipse.emf.cdo.releng.parent/tp/org.eclipse.emf.cdo.releng.tp.target
+++ b/releng/org.eclipse.emf.cdo.releng.parent/tp/org.eclipse.emf.cdo.releng.tp.target
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
-<target name="Generated from CDO" sequenceNumber="32">
+<target name="Generated from CDO" sequenceNumber="33">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="com.google.guava" version="0.0.0"/>
@@ -25,6 +25,13 @@
<unit id="org.eclipse.gmf.runtime.notation.edit" version="0.0.0"/>
<unit id="org.eclipse.gmf.runtime.notation.providers" version="0.0.0"/>
<unit id="org.eclipse.graphiti.ui" version="0.0.0"/>
+ <unit id="org.eclipse.jetty.client" version="0.0.0"/>
+ <unit id="org.eclipse.jetty.websocket.api" version="0.0.0"/>
+ <unit id="org.eclipse.jetty.websocket.client" version="0.0.0"/>
+ <unit id="org.eclipse.jetty.websocket.common" version="0.0.0"/>
+ <unit id="org.eclipse.jetty.websocket.server" version="0.0.0"/>
+ <unit id="org.eclipse.jetty.websocket.servlet" version="0.0.0"/>
+ <unit id="org.eclipse.jetty.xml" version="0.0.0"/>
<unit id="org.eclipse.nebula.widgets.gallery" version="0.0.0"/>
<unit id="org.eclipse.nebula.widgets.pshelf" version="0.0.0"/>
<unit id="org.eclipse.ocl.ecore" version="0.0.0"/>

Back to the top