diff options
author | Eike Stepper | 2009-01-13 09:11:40 +0000 |
---|---|---|
committer | Eike Stepper | 2009-01-13 09:11:40 +0000 |
commit | 6c5233a735c56100605f46b59f4e46a7c1cf40dc (patch) | |
tree | 12242648387b11bbc99fa4e332a10c95396a69cb /plugins/org.eclipse.emf.cdo.tests/src/org | |
parent | 5635ec88448a920dc02e0d649441aa5c4146b259 (diff) | |
download | cdo-6c5233a735c56100605f46b59f4e46a7c1cf40dc.tar.gz cdo-6c5233a735c56100605f46b59f4e46a7c1cf40dc.tar.xz cdo-6c5233a735c56100605f46b59f4e46a7c1cf40dc.zip |
Prepare common query
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests/src/org')
12 files changed, 40 insertions, 30 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AttributeTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AttributeTest.java index 4c83dbb201..bd9f4a3238 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AttributeTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AttributeTest.java @@ -120,6 +120,7 @@ public class AttributeTest extends AbstractCDOTest { assertEquals(storeByteArray[i], saveByteArray[i]); } + view.close(); session.close(); } diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ConflictResolverTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ConflictResolverTest.java index b59a5c95cd..700705a29c 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ConflictResolverTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ConflictResolverTest.java @@ -16,7 +16,7 @@ import org.eclipse.emf.cdo.tests.model1.Address; import org.eclipse.emf.cdo.transaction.CDOTransaction; import org.eclipse.emf.cdo.util.CDOUtil; -import org.eclipse.emf.spi.cdo.CDOObjectConflictResolver.MergeLocalChangesPerFeature; +import org.eclipse.emf.spi.cdo.AbstractObjectConflictResolver.MergeLocalChangesPerFeature; /** * @author Simon McDuff diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ImportXML.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ImportXML.java index 347fe37778..b4b1ff84dc 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ImportXML.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ImportXML.java @@ -10,19 +10,19 @@ */ package org.eclipse.emf.cdo.tests; +import org.eclipse.emf.cdo.net4j.CDONet4jUtil; +import org.eclipse.emf.cdo.net4j.CDOSessionConfiguration; import org.eclipse.emf.cdo.server.CDOServerUtil; import org.eclipse.emf.cdo.server.IRepository; import org.eclipse.emf.cdo.server.IStore; import org.eclipse.emf.cdo.server.StoreUtil; import org.eclipse.emf.cdo.server.IRepository.Props; import org.eclipse.emf.cdo.session.CDOSession; -import org.eclipse.emf.cdo.session.CDOSessionConfiguration; import org.eclipse.emf.cdo.tests.model1.Category; import org.eclipse.emf.cdo.tests.model1.Model1Factory; import org.eclipse.emf.cdo.tests.model1.Model1Package; import org.eclipse.emf.cdo.tests.model1.Product1; import org.eclipse.emf.cdo.transaction.CDOTransaction; -import org.eclipse.emf.cdo.util.CDOUtil; import org.eclipse.net4j.Net4jUtil; import org.eclipse.net4j.connector.IConnector; @@ -54,7 +54,7 @@ public class ImportXML Net4jUtil.prepareContainer(container); // Prepare the Net4j kernel JVMUtil.prepareContainer(container); // Prepare the JVM transport CDOServerUtil.prepareContainer(container); // Prepare the CDO server - CDOUtil.prepareContainer(container); // Prepare the CDO client + CDONet4jUtil.prepareContainer(container); // Prepare the CDO client container.activate(); // Start the transport and create a repository @@ -112,7 +112,7 @@ public class ImportXML protected static CDOSession openSession(IConnector connector) { - CDOSessionConfiguration configuration = CDOUtil.createSessionConfiguration(); + CDOSessionConfiguration configuration = CDONet4jUtil.createSessionConfiguration(); configuration.setConnector(connector); configuration.setRepositoryName(REPOSITORY_NAME); return configuration.openSession(); diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LegacyTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LegacyTest.java index e2b161d873..8c8518a19a 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LegacyTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LegacyTest.java @@ -26,7 +26,7 @@ public class LegacyTest extends AbstractCDOTest // resource.getContents().add(hook); // transaction.commit(); // - // CDOObject cdoHook = CDOUtil.getCDOObject(hook); + // CDOObject cdoHook = CDONet4jUtil.getCDOObject(hook); // assertEquals(false, CDOLegacyWrapper.isLegacyProxy(cdoHook)); // assertEquals(CDOState.CLEAN, cdoHook.cdoState()); // assertEquals(CDOState.CLEAN, resource.cdoState()); @@ -50,7 +50,7 @@ public class LegacyTest extends AbstractCDOTest // EList<EObject> contents = resource.getContents(); // // Hook hook = (Hook)contents.get(0); - // CDOObject cdoHook = CDOUtil.getCDOObject(hook); + // CDOObject cdoHook = CDONet4jUtil.getCDOObject(hook); // assertEquals(false, CDOLegacyWrapper.isLegacyProxy(cdoHook)); // assertEquals(CDOState.CLEAN, cdoHook.cdoState()); // assertEquals(CDOState.CLEAN, resource.cdoState()); @@ -76,7 +76,7 @@ public class LegacyTest extends AbstractCDOTest // resource.getContents().add(hook); // transaction.commit(); // - // CDOObject cdoHook = CDOUtil.getCDOObject(hook); + // CDOObject cdoHook = CDONet4jUtil.getCDOObject(hook); // assertEquals(false, CDOLegacyWrapper.isLegacyProxy(cdoHook)); // assertEquals(CDOState.CLEAN, cdoHook.cdoState()); // assertEquals(CDOState.CLEAN, resource.cdoState()); @@ -91,7 +91,7 @@ public class LegacyTest extends AbstractCDOTest // Hook hook = (Hook)contents.get(0); // assertNotProxy(hook); // - // CDOObject cdoHook = CDOUtil.getCDOObject(hook); + // CDOObject cdoHook = CDONet4jUtil.getCDOObject(hook); // assertEquals(false, CDOLegacyWrapper.isLegacyProxy(cdoHook)); // assertEquals(CDOState.CLEAN, cdoHook.cdoState()); // @@ -111,17 +111,17 @@ public class LegacyTest extends AbstractCDOTest // Hook h0 = children.get(0); // assertNotProxy(h0); // assertEquals("Hook 1", h0.getName()); - // assertEquals(CDOState.CLEAN, CDOUtil.getCDOObject(h0).cdoState()); + // assertEquals(CDOState.CLEAN, CDONet4jUtil.getCDOObject(h0).cdoState()); // // Hook h1 = children.get(1); // assertNotProxy(h1); // assertEquals("Hook 2", h1.getName()); - // assertEquals(CDOState.CLEAN, CDOUtil.getCDOObject(h1).cdoState()); + // assertEquals(CDOState.CLEAN, CDONet4jUtil.getCDOObject(h1).cdoState()); // // Hook h2 = children.get(2); // assertNotProxy(h2); // assertEquals("Hook 3", h2.getName()); - // assertEquals(CDOState.CLEAN, CDOUtil.getCDOObject(h2).cdoState()); + // assertEquals(CDOState.CLEAN, CDONet4jUtil.getCDOObject(h2).cdoState()); // session.close(); // } // diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PackageRegistryTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PackageRegistryTest.java index 2bdccd36e7..d419b1814f 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PackageRegistryTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PackageRegistryTest.java @@ -13,9 +13,10 @@ package org.eclipse.emf.cdo.tests; import org.eclipse.emf.cdo.CDOObject; import org.eclipse.emf.cdo.common.model.CDOPackage; import org.eclipse.emf.cdo.eresource.CDOResource; +import org.eclipse.emf.cdo.net4j.CDONet4jUtil; +import org.eclipse.emf.cdo.net4j.CDOSessionConfiguration; import org.eclipse.emf.cdo.session.CDOPackageTypeRegistry; import org.eclipse.emf.cdo.session.CDOSession; -import org.eclipse.emf.cdo.session.CDOSessionConfiguration; import org.eclipse.emf.cdo.tests.bundle.OM; import org.eclipse.emf.cdo.tests.config.IRepositoryConfig; import org.eclipse.emf.cdo.tests.mango.Value; @@ -29,7 +30,6 @@ import org.eclipse.emf.cdo.tests.model3.subpackage.Class2; import org.eclipse.emf.cdo.tests.model3.subpackage.SubpackageFactory; import org.eclipse.emf.cdo.tests.model3.subpackage.SubpackagePackage; import org.eclipse.emf.cdo.transaction.CDOTransaction; -import org.eclipse.emf.cdo.util.CDOUtil; import org.eclipse.emf.cdo.util.EMFUtil; import org.eclipse.emf.common.util.URI; @@ -237,7 +237,7 @@ public class PackageRegistryTest extends AbstractCDOTest { { // Create resource in session 1 - CDOSessionConfiguration configuration = CDOUtil.createSessionConfiguration(); + CDOSessionConfiguration configuration = CDONet4jUtil.createSessionConfiguration(); configuration.setConnector(getConnector()); configuration.setRepositoryName(IRepositoryConfig.REPOSITORY_NAME); configuration.setEagerPackageRegistry(); @@ -270,7 +270,7 @@ public class PackageRegistryTest extends AbstractCDOTest { { // Create resource in session 1 - CDOSessionConfiguration configuration = CDOUtil.createSessionConfiguration(); + CDOSessionConfiguration configuration = CDONet4jUtil.createSessionConfiguration(); configuration.setConnector(getConnector()); configuration.setRepositoryName(IRepositoryConfig.REPOSITORY_NAME); configuration.setLazyPackageRegistry(); diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StateMachineTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StateMachineTest.java index 161d32a97f..901d60add6 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StateMachineTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StateMachineTest.java @@ -24,13 +24,13 @@ import org.eclipse.emf.cdo.transaction.CDOTransaction; import org.eclipse.emf.cdo.util.CDOUtil; import org.eclipse.emf.internal.cdo.CDOStateMachine; -import org.eclipse.emf.internal.cdo.protocol.CommitTransactionResult; import org.eclipse.net4j.util.io.IOUtil; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.spi.cdo.InternalCDOObject; +import org.eclipse.emf.spi.cdo.CDOSessionProtocol.CommitTransactionResult; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TransactionMonitoringTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TransactionMonitoringTest.java index cd5b10a28b..693b21d78f 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TransactionMonitoringTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TransactionMonitoringTest.java @@ -10,12 +10,12 @@ */ package org.eclipse.emf.cdo.tests; +import org.eclipse.emf.cdo.net4j.CDONet4jUtil; +import org.eclipse.emf.cdo.net4j.CDOSessionConfiguration; import org.eclipse.emf.cdo.session.CDOSession; -import org.eclipse.emf.cdo.session.CDOSessionConfiguration; import org.eclipse.emf.cdo.tests.model1.Model1Factory; import org.eclipse.emf.cdo.tests.model1.Model1Package; import org.eclipse.emf.cdo.transaction.CDOTransaction; -import org.eclipse.emf.cdo.util.CDOUtil; import org.eclipse.net4j.Net4jUtil; import org.eclipse.net4j.tcp.TCPUtil; @@ -41,10 +41,10 @@ public class TransactionMonitoringTest IManagedContainer container = ContainerUtil.createContainer(); Net4jUtil.prepareContainer(container); TCPUtil.prepareContainer(container); - CDOUtil.prepareContainer(container); + CDONet4jUtil.prepareContainer(container); container.activate(); - CDOSessionConfiguration configuration = CDOUtil.createSessionConfiguration(); + CDOSessionConfiguration configuration = CDONet4jUtil.createSessionConfiguration(); configuration.setConnector(TCPUtil.getConnector(container, "localhost")); configuration.setRepositoryName("repo1"); 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 bd869c2c04..dfab51d152 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 @@ -44,7 +44,10 @@ public class Bugzilla_241464_Test extends AbstractCDOTest } CDOSession session = openModel1Session(); - session.getProtocol().setTimeout(2000L); + if (session instanceof org.eclipse.emf.cdo.net4j.CDOSession) + { + ((org.eclipse.emf.cdo.net4j.CDOSession)session).options().getProtocol().setTimeout(2000L); + } CDOTransaction transaction = session.openTransaction(); CDOResource resource = transaction.getResource("/test1"); diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_246442_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_246442_Test.java index 768ef00ace..d1fd0c0212 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_246442_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_246442_Test.java @@ -67,7 +67,10 @@ public class Bugzilla_246442_Test extends AbstractCDOTest } CDOSession session = openSession(); - session.getProtocol().setTimeout(2000L); + if (session instanceof org.eclipse.emf.cdo.net4j.CDOSession) + { + ((org.eclipse.emf.cdo.net4j.CDOSession)session).options().getProtocol().setTimeout(2000L); + } CDOTransaction transaction = session.openTransaction(); transaction.getObject(lookupObject); diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_258933_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_258933_Test.java index 25a366fa86..0c193e970e 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_258933_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_258933_Test.java @@ -124,7 +124,10 @@ public class Bugzilla_258933_Test extends AbstractCDOTest CDOSession session = openSession(); session.getPackageRegistry().putEPackage(topPackage); - session.getProtocol().setTimeout(2000L); + if (session instanceof org.eclipse.emf.cdo.net4j.CDOSession) + { + ((org.eclipse.emf.cdo.net4j.CDOSession)session).options().getProtocol().setTimeout(2000L); + } CDOTransaction transaction = session.openTransaction(); CDOObject instance = (CDOObject)transaction.getResource("/test1").getContents().get(0); diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/ContainerConfig.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/ContainerConfig.java index 4aed791ce2..89b83956b0 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/ContainerConfig.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/ContainerConfig.java @@ -10,9 +10,9 @@ */ package org.eclipse.emf.cdo.tests.config.impl; +import org.eclipse.emf.cdo.net4j.CDONet4jUtil; import org.eclipse.emf.cdo.server.CDOServerUtil; import org.eclipse.emf.cdo.tests.config.IContainerConfig; -import org.eclipse.emf.cdo.util.CDOUtil; import org.eclipse.net4j.Net4jUtil; import org.eclipse.net4j.util.container.ContainerUtil; @@ -96,7 +96,7 @@ public abstract class ContainerConfig extends Config implements IContainerConfig { IManagedContainer container = ContainerUtil.createContainer(); Net4jUtil.prepareContainer(container); - CDOUtil.prepareContainer(container); + CDONet4jUtil.prepareContainer(container); CDOServerUtil.prepareContainer(container); return container; } @@ -144,7 +144,7 @@ public abstract class ContainerConfig extends Config implements IContainerConfig { IManagedContainer container = ContainerUtil.createContainer(); Net4jUtil.prepareContainer(container); - CDOUtil.prepareContainer(container); + CDONet4jUtil.prepareContainer(container); return container; } 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 65e4c5cadf..8600dda89f 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 @@ -10,12 +10,12 @@ */ package org.eclipse.emf.cdo.tests.config.impl; +import org.eclipse.emf.cdo.net4j.CDONet4jUtil; +import org.eclipse.emf.cdo.net4j.CDOSessionConfiguration; import org.eclipse.emf.cdo.session.CDOSession; -import org.eclipse.emf.cdo.session.CDOSessionConfiguration; import org.eclipse.emf.cdo.tests.config.IConfig; import org.eclipse.emf.cdo.tests.config.IRepositoryConfig; import org.eclipse.emf.cdo.tests.config.ISessionConfig; -import org.eclipse.emf.cdo.util.CDOUtil; import org.eclipse.emf.internal.cdo.session.CDOPackageTypeRegistryImpl; @@ -147,7 +147,7 @@ public abstract class SessionConfig extends Config implements ISessionConfig private CDOSessionConfiguration createSessionConfiguration(String repositoryName) { - CDOSessionConfiguration configuration = CDOUtil.createSessionConfiguration(); + CDOSessionConfiguration configuration = CDONet4jUtil.createSessionConfiguration(); configuration.setConnector(getConnector()); configuration.setRepositoryName(repositoryName); return configuration; |