Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Ratz2018-09-21 13:11:47 +0000
committerSebastian Ratz2018-09-21 13:59:52 +0000
commitbb4abd131785dc66b2a4da321ded042fd4e37db1 (patch)
tree1681b70abcbf2c3babfa4f42bc39611e2df80817 /org.eclipse.jface.text.tests/src/org
parenteef6a58d93958ef187fbaa9bc56cce3ced1a5b80 (diff)
downloadeclipse.platform.text-bb4abd131785dc66b2a4da321ded042fd4e37db1.tar.gz
eclipse.platform.text-bb4abd131785dc66b2a4da321ded042fd4e37db1.tar.xz
eclipse.platform.text-bb4abd131785dc66b2a4da321ded042fd4e37db1.zip
Bug 535964 - Move some non UI classes from jface.text to o.e.text.I20180922-1800I20180922-0245I20180922-0005I20180921-1800
Fix TemplatePersistenceData#equals implementation. Change-Id: Ie742ce68e685642d81f83bc9eb53a6b72e2a5516 Signed-off-by: Sebastian Ratz <sebastian.ratz@sap.com>
Diffstat (limited to 'org.eclipse.jface.text.tests/src/org')
-rw-r--r--org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/JFaceTextTestSuite.java5
-rw-r--r--org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/templates/persistence/TemplatePersistenceDataTest.java46
2 files changed, 50 insertions, 1 deletions
diff --git a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/JFaceTextTestSuite.java b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/JFaceTextTestSuite.java
index 346da8ce1..d1b8f5c1c 100644
--- a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/JFaceTextTestSuite.java
+++ b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/JFaceTextTestSuite.java
@@ -24,6 +24,7 @@ import org.eclipse.jface.text.tests.rules.FastPartitionerTest;
import org.eclipse.jface.text.tests.rules.ScannerColumnTest;
import org.eclipse.jface.text.tests.rules.WordRuleTest;
import org.eclipse.jface.text.tests.source.LineNumberRulerColumnTest;
+import org.eclipse.jface.text.tests.templates.persistence.TemplatePersistenceDataTest;
/**
@@ -49,7 +50,9 @@ import org.eclipse.jface.text.tests.source.LineNumberRulerColumnTest;
DefaultPartitionerZeroLengthTest.class,
FastPartitionerTest.class,
ScannerColumnTest.class,
- WordRuleTest.class
+ WordRuleTest.class,
+
+ TemplatePersistenceDataTest.class,
})
public class JFaceTextTestSuite {
// see @SuiteClasses
diff --git a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/templates/persistence/TemplatePersistenceDataTest.java b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/templates/persistence/TemplatePersistenceDataTest.java
new file mode 100644
index 000000000..07719d8c1
--- /dev/null
+++ b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/templates/persistence/TemplatePersistenceDataTest.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2018 SAP SE and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * SAP SE - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jface.text.tests.templates.persistence;
+
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.persistence.TemplatePersistenceData;
+
+@SuppressWarnings("deprecation")
+public class TemplatePersistenceDataTest {
+
+ @Test
+ public void testEquals() throws Exception {
+ Template template= new Template();
+ org.eclipse.text.templates.TemplatePersistenceData persistenceData1= new org.eclipse.text.templates.TemplatePersistenceData(template, false);
+ org.eclipse.text.templates.TemplatePersistenceData persistenceData2= new org.eclipse.text.templates.TemplatePersistenceData(template, false);
+
+ TemplatePersistenceData deprPersistenceDataWithRef1A= new TemplatePersistenceData(persistenceData1);
+ TemplatePersistenceData deprPersistenceDataWithRef1B= new TemplatePersistenceData(persistenceData1);
+
+ TemplatePersistenceData deprPersistenceDataWithRef2= new TemplatePersistenceData(persistenceData2);
+
+ TemplatePersistenceData deprPersistenceData3= new TemplatePersistenceData(template, false);
+
+ assertTrue(deprPersistenceDataWithRef1A.equals(deprPersistenceDataWithRef1B));
+ assertFalse(deprPersistenceDataWithRef1A.equals(deprPersistenceDataWithRef2));
+ assertFalse(deprPersistenceDataWithRef1A.equals(deprPersistenceData3));
+ assertTrue(deprPersistenceData3.equals(deprPersistenceData3));
+ }
+}

Back to the top