Author: dgolovin
Date: 2008-07-03 20:22:17 -0400 (Thu, 03 Jul 2008)
New Revision: 9062
Added:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/preferences/
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/preferences/VpeEditorPreferencesPageTest.java
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/template/
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/template/VpeTemplateManagerTest.java
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/META-INF/MANIFEST.MF
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java
Log:
Modified: trunk/vpe/tests/org.jboss.tools.vpe.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/META-INF/MANIFEST.MF 2008-07-03 10:54:26 UTC
(rev 9061)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/META-INF/MANIFEST.MF 2008-07-04 00:22:17 UTC
(rev 9062)
@@ -9,7 +9,11 @@
org.eclipse.core.runtime,
org.junit,
org.jboss.tools.common,
- org.jboss.tools.vpe
+ org.jboss.tools.vpe,
+ org.jboss.tools.tests;bundle-version="2.0.0",
+ org.jboss.tools.common.model.ui;bundle-version="2.0.0"
Eclipse-LazyStart: true
-Export-Package: org.jboss.tools.vpe.test
+Export-Package: org.jboss.tools.vpe.editor.preferences,
+ org.jboss.tools.vpe.editor.template,
+ org.jboss.tools.vpe.test
Bundle-ClassPath: vpe-tests.jar
Added:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/preferences/VpeEditorPreferencesPageTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/preferences/VpeEditorPreferencesPageTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/preferences/VpeEditorPreferencesPageTest.java 2008-07-04
00:22:17 UTC (rev 9062)
@@ -0,0 +1,24 @@
+package org.jboss.tools.vpe.editor.preferences;
+
+import junit.framework.TestCase;
+
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.jboss.tools.test.util.WorkbenchUtils;
+
+public class VpeEditorPreferencesPageTest extends TestCase {
+ public void testVpeEditorPreferencesPageShow() {
+ PreferenceDialog prefDialog =
+ WorkbenchUtils.createPreferenceDialog(
+ VpeEditorPreferencesPage.class.getName());
+
+ try {
+ prefDialog.setBlockOnOpen(false);
+ prefDialog.open();
+
+ Object selectedPage = prefDialog.getSelectedPage();
+ assertTrue("Selected page is not an instance of
org.jboss.tools.vpe.editor.preferences.VpeEditorPreferencesPage", selectedPage
instanceof VpeEditorPreferencesPage);
+ } finally {
+ prefDialog.close();
+ }
+ }
+}
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/preferences/VpeEditorPreferencesPageTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/template/VpeTemplateManagerTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/template/VpeTemplateManagerTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/template/VpeTemplateManagerTest.java 2008-07-04
00:22:17 UTC (rev 9062)
@@ -0,0 +1,54 @@
+package org.jboss.tools.vpe.editor.template;
+
+import java.util.List;
+
+import org.jboss.tools.vpe.editor.util.TemplateManagingUtil;
+
+import junit.framework.TestCase;
+
+public class VpeTemplateManagerTest extends TestCase {
+
+ public void testSetAnyTemplates() {
+ VpeAnyData data = new VpeAnyData(
+ "tag-name1",
+ "tag-value",
+ "yes",
+ "red",
+ "green",
+ "blue",
+ "white",
+ true
+ );
+
+ VpeTemplateManager.getInstance().setAnyTemplate(data);
+
+ data = new VpeAnyData(
+ "tag-name2",
+ "tag-value",
+ "yes",
+ "red",
+ "green",
+ "blue",
+ "white",
+ true
+ );
+
+ VpeTemplateManager.getInstance().setAnyTemplate(data);
+ }
+
+ public void testGetAnyTemplates() {
+ List<VpeAnyData> templates = VpeTemplateManager.getInstance().getAnyTemplates();
+ assertEquals(2, templates.size());
+ }
+
+ public void testReload() {
+ VpeTemplateManager.getInstance().reload();
+ }
+
+ public void testGetDefTemplate() {
+ VpeTemplateManager.getInstance().setDefTemplate(null);
+ VpeTemplate template = VpeTemplateManager.getInstance().getDefTemplate();
+ assertNotNull("TemplateManager.getDefTemplate() cannot return
null",template);
+ }
+
+}
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/template/VpeTemplateManagerTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java 2008-07-03
10:54:26 UTC (rev 9061)
+++
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java 2008-07-04
00:22:17 UTC (rev 9062)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.vpe.test;
+import org.jboss.tools.vpe.editor.preferences.VpeEditorPreferencesPageTest;
+import org.jboss.tools.vpe.editor.template.VpeTemplateManagerTest;
+
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
@@ -28,6 +31,8 @@
// $JUnit-BEGIN$
suite.addTestSuite(TemplateLoadingTest.class);
suite.addTestSuite(TemplatesExpressionParsingTest.class);
+ suite.addTestSuite(VpeEditorPreferencesPageTest.class);
+ suite.addTestSuite(VpeTemplateManagerTest.class);
// $JUnit-END$
return suite;
}