Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2013-09-05 15:43:45 -0400
committerChristian W. Damus2013-09-05 15:43:45 -0400
commit9e19eac24bae87190cfbf91d42525bb39bff5ead (patch)
treec8137c7298e3232b69ca61971a27112ef10eb934
parent54a1f4ae74f0bca91c4626216c11eea7806d4265 (diff)
downloadorg.eclipse.papyrus-9e19eac24bae87190cfbf91d42525bb39bff5ead.tar.gz
org.eclipse.papyrus-9e19eac24bae87190cfbf91d42525bb39bff5ead.tar.xz
org.eclipse.papyrus-9e19eac24bae87190cfbf91d42525bb39bff5ead.zip
403915: [CDO] Test failure in Hudson build
https://bugs.eclipse.org/bugs/show_bug.cgi?id=403915 Tweaking the CDOPackageImportSource::CDOContent class to ensure more consistent behaviour with other content providers. More importantly, because the test case doesn't assign a viewer to the ModelRepositoryContentProvider, make sure that the asynchronous DI model query job doesn't NPE on the null viewer reference.
-rw-r--r--extraplugins/cdo/org.eclipse.papyrus.cdo.ui/src/org/eclipse/papyrus/cdo/internal/ui/views/DIResourceQuery.java5
-rw-r--r--extraplugins/cdo/org.eclipse.papyrus.cdo.uml.ui/src/org/eclipse/papyrus/cdo/uml/internal/ui/importsources/CDOPackageImportSource.java5
-rw-r--r--tests/junit/extraplugins/cdo/org.eclipse.papyrus.cdo.core.tests/src/org/eclipse/papyrus/cdo/core/tests/AbstractPapyrusCDOTest.java10
3 files changed, 7 insertions, 13 deletions
diff --git a/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/src/org/eclipse/papyrus/cdo/internal/ui/views/DIResourceQuery.java b/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/src/org/eclipse/papyrus/cdo/internal/ui/views/DIResourceQuery.java
index 1ac8e3c81d1..317db10849f 100644
--- a/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/src/org/eclipse/papyrus/cdo/internal/ui/views/DIResourceQuery.java
+++ b/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/src/org/eclipse/papyrus/cdo/internal/ui/views/DIResourceQuery.java
@@ -269,14 +269,13 @@ public class DIResourceQuery {
diResources.set(ImmutableSet.copyOf(result));
- if(viewer.getControl() != null) {
+ if((viewer != null) && (viewer.getControl() != null)) {
Display display = viewer.getControl().getDisplay();
if(display != null) {
display.asyncExec(new Runnable() {
public void run() {
- if((viewer.getControl() != null) && !viewer.getControl().isDisposed()) {
-
+ if((viewer != null) && (viewer.getControl() != null) && !viewer.getControl().isDisposed()) {
refresh();
}
}
diff --git a/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.ui/src/org/eclipse/papyrus/cdo/uml/internal/ui/importsources/CDOPackageImportSource.java b/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.ui/src/org/eclipse/papyrus/cdo/uml/internal/ui/importsources/CDOPackageImportSource.java
index e3fcaf440ff..0a676330152 100644
--- a/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.ui/src/org/eclipse/papyrus/cdo/uml/internal/ui/importsources/CDOPackageImportSource.java
+++ b/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.ui/src/org/eclipse/papyrus/cdo/uml/internal/ui/importsources/CDOPackageImportSource.java
@@ -198,12 +198,15 @@ public class CDOPackageImportSource extends AbstractPackageImportSource {
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if(newInput == null) {
itemProvider.inputChanged(viewer, repoMan, null);
+ super.inputChanged(viewer, repoMan, null);
} else {
// substitute the repository manager as the input element
itemProvider.inputChanged(viewer, null, repoMan);
// prime the internal nodes for the repositories
- itemProvider.getChildren(repoMan);
+ itemProvider.getElements(repoMan);
+
+ super.inputChanged(viewer, null, repoMan);
}
}
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 632c9bf226d..b4322a658f0 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
@@ -17,7 +17,6 @@ import static org.junit.Assert.assertThat;
import java.util.Map;
import java.util.regex.Pattern;
-import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.CDOCommonRepository;
import org.eclipse.emf.cdo.net4j.CDONet4jUtil;
import org.eclipse.emf.cdo.server.CDOServerUtil;
@@ -27,7 +26,6 @@ import org.eclipse.emf.cdo.server.net4j.CDONet4jServerUtil;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.spi.server.InternalRepository;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
@@ -124,7 +122,6 @@ public abstract class AbstractPapyrusCDOTest {
props.put(Props.OVERRIDE_UUID, ""); // use the name as the UUID
props.put(Props.SUPPORTING_AUDITS, "false");
props.put(Props.SUPPORTING_BRANCHES, "false");
- props.put(Props.SUPPORTING_ECORE, "true");
props.put(Props.ID_GENERATION_LOCATION, CDOCommonRepository.IDGenerationLocation.STORE.toString());
}
@@ -234,13 +231,8 @@ public abstract class AbstractPapyrusCDOTest {
}
protected <T extends EObject> T getMasterViewObject(T object) {
- CDOObject cdo = CDOUtil.getCDOObject(object);
-
CDOView view = getInternalPapyrusRepository().getMasterView();
- @SuppressWarnings("unchecked")
- T result = (T)CDOUtil.getEObject(view.getObject(cdo.cdoID()));
-
- return result;
+ return view.getObject(object);
}
public static <T extends Number & Comparable<T>> Matcher<T> lessThan(final T max) {

Back to the top