Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2016-02-24 09:58:06 +0000
committerGerrit Code Review @ Eclipse.org2016-02-25 17:13:27 +0000
commit2825d2d5875f0b13f631f471dbc657581ba04052 (patch)
treea27d6b715bede88c393325b9f3b93a7b4e7cb1a6
parent97a0ec832d50eb026e8eabde16a77765624ac91e (diff)
downloadorg.eclipse.papyrus-2825d2d5875f0b13f631f471dbc657581ba04052.tar.gz
org.eclipse.papyrus-2825d2d5875f0b13f631f471dbc657581ba04052.tar.xz
org.eclipse.papyrus-2825d2d5875f0b13f631f471dbc657581ba04052.zip
Correct the nattable failing tests on master.
Change-Id: I130ceccf2671eb91368a4203a9f868715a7d0915 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@all4tec.net>
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DefaultEditHelper.java4
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java10
-rw-r--r--tests/junit/plugins/sysml/nattable/org.eclipse.papyrus.sysml.nattable.requirement.tests/src/org/eclipse/papyrus/sysml/nattable/requirement/tests/importfile/ImportCellsAll_Test.java10
-rw-r--r--tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/src/org/eclipse/papyrus/uml/nattable/clazz/config/tests/importfile/ImportCellsAll_H1_H1_H1_MultiColumns_Test.java13
-rw-r--r--tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/src/org/eclipse/papyrus/uml/nattable/clazz/config/tests/importfile/ImportCellsAll_V1_V3_V1_MultiColumns_Test.java13
-rw-r--r--tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/importfile/ImportCellsAll_Test.java10
6 files changed, 10 insertions, 50 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DefaultEditHelper.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DefaultEditHelper.java
index fbb22f08228..cc5b7d3cc6b 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DefaultEditHelper.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DefaultEditHelper.java
@@ -365,7 +365,9 @@ public class DefaultEditHelper extends AbstractNotifierEditHelper {
}
}
- Arrays.sort(advices, new AdviceComparator());
+ if(null != advices){
+ Arrays.sort(advices, new AdviceComparator());
+ }
return advices;
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java
index 7f4b963a302..ecc03c1c6c8 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java
@@ -513,7 +513,9 @@ public class PasteEObjectAxisInNattableCommandProvider implements PasteNattableC
}
// 1. Add the elements to the context
- compoundCommand.append(AddCommand.create(contextEditingDomain, tableContext, containmentFeature, createdElements));
+ if(!createdElements.isEmpty()){
+ compoundCommand.append(AddCommand.create(contextEditingDomain, tableContext, containmentFeature, createdElements));
+ }
if (progressMonitor != null) {
if (progressMonitor.isCanceled()) {
@@ -530,7 +532,7 @@ public class PasteEObjectAxisInNattableCommandProvider implements PasteNattableC
cmd = tableManager.getAddRowElementCommand(createdElements);
}
if (null != cmd) {// could be null
- compoundCommand.append(cmd);
+ compoundCommand.appendIfCanExecute(cmd);
}
if (progressMonitor != null) {
@@ -579,7 +581,9 @@ public class PasteEObjectAxisInNattableCommandProvider implements PasteNattableC
}
// add the created cells to the table
- compoundCommand.append(AddCommand.create(tableEditingDomain, table, NattablePackage.eINSTANCE.getTable_Cells(), cells));
+ if(!cells.isEmpty()){
+ compoundCommand.append(AddCommand.create(tableEditingDomain, table, NattablePackage.eINSTANCE.getTable_Cells(), cells));
+ }
// Execute the global command
if (null != compoundCommand && !compoundCommand.isEmpty() && compoundCommand.canExecute()) {
diff --git a/tests/junit/plugins/sysml/nattable/org.eclipse.papyrus.sysml.nattable.requirement.tests/src/org/eclipse/papyrus/sysml/nattable/requirement/tests/importfile/ImportCellsAll_Test.java b/tests/junit/plugins/sysml/nattable/org.eclipse.papyrus.sysml.nattable.requirement.tests/src/org/eclipse/papyrus/sysml/nattable/requirement/tests/importfile/ImportCellsAll_Test.java
index 595859f0892..6361b6c8ff3 100644
--- a/tests/junit/plugins/sysml/nattable/org.eclipse.papyrus.sysml.nattable.requirement.tests/src/org/eclipse/papyrus/sysml/nattable/requirement/tests/importfile/ImportCellsAll_Test.java
+++ b/tests/junit/plugins/sysml/nattable/org.eclipse.papyrus.sysml.nattable.requirement.tests/src/org/eclipse/papyrus/sysml/nattable/requirement/tests/importfile/ImportCellsAll_Test.java
@@ -38,14 +38,4 @@ public class ImportCellsAll_Test extends AbstractImportCellsTest {
super.manageSelection(manager);
manager.getBodyLayerStack().getSelectionLayer().doCommand(new SelectCellCommand(manager.getBodyLayerStack().getSelectionLayer(), 2, 2, true, false));
}
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.papyrus.uml.nattable.generic.tests.paste.overwrite.AbstractPasteInsertTest#testUndo_Redo(org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager)
- */
- @Override
- protected void testUndo_Redo(NattableModelManager treeManager) throws Exception {
- // Do nothing : The undo/redo is not implemented for the old basic paste
- }
}
diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/src/org/eclipse/papyrus/uml/nattable/clazz/config/tests/importfile/ImportCellsAll_H1_H1_H1_MultiColumns_Test.java b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/src/org/eclipse/papyrus/uml/nattable/clazz/config/tests/importfile/ImportCellsAll_H1_H1_H1_MultiColumns_Test.java
index 97c487323bd..866d450d2b4 100644
--- a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/src/org/eclipse/papyrus/uml/nattable/clazz/config/tests/importfile/ImportCellsAll_H1_H1_H1_MultiColumns_Test.java
+++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/src/org/eclipse/papyrus/uml/nattable/clazz/config/tests/importfile/ImportCellsAll_H1_H1_H1_MultiColumns_Test.java
@@ -13,8 +13,6 @@
package org.eclipse.papyrus.uml.nattable.clazz.config.tests.importfile;
-import org.eclipse.papyrus.infra.nattable.manager.table.TreeNattableModelManager;
-
/**
* Test import all of selection with hidden categories.
*/
@@ -36,15 +34,4 @@ public class ImportCellsAll_H1_H1_H1_MultiColumns_Test extends AbstractImportCel
public String removeClassName(final String className) throws Exception {
return className.replaceFirst("ImportCellsAll_", ""); //$NON-NLS-1$ //$NON-NLS-2$ k
}
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.papyrus.uml.nattable.clazz.config.tests.paste.overwrite.AbstractPasteInsertTest#testUndo_Redo(org.eclipse.papyrus.infra.nattable.manager.table.TreeNattableModelManager)
- */
- @Override
- protected void testUndo_Redo(final TreeNattableModelManager treeManager) throws Exception {
- // Do nothing : The undo/redo is not implemented for the old basic paste
- }
-
}
diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/src/org/eclipse/papyrus/uml/nattable/clazz/config/tests/importfile/ImportCellsAll_V1_V3_V1_MultiColumns_Test.java b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/src/org/eclipse/papyrus/uml/nattable/clazz/config/tests/importfile/ImportCellsAll_V1_V3_V1_MultiColumns_Test.java
index cecca8abbfa..7101a5eced9 100644
--- a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/src/org/eclipse/papyrus/uml/nattable/clazz/config/tests/importfile/ImportCellsAll_V1_V3_V1_MultiColumns_Test.java
+++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/src/org/eclipse/papyrus/uml/nattable/clazz/config/tests/importfile/ImportCellsAll_V1_V3_V1_MultiColumns_Test.java
@@ -13,8 +13,6 @@
package org.eclipse.papyrus.uml.nattable.clazz.config.tests.importfile;
-import org.eclipse.papyrus.infra.nattable.manager.table.TreeNattableModelManager;
-
/**
* Test import all of selection with hidden categories.
*/
@@ -36,15 +34,4 @@ public class ImportCellsAll_V1_V3_V1_MultiColumns_Test extends AbstractImportCel
public String removeClassName(final String className) throws Exception {
return className.replaceFirst("ImportCellsAll_", ""); //$NON-NLS-1$ //$NON-NLS-2$ k
}
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.papyrus.uml.nattable.clazz.config.tests.paste.overwrite.AbstractPasteInsertTest#testUndo_Redo(org.eclipse.papyrus.infra.nattable.manager.table.TreeNattableModelManager)
- */
- @Override
- protected void testUndo_Redo(final TreeNattableModelManager treeManager) throws Exception {
- // Do nothing : The undo/redo is not implemented for the old basic paste
- }
-
}
diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/importfile/ImportCellsAll_Test.java b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/importfile/ImportCellsAll_Test.java
index fd977217ba5..16cc5c3ed5a 100644
--- a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/importfile/ImportCellsAll_Test.java
+++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/importfile/ImportCellsAll_Test.java
@@ -38,14 +38,4 @@ public class ImportCellsAll_Test extends AbstractImportCellsTest {
super.manageSelection(manager);
manager.getBodyLayerStack().getSelectionLayer().doCommand(new SelectCellCommand(manager.getBodyLayerStack().getSelectionLayer(), 2, 2, true, false));
}
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.papyrus.uml.nattable.generic.tests.paste.overwrite.AbstractPasteInsertTest#testUndo_Redo(org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager)
- */
- @Override
- protected void testUndo_Redo(NattableModelManager treeManager) throws Exception {
- // Do nothing : The undo/redo is not implemented for the old basic paste
- }
}

Back to the top