Author: mareshkau
Date: 2009-02-06 08:01:13 -0500 (Fri, 06 Feb 2009)
New Revision: 13508
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-auto.xml
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/VpeTemplateManagerTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-883, fixing errors in junit tests
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-auto.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-auto.xml 2009-02-06
12:05:59 UTC (rev 13507)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-auto.xml 2009-02-06
13:01:13 UTC (rev 13508)
@@ -1,13 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<vpe:templates>
- <vpe:tag case-sensitive="no" name="">
- <vpe:template children="no" modify="no">
- <vpe:any style="color:red" tag-for-display="tag-name1"
value="tag-value"/>
- </vpe:template>
- </vpe:tag>
- <vpe:tag case-sensitive="no" name="">
- <vpe:template children="no" modify="no">
- <vpe:any style="color:white" tag-for-display="tag-name2"
value="tag-value"/>
- </vpe:template>
- </vpe:tag>
-</vpe:templates>
+<vpe:templates/>
Modified:
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 2009-02-06
12:05:59 UTC (rev 13507)
+++
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/preferences/VpeEditorPreferencesPageTest.java 2009-02-06
13:01:13 UTC (rev 13508)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.vpe.editor.preferences;
import junit.framework.TestCase;
Modified:
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 2009-02-06
12:05:59 UTC (rev 13507)
+++
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/template/VpeTemplateManagerTest.java 2009-02-06
13:01:13 UTC (rev 13508)
@@ -1,12 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.vpe.editor.template;
+import java.util.Collections;
import java.util.List;
import junit.framework.TestCase;
+/**
+ * Test for Template Manager
+ * @author mareshkau
+ */
public class VpeTemplateManagerTest extends TestCase {
+ private List<VpeAnyData> oldTemplates;
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ oldTemplates = VpeTemplateManager.getInstance().getAnyTemplates();
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ VpeTemplateManager.getInstance().setAnyTemplates(oldTemplates);
+ super.tearDown();
+ }
+
public void testSetAnyTemplates() {
+ List<VpeAnyData> clearList = Collections.emptyList();
+ VpeTemplateManager.getInstance().setAnyTemplates(clearList);
VpeAnyData data = new VpeAnyData(
"tag-name1", //$NON-NLS-1$
"tag-value", //$NON-NLS-1$
@@ -22,9 +59,6 @@
);
VpeTemplateManager.getInstance().setAnyTemplate(data);
- }
-
- public void testGetAnyTemplates() {
List<VpeAnyData> templates = VpeTemplateManager.getInstance().getAnyTemplates();
assertEquals(2, templates.size());
}