Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/junit/extraplugins/cdo/org.eclipse.papyrus.cdo.core.tests/src/org/eclipse/papyrus/cdo/core/tests/AbstractPapyrusCDOTest.java3
-rw-r--r--tests/junit/extraplugins/cdo/org.eclipse.papyrus.cdo.core.tests/src/org/eclipse/papyrus/cdo/internal/core/tests/PapyrusRepositoryManagerTest.java11
2 files changed, 11 insertions, 3 deletions
diff --git a/tests/junit/extraplugins/cdo/org.eclipse.papyrus.cdo.core.tests/src/org/eclipse/papyrus/cdo/core/tests/AbstractPapyrusCDOTest.java b/tests/junit/extraplugins/cdo/org.eclipse.papyrus.cdo.core.tests/src/org/eclipse/papyrus/cdo/core/tests/AbstractPapyrusCDOTest.java
index 01fd56634d4..73f3b43018a 100644
--- a/tests/junit/extraplugins/cdo/org.eclipse.papyrus.cdo.core.tests/src/org/eclipse/papyrus/cdo/core/tests/AbstractPapyrusCDOTest.java
+++ b/tests/junit/extraplugins/cdo/org.eclipse.papyrus.cdo.core.tests/src/org/eclipse/papyrus/cdo/core/tests/AbstractPapyrusCDOTest.java
@@ -109,6 +109,9 @@ public abstract class AbstractPapyrusCDOTest {
repository.disconnect();
PapyrusRepositoryManager.INSTANCE.removeRepository(repository);
repository = null;
+
+ // persist the removal (the new new repository saved its UUID when opened)
+ PapyrusRepositoryManager.INSTANCE.saveRepositories();
}
LifecycleUtil.deactivate(container);
diff --git a/tests/junit/extraplugins/cdo/org.eclipse.papyrus.cdo.core.tests/src/org/eclipse/papyrus/cdo/internal/core/tests/PapyrusRepositoryManagerTest.java b/tests/junit/extraplugins/cdo/org.eclipse.papyrus.cdo.core.tests/src/org/eclipse/papyrus/cdo/internal/core/tests/PapyrusRepositoryManagerTest.java
index b940e0a1056..655f9fac00b 100644
--- a/tests/junit/extraplugins/cdo/org.eclipse.papyrus.cdo.core.tests/src/org/eclipse/papyrus/cdo/internal/core/tests/PapyrusRepositoryManagerTest.java
+++ b/tests/junit/extraplugins/cdo/org.eclipse.papyrus.cdo.core.tests/src/org/eclipse/papyrus/cdo/internal/core/tests/PapyrusRepositoryManagerTest.java
@@ -178,6 +178,7 @@ public class PapyrusRepositoryManagerTest extends AbstractPapyrusCDOTest {
repo.addResourceSetDisposalApprover(new IResourceSetDisposalApprover() {
+ @Override
public DisposeAction disposalRequested(IPapyrusRepository repository, Collection<ResourceSet> resourceSets) {
return DisposeAction.NONE;
@@ -207,6 +208,7 @@ public class PapyrusRepositoryManagerTest extends AbstractPapyrusCDOTest {
repo.addResourceSetDisposalApprover(new IResourceSetDisposalApprover() {
+ @Override
public DisposeAction disposalRequested(IPapyrusRepository repository, Collection<ResourceSet> resourceSets) {
return DisposeAction.SAVE;
@@ -237,6 +239,7 @@ public class PapyrusRepositoryManagerTest extends AbstractPapyrusCDOTest {
repo.addResourceSetDisposalApprover(new IResourceSetDisposalApprover() {
+ @Override
public DisposeAction disposalRequested(IPapyrusRepository repository, Collection<ResourceSet> resourceSets) {
return DisposeAction.CLOSE;
@@ -270,13 +273,12 @@ public class PapyrusRepositoryManagerTest extends AbstractPapyrusCDOTest {
@Before
public void createRepositoryManager() throws Exception {
-
- fixture = new PapyrusRepositoryManager();
+ // make sure that any saves are ephemeral
+ fixture = new PapyrusRepositoryManager(new StringStorage());
}
@After
public void disposeRepositoryManager() throws Exception {
-
if(fixture != null) {
fixture.dispose();
fixture = null;
@@ -379,6 +381,7 @@ public class PapyrusRepositoryManagerTest extends AbstractPapyrusCDOTest {
return result;
}
+ @Override
public void notifyEvent(IEvent event) {
if(event instanceof CDOTransactionFinishedEvent) {
committed = true;
@@ -390,11 +393,13 @@ public class PapyrusRepositoryManagerTest extends AbstractPapyrusCDOTest {
String storage = null;
+ @Override
public InputStream createInputStream() throws IOException {
return (storage == null ? null : new ByteArrayInputStream(storage.getBytes("UTF-8")));
}
+ @Override
public OutputStream createOutputStream() throws IOException {
return new ByteArrayOutputStream() {

Back to the top