Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-07-05 03:53:46 -0400
committerEike Stepper2011-07-05 03:53:46 -0400
commite6b488fa576bbe269150e98da0ad7e7902e03f18 (patch)
tree8341975896d5602cedd35b7e593b12576e868043 /plugins
parent2b575fea99ad1273b69d2d19bd23dda463545aea (diff)
downloadcdo-e6b488fa576bbe269150e98da0ad7e7902e03f18.tar.gz
cdo-e6b488fa576bbe269150e98da0ad7e7902e03f18.tar.xz
cdo-e6b488fa576bbe269150e98da0ad7e7902e03f18.zip
[350146] Make protocol timeout on the CDO server configurable
https://bugs.eclipse.org/bugs/show_bug.cgi?id=350146
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/SessionTest.java28
1 files changed, 28 insertions, 0 deletions
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 47a4368b76..b9f9348bba 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
@@ -13,16 +13,21 @@ package org.eclipse.emf.cdo.tests;
import org.eclipse.emf.cdo.common.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.server.IRepository;
+import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionCache;
+import org.eclipse.emf.cdo.spi.server.ISessionProtocol;
import org.eclipse.emf.cdo.tests.config.impl.RepositoryConfig;
import org.eclipse.emf.cdo.tests.config.impl.SessionConfig;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.util.CommitException;
import org.eclipse.emf.cdo.view.CDOView;
+import org.eclipse.net4j.signal.ISignalProtocol;
import org.eclipse.net4j.signal.RemoteException;
import org.eclipse.net4j.util.WrappedException;
+import org.eclipse.net4j.util.container.ContainerEventAdapter;
+import org.eclipse.net4j.util.container.IContainer;
import org.eclipse.net4j.util.om.OMPlatform;
import org.eclipse.net4j.util.om.log.OMLogHandler;
import org.eclipse.net4j.util.om.log.OMLogger;
@@ -386,4 +391,27 @@ public class SessionTest extends AbstractCDOTest
assertEquals(SecurityException.class, success.getCause().getClass());
}
}
+
+ public void testSetProtocolTimeout() throws Exception
+ {
+ IRepository repository = getRepository();
+ repository.getSessionManager().addListener(new ContainerEventAdapter<ISession>()
+ {
+ @Override
+ protected void onAdded(IContainer<ISession> container, ISession session)
+ {
+ ISessionProtocol protocol = session.getProtocol();
+ if (protocol instanceof ISignalProtocol)
+ {
+ ISignalProtocol<?> signalProtocol = (ISignalProtocol<?>)protocol;
+ signalProtocol.setTimeout(30L * 1000L);
+ }
+ }
+ });
+
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ transaction.createResource(getResourcePath("ttt"));
+ transaction.commit();
+ }
}

Back to the top