diff options
author | Eike Stepper | 2017-01-13 07:41:44 +0000 |
---|---|---|
committer | Eike Stepper | 2017-01-13 08:18:31 +0000 |
commit | 226fddd44f9b402b4c2330ce32c469cdc71a61dd (patch) | |
tree | 12850a5dd1e3734ff8b17dd5413ddfdf48b6e8e6 /plugins/org.eclipse.emf.cdo.tests.db | |
parent | bb6dacda5af21995d9632c1ec9444e7d5e2a63c5 (diff) | |
download | cdo-226fddd44f9b402b4c2330ce32c469cdc71a61dd.tar.gz cdo-226fddd44f9b402b4c2330ce32c469cdc71a61dd.tar.xz cdo-226fddd44f9b402b4c2330ce32c469cdc71a61dd.zip |
[510412] DefaultCDOMerger produces incorrect results for MOVE deltas in many-valued features
https://bugs.eclipse.org/bugs/show_bug.cgi?id=510412
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests.db')
27 files changed, 156 insertions, 95 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AbstractSetupDBConfig.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AbstractSetupDBConfig.java index 18192d8c60..2bd9a1fe07 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AbstractSetupDBConfig.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AbstractSetupDBConfig.java @@ -10,8 +10,6 @@ */ package org.eclipse.emf.cdo.tests.db; -import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; - import org.eclipse.net4j.db.DBException; import org.eclipse.net4j.db.DBUtil; @@ -30,10 +28,9 @@ public abstract class AbstractSetupDBConfig extends DBConfig private transient DataSource setupDataSource; - public AbstractSetupDBConfig(String name, boolean supportingAudits, boolean supportingBranches, boolean withRanges, boolean copyOnBranch, - boolean inverseLists, IDGenerationLocation idGenerationLocation) + public AbstractSetupDBConfig(String name) { - super(name, supportingAudits, supportingBranches, withRanges, copyOnBranch, inverseLists, idGenerationLocation); + super(name); } protected String getDBName(String repoName) diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBDerby.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBDerby.java index 66ab714fd4..00f5972e37 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBDerby.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBDerby.java @@ -10,8 +10,6 @@ */ package org.eclipse.emf.cdo.tests.db; -import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; - import junit.framework.Test; import junit.framework.TestSuite; @@ -28,7 +26,7 @@ public class AllTestsDBDerby extends DBConfigs @Override protected void initConfigSuites(TestSuite parent) { - addScenario(parent, new DerbyConfig(true, true, IDGenerationLocation.STORE), JVM, NATIVE); + addScenario(parent, new DerbyConfig().supportingBranches(true), JVM, NATIVE); // addScenario(parent, AllTestsDBDerby.Derby.INSTANCE, TCP, NATIVE); } } diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2Audit.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2Audit.java index d0105fdb7f..1ad0f605b6 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2Audit.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2Audit.java @@ -30,10 +30,10 @@ public class AllTestsDBH2Audit extends DBConfigs public static void initConfigSuites(ConfigTestSuite suite, TestSuite parent, IDGenerationLocation idGenerationLocation) { // Without ranges - suite.addScenario(parent, new H2Config(true, false, false, false, false, idGenerationLocation), JVM, NATIVE); + suite.addScenario(parent, new H2Config().supportingAudits(true).idGenerationLocation(idGenerationLocation), JVM, NATIVE); // With ranges - suite.addScenario(parent, new H2Config(true, false, true, false, false, idGenerationLocation), JVM, NATIVE); + suite.addScenario(parent, new H2Config().supportingAudits(true).idGenerationLocation(idGenerationLocation).copyOnBranch(true), JVM, NATIVE); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2Branching.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2Branching.java index 26e658e3e7..03b9b2ca4a 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2Branching.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2Branching.java @@ -29,13 +29,14 @@ public class AllTestsDBH2Branching extends DBConfigs public static void initConfigSuites(ConfigTestSuite suite, TestSuite parent, IDGenerationLocation idGenerationLocation) { // Without ranges - suite.addScenario(parent, new H2Config(true, true, false, false, false, idGenerationLocation), JVM, NATIVE); + suite.addScenario(parent, new H2Config().supportingBranches(true).idGenerationLocation(idGenerationLocation), JVM, NATIVE); // With ranges - suite.addScenario(parent, new H2Config(true, true, true, false, false, idGenerationLocation), JVM, NATIVE); + suite.addScenario(parent, new H2Config().supportingBranches(true).idGenerationLocation(idGenerationLocation).withRanges(true), JVM, NATIVE); // With ranges and copy-on-branch - // suite.addScenario(parent, new H2Config(true, true, true, true, idGenerationLocation), JVM, NATIVE); + // suite.addScenario(parent, new + // H2Config().supportingBranches(true).idGenerationLocation(idGenerationLocation).copyOnBranch(true), JVM, NATIVE); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2BranchingUUIDs.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2BranchingUUIDs.java index a587a52153..03062d74e2 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2BranchingUUIDs.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2BranchingUUIDs.java @@ -28,6 +28,6 @@ public class AllTestsDBH2BranchingUUIDs extends DBConfigs @Override protected void initConfigSuites(TestSuite parent) { - addScenario(parent, new H2Config(true, true, false, false, false, IDGenerationLocation.CLIENT), JVM, NATIVE); + addScenario(parent, new H2Config().supportingBranches(true).idGenerationLocation(IDGenerationLocation.CLIENT), JVM, NATIVE); } } diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2NonAudit.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2NonAudit.java index f1a0f668a2..ed72145a11 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2NonAudit.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2NonAudit.java @@ -12,6 +12,7 @@ package org.eclipse.emf.cdo.tests.db; import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; import org.eclipse.emf.cdo.tests.config.impl.ConfigTestSuite; +import org.eclipse.emf.cdo.tests.config.impl.RepositoryConfig; import junit.framework.Test; import junit.framework.TestSuite; @@ -28,7 +29,12 @@ public class AllTestsDBH2NonAudit extends DBConfigs public static void initConfigSuites(ConfigTestSuite suite, TestSuite parent, IDGenerationLocation idGenerationLocation) { - suite.addScenario(parent, new H2Config(false, false, false, false, false, idGenerationLocation), JVM, NATIVE); + RepositoryConfig config = new H2Config().idGenerationLocation(idGenerationLocation); + + // TODO list-ordering + // config.listOrdering(ListOrdering.UNORDERED).supportingChunks(false); + + suite.addScenario(parent, config, JVM, NATIVE); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBHsqldb.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBHsqldb.java index 6c3f5f1f05..86ac3f18b7 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBHsqldb.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBHsqldb.java @@ -10,7 +10,6 @@ */ package org.eclipse.emf.cdo.tests.db; -import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_266982_Test; import org.eclipse.emf.cdo.tests.config.IScenario; import org.eclipse.emf.cdo.tests.config.impl.ConfigTest; @@ -33,7 +32,7 @@ public class AllTestsDBHsqldb extends DBConfigs @Override protected void initConfigSuites(TestSuite parent) { - addScenario(parent, new HsqldbConfig(true, false, IDGenerationLocation.STORE), JVM, NATIVE); + addScenario(parent, new HsqldbConfig().supportingAudits(true), JVM, NATIVE); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBHsqldbNonAudit.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBHsqldbNonAudit.java index 131b99ebae..a85dd92e1a 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBHsqldbNonAudit.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBHsqldbNonAudit.java @@ -10,7 +10,6 @@ */ package org.eclipse.emf.cdo.tests.db; -import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_261218_Test; import org.eclipse.emf.cdo.tests.config.IScenario; import org.eclipse.emf.cdo.tests.config.impl.ConfigTest; @@ -33,7 +32,7 @@ public class AllTestsDBHsqldbNonAudit extends DBConfigs @Override protected void initConfigSuites(TestSuite parent) { - addScenario(parent, new HsqldbConfig(false, false, IDGenerationLocation.STORE), TCP, NATIVE); + addScenario(parent, new HsqldbConfig().supportingAudits(true), TCP, NATIVE); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBMysql.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBMysql.java index 6d1386cfd6..a9b675c13c 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBMysql.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBMysql.java @@ -11,7 +11,6 @@ */ package org.eclipse.emf.cdo.tests.db; -import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; import org.eclipse.emf.cdo.tests.BranchingSameSessionTest; import org.eclipse.emf.cdo.tests.BranchingTest; import org.eclipse.emf.cdo.tests.MergingTest; @@ -36,7 +35,7 @@ public class AllTestsDBMysql extends DBConfigs @Override protected void initConfigSuites(TestSuite parent) { - addScenario(parent, new MysqlConfig(false, false, false, IDGenerationLocation.STORE), JVM, NATIVE); + addScenario(parent, new MysqlConfig(), JVM, NATIVE); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBOracle.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBOracle.java index 49c7a6608c..0a5eb4f6b8 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBOracle.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBOracle.java @@ -35,6 +35,6 @@ public class AllTestsDBOracle extends DBConfigs private void addScenarios(TestSuite parent, IDGenerationLocation idGenerationLocation) { - addScenario(parent, new OracleConfig.SingleUser(false, false, idGenerationLocation), JVM, NATIVE); + addScenario(parent, new OracleConfig.SingleUser().idGenerationLocation(idGenerationLocation), JVM, NATIVE); } } diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBPsql.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBPsql.java index 5a3b14daee..79c4fa6c66 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBPsql.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBPsql.java @@ -12,8 +12,6 @@ */ package org.eclipse.emf.cdo.tests.db; -import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; - import junit.framework.Test; import junit.framework.TestSuite; @@ -37,8 +35,8 @@ public class AllTestsDBPsql extends DBConfigs @Override protected void initConfigSuites(TestSuite parent) { - addScenario(parent, new PostgresqlConfig(false, false, IDGenerationLocation.STORE), JVM, NATIVE); - addScenario(parent, new PostgresqlConfig(true, false, IDGenerationLocation.STORE), JVM, NATIVE); - addScenario(parent, new PostgresqlConfig(true, true, IDGenerationLocation.STORE), JVM, NATIVE); + addScenario(parent, new PostgresqlConfig(), JVM, NATIVE); + addScenario(parent, new PostgresqlConfig().supportingAudits(true), JVM, NATIVE); + addScenario(parent, new PostgresqlConfig().supportingBranches(true), JVM, NATIVE); } } 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 index 5b017c0079..db668bb9b9 100644 --- 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 @@ -40,8 +40,8 @@ public class AnyTestManyTimesDB extends TestSuite implements IConstants 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, INVERSE_LISTS, - ID_GENERATION_LOCATION); + private static final RepositoryConfig REPOSITORY_CONFIG = new H2Config().supportingAudits(SUPPORTING_AUDITS).supportingBranches(SUPPORTING_BRANCHES) + .withRanges(WITH_RANGES).copyOnBranch(COPY_ON_BRANCH).inverseLists(INVERSE_LISTS).idGenerationLocation(ID_GENERATION_LOCATION); private static final SessionConfig SESSION_CONFIG = JVM; diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBConfig.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBConfig.java index 8a34e65832..d12bf95046 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBConfig.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBConfig.java @@ -53,13 +53,9 @@ public abstract class DBConfig extends RepositoryConfig private transient IDBAdapter dbAdapter; - public DBConfig(String name, boolean supportingAudits, boolean supportingBranches, boolean withRanges, boolean copyOnBranch, boolean inverseLists, - IDGenerationLocation idGenerationLocation) + public DBConfig(String name) { - super(name, supportingAudits, supportingBranches, idGenerationLocation); - this.withRanges = withRanges; - this.copyOnBranch = copyOnBranch; - this.inverseLists = inverseLists; + super(name); } @Override @@ -69,17 +65,17 @@ public abstract class DBConfig extends RepositoryConfig capabilities.add(CAPABILITY); capabilities.add(getDBAdapterName()); - if (isWithRanges()) + if (withRanges()) { capabilities.add(CAPABILITY_RANGES); } - if (isCopyOnBranch()) + if (copyOnBranch()) { capabilities.add(CAPABILITY_COPY_ON_BRANCH); } - if (isInverseLists()) + if (inverseLists()) { capabilities.add(CAPABILITY_INVERSE_LISTS); } @@ -103,21 +99,69 @@ public abstract class DBConfig extends RepositoryConfig return "DB"; } - public boolean isWithRanges() + @Override + public DBConfig supportingAudits(boolean supportingAudits) + { + return (DBConfig)super.supportingAudits(supportingAudits); + } + + @Override + public DBConfig supportingBranches(boolean supportingBranches) + { + return (DBConfig)super.supportingBranches(supportingBranches); + } + + @Override + public DBConfig supportingChunks(boolean supportingChunks) + { + return (DBConfig)super.supportingChunks(supportingChunks); + } + + @Override + public DBConfig supportingExtRefs(boolean supportingExtRefs) + { + return (DBConfig)super.supportingExtRefs(supportingExtRefs); + } + + @Override + public DBConfig idGenerationLocation(IDGenerationLocation idGenerationLocation) + { + return (DBConfig)super.idGenerationLocation(idGenerationLocation); + } + + public boolean withRanges() { return withRanges; } - public boolean isCopyOnBranch() + public DBConfig withRanges(boolean withRanges) + { + this.withRanges = withRanges; + return this; + } + + public boolean copyOnBranch() { return copyOnBranch; } - public boolean isInverseLists() + public DBConfig copyOnBranch(boolean copyOnBranch) + { + this.copyOnBranch = copyOnBranch; + return this; + } + + public boolean inverseLists() { return inverseLists; } + public DBConfig inverseLists(boolean inverseLists) + { + this.inverseLists = inverseLists; + return this; + } + @Override public void setUp() throws Exception { @@ -165,7 +209,7 @@ public abstract class DBConfig extends RepositoryConfig return mappingStrategy; } - return CDODBUtil.createHorizontalMappingStrategy(isSupportingAudits(), isSupportingBranches(), withRanges); + return CDODBUtil.createHorizontalMappingStrategy(supportingAudits(), supportingBranches(), withRanges); } protected IMappingStrategy getTestMappingStrategy() diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBConfigs.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBConfigs.java index bde5b498ee..4b171a5cad 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBConfigs.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBConfigs.java @@ -45,7 +45,7 @@ public abstract class DBConfigs extends AllConfigs super.initTestClasses(testClasses, scenario); testClasses.remove(MEMStoreQueryTest.class); - if (!scenario.getRepositoryConfig().isSupportingBranches()) + if (!scenario.getRepositoryConfig().supportingBranches()) { testClasses.remove(BranchingTest.class); testClasses.remove(BranchingSameSessionTest.class); @@ -53,7 +53,7 @@ public abstract class DBConfigs extends AllConfigs testClasses.remove(Bugzilla_303807_Test.class); } - if (!scenario.getRepositoryConfig().isSupportingAudits()) + if (!scenario.getRepositoryConfig().supportingAudits()) { // non-audit mode - remove audit tests testClasses.remove(AuditTest.class); diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DerbyConfig.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DerbyConfig.java index a9e591d4bc..6c0485cc31 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DerbyConfig.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DerbyConfig.java @@ -10,8 +10,6 @@ */ package org.eclipse.emf.cdo.tests.db; -import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; - import org.eclipse.net4j.db.DBUtil; import org.eclipse.net4j.db.IDBAdapter; import org.eclipse.net4j.db.derby.EmbeddedDerbyAdapter; @@ -41,9 +39,9 @@ public class DerbyConfig extends DBConfig private static HashMap<File, EmbeddedDataSource> dataSources = new HashMap<File, EmbeddedDataSource>(); - public DerbyConfig(boolean supportingAudits, boolean supportingBranches, IDGenerationLocation idGenerationLocation) + public DerbyConfig() { - super(DB_ADAPTER_NAME, supportingAudits, supportingBranches, false, false, false, idGenerationLocation); + super(DB_ADAPTER_NAME); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/H2Config.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/H2Config.java index 027808fcd7..6cc23fc24c 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/H2Config.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/H2Config.java @@ -10,8 +10,6 @@ */ package org.eclipse.emf.cdo.tests.db; -import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; - import org.eclipse.net4j.db.IDBAdapter; import org.eclipse.net4j.db.h2.H2Adapter; import org.eclipse.net4j.util.io.IOUtil; @@ -36,10 +34,9 @@ public class H2Config extends DBConfig private static JdbcDataSource defaultDataSource; - public H2Config(boolean supportingAudits, boolean supportingBranches, boolean withRanges, boolean copyOnBranch, boolean inverseLists, - IDGenerationLocation idGenerationLocation) + public H2Config() { - super(DB_ADAPTER_NAME, supportingAudits, supportingBranches, withRanges, copyOnBranch, inverseLists, idGenerationLocation); + super(DB_ADAPTER_NAME); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/HsqldbConfig.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/HsqldbConfig.java index 42951cdbe9..6bc56f9e1d 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/HsqldbConfig.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/HsqldbConfig.java @@ -10,7 +10,6 @@ */ package org.eclipse.emf.cdo.tests.db; -import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; import org.eclipse.emf.cdo.server.IRepository; import org.eclipse.emf.cdo.server.IRepository.Props; import org.eclipse.emf.cdo.tests.db.bundle.OM; @@ -45,9 +44,9 @@ public class HsqldbConfig extends DBConfig private transient ArrayList<HSQLDBDataSource> dataSources; - public HsqldbConfig(boolean supportingAudits, boolean supportingBranches, IDGenerationLocation idGenerationLocation) + public HsqldbConfig() { - super(DB_ADAPTER_NAME, supportingAudits, supportingBranches, false, false, false, idGenerationLocation); + super(DB_ADAPTER_NAME); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/MysqlConfig.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/MysqlConfig.java index 72e7252120..49f9ba9921 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/MysqlConfig.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/MysqlConfig.java @@ -10,8 +10,6 @@ */ package org.eclipse.emf.cdo.tests.db; -import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; - import org.eclipse.net4j.db.IDBAdapter; import org.eclipse.net4j.db.mysql.MYSQLAdapter; @@ -43,9 +41,9 @@ public class MysqlConfig extends AbstractSetupDBConfig private static final long serialVersionUID = 1L; - public MysqlConfig(boolean supportingAudits, boolean supportingBranches, boolean inverseLists, IDGenerationLocation idGenerationLocation) + public MysqlConfig() { - super(DB_ADAPTER_NAME, supportingAudits, supportingBranches, false, false, inverseLists, idGenerationLocation); + super(DB_ADAPTER_NAME); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/OracleConfig.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/OracleConfig.java index 03240bb814..c19bc15cc8 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/OracleConfig.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/OracleConfig.java @@ -10,7 +10,6 @@ */ package org.eclipse.emf.cdo.tests.db; -import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; import org.eclipse.emf.cdo.server.db.IDBStore; import org.eclipse.emf.cdo.tests.db.bundle.OM; @@ -49,9 +48,9 @@ public abstract class OracleConfig extends AbstractSetupDBConfig private static final long serialVersionUID = 1L; - public OracleConfig(boolean supportingAudits, boolean supportingBranches, IDGenerationLocation idGenerationLocation) + public OracleConfig() { - super(DB_ADAPTER_NAME, supportingAudits, supportingBranches, false, false, false, idGenerationLocation); + super(DB_ADAPTER_NAME); } @Override @@ -106,9 +105,8 @@ public abstract class OracleConfig extends AbstractSetupDBConfig { private static final long serialVersionUID = 1L; - public SingleUser(boolean supportingAudits, boolean supportingBranches, IDGenerationLocation idGenerationLocation) + public SingleUser() { - super(supportingAudits, supportingBranches, idGenerationLocation); } @Override @@ -138,9 +136,8 @@ public abstract class OracleConfig extends AbstractSetupDBConfig { private static final long serialVersionUID = 1L; - public MultiUser(boolean supportingAudits, boolean supportingBranches, IDGenerationLocation idGenerationLocation) + public MultiUser() { - super(supportingAudits, supportingBranches, idGenerationLocation); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/PostgresqlConfig.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/PostgresqlConfig.java index 541be6617a..510b59c677 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/PostgresqlConfig.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/PostgresqlConfig.java @@ -10,8 +10,6 @@ */ package org.eclipse.emf.cdo.tests.db; -import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; - import org.eclipse.net4j.db.IDBAdapter; import org.eclipse.net4j.db.postgresql.PostgreSQLAdapter; @@ -38,9 +36,9 @@ public class PostgresqlConfig extends AbstractSetupDBConfig private static final long serialVersionUID = 1L; - public PostgresqlConfig(boolean supportingAudits, boolean supportingBranches, IDGenerationLocation idGenerationLocation) + public PostgresqlConfig() { - super(DB_ADAPTER_NAME, supportingAudits, supportingBranches, false, false, false, idGenerationLocation); + super(DB_ADAPTER_NAME); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBH2Offline.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBH2Offline.java index 68e36e6e16..51d68fa44f 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBH2Offline.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBH2Offline.java @@ -45,9 +45,7 @@ public class AllTestsDBH2Offline extends DBConfigs @Override protected void initConfigSuites(TestSuite parent) { - // addScenario(parent, new H2OfflineConfig(false, false, IDGenerationLocation.STORE), JVM, NATIVE); - addScenario(parent, new H2OfflineConfig(false, false, IDGenerationLocation.CLIENT), JVM, NATIVE); - // addScenario(parent, new H2OfflineConfig(true, false, IDGenerationLocation.STORE), JVM, NATIVE); + addScenario(parent, new H2OfflineConfig().idGenerationLocation(IDGenerationLocation.CLIENT), JVM, NATIVE); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBMysqlOffline.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBMysqlOffline.java index 412b3ebdac..6ce753d4db 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBMysqlOffline.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/AllTestsDBMysqlOffline.java @@ -45,9 +45,7 @@ public class AllTestsDBMysqlOffline extends DBConfigs @Override protected void initConfigSuites(TestSuite parent) { - // addScenario(parent, new MysqlOfflineConfig(false, false, IDGenerationLocation.STORE), JVM, NATIVE); - addScenario(parent, new MysqlOfflineConfig(false, false, IDGenerationLocation.CLIENT), JVM, NATIVE); - // addScenario(parent, new MysqlOfflineConfig(true, false, IDGenerationLocation.STORE), JVM, NATIVE); + addScenario(parent, new MysqlOfflineConfig().idGenerationLocation(IDGenerationLocation.CLIENT), JVM, NATIVE); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/Bugzilla_351078_DB_Test.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/Bugzilla_351078_DB_Test.java index 4c6a683bfc..d57961c360 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/Bugzilla_351078_DB_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/Bugzilla_351078_DB_Test.java @@ -38,7 +38,7 @@ public class Bugzilla_351078_DB_Test extends Bugzilla_351078_Test // XXX use capabilities?! DBOfflineConfig config = (DBOfflineConfig)getRepositoryConfig(); - if (config.isWithRanges()) + if (config.withRanges()) { byte[] masterTable = readTable(master); byte[] cloneTable = readTable(getRepository()); diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/DBOfflineConfig.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/DBOfflineConfig.java index 0fe2b3d1d1..0826f2d9f8 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/DBOfflineConfig.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/DBOfflineConfig.java @@ -39,23 +39,63 @@ public abstract class DBOfflineConfig extends OfflineConfig private boolean copyOnBranch; - public DBOfflineConfig(String name, boolean withRanges, boolean copyOnBranch, IDGenerationLocation idGenerationLocation) + public DBOfflineConfig(String name) { - super(name, idGenerationLocation); - this.withRanges = withRanges; - this.copyOnBranch = copyOnBranch; + super(name); + } + + @Override + public DBOfflineConfig supportingAudits(boolean supportingAudits) + { + return (DBOfflineConfig)super.supportingAudits(supportingAudits); + } + + @Override + public DBOfflineConfig supportingBranches(boolean supportingBranches) + { + return (DBOfflineConfig)super.supportingBranches(supportingBranches); + } + + @Override + public DBOfflineConfig supportingChunks(boolean supportingChunks) + { + return (DBOfflineConfig)super.supportingChunks(supportingChunks); + } + + @Override + public DBOfflineConfig supportingExtRefs(boolean supportingExtRefs) + { + return (DBOfflineConfig)super.supportingExtRefs(supportingExtRefs); + } + + @Override + public DBOfflineConfig idGenerationLocation(IDGenerationLocation idGenerationLocation) + { + return (DBOfflineConfig)super.idGenerationLocation(idGenerationLocation); } - public boolean isWithRanges() + public boolean withRanges() { return withRanges; } - public boolean isCopyOnBranch() + public DBOfflineConfig withRanges(boolean withRanges) + { + this.withRanges = withRanges; + return this; + } + + public boolean copyOnBranch() { return copyOnBranch; } + public DBOfflineConfig copyOnBranch(boolean copyOnBranch) + { + this.copyOnBranch = copyOnBranch; + return this; + } + @Override protected String getStoreName() { @@ -67,12 +107,12 @@ public abstract class DBOfflineConfig extends OfflineConfig { super.initCapabilities(capabilities); - if (isWithRanges()) + if (withRanges()) { capabilities.add(DBConfig.CAPABILITY_RANGES); } - if (isCopyOnBranch()) + if (copyOnBranch()) { capabilities.add(DBConfig.CAPABILITY_COPY_ON_BRANCH); } @@ -108,7 +148,7 @@ public abstract class DBOfflineConfig extends OfflineConfig protected IMappingStrategy createMappingStrategy() { - return CDODBUtil.createHorizontalMappingStrategy(isSupportingAudits(), isSupportingBranches(), withRanges); + return CDODBUtil.createHorizontalMappingStrategy(supportingAudits(), supportingBranches(), withRanges); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/H2OfflineConfig.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/H2OfflineConfig.java index 46eb0d8e4d..691fa03326 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/H2OfflineConfig.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/H2OfflineConfig.java @@ -10,7 +10,6 @@ */ package org.eclipse.emf.cdo.tests.db.offline; -import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; import org.eclipse.emf.cdo.tests.db.H2Config; import org.eclipse.net4j.db.DBUtil; @@ -40,9 +39,9 @@ public class H2OfflineConfig extends DBOfflineConfig private static JdbcDataSource defaultDataSource; - public H2OfflineConfig(boolean withRanges, boolean copyOnBranch, IDGenerationLocation idGenerationLocation) + public H2OfflineConfig() { - super("H2Offline", withRanges, copyOnBranch, idGenerationLocation); + super("H2Offline"); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/MysqlOfflineConfig.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/MysqlOfflineConfig.java index 5e51e19245..93449fdb94 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/MysqlOfflineConfig.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/offline/MysqlOfflineConfig.java @@ -10,7 +10,6 @@ */ package org.eclipse.emf.cdo.tests.db.offline; -import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; import org.eclipse.emf.cdo.tests.db.MysqlConfig; import org.eclipse.net4j.db.DBUtil; @@ -51,9 +50,9 @@ public class MysqlOfflineConfig extends DBOfflineConfig private transient List<String> databases = new ArrayList<String>(); - public MysqlOfflineConfig(boolean withRanges, boolean copyOnBranch, IDGenerationLocation idGenerationLocation) + public MysqlOfflineConfig() { - super("MySqlOffline", withRanges, copyOnBranch, idGenerationLocation); + super("MySqlOffline"); } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/performance/AllPerformanceTestsH2NonAudit.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/performance/AllPerformanceTestsH2NonAudit.java index 24335f3645..3bb4dddd3c 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/performance/AllPerformanceTestsH2NonAudit.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/performance/AllPerformanceTestsH2NonAudit.java @@ -10,7 +10,6 @@ */ package org.eclipse.emf.cdo.tests.db.performance; -import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; import org.eclipse.emf.cdo.tests.db.H2Config; import org.eclipse.emf.cdo.tests.performance.AllPerformanceTests; @@ -30,6 +29,6 @@ public class AllPerformanceTestsH2NonAudit extends AllPerformanceTests @Override protected void initConfigSuites(TestSuite parent) { - addScenario(parent, new H2Config(false, false, false, false, false, IDGenerationLocation.STORE), JVM, NATIVE); + addScenario(parent, new H2Config(), JVM, NATIVE); } } |