Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_381472_Test.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/IRepositoryConfig.java17
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java12
3 files changed, 33 insertions, 26 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 9b7271e97e..2a79de4e13 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
@@ -22,8 +22,10 @@ import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.emf.cdo.server.spi.admin.CDOAdminHandler;
import org.eclipse.emf.cdo.spi.server.InternalRepository;
import org.eclipse.emf.cdo.tests.AbstractCDOTest;
+import org.eclipse.emf.cdo.tests.config.IRepositoryConfig.CallAddRepository;
import org.eclipse.emf.cdo.tests.config.ISessionConfig;
import org.eclipse.emf.cdo.tests.config.impl.ConfigTest.CleanRepositoriesAfter;
+import org.eclipse.emf.cdo.tests.config.impl.ConfigTest.CleanRepositoriesBefore;
import org.eclipse.emf.cdo.tests.config.impl.ConfigTest.Requires;
import org.eclipse.emf.cdo.tests.config.impl.SessionConfig;
import org.eclipse.emf.cdo.tests.util.TestListener;
@@ -50,7 +52,9 @@ import java.util.Map;
* @author Eike Stepper
*/
@Requires(ISessionConfig.CAPABILITY_NET4J)
+@CleanRepositoriesBefore
@CleanRepositoriesAfter
+@CallAddRepository
public class Bugzilla_381472_Test extends AbstractCDOTest
{
private static final String ADMIN_HANDLER_TYPE = "test";
@@ -95,19 +99,19 @@ public class Bugzilla_381472_Test extends AbstractCDOTest
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();
- }
+ // @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
{
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 8cf81817ea..594369ee90 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
@@ -15,6 +15,11 @@ import org.eclipse.emf.cdo.server.IRepositoryProvider;
import org.eclipse.emf.cdo.server.IStore;
import org.eclipse.emf.cdo.spi.server.InternalRepository;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
import java.util.Map;
/**
@@ -50,7 +55,15 @@ public interface IRepositoryConfig extends IConfig, IRepositoryProvider
public void setRestarting(boolean on);
- public void setAddRepository(boolean on);
-
public IStore createStore(String repoName);
+
+ /**
+ * @author Eike Stepper
+ */
+ @Inherited
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target({ ElementType.TYPE, ElementType.METHOD })
+ public @interface CallAddRepository
+ {
+ }
}
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 4739bda3ff..882484744a 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,11 +118,6 @@ 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;
@@ -202,11 +197,6 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf
restarting = on;
}
- public void setAddRepository(boolean on)
- {
- addRepository = on;
- }
-
public boolean isRestarting()
{
return restarting;
@@ -275,7 +265,7 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf
{
LifecycleUtil.activate(repository);
- if (addRepository)
+ if (hasAnnotation(CallAddRepository.class))
{
CDOServerUtil.addRepository(serverContainer, repository);
}

Back to the top