diff options
4 files changed, 175 insertions, 28 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/AnyTestManyTimesDB.launch b/plugins/org.eclipse.emf.cdo.tests.db/AnyTestManyTimesDB.launch new file mode 100644 index 0000000000..dafab18766 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.db/AnyTestManyTimesDB.launch @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AnyTestManyTimesDB.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"/> +<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.db.AnyTestManyTimesDB"/> +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.tests.db"/> +<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx1g -Dorg.eclipse.net4j.util.om.trace.disable=true -Dorg.eclipse.emf.cdo.tests.config.impl.RepositoryConfig.enableServerBrowser=false -Dorg.eclipse.net4j.db.close.noisy=true"/> +</launchConfiguration> diff --git a/plugins/org.eclipse.emf.cdo.tests.db/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.tests.db/META-INF/MANIFEST.MF index 1db0e21334..47e8ff1d5d 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.cdo.tests.db/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.emf.cdo.tests.db;singleton:=true -Bundle-Version: 4.0.400.qualifier +Bundle-Version: 4.0.500.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin @@ -27,10 +27,10 @@ Import-Package: com.mysql.jdbc.jdbc2.optional;version="[5.0.0,6.0.0)", org.hsqldb.jdbc;version="[2.0.0,3.0.0)", org.postgresql.ds;version="[9.0.0,10.0.0)", org.postgresql.ds.common;version="[9.0.0,10.0.0)" -Export-Package: org.eclipse.emf.cdo.tests.db;version="4.0.400";x-friends:="org.eclipse.emf.cdo.tests.all", - org.eclipse.emf.cdo.tests.db.bundle;version="4.0.400";x-internal:=true, - org.eclipse.emf.cdo.tests.db.capabilities;version="4.0.400";x-friends:="org.eclipse.emf.cdo.tests.all", - org.eclipse.emf.cdo.tests.db.offline;version="4.0.400";x-friends:="org.eclipse.emf.cdo.tests.all", - org.eclipse.emf.cdo.tests.db.performance;version="4.0.400";x-friends:="org.eclipse.emf.cdo.tests.all", - org.eclipse.emf.cdo.tests.db.revisioncache;version="4.0.400";x-friends:="org.eclipse.emf.cdo.tests.all", - org.eclipse.emf.cdo.tests.db.verifier;version="4.0.400";x-friends:="org.eclipse.emf.cdo.tests.all" +Export-Package: org.eclipse.emf.cdo.tests.db;version="4.0.500";x-friends:="org.eclipse.emf.cdo.tests.all", + org.eclipse.emf.cdo.tests.db.bundle;version="4.0.500";x-internal:=true, + org.eclipse.emf.cdo.tests.db.capabilities;version="4.0.500";x-friends:="org.eclipse.emf.cdo.tests.all", + org.eclipse.emf.cdo.tests.db.offline;version="4.0.500";x-friends:="org.eclipse.emf.cdo.tests.all", + org.eclipse.emf.cdo.tests.db.performance;version="4.0.500";x-friends:="org.eclipse.emf.cdo.tests.all", + org.eclipse.emf.cdo.tests.db.revisioncache;version="4.0.500";x-friends:="org.eclipse.emf.cdo.tests.all", + org.eclipse.emf.cdo.tests.db.verifier;version="4.0.500";x-friends:="org.eclipse.emf.cdo.tests.all" diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AnyTestManyTimesDB.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AnyTestManyTimesDB.java new file mode 100644 index 0000000000..f600c28730 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AnyTestManyTimesDB.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2015 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: + * Eike Stepper - initial API and implementation + */ +package org.eclipse.emf.cdo.tests.db; + +import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_416474_Test; +import org.eclipse.emf.cdo.tests.config.IConstants; +import org.eclipse.emf.cdo.tests.config.impl.ConfigTest; +import org.eclipse.emf.cdo.tests.config.impl.ModelConfig; +import org.eclipse.emf.cdo.tests.config.impl.RepositoryConfig; +import org.eclipse.emf.cdo.tests.config.impl.Scenario; +import org.eclipse.emf.cdo.tests.config.impl.SessionConfig; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * @author Eike Stepper + */ +public class AnyTestManyTimesDB extends TestSuite implements IConstants +{ + private static final boolean SUPPORTING_AUDITS = false; + + private static final boolean SUPPORTING_BRANCHES = false; + + private static final boolean WITH_RANGES = false; + + private static final boolean COPY_ON_BRANCH = false; + + private static final IDGenerationLocation ID_GENERATION_LOCATION = IDGenerationLocation.STORE; + + private static final RepositoryConfig REPOSITORY_CONFIG = new H2Config(SUPPORTING_AUDITS, SUPPORTING_BRANCHES, + WITH_RANGES, COPY_ON_BRANCH, ID_GENERATION_LOCATION); + + private static final SessionConfig SESSION_CONFIG = JVM; + + private static final ModelConfig MODEL_CONFIG = NATIVE; + + private static final String METHOD = "testMatchesAnyStringAttribute"; + + private static final int RUNS = 10000; + + private static ConfigTest createTest(final String displayName) + { + return new Bugzilla_416474_Test() + { + @Override + public String getName() + { + return displayName; + } + + @Override + protected String getTestMethodName() + { + return METHOD; + } + }; + } + + public static Test suite() + { + TestSuite suite = new TestSuite(AnyTestManyTimesDB.class) + { + @Override + public void addTest(Test test) + { + if (test instanceof TestCase) + { + TestCase testCase = (TestCase)test; + if ("warning".equals(testCase.getName())) + { + return; + } + } + + super.addTest(test); + } + }; + + for (int run = 0; run < RUNS; run++) + { + ConfigTest test = createTest(METHOD + " [" + (run + 1) + "]"); + test.setName(METHOD); + test.setScenario(new Scenario(REPOSITORY_CONFIG, SESSION_CONFIG, MODEL_CONFIG) + { + private static final long serialVersionUID = 1L; + + @Override + public boolean alwaysCleanRepositories() + { + return true; + } + }); + + suite.addTest(test); + } + + return suite; + } +} diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AnyTestManyTimes.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AnyTestManyTimes.java index 10e1bbdb50..4bb3bf2025 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AnyTestManyTimes.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AnyTestManyTimes.java @@ -10,7 +10,7 @@ */ package org.eclipse.emf.cdo.tests; -import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_316444_Test; +import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_416474_Test; import org.eclipse.emf.cdo.tests.config.IConstants; import org.eclipse.emf.cdo.tests.config.impl.ConfigTest; import org.eclipse.emf.cdo.tests.config.impl.ModelConfig; @@ -19,6 +19,7 @@ import org.eclipse.emf.cdo.tests.config.impl.Scenario; import org.eclipse.emf.cdo.tests.config.impl.SessionConfig; import junit.framework.Test; +import junit.framework.TestCase; import junit.framework.TestSuite; /** @@ -26,41 +27,57 @@ import junit.framework.TestSuite; */ public class AnyTestManyTimes extends TestSuite implements IConstants { - private static final RepositoryConfig REPOSITORY_CONFIG = MEM_AUDITS; + private static final RepositoryConfig REPOSITORY_CONFIG = MEM; private static final SessionConfig SESSION_CONFIG = JVM; private static final ModelConfig MODEL_CONFIG = NATIVE; - private static final Class<? extends ConfigTest> CLASS = Bugzilla_316444_Test.class; - - private static final String METHOD = "testLockParentWithEAttributeChange"; + private static final String METHOD = "testMatchesAnyStringAttribute"; private static final int RUNS = 10000; - public static Test suite() + private static ConfigTest createTest(final String displayName) { - TestSuite suite = new TestSuite(CLASS.getName()); - - for (int run = 0; run < RUNS; run++) + return new Bugzilla_416474_Test() { - final String displayName = METHOD + " [" + (run + 1) + "]"; + @Override + public String getName() + { + return displayName; + } - Bugzilla_316444_Test test = new Bugzilla_316444_Test() + @Override + protected String getTestMethodName() { - @Override - public String getName() - { - return displayName; - } + return METHOD; + } + }; + } - @Override - protected String getTestMethodName() + public static Test suite() + { + TestSuite suite = new TestSuite(AnyTestManyTimes.class) + { + @Override + public void addTest(Test test) + { + if (test instanceof TestCase) { - return METHOD; + TestCase testCase = (TestCase)test; + if ("warning".equals(testCase.getName())) + { + return; + } } - }; + super.addTest(test); + } + }; + + for (int run = 0; run < RUNS; run++) + { + ConfigTest test = createTest(METHOD + " [" + (run + 1) + "]"); test.setName(METHOD); test.setScenario(new Scenario(REPOSITORY_CONFIG, SESSION_CONFIG, MODEL_CONFIG) { |