Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStéphane Bégaudeau2016-03-31 08:02:46 -0400
committerStephane Begaudeau2016-04-07 08:12:24 -0400
commitf6f650553bee0656bd8d7b9dfe3b0816dbfeea94 (patch)
tree01b7aa39851ba7694a037168803f40229c5fa0df /tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/core
parentf9e41ebf561e225e05ea3d5e9afab6721606655c (diff)
downloadorg.eclipse.eef-f6f650553bee0656bd8d7b9dfe3b0816dbfeea94.tar.gz
org.eclipse.eef-f6f650553bee0656bd8d7b9dfe3b0816dbfeea94.tar.xz
org.eclipse.eef-f6f650553bee0656bd8d7b9dfe3b0816dbfeea94.zip
Add new unit tests
Change-Id: I74cc247e79ddc26499bac925bd3bb7cefe385c7a Signed-off-by: Stéphane Bégaudeau <stephane.begaudeau@obeo.fr>
Diffstat (limited to 'tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/core')
-rw-r--r--tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/core/EEFDomainClassTesterTests.java71
1 files changed, 71 insertions, 0 deletions
diff --git a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/core/EEFDomainClassTesterTests.java b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/core/EEFDomainClassTesterTests.java
new file mode 100644
index 000000000..252eb9004
--- /dev/null
+++ b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/core/EEFDomainClassTesterTests.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.eef.tests.internal.core;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.eef.EefFactory;
+import org.eclipse.eef.EefPackage;
+import org.eclipse.eef.core.api.EEFDomainClassTester;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.junit.Test;
+
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Tests of {@link EEFDomainClassTester}.
+ *
+ * @author sbegaudeau
+ */
+@SuppressWarnings({ "checkstyle:javadocmethod" })
+public class EEFDomainClassTesterTests {
+
+ private void test(EPackage ePackage, EObject eObject, String domainClass) {
+ List<EPackage> ePackages = new ArrayList<>();
+ ePackages.add(ePackage);
+ assertTrue(new EEFDomainClassTester().eInstanceOf(ePackages, eObject, domainClass));
+ }
+
+ @Test
+ public void testDomainClass() {
+ this.test(EefPackage.eINSTANCE, EefFactory.eINSTANCE.createEEFButtonDescription(), "eef.EEFButtonDescription"); //$NON-NLS-1$
+ this.test(EefPackage.eINSTANCE, EefFactory.eINSTANCE.createEEFButtonDescription(), "eef::EEFButtonDescription"); //$NON-NLS-1$
+ }
+
+ @Test
+ public void testDomainClassWithoutPackageName() {
+ this.test(EefPackage.eINSTANCE, EefFactory.eINSTANCE.createEEFButtonDescription(), "EEFButtonDescription"); //$NON-NLS-1$
+ }
+
+ @Test
+ public void testEObjectDomainClass() {
+ this.test(EefPackage.eINSTANCE, EefFactory.eINSTANCE.createEEFButtonDescription(), "ecore.EObject"); //$NON-NLS-1$
+ this.test(EefPackage.eINSTANCE, EefFactory.eINSTANCE.createEEFButtonDescription(), "ecore::EObject"); //$NON-NLS-1$
+ }
+
+ @Test
+ public void testEObjectDomainClassWithoutPackageName() {
+ this.test(EefPackage.eINSTANCE, EefFactory.eINSTANCE.createEEFButtonDescription(), "EObject"); //$NON-NLS-1$
+ }
+
+ @Test
+ public void testSuperclassDomainClass() {
+ this.test(EefPackage.eINSTANCE, EefFactory.eINSTANCE.createEEFButtonDescription(), "eef.EEFWidgetDescription"); //$NON-NLS-1$
+ this.test(EefPackage.eINSTANCE, EefFactory.eINSTANCE.createEEFButtonDescription(), "eef::EEFWidgetDescription"); //$NON-NLS-1$
+ }
+
+ @Test
+ public void testSuperclassDomainClassWithoutPackageName() {
+ this.test(EefPackage.eINSTANCE, EefFactory.eINSTANCE.createEEFButtonDescription(), "EEFWidgetDescription"); //$NON-NLS-1$
+ }
+}

Back to the top