diff options
author | Eike Stepper | 2012-06-03 18:12:35 +0000 |
---|---|---|
committer | Eike Stepper | 2012-06-03 18:12:35 +0000 |
commit | df7d23f0c25d1a5cb17c0cb887ca0799d399c334 (patch) | |
tree | 7f721480f729eebc4b8136c334475915cd801a5c | |
parent | 570b209c236d27b5ae7f25dd177c27bfc312eebb (diff) | |
download | cdo-df7d23f0c25d1a5cb17c0cb887ca0799d399c334.tar.gz cdo-df7d23f0c25d1a5cb17c0cb887ca0799d399c334.tar.xz cdo-df7d23f0c25d1a5cb17c0cb887ca0799d399c334.zip |
[381472] Design a repository administration API
https://bugs.eclipse.org/bugs/show_bug.cgi?id=381472
Make CDOServerUtil.addRepository() conditional in RepositoryConfig
to fix test performance degradation.
3 files changed, 56 insertions, 21 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_381472_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_381472_Test.java index 60cdde3abb..9b7271e97e 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_381472_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_381472_Test.java @@ -90,6 +90,25 @@ public class Bugzilla_381472_Test extends AbstractCDOTest return CDOAdminUtil.openAdmin(connector); } + private void cleanup(CDOAdmin admin) + { + IOUtil.closeSilent(admin); + } + + @Override + protected void doSetUp() throws Exception + { + getRepositoryConfig().setAddRepository(true); + super.doSetUp(); + } + + @Override + protected void doTearDown() throws Exception + { + getRepositoryConfig().setAddRepository(false); + super.doTearDown(); + } + public void testInitial() throws Exception { CDOAdmin admin = openAdmin(null); @@ -102,7 +121,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } @@ -122,7 +141,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } @@ -160,7 +179,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } @@ -206,7 +225,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } @@ -252,7 +271,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } @@ -281,7 +300,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } @@ -307,7 +326,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } @@ -343,7 +362,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } @@ -380,7 +399,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } @@ -417,7 +436,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } @@ -448,7 +467,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } @@ -480,7 +499,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } @@ -514,7 +533,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } @@ -548,7 +567,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } @@ -567,7 +586,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } @@ -594,7 +613,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } @@ -614,7 +633,7 @@ public class Bugzilla_381472_Test extends AbstractCDOTest } finally { - IOUtil.closeSilent(admin); + cleanup(admin); } } } diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IRepositoryConfig.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IRepositoryConfig.java index 9102649a2f..8cf81817ea 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IRepositoryConfig.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IRepositoryConfig.java @@ -48,7 +48,9 @@ public interface IRepositoryConfig extends IConfig, IRepositoryProvider public void registerRepository(InternalRepository repository); - public void setRestarting(boolean b); + public void setRestarting(boolean on); + + public void setAddRepository(boolean on); public IStore createStore(String repoName); } diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java index aec40bd69f..4739bda3ff 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java @@ -118,6 +118,11 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf */ private transient boolean restarting; + /** + * Whether CDOServerUtil.addRepository() is to be called for repositories that are activated + */ + private transient boolean addRepository; + private transient String lastRepoProps; private transient CDOServerBrowser serverBrowser; @@ -192,9 +197,14 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf return ""; } - public void setRestarting(boolean restarting) + public void setRestarting(boolean on) { - this.restarting = restarting; + restarting = on; + } + + public void setAddRepository(boolean on) + { + addRepository = on; } public boolean isRestarting() @@ -264,7 +274,11 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf if (activate) { LifecycleUtil.activate(repository); - // CDOServerUtil.addRepository(serverContainer, repository); + + if (addRepository) + { + CDOServerUtil.addRepository(serverContainer, repository); + } } } |