Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/junit/plugins/sysml/nattable/org.eclipse.papyrus.sysml.nattable.requirement.tests/src/org/eclipse/papyrus/sysml/nattable/requirement/tests/insert/InsertEmptyWarningNotExisting_Test.java')
-rw-r--r--tests/junit/plugins/sysml/nattable/org.eclipse.papyrus.sysml.nattable.requirement.tests/src/org/eclipse/papyrus/sysml/nattable/requirement/tests/insert/InsertEmptyWarningNotExisting_Test.java59
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/junit/plugins/sysml/nattable/org.eclipse.papyrus.sysml.nattable.requirement.tests/src/org/eclipse/papyrus/sysml/nattable/requirement/tests/insert/InsertEmptyWarningNotExisting_Test.java b/tests/junit/plugins/sysml/nattable/org.eclipse.papyrus.sysml.nattable.requirement.tests/src/org/eclipse/papyrus/sysml/nattable/requirement/tests/insert/InsertEmptyWarningNotExisting_Test.java
new file mode 100644
index 00000000000..5c3962e3a33
--- /dev/null
+++ b/tests/junit/plugins/sysml/nattable/org.eclipse.papyrus.sysml.nattable.requirement.tests/src/org/eclipse/papyrus/sysml/nattable/requirement/tests/insert/InsertEmptyWarningNotExisting_Test.java
@@ -0,0 +1,59 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.sysml.nattable.requirement.tests.insert;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.nebula.widgets.nattable.selection.command.SelectRowsCommand;
+import org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager;
+import org.eclipse.papyrus.infra.nattable.messages.Messages;
+import org.junit.Assert;
+
+/**
+ * Test pastes overwrite all of selection with hidden categories.
+ */
+public class InsertEmptyWarningNotExisting_Test extends AbstractInsertEmptyTest {
+
+ /**
+ * Constructor.
+ */
+ public InsertEmptyWarningNotExisting_Test() {
+ super();
+ }
+
+ /**
+ * Manage the selection with the shift key.
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.uml.nattable.clazz.config.tests.paste.overwrite.AbstractPasteOverwriteTest#manageSelection(org.eclipse.papyrus.infra.nattable.manager.table.TreeNattableModelManager)
+ */
+ @Override
+ public void manageSelection(final NattableModelManager manager) throws Exception {
+ super.manageSelection(manager);
+ manager.getBodyLayerStack().getSelectionLayer().doCommand(new SelectRowsCommand(manager.getBodyLayerStack().getSelectionLayer(), 0, 2, true, false));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.uml.nattable.clazz.config.tests.paste.overwrite.AbstractPasteOverwriteTest#checkReturned_Status(org.eclipse.core.runtime.IStatus)
+ */
+ @Override
+ protected void checkReturned_Status(final IStatus status) {
+ Assert.assertEquals("Warning must be caught", IStatus.WARNING, status.getSeverity()); //$NON-NLS-1$
+ Assert.assertEquals("Warning message is not the expected message", Messages.AbstractPasteInSelectionNattableCommandProvider_ThePasteHasBeenDoneWithSomeProblems, status.getMessage()); //$NON-NLS-1$
+ Assert.assertTrue("Status must be a multi-status", status instanceof MultiStatus); //$NON-NLS-1$
+ Assert.assertEquals("Warning message is not the expected message", "The identifier 'Class2' was not found in the selection, so the object was created", ((MultiStatus)status).getChildren()[0].getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+}

Back to the top