Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2013-01-06 14:24:18 -0500
committerChristian W. Damus2013-01-07 08:56:48 -0500
commitf81041496d650d8dfb3410890fcdface9f3d07fb (patch)
tree287436cf8fe65696941a1defdce41e683d1a3049 /plugins/org.eclipse.net4j.tests/src/org
parent5d6560c638d56707536fb0cd5beda2ca323b93b6 (diff)
downloadcdo-f81041496d650d8dfb3410890fcdface9f3d07fb.tar.gz
cdo-f81041496d650d8dfb3410890fcdface9f3d07fb.tar.xz
cdo-f81041496d650d8dfb3410890fcdface9f3d07fb.zip
Fix spurious diffs
Diffstat (limited to 'plugins/org.eclipse.net4j.tests/src/org')
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPAcceptorDefImplTest.java226
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPConnectorDefImplTest.java252
2 files changed, 239 insertions, 239 deletions
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPAcceptorDefImplTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPAcceptorDefImplTest.java
index d19a060a0b..2d80b220ce 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPAcceptorDefImplTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPAcceptorDefImplTest.java
@@ -1,113 +1,113 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, 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:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.tests.defs;
-
-import org.eclipse.net4j.defs.Net4jDefsFactory;
-import org.eclipse.net4j.defs.TCPAcceptorDef;
-import org.eclipse.net4j.internal.tcp.TCPConnector;
-import org.eclipse.net4j.tcp.ITCPAcceptor;
-import org.eclipse.net4j.util.defs.ChallengeNegotiatorDef;
-import org.eclipse.net4j.util.defs.Net4jUtilDefsFactory;
-import org.eclipse.net4j.util.defs.User;
-import org.eclipse.net4j.util.defs.UserManagerDef;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import org.eclipse.net4j.util.tests.AbstractOMTest;
-
-/**
- * @author Andre Dietisheim
- */
-public class TCPAcceptorDefImplTest extends AbstractOMTest
-{
- private static final long TIMEOUT = 10000;
-
- private static final long DELAY = 500;
-
- private static final String HOST = "localhost"; //$NON-NLS-1$
-
- private static final int PORT = 2036;
-
- private static final String USERID = "André"; //$NON-NLS-1$
-
- private static final String PASSWORD = "aPassword"; //$NON-NLS-1$
-
- private TCPConnector tcpConnector;
-
- @Override
- protected void doSetUp() throws Exception
- {
- tcpConnector = Util.createTCPClientConnector(HOST, PORT, Util.createTCPSelector());
- }
-
- @Override
- protected void doTearDown() throws Exception
- {
- LifecycleUtil.deactivate(tcpConnector);
- }
-
- public void testAcceptorDefOpensConnection()
- {
- TCPAcceptorDef tcpAcceptorDef = createTCPAcceptorDef();
-
- ITCPAcceptor tcpAcceptor = (ITCPAcceptor)tcpAcceptorDef.getInstance();
-
- assertEquals(true, LifecycleUtil.isActive(tcpAcceptor));
-
- LifecycleUtil.activate(tcpConnector);
- tcpConnector.waitForConnection(DELAY + TIMEOUT);
- assertEquals(true, LifecycleUtil.isActive(tcpConnector));
-
- LifecycleUtil.deactivate(tcpAcceptor);
- }
-
- /**
- * Doesn't work yet: UserManager does not add its users yet
- */
- public void _testCredentialsProvider()
- {
- TCPAcceptorDef tcpAcceptorDef = createTCPAcceptorDef();
-
- User user = Net4jUtilDefsFactory.eINSTANCE.createUser();
- user.setUserID(USERID);
- user.setPassword(PASSWORD);
-
- UserManagerDef userManagerDef = Net4jUtilDefsFactory.eINSTANCE.createUserManagerDef();
- userManagerDef.getUser().add(user);
-
- ChallengeNegotiatorDef challengeNegotiatorDef = Net4jUtilDefsFactory.eINSTANCE.createChallengeNegotiatorDef();
- challengeNegotiatorDef.setRandomizer(Net4jUtilDefsFactory.eINSTANCE.createRandomizerDef());
- challengeNegotiatorDef.setUserManager(userManagerDef);
-
- tcpAcceptorDef.setNegotiator(challengeNegotiatorDef);
- ITCPAcceptor tcpAcceptor = (ITCPAcceptor)tcpAcceptorDef.getInstance();
- assertEquals(true, LifecycleUtil.isActive(tcpAcceptor));
-
- Util.addNegotiator(USERID, PASSWORD, tcpConnector);
- LifecycleUtil.activate(tcpConnector);
-
- tcpConnector.waitForConnection(DELAY + TIMEOUT);
- LifecycleUtil.deactivate(tcpConnector);
-
- Util.removeNegotiator(tcpConnector);
- LifecycleUtil.deactivate(tcpAcceptor);
- }
-
- private TCPAcceptorDef createTCPAcceptorDef()
- {
- TCPAcceptorDef tcpAcceptorDef = Net4jDefsFactory.eINSTANCE.createTCPAcceptorDef();
- tcpAcceptorDef.setHost(HOST);
- tcpAcceptorDef.setPort(PORT);
- tcpAcceptorDef.setBufferProvider(Net4jDefsFactory.eINSTANCE.createBufferPoolDef());
- tcpAcceptorDef.setExecutorService(Net4jUtilDefsFactory.eINSTANCE.createThreadPoolDef());
- tcpAcceptorDef.setTcpSelectorDef(Net4jDefsFactory.eINSTANCE.createTCPSelectorDef());
- return tcpAcceptorDef;
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, 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:
+ * Andre Dietisheim - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.net4j.tests.defs;
+
+import org.eclipse.net4j.defs.Net4jDefsFactory;
+import org.eclipse.net4j.defs.TCPAcceptorDef;
+import org.eclipse.net4j.internal.tcp.TCPConnector;
+import org.eclipse.net4j.tcp.ITCPAcceptor;
+import org.eclipse.net4j.util.defs.ChallengeNegotiatorDef;
+import org.eclipse.net4j.util.defs.Net4jUtilDefsFactory;
+import org.eclipse.net4j.util.defs.User;
+import org.eclipse.net4j.util.defs.UserManagerDef;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+import org.eclipse.net4j.util.tests.AbstractOMTest;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class TCPAcceptorDefImplTest extends AbstractOMTest
+{
+ private static final long TIMEOUT = 10000;
+
+ private static final long DELAY = 500;
+
+ private static final String HOST = "localhost"; //$NON-NLS-1$
+
+ private static final int PORT = 2036;
+
+ private static final String USERID = "André"; //$NON-NLS-1$
+
+ private static final String PASSWORD = "aPassword"; //$NON-NLS-1$
+
+ private TCPConnector tcpConnector;
+
+ @Override
+ protected void doSetUp() throws Exception
+ {
+ tcpConnector = Util.createTCPClientConnector(HOST, PORT, Util.createTCPSelector());
+ }
+
+ @Override
+ protected void doTearDown() throws Exception
+ {
+ LifecycleUtil.deactivate(tcpConnector);
+ }
+
+ public void testAcceptorDefOpensConnection()
+ {
+ TCPAcceptorDef tcpAcceptorDef = createTCPAcceptorDef();
+
+ ITCPAcceptor tcpAcceptor = (ITCPAcceptor)tcpAcceptorDef.getInstance();
+
+ assertEquals(true, LifecycleUtil.isActive(tcpAcceptor));
+
+ LifecycleUtil.activate(tcpConnector);
+ tcpConnector.waitForConnection(DELAY + TIMEOUT);
+ assertEquals(true, LifecycleUtil.isActive(tcpConnector));
+
+ LifecycleUtil.deactivate(tcpAcceptor);
+ }
+
+ /**
+ * Doesn't work yet: UserManager does not add its users yet
+ */
+ public void _testCredentialsProvider()
+ {
+ TCPAcceptorDef tcpAcceptorDef = createTCPAcceptorDef();
+
+ User user = Net4jUtilDefsFactory.eINSTANCE.createUser();
+ user.setUserID(USERID);
+ user.setPassword(PASSWORD);
+
+ UserManagerDef userManagerDef = Net4jUtilDefsFactory.eINSTANCE.createUserManagerDef();
+ userManagerDef.getUser().add(user);
+
+ ChallengeNegotiatorDef challengeNegotiatorDef = Net4jUtilDefsFactory.eINSTANCE.createChallengeNegotiatorDef();
+ challengeNegotiatorDef.setRandomizer(Net4jUtilDefsFactory.eINSTANCE.createRandomizerDef());
+ challengeNegotiatorDef.setUserManager(userManagerDef);
+
+ tcpAcceptorDef.setNegotiator(challengeNegotiatorDef);
+ ITCPAcceptor tcpAcceptor = (ITCPAcceptor)tcpAcceptorDef.getInstance();
+ assertEquals(true, LifecycleUtil.isActive(tcpAcceptor));
+
+ Util.addNegotiator(USERID, PASSWORD, tcpConnector);
+ LifecycleUtil.activate(tcpConnector);
+
+ tcpConnector.waitForConnection(DELAY + TIMEOUT);
+ LifecycleUtil.deactivate(tcpConnector);
+
+ Util.removeNegotiator(tcpConnector);
+ LifecycleUtil.deactivate(tcpAcceptor);
+ }
+
+ private TCPAcceptorDef createTCPAcceptorDef()
+ {
+ TCPAcceptorDef tcpAcceptorDef = Net4jDefsFactory.eINSTANCE.createTCPAcceptorDef();
+ tcpAcceptorDef.setHost(HOST);
+ tcpAcceptorDef.setPort(PORT);
+ tcpAcceptorDef.setBufferProvider(Net4jDefsFactory.eINSTANCE.createBufferPoolDef());
+ tcpAcceptorDef.setExecutorService(Net4jUtilDefsFactory.eINSTANCE.createThreadPoolDef());
+ tcpAcceptorDef.setTcpSelectorDef(Net4jDefsFactory.eINSTANCE.createTCPSelectorDef());
+ return tcpAcceptorDef;
+ }
+}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPConnectorDefImplTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPConnectorDefImplTest.java
index 9e5f505a1e..f90d934e70 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPConnectorDefImplTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPConnectorDefImplTest.java
@@ -1,126 +1,126 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, 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:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.tests.defs;
-
-import org.eclipse.net4j.defs.Net4jDefsFactory;
-import org.eclipse.net4j.defs.TCPConnectorDef;
-import org.eclipse.net4j.internal.tcp.TCPAcceptor;
-import org.eclipse.net4j.tcp.ITCPConnector;
-import org.eclipse.net4j.tests.AbstractProtocolTest;
-import org.eclipse.net4j.util.defs.Net4jUtilDefsFactory;
-import org.eclipse.net4j.util.defs.PasswordCredentialsProviderDef;
-import org.eclipse.net4j.util.defs.ResponseNegotiatorDef;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-
-/**
- * @author Andre Dietisheim
- */
-public class TCPConnectorDefImplTest extends AbstractProtocolTest
-{
- private static final long DELAY = 500l;
-
- private static final int PORT = 2036;
-
- private static final long TIMEOUT = 10000l;
-
- private static final String USERID = "André"; //$NON-NLS-1$
-
- private static final String PASSWORD = "aPassword"; //$NON-NLS-1$
-
- private TCPAcceptor tcpAcceptor;
-
- @Override
- protected void doSetUp() throws Exception
- {
- tcpAcceptor = Util.createTCPAcceptor(HOST, PORT, DELAY);
- }
-
- @Override
- protected void doTearDown() throws Exception
- {
- LifecycleUtil.deactivate(tcpAcceptor);
- }
-
- public void testConnectorDefOpensConnection()
- {
- TCPConnectorDef tcpConnectorDef = Net4jDefsFactory.eINSTANCE.createTCPConnectorDef();
-
- tcpConnectorDef.setHost(HOST);
- tcpConnectorDef.setPort(PORT);
- tcpConnectorDef.setBufferProvider(Net4jDefsFactory.eINSTANCE.createBufferPoolDef());
- tcpConnectorDef.setExecutorService(Net4jUtilDefsFactory.eINSTANCE.createThreadPoolDef());
- tcpConnectorDef.setTcpSelectorDef(Net4jDefsFactory.eINSTANCE.createTCPSelectorDef());
-
- ITCPConnector tcpConnector = (ITCPConnector)tcpConnectorDef.getInstance();
-
- tcpConnector.waitForConnection(DELAY + TIMEOUT);
- assertEquals(true, LifecycleUtil.isActive(tcpConnector));
-
- LifecycleUtil.deactivate(tcpConnector);
- }
-
- public void testNewInstanceWhenTouched()
- {
- TCPConnectorDef tcpConnectorDef = Net4jDefsFactory.eINSTANCE.createTCPConnectorDef();
-
- tcpConnectorDef.setHost(HOST);
- tcpConnectorDef.setPort(PORT);
- tcpConnectorDef.setBufferProvider(Net4jDefsFactory.eINSTANCE.createBufferPoolDef());
- tcpConnectorDef.setExecutorService(Net4jUtilDefsFactory.eINSTANCE.createThreadPoolDef());
- tcpConnectorDef.setTcpSelectorDef(Net4jDefsFactory.eINSTANCE.createTCPSelectorDef());
-
- ITCPConnector thisTcpConnector = (ITCPConnector)tcpConnectorDef.getInstance();
- tcpConnectorDef.setPort(PORT + 1);
-
- assertEquals(true, tcpConnectorDef.isTouched());
-
- ITCPConnector thatTcpConnector = (ITCPConnector)tcpConnectorDef.getInstance();
-
- assertEquals(true, !LifecycleUtil.isActive(thisTcpConnector));
- assertEquals(true, !tcpConnectorDef.isTouched());
- assertEquals(true, thisTcpConnector != thatTcpConnector);
-
- LifecycleUtil.deactivate(thisTcpConnector);
- LifecycleUtil.deactivate(thatTcpConnector);
- }
-
- public void testCredentialsProvider()
- {
- Util.addNegotiator(USERID, PASSWORD, tcpAcceptor);
-
- TCPConnectorDef tcpConnectorDef = Net4jDefsFactory.eINSTANCE.createTCPConnectorDef();
-
- tcpConnectorDef.setHost(HOST);
- tcpConnectorDef.setPort(PORT);
- tcpConnectorDef.setBufferProvider(Net4jDefsFactory.eINSTANCE.createBufferPoolDef());
- tcpConnectorDef.setExecutorService(Net4jUtilDefsFactory.eINSTANCE.createThreadPoolDef());
- tcpConnectorDef.setTcpSelectorDef(Net4jDefsFactory.eINSTANCE.createTCPSelectorDef());
-
- PasswordCredentialsProviderDef credentialsProviderDef = Net4jUtilDefsFactory.eINSTANCE
- .createPasswordCredentialsProviderDef();
- credentialsProviderDef.setUserID(USERID);
- credentialsProviderDef.setPassword(PASSWORD);
-
- ResponseNegotiatorDef negotiatorDef = Net4jUtilDefsFactory.eINSTANCE.createResponseNegotiatorDef();
- negotiatorDef.setCredentialsProvider(credentialsProviderDef);
- tcpConnectorDef.setNegotiator(negotiatorDef);
-
- ITCPConnector tcpConnector = (ITCPConnector)tcpConnectorDef.getInstance();
-
- tcpConnector.waitForConnection(DELAY + TIMEOUT);
- assertEquals(true, LifecycleUtil.isActive(tcpConnector));
-
- LifecycleUtil.deactivate(tcpConnector);
-
- Util.removeNegotiator(tcpAcceptor);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, 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:
+ * Andre Dietisheim - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.net4j.tests.defs;
+
+import org.eclipse.net4j.defs.Net4jDefsFactory;
+import org.eclipse.net4j.defs.TCPConnectorDef;
+import org.eclipse.net4j.internal.tcp.TCPAcceptor;
+import org.eclipse.net4j.tcp.ITCPConnector;
+import org.eclipse.net4j.tests.AbstractProtocolTest;
+import org.eclipse.net4j.util.defs.Net4jUtilDefsFactory;
+import org.eclipse.net4j.util.defs.PasswordCredentialsProviderDef;
+import org.eclipse.net4j.util.defs.ResponseNegotiatorDef;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class TCPConnectorDefImplTest extends AbstractProtocolTest
+{
+ private static final long DELAY = 500l;
+
+ private static final int PORT = 2036;
+
+ private static final long TIMEOUT = 10000l;
+
+ private static final String USERID = "André"; //$NON-NLS-1$
+
+ private static final String PASSWORD = "aPassword"; //$NON-NLS-1$
+
+ private TCPAcceptor tcpAcceptor;
+
+ @Override
+ protected void doSetUp() throws Exception
+ {
+ tcpAcceptor = Util.createTCPAcceptor(HOST, PORT, DELAY);
+ }
+
+ @Override
+ protected void doTearDown() throws Exception
+ {
+ LifecycleUtil.deactivate(tcpAcceptor);
+ }
+
+ public void testConnectorDefOpensConnection()
+ {
+ TCPConnectorDef tcpConnectorDef = Net4jDefsFactory.eINSTANCE.createTCPConnectorDef();
+
+ tcpConnectorDef.setHost(HOST);
+ tcpConnectorDef.setPort(PORT);
+ tcpConnectorDef.setBufferProvider(Net4jDefsFactory.eINSTANCE.createBufferPoolDef());
+ tcpConnectorDef.setExecutorService(Net4jUtilDefsFactory.eINSTANCE.createThreadPoolDef());
+ tcpConnectorDef.setTcpSelectorDef(Net4jDefsFactory.eINSTANCE.createTCPSelectorDef());
+
+ ITCPConnector tcpConnector = (ITCPConnector)tcpConnectorDef.getInstance();
+
+ tcpConnector.waitForConnection(DELAY + TIMEOUT);
+ assertEquals(true, LifecycleUtil.isActive(tcpConnector));
+
+ LifecycleUtil.deactivate(tcpConnector);
+ }
+
+ public void testNewInstanceWhenTouched()
+ {
+ TCPConnectorDef tcpConnectorDef = Net4jDefsFactory.eINSTANCE.createTCPConnectorDef();
+
+ tcpConnectorDef.setHost(HOST);
+ tcpConnectorDef.setPort(PORT);
+ tcpConnectorDef.setBufferProvider(Net4jDefsFactory.eINSTANCE.createBufferPoolDef());
+ tcpConnectorDef.setExecutorService(Net4jUtilDefsFactory.eINSTANCE.createThreadPoolDef());
+ tcpConnectorDef.setTcpSelectorDef(Net4jDefsFactory.eINSTANCE.createTCPSelectorDef());
+
+ ITCPConnector thisTcpConnector = (ITCPConnector)tcpConnectorDef.getInstance();
+ tcpConnectorDef.setPort(PORT + 1);
+
+ assertEquals(true, tcpConnectorDef.isTouched());
+
+ ITCPConnector thatTcpConnector = (ITCPConnector)tcpConnectorDef.getInstance();
+
+ assertEquals(true, !LifecycleUtil.isActive(thisTcpConnector));
+ assertEquals(true, !tcpConnectorDef.isTouched());
+ assertEquals(true, thisTcpConnector != thatTcpConnector);
+
+ LifecycleUtil.deactivate(thisTcpConnector);
+ LifecycleUtil.deactivate(thatTcpConnector);
+ }
+
+ public void testCredentialsProvider()
+ {
+ Util.addNegotiator(USERID, PASSWORD, tcpAcceptor);
+
+ TCPConnectorDef tcpConnectorDef = Net4jDefsFactory.eINSTANCE.createTCPConnectorDef();
+
+ tcpConnectorDef.setHost(HOST);
+ tcpConnectorDef.setPort(PORT);
+ tcpConnectorDef.setBufferProvider(Net4jDefsFactory.eINSTANCE.createBufferPoolDef());
+ tcpConnectorDef.setExecutorService(Net4jUtilDefsFactory.eINSTANCE.createThreadPoolDef());
+ tcpConnectorDef.setTcpSelectorDef(Net4jDefsFactory.eINSTANCE.createTCPSelectorDef());
+
+ PasswordCredentialsProviderDef credentialsProviderDef = Net4jUtilDefsFactory.eINSTANCE
+ .createPasswordCredentialsProviderDef();
+ credentialsProviderDef.setUserID(USERID);
+ credentialsProviderDef.setPassword(PASSWORD);
+
+ ResponseNegotiatorDef negotiatorDef = Net4jUtilDefsFactory.eINSTANCE.createResponseNegotiatorDef();
+ negotiatorDef.setCredentialsProvider(credentialsProviderDef);
+ tcpConnectorDef.setNegotiator(negotiatorDef);
+
+ ITCPConnector tcpConnector = (ITCPConnector)tcpConnectorDef.getInstance();
+
+ tcpConnector.waitForConnection(DELAY + TIMEOUT);
+ assertEquals(true, LifecycleUtil.isActive(tcpConnector));
+
+ LifecycleUtil.deactivate(tcpConnector);
+
+ Util.removeNegotiator(tcpAcceptor);
+ }
+}

Back to the top