This commit was manufactured by cvs2svn to create branch 'R3_2_5_patches'.
diff --git a/org.eclipse.wst.common.snippets.tests/.classpath b/org.eclipse.wst.common.snippets.tests/.classpath
deleted file mode 100644
index ce73933..0000000
--- a/org.eclipse.wst.common.snippets.tests/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.wst.common.snippets.tests/.cvsignore b/org.eclipse.wst.common.snippets.tests/.cvsignore
deleted file mode 100644
index af21aeb..0000000
--- a/org.eclipse.wst.common.snippets.tests/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-build.xml
-temp.folder
-snippettests.jar
-org.eclipse.wst.common.snippets.tests_1.0.0.zip
-snippetstests.jar
-snippetstestssrc.zip
-javaCompiler.snippetstests.jar.args
diff --git a/org.eclipse.wst.common.snippets.tests/.project b/org.eclipse.wst.common.snippets.tests/.project
deleted file mode 100644
index 726c4ef..0000000
--- a/org.eclipse.wst.common.snippets.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.common.snippets.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/org.eclipse.wst.common.snippets.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.wst.common.snippets.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91..0000000
--- a/org.eclipse.wst.common.snippets.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/org.eclipse.wst.common.snippets.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.wst.common.snippets.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2dd8b5c..0000000
--- a/org.eclipse.wst.common.snippets.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sun Apr 16 14:37:21 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/org.eclipse.wst.common.snippets.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.wst.common.snippets.tests/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ef2ac65..0000000
--- a/org.eclipse.wst.common.snippets.tests/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/org.eclipse.wst.common.snippets.tests/.settings/org.eclipse.ltk.core.refactoring.prefs b/org.eclipse.wst.common.snippets.tests/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c..0000000
--- a/org.eclipse.wst.common.snippets.tests/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/org.eclipse.wst.common.snippets.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.wst.common.snippets.tests/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index f724958..0000000
--- a/org.eclipse.wst.common.snippets.tests/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Sun Apr 16 14:05:29 EDT 2006
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/org.eclipse.wst.common.snippets.tests/META-INF/MANIFEST.MF b/org.eclipse.wst.common.snippets.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 6884c81..0000000
--- a/org.eclipse.wst.common.snippets.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,24 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.common.snippets.tests; singleton:=true
-Bundle-Version: 1.0.300.qualifier
-Bundle-ClassPath: snippetstests.jar
-Bundle-Activator: org.eclipse.wst.common.snippets.tests.TestsPlugin
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.common.snippets.core.tests,
- org.eclipse.wst.common.snippets.tests,
- org.eclipse.wst.common.snippets.ui.tests
-Require-Bundle: org.junit;bundle-version=3.8.2,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.text,
- org.eclipse.ui,
- org.eclipse.wst.common.snippets,
- org.eclipse.ui.ide,
- org.eclipse.ui.workbench.texteditor,
- org.eclipse.gef
-Eclipse-LazyStart: true
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/org.eclipse.wst.common.snippets.tests/about.html b/org.eclipse.wst.common.snippets.tests/about.html
deleted file mode 100644
index 2199df3..0000000
--- a/org.eclipse.wst.common.snippets.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributors license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/org.eclipse.wst.common.snippets.tests/build.properties b/org.eclipse.wst.common.snippets.tests/build.properties
deleted file mode 100644
index 6fcacc2..0000000
--- a/org.eclipse.wst.common.snippets.tests/build.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2009 IBM Corporation 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-snippetstests.source.. = src/
-snippetstests.output.. = bin/
-bin.includes = META-INF/,\
- test.xml,\
- plugin.xml,\
- snippetstests.jar,\
- testfiles/,\
- plugin.properties,\
- about.html,\
- META-INF/,\
- META-INF/
-jars.compile.order = snippetstests.jar
-source.snippetstests.jar = src/
-output.snippetstests.jar = bin/
-
diff --git a/org.eclipse.wst.common.snippets.tests/plugin.properties b/org.eclipse.wst.common.snippets.tests/plugin.properties
deleted file mode 100644
index 21863d8..0000000
--- a/org.eclipse.wst.common.snippets.tests/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2006 IBM Corporation 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-# not to be translated
-
-unittest_category_label=org.eclipse.wst.common.snippets.tests-category
-
-unittest_item0_label=test item 0
-unittest_item0_content=sample content 0
-
-unittest_item1_label=test item 1
-unittest_item1_content=test content ${variableA} and more ${variableB}
-unittest_item1_varA=variable A
-unittest_item1_varB=variable B
-
-Bundle-Name.0 = Snippets Tests
-Bundle-Vendor.0 = Eclipse Web Tools Platform
\ No newline at end of file
diff --git a/org.eclipse.wst.common.snippets.tests/plugin.xml b/org.eclipse.wst.common.snippets.tests/plugin.xml
deleted file mode 100644
index 7921eae..0000000
--- a/org.eclipse.wst.common.snippets.tests/plugin.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <!--======================================================================================-->
- <!-- Snippet View contributions -->
- <!--======================================================================================-->
- <extension
- point="org.eclipse.wst.common.snippets.SnippetContributions">
- <category
- label="%unittest_category_label"
- id="org.eclipse.wst.common.snippets.tests.category0"
- contenttypes="org.eclipse.core.runtime.text">
- <item
- label="%unittest_item0_label"
- id="org.eclipse.wst.common.snippets.tests.item0">
- <content>%unittest_item0_content</content>
- </item>
- <item
- label="%unittest_item1_label"
- id="org.eclipse.wst.common.snippets.tests.item1">
- <content>%unittest_item1_content</content>
- <variable
- description="%unittest_item1_varA"
- id="variableA" />
- <variable
- description="%unittest_item1_varB"
- id="variableB"
- default="bfoo" />
- </item>
- </category>
- </extension>
- <extension
- point="org.eclipse.wst.common.snippets.SnippetProvider">
- <provider
- class="org.eclipse.wst.common.snippets.tests.helpers.TextSnippetProvider2"
- priority="101">
- <enablement>
- <instanceof
- value="org.eclipse.ui.texteditor.ITextEditor">
- </instanceof></enablement>
- </provider>
- <provider
- class="org.eclipse.wst.common.snippets.tests.helpers.DummyProvider"
- priority="2">
- <enablement>
- <instanceof
- value="org.eclipse.wst.common.snippets.tests.helpers.CommonApplicableInterface">
- </instanceof>
- </enablement>
- </provider>
- <provider
- class="org.eclipse.wst.common.snippets.tests.helpers.ComplexProvider"
- priority="20">
- <enablement>
- <instanceof
- value="org.eclipse.wst.common.snippets.tests.helpers.SApplicableEditor">
- </instanceof></enablement>
- </provider>
- </extension>
-
-</plugin>
diff --git a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/core/tests/SnippetCoreTests.java b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/core/tests/SnippetCoreTests.java
deleted file mode 100644
index b683ed1..0000000
--- a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/core/tests/SnippetCoreTests.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.common.snippets.core.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.snippets.core.ISnippetCategory;
-import org.eclipse.wst.common.snippets.core.ISnippetItem;
-import org.eclipse.wst.common.snippets.core.ISnippetVariable;
-import org.eclipse.wst.common.snippets.core.ISnippetsEntry;
-import org.eclipse.wst.common.snippets.internal.SnippetDefinitions;
-import org.eclipse.wst.common.snippets.internal.model.SnippetManager;
-import org.eclipse.wst.common.snippets.internal.palette.SnippetVariable;
-
-public class SnippetCoreTests extends TestCase {
-
- private SnippetDefinitions fCurrentDefinitions;
-
- public SnippetCoreTests() {
- super();
- }
-
- public SnippetCoreTests(String name) {
- super(name);
- }
-
- private ISnippetVariable getVariable(ISnippetItem item, String id) {
- for (int i = 0; i < item.getVariables().length; i++) {
- if (((SnippetVariable) item.getVariables()[i]).getId().equals(id)) {
- return item.getVariables()[i];
- }
- }
- return null;
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- fCurrentDefinitions = SnippetManager.getInstance().getDefinitions();
- }
-
- public void testCategoryLoadedFromPlugin() {
- ISnippetCategory testCategory = fCurrentDefinitions.getCategory("org.eclipse.wst.common.snippets.tests.category0"); //$NON-NLS-1$
- assertNotNull("test category not found", testCategory); //$NON-NLS-1$
- assertEquals("test category source type incorrect", ISnippetsEntry.SNIPPET_SOURCE_PLUGINS, testCategory.getSourceType()); //$NON-NLS-1$
- assertNotNull("test category source description missing", testCategory.getSourceDescriptor()); //$NON-NLS-1$
- assertEquals("test category description incorrect", null, testCategory.getDescription()); //$NON-NLS-1$
- assertEquals("test category label incorrect", "org.eclipse.wst.common.snippets.tests-category", testCategory.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
- assertNotNull("test category has no content-type visibility filters", testCategory.getFilters()); //$NON-NLS-1$
- assertTrue("test category has no visibility filters", testCategory.getFilters().length > 0); //$NON-NLS-1$
- assertEquals("test category has wrong content-type visibility filter", "*", testCategory.getFilters()[0]); //$NON-NLS-1$
- }
-
- public void testItem0LoadedFromPlugin() {
- ISnippetCategory testCategory = fCurrentDefinitions.getCategory("org.eclipse.wst.common.snippets.tests.category0"); //$NON-NLS-1$
- assertNotNull("test category not found", testCategory); //$NON-NLS-1$
- ISnippetItem item = fCurrentDefinitions.getItem("org.eclipse.wst.common.snippets.tests.item0"); //$NON-NLS-1$
- assertNotNull("test item 0 not found", item); //$NON-NLS-1$
- assertEquals("parent category mismatched", testCategory, item.getCategory()); //$NON-NLS-1$
- assertEquals("item content incorrect", "sample content 0", item.getContentString()); //$NON-NLS-1$
- assertEquals("item description incorrect", "", item.getDescription()); //$NON-NLS-1$
- assertEquals("item label incorrect", "test item 0", item.getLabel()); //$NON-NLS-1$
- assertEquals("item source type incorrect", ISnippetsEntry.SNIPPET_SOURCE_PLUGINS, item.getSourceType()); //$NON-NLS-1$
- assertNotNull("item source description missing", item.getSourceDescriptor()); //$NON-NLS-1$
- assertEquals("item has extra variables", 0, item.getVariables().length); //$NON-NLS-1$
- assertTrue("item has visibility filters", item.getFilters().length == 0); //$NON-NLS-1$
- }
-
- public void testItem1LoadedFromPlugin() {
- ISnippetCategory testCategory = fCurrentDefinitions.getCategory("org.eclipse.wst.common.snippets.tests.category0"); //$NON-NLS-1$
- assertNotNull("test category not found", testCategory); //$NON-NLS-1$
- ISnippetItem item = fCurrentDefinitions.getItem("org.eclipse.wst.common.snippets.tests.item1"); //$NON-NLS-1$
- assertNotNull("test item 1 not found", item); //$NON-NLS-1$
- assertEquals("parent category mismatched", testCategory, item.getCategory()); //$NON-NLS-1$
- assertEquals("item content incorrect", "test content ${variableA} and more ${variableB}", item.getContentString()); //$NON-NLS-1$
- assertEquals("item description incorrect", "", item.getDescription()); //$NON-NLS-1$
- assertEquals("item label incorrect", "test item 1", item.getLabel()); //$NON-NLS-1$
- assertEquals("item source type incorrect", ISnippetsEntry.SNIPPET_SOURCE_PLUGINS, item.getSourceType()); //$NON-NLS-1$
- assertNotNull("item source description missing", item.getSourceDescriptor()); //$NON-NLS-1$
- assertTrue("item has visibility filters", item.getFilters().length == 0); //$NON-NLS-1$
- assertEquals("item has the wrong number of variables", 2, item.getVariables().length); //$NON-NLS-1$
-
- ISnippetVariable variable = getVariable(item, "variableA");
- assertNotNull("variable A missing", variable);
- assertEquals("variable has the wrong default value", "", variable.getDefaultValue()); //$NON-NLS-1$
- assertEquals("variable has the wrong description", "variable A", variable.getDescription()); //$NON-NLS-1$
- assertEquals("variable has the wrong name", "variableA", variable.getName()); //$NON-NLS-1$
-
- variable = getVariable(item, "variableB");
- assertNotNull("variable B missing", variable);
- assertEquals("variable has the wrong default value", "bfoo", variable.getDefaultValue()); //$NON-NLS-1$
- assertEquals("variable has the wrong description", "variable B", variable.getDescription()); //$NON-NLS-1$
- assertEquals("variable has the wrong name", "variableB", variable.getName()); //$NON-NLS-1$
- }
-}
diff --git a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/AllTests.java b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/AllTests.java
deleted file mode 100644
index 6936b71..0000000
--- a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/AllTests.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.common.snippets.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.common.snippets.core.tests.SnippetCoreTests;
-import org.eclipse.wst.common.snippets.tests.providers.SnippetProviderExtensionTests;
-import org.eclipse.wst.common.snippets.tests.providers.TextProviderTests;
-import org.eclipse.wst.common.snippets.tests.scenarios.ObjectOrientedSnippetScenario;
-import org.eclipse.wst.common.snippets.ui.tests.SnippetUITests;
-
-
-public class AllTests extends TestSuite {
-
- public static Test suite() {
- return new AllTests();
- }
-
- public AllTests() {
- super();
- addTest(new TestSuite(SnippetCoreTests.class));
- addTest(new TestSuite(SnippetProviderExtensionTests.class));
- addTest(new TestSuite(TextProviderTests.class));
- addTest(new TestSuite(SnippetUITests.class));
- addTest(new TestSuite(ObjectOrientedSnippetScenario.class));
- }
-}
diff --git a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/TestsPlugin.java b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/TestsPlugin.java
deleted file mode 100644
index 71a4197..0000000
--- a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/TestsPlugin.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 by SAP AG, Walldorf.
- * 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:
- * SAP AG - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.snippets.tests;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class TestsPlugin extends AbstractUIPlugin {
-
- public static final String PLUGIN_ID = "org.eclipse.wst.common.snippets.tests";
- //The shared instance.
- private static TestsPlugin plugin;
-
- /**
- * The constructor.
- */
- public TestsPlugin() {
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static TestsPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.wst.common.snippets.tests", path);
- }
-}
diff --git a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/CommonApplicableInterface.java b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/CommonApplicableInterface.java
deleted file mode 100644
index bff1dd3..0000000
--- a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/CommonApplicableInterface.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 by SAP AG, Walldorf.
- * 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:
- * SAP AG - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.snippets.tests.helpers;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.PartInitException;
-
-public class CommonApplicableInterface implements IEditorPart{
-
- public IEditorInput getEditorInput() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IEditorSite getEditorSite() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void init(IEditorSite site, IEditorInput input)
- throws PartInitException {
- // TODO Auto-generated method stub
-
- }
-
- public void addPropertyListener(IPropertyListener listener) {
- // TODO Auto-generated method stub
-
- }
-
- public void createPartControl(Composite parent) {
- // TODO Auto-generated method stub
-
- }
-
- public void dispose() {
- // TODO Auto-generated method stub
-
- }
-
- public IWorkbenchPartSite getSite() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getTitle() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Image getTitleImage() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getTitleToolTip() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void removePropertyListener(IPropertyListener listener) {
- // TODO Auto-generated method stub
-
- }
-
- public void setFocus() {
- // TODO Auto-generated method stub
-
- }
-
- public Object getAdapter(Class adapter) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void doSave(IProgressMonitor monitor) {
- // TODO Auto-generated method stub
-
- }
-
- public void doSaveAs() {
- // TODO Auto-generated method stub
-
- }
-
- public boolean isDirty() {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean isSaveAsAllowed() {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean isSaveOnCloseNeeded() {
- // TODO Auto-generated method stub
- return false;
- }
-
-}
diff --git a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/ComplexInsertion.java b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/ComplexInsertion.java
deleted file mode 100644
index 041d8ef..0000000
--- a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/ComplexInsertion.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 by SAP AG, Walldorf.
- * 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:
- * SAP AG - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.snippets.tests.helpers;
-
-import org.eclipse.swt.dnd.DragSourceEvent;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.common.snippets.core.ISnippetItem;
-import org.eclipse.wst.common.snippets.ui.ISnippetInsertion;
-
-public class ComplexInsertion implements ISnippetInsertion {
-
- public void dragSetData(DragSourceEvent event, ISnippetItem item) {
- // TODO Auto-generated method stub
-
- }
-
- public Transfer[] getTransfers() {
- // TODO Auto-generated method stub
- return new Transfer[0];
- }
-
- public void insert(IEditorPart editorPart) {
- // TODO Auto-generated method stub
-
- }
-
- public void setEditorPart(IEditorPart targetPart) {
- // TODO Auto-generated method stub
-
- }
-
- public void setItem(ISnippetItem item) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/ComplexProvider.java b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/ComplexProvider.java
deleted file mode 100644
index 6a53f87..0000000
--- a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/ComplexProvider.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 by SAP AG, Walldorf.
- * 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:
- * SAP AG - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.snippets.tests.helpers;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileWriter;
-import java.io.IOException;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.wst.common.snippets.internal.AbstractSnippetProvider;
-import org.eclipse.wst.common.snippets.internal.editors.ISnippetEditor;
-import org.eclipse.wst.common.snippets.tests.TestsPlugin;
-import org.eclipse.wst.common.snippets.ui.ISnippetInsertion;
-
-public class ComplexProvider extends AbstractSnippetProvider {
-
- public static final String TEST_TXT = "test.txt";
- public static final String TESTING = "testing 1, 2, 3, 4, 5, 6";
-
- public String getId() {
- return "Complex_Example";
- }
-
- public ISnippetInsertion getSnippetInsertion() {
- return new ComplexInsertion();
- }
-
- public boolean isActionEnabled(ISelection selection) {
- return true;
- }
-
- public IStatus saveAdditionalContent(IPath path) {
- if (path == null){
- throw new IllegalArgumentException("path is null");
- }
- File f = new File(path.toOSString());
- if (!f.exists()){
- f.mkdir();
- }
- File testSave = new File(f, TEST_TXT);
- try {
- saveTextFile(testSave);
- } catch (IOException e) {
- return new Status(IStatus.ERROR, TestsPlugin.PLUGIN_ID, "could not save file");
- }
- return Status.OK_STATUS;
- }
-
- private void saveTextFile(File testSave) throws IOException {
- BufferedWriter bw = null;
- try {
- bw = new BufferedWriter(new FileWriter(testSave));
- bw.write(TESTING);
-
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } finally {
- if (bw != null){
- bw.close();
- }
- }
- }
-
- public ISnippetEditor getSnippetEditor() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/DummyProvider.java b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/DummyProvider.java
deleted file mode 100644
index 4cdda54..0000000
--- a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/DummyProvider.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 by SAP AG, Walldorf.
- * 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:
- * SAP AG - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.snippets.tests.helpers;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.wst.common.snippets.internal.AbstractSnippetProvider;
-import org.eclipse.wst.common.snippets.internal.editors.ISnippetEditor;
-import org.eclipse.wst.common.snippets.ui.ISnippetInsertion;
-
-public class DummyProvider extends AbstractSnippetProvider {
-
- public String getId() {
- return "dummy";
- }
-
- public ISnippetInsertion getSnippetInsertion() {
- return null;
- }
-
- public boolean isActionEnabled(ISelection selection) {
- return false;
- }
-
- public IStatus saveAdditionalContent(IPath path) {
- return null;
- }
-
- public ISnippetEditor getSnippetEditor() {
- // TODO Auto-generated method stub
- return null;
- }
-
-
-}
diff --git a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/SApplicableEditor.java b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/SApplicableEditor.java
deleted file mode 100644
index 516f998..0000000
--- a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/SApplicableEditor.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 by SAP AG, Walldorf.
- * 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:
- * SAP AG - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.snippets.tests.helpers;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.PartInitException;
-
-public class SApplicableEditor implements IEditorPart {
-
- public IEditorInput getEditorInput() {
- return null;
- }
-
- public IEditorSite getEditorSite() {
- return null;
- }
-
- public void init(IEditorSite site, IEditorInput input)
- throws PartInitException {
-
- }
-
- public void addPropertyListener(IPropertyListener listener) {
- // TODO Auto-generated method stub
-
- }
-
- public void createPartControl(Composite parent) {
- // TODO Auto-generated method stub
-
- }
-
- public void dispose() {
- // TODO Auto-generated method stub
-
- }
-
- public IWorkbenchPartSite getSite() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getTitle() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Image getTitleImage() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getTitleToolTip() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void removePropertyListener(IPropertyListener listener) {
- // TODO Auto-generated method stub
-
- }
-
- public void setFocus() {
- // TODO Auto-generated method stub
-
- }
-
- public Object getAdapter(Class adapter) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void doSave(IProgressMonitor monitor) {
- // TODO Auto-generated method stub
-
- }
-
- public void doSaveAs() {
- // TODO Auto-generated method stub
-
- }
-
- public boolean isDirty() {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean isSaveAsAllowed() {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean isSaveOnCloseNeeded() {
- // TODO Auto-generated method stub
- return false;
- }
-
-}
diff --git a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/TextSnippetProvider2.java b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/TextSnippetProvider2.java
deleted file mode 100644
index 167f578..0000000
--- a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/helpers/TextSnippetProvider2.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 by SAP AG, Walldorf.
- * 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:
- * SAP AG - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.snippets.tests.helpers;
-
-import org.eclipse.wst.common.snippets.ui.TextSnippetProvider;
-
-public class TextSnippetProvider2 extends TextSnippetProvider {
-
-
-}
diff --git a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/providers/SnippetProviderExtensionTests.java b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/providers/SnippetProviderExtensionTests.java
deleted file mode 100644
index db7dcc0..0000000
--- a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/providers/SnippetProviderExtensionTests.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 by SAP AG, Walldorf.
- * 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:
- * SAP AG - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.snippets.tests.providers;
-
-import junit.framework.TestCase;
-
-import org.eclipse.ui.texteditor.AbstractTextEditor;
-import org.eclipse.wst.common.snippets.core.ISnippetProvider;
-import org.eclipse.wst.common.snippets.internal.util.SnippetProviderManager;
-import org.eclipse.wst.common.snippets.tests.helpers.CommonApplicableInterface;
-import org.eclipse.wst.common.snippets.tests.helpers.TextSnippetProvider2;
-import org.eclipse.wst.common.snippets.ui.TextSnippetProvider;
-
-public class SnippetProviderExtensionTests extends TestCase {
-
- public void testEnablement() throws Exception {
- ISnippetProvider applicableProvider = SnippetProviderManager.getApplicableProvider(new AbstractTextEditor(){});
- assertNotNull(applicableProvider);
- applicableProvider = SnippetProviderManager.getApplicableProvider(new CommonApplicableInterface(){});
- assertNotNull(applicableProvider);
- assertEquals("dummy", applicableProvider.getId());
-
- }
-
- public void testDefaultTextSnippetProviderRegistration() throws Exception {
- ISnippetProvider applicableProvider = SnippetProviderManager.getApplicableProvider(new AbstractTextEditor(){});
- assertNotNull(applicableProvider);
- assertEquals(applicableProvider.getClass(), TextSnippetProvider.class);
- }
-
-
- public void testPriority() throws Exception {
- ISnippetProvider applicableProvider = SnippetProviderManager.getApplicableProvider(new AbstractTextEditor(){});
- assertNotNull(applicableProvider);
- assertEquals(applicableProvider.getClass(), TextSnippetProvider.class);
- assertNotNull(SnippetProviderManager.findProvider(TextSnippetProvider2.class.getName()));
- }
-
-
-
-}
diff --git a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/providers/TextProviderTests.java b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/providers/TextProviderTests.java
deleted file mode 100644
index 7175f29..0000000
--- a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/providers/TextProviderTests.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 by SAP AG, Walldorf.
- * 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:
- * SAP AG - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.snippets.tests.providers;
-
-import java.io.ByteArrayInputStream;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.gef.palette.PaletteDrawer;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.common.snippets.internal.SnippetsPlugin;
-import org.eclipse.wst.common.snippets.internal.palette.SnippetPaletteDrawerFactory;
-import org.eclipse.wst.common.snippets.internal.palette.SnippetPaletteItem;
-import org.eclipse.wst.common.snippets.internal.palette.SnippetPaletteRoot;
-import org.eclipse.wst.common.snippets.internal.ui.SnippetsView;
-import org.eclipse.wst.common.snippets.ui.TextSnippetProvider;
-
-public class TextProviderTests extends TestCase {
-
- private IFile file;
-
- protected void setUp() throws Exception {
- super.setUp();
- String projectName = System.currentTimeMillis() + "";
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- if (!project.exists()){
- project.create(new NullProgressMonitor());
- }
- if (!project.isOpen()){
- project.open(new NullProgressMonitor());
- }
- file = project.getFile("testTextSnippet.txt");
- if (!file.exists()){
- ByteArrayInputStream sr = new ByteArrayInputStream("test Text Snippet Provider".getBytes());
- file.create(sr, true, new NullProgressMonitor());
- }
- }
-
- public void testTextSnippetCreation() throws Exception {
- SnippetsView view;
- SnippetPaletteRoot anchor = null;
- view = (SnippetsView) SnippetsPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(SnippetsPlugin.NAMES.VIEW_ID);
- if (view == null) {
- view = (SnippetsView) SnippetsPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(SnippetsPlugin.NAMES.VIEW_ID);
- }
- if (view != null) {
- anchor = view.getRoot();
- }
- Shell activeShell = SnippetsPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(); //Display.getDefault().getActiveShell();
- assertNotNull("no active shell", activeShell);
- PaletteDrawer drawer = (PaletteDrawer) new SnippetPaletteDrawerFactory().createNewEntry(activeShell, anchor);
- drawer.setLabel("testName");
- TextSnippetProvider textSnippetProvider = new TextSnippetProvider();
- IEditorPart openEditor = IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), file);
- assertNotNull("no editor opened", openEditor);
- textSnippetProvider.setEditor(openEditor);
-
-
- SnippetPaletteItem createSnippet = textSnippetProvider.createSnippet(drawer);
- assertNotNull("no SnippetPaletteItem created", createSnippet);
- ITextEditor editor = (ITextEditor) openEditor;
- editor.selectAndReveal(0, 5);
-
- assertFalse("textSnippetProvider action is enabled with no selection", textSnippetProvider.isActionEnabled(null));
- assertTrue("textSnippetProvider action is not enabled with text selection", textSnippetProvider.isActionEnabled(editor.getSelectionProvider().getSelection()));
- editor.selectAndReveal(0, 0);
- assertFalse("textSnippetProvider action is not enabled with text selection", textSnippetProvider.isActionEnabled(editor.getSelectionProvider().getSelection()));
- }
-}
diff --git a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/scenarios/ObjectOrientedSnippetScenario.java b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/scenarios/ObjectOrientedSnippetScenario.java
deleted file mode 100644
index 0fc8f6b..0000000
--- a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/scenarios/ObjectOrientedSnippetScenario.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 by SAP AG, Walldorf.
- * 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:
- * SAP AG - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.snippets.tests.scenarios;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.gef.palette.PaletteDrawer;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.common.snippets.core.ISnippetsEntry;
-import org.eclipse.wst.common.snippets.internal.SnippetsPlugin;
-import org.eclipse.wst.common.snippets.internal.palette.SnippetPaletteDrawerFactory;
-import org.eclipse.wst.common.snippets.internal.palette.SnippetPaletteItem;
-import org.eclipse.wst.common.snippets.internal.palette.SnippetPaletteRoot;
-import org.eclipse.wst.common.snippets.internal.ui.SnippetsView;
-import org.eclipse.wst.common.snippets.tests.helpers.ComplexProvider;
-
-public class ObjectOrientedSnippetScenario extends TestCase {
-
-
- private IFile file;
-
- protected void setUp() throws Exception {
- super.setUp();
- String projectName = System.currentTimeMillis() + "";
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- if (!project.exists()){
- project.create(new NullProgressMonitor());
- }
- if (!project.isOpen()){
- project.open(new NullProgressMonitor());
- }
- file = project.getFile("testTextSnippet.txt");
- if (!file.exists()){
- ByteArrayInputStream sr = new ByteArrayInputStream("test Text Snippet Provider".getBytes());
- file.create(sr, true, new NullProgressMonitor());
- }
- }
-
- public void testSave() throws Exception {
- SnippetsView view;
- SnippetPaletteRoot anchor = null;
- view = (SnippetsView) SnippetsPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(SnippetsPlugin.NAMES.VIEW_ID);
- if (view == null) {
- view = (SnippetsView) SnippetsPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(SnippetsPlugin.NAMES.VIEW_ID);
- }
- if (view != null) {
- anchor = view.getRoot();
- }
- Shell activeShell = SnippetsPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();//Display.getDefault().getActiveShell();
- assertNotNull(activeShell);
- PaletteDrawer drawer = (PaletteDrawer) new SnippetPaletteDrawerFactory().createNewEntry(activeShell, anchor);
- drawer.setLabel("testName");
-
- ComplexProvider provider = new ComplexProvider();
- IEditorPart openEditor = IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), file);
- provider.setEditor(openEditor);
- SnippetPaletteItem createSnippet = provider.createSnippet(drawer);
- assertNotNull(createSnippet);
- File f = new File (createSnippet.getStorageLocation().toOSString());
- assertTrue(f.exists());
- assertEquals(1, f.list().length);
- assertEquals(ComplexProvider.TEST_TXT, f.listFiles()[0].getName());
- assertEquals(ComplexProvider.TESTING.trim(), getContents(f.listFiles()[0]).trim());
-}
-
- public void testProviderBasedSourceType() throws Exception {
- SnippetsView view;
- SnippetPaletteRoot anchor = null;
- view = (SnippetsView) SnippetsPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(SnippetsPlugin.NAMES.VIEW_ID);
- if (view == null) {
- view = (SnippetsView) SnippetsPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(SnippetsPlugin.NAMES.VIEW_ID);
- }
- if (view != null) {
- anchor = view.getRoot();
- }
- Shell activeShell = SnippetsPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();//Display.getDefault().getActiveShell();
- assertNotNull(activeShell);
- PaletteDrawer drawer = (PaletteDrawer) new SnippetPaletteDrawerFactory().createNewEntry(activeShell, anchor);
- drawer.setLabel(getName());
-
- ComplexProvider provider = new ComplexProvider();
- IEditorPart openEditor = IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), file);
- provider.setEditor(openEditor);
- SnippetPaletteItem createSnippet = provider.createSnippet(drawer);
- assertNotNull(createSnippet);
- File f = new File (createSnippet.getStorageLocation().toOSString());
- assertTrue(f.exists());
- assertEquals(1, f.list().length);
- assertEquals(ComplexProvider.TEST_TXT, f.listFiles()[0].getName());
- assertEquals(ComplexProvider.TESTING.trim(), getContents(f.listFiles()[0]).trim());
-
- assertEquals(ISnippetsEntry.SNIPPET_SOURCE_USER, createSnippet.getSourceType());
-}
-
-
- public String getContents(File aFile) {
- StringBuffer contents = new StringBuffer();
-
- try {
- BufferedReader input = new BufferedReader(new FileReader(aFile));
- try {
- String line = null; //not declared within while loop
- while (( line = input.readLine()) != null){
- contents.append(line);
- contents.append(System.getProperty("line.separator"));
- }
- }
- finally {
- input.close();
- }
- }
- catch (IOException ex){
- ex.printStackTrace();
- }
-
- return contents.toString();
- }
-}
diff --git a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/ui/tests/SnippetUITests.java b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/ui/tests/SnippetUITests.java
deleted file mode 100644
index c4889c6..0000000
--- a/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/ui/tests/SnippetUITests.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.common.snippets.ui.tests;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.common.snippets.core.ISnippetItem;
-import org.eclipse.wst.common.snippets.internal.SnippetDefinitions;
-import org.eclipse.wst.common.snippets.internal.model.SnippetManager;
-import org.eclipse.wst.common.snippets.internal.ui.SnippetsView;
-import org.eclipse.wst.common.snippets.tests.TestsPlugin;
-
-
-public class SnippetUITests extends TestCase {
- private SnippetDefinitions fCurrentDefinitions;
-
- private IFile copyBundleEntryIntoWorkspace(String entryname, String fullPath) {
- IFile file = null;
- URL entry = TestsPlugin.getDefault().getBundle().getEntry(entryname);
- if (entry != null) {
- try {
- byte[] b = new byte[2048];
- InputStream input = entry.openStream();
- ByteArrayOutputStream output = new ByteArrayOutputStream();
- int i = -1;
- while ((i = input.read(b)) > -1) {
- output.write(b, 0, i);
- }
- file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fullPath));
- if (file != null) {
- file.create(new ByteArrayInputStream(output.toByteArray()), true, new NullProgressMonitor());
- }
- }
- catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- return file;
- }
-
- private IProject createSimpleProject(String name, IPath location, String[] natureIds) {
- IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(name);
- if (location != null) {
- description.setLocation(location);
- }
- if (natureIds != null) {
- description.setNatureIds(natureIds);
- }
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
- try {
- project.create(description, new NullProgressMonitor());
- assertTrue(project.exists());
- project.open(new NullProgressMonitor());
- }
- catch (CoreException e) {
- e.printStackTrace();
- }
- return project;
- }
-
- private IWorkbenchPage getActivePage() throws WorkbenchException {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null) {
- window = PlatformUI.getWorkbench().openWorkbenchWindow(null);
- }
- IWorkbenchPage page = window.getActivePage();
- if (page == null) {
- page = window.openPage(null);
- }
- return page;
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- fCurrentDefinitions = SnippetManager.getInstance().getDefinitions();
- }
-
- public void testInsertIntoActiveEditorNoVariables() throws Exception {
- IWorkbenchPage page = getActivePage();
- SnippetsView view = null;
- Object o;
- assertNotNull(o = page.showView("org.eclipse.wst.common.snippets.internal.ui.SnippetsView"));
- view = (SnippetsView) o;
- assertEquals("view part is wrong type", SnippetsView.class.getName(), o.getClass().getName());
-
- ISnippetItem item = fCurrentDefinitions.getItem("org.eclipse.wst.common.snippets.tests.item0"); //$NON-NLS-1$
- assertNotNull("test item 1 not found", item); //$NON-NLS-1$
-
- //IProject p =
- createSimpleProject("testInsertIntoActiveEditor", null, null);
- IFile testFile = copyBundleEntryIntoWorkspace("testfiles/testInsertIntoActiveEditor.txt", "testInsertIntoActiveEditor/testInsertIntoActiveEditor.txt");
- IEditorDescriptor descriptor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(testFile.getName());
- assertTrue("no default editor found", descriptor != null);
- IEditorInput editorInput = new FileEditorInput(testFile);
- IEditorPart openedEditor = getActivePage().openEditor(editorInput, descriptor.getId(), true);
- assertTrue("no default text editor found", openedEditor instanceof ITextEditor);
-
- // use setSelectedEntry as that works the drag support
- view.setSelectedEntry(item);
-
- view.insert();
-
- IDocument document = ((ITextEditor) openedEditor).getDocumentProvider().getDocument(editorInput);
- assertEquals("resulting text does not match", "sample content 0", document.get());
- openedEditor.doSave(new NullProgressMonitor());
-
- PlatformUI.getWorkbench().saveAllEditors(false);
- }
-
- public void testOpenSnippetsView() throws CoreException {
- IWorkbenchPage page = getActivePage();
- Object o;
- assertNotNull(o = page.showView("org.eclipse.wst.common.snippets.internal.ui.SnippetsView"));
- assertEquals("view part is wrong type", SnippetsView.class.getName(), o.getClass().getName());
- }
-}
diff --git a/org.eclipse.wst.common.snippets.tests/test.xml b/org.eclipse.wst.common.snippets.tests/test.xml
deleted file mode 100644
index cbdf405..0000000
--- a/org.eclipse.wst.common.snippets.tests/test.xml
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<project
- name="testsuite"
- default="run"
- basedir=".">
-
- <!-- The following properties should be passed into this script -->
- <!-- ${eclipse-home} -->
- <!-- ${buildDirectory} -->
- <!-- ${buildLabel} -->
-
- <!-- should be little need to change what's above -->
-
- <property
- name="plugin-name"
- value="org.eclipse.wst.common.snippets.tests" />
- <property
- name="classname"
- value="org.eclipse.wst.common.snippets.tests.AllTests" />
- <property
- name="testType"
- value="ui-test" />
-
- <!-- should be little need to change what's below -->
-
- <echo message="basedir: ${basedir}" />
- <echo message="eclipse-home: ${eclipse-home}" />
- <echo message="buildDirectory: ${buildDirectory}" />
- <echo message="plugin-name: ${plugin-name}" />
- <echo message="classname: ${classname}" />
- <echo message="testType ${testType}" />
-
-
- <property
- name="library-file"
- value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml" />
- <property
- name="workspace"
- value="${eclipse-home}/junitworkspaces/${plugin-name}" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp />
- <delete>
- <fileset
- dir="${eclipse-home}"
- includes="${plugin-name}.*xml" />
- </delete>
- <!-- make directory, in case path doesn't exist yet -->
- <mkdir dir="${workspace}" />
- <!-- but delete to make sure fresh contents-->
- <delete
- dir="${workspace}"
- quiet="true" />
-
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
-
- <ant
- target="${testType}"
- antfile="${library-file}"
- dir="${eclipse-home}">
- <property
- name="data-dir"
- value="${workspace}" />
- <property
- name="plugin-name"
- value="${plugin-name}" />
- <property
- name="classname"
- value="${classname}" />
- <property
- name="plugin-path"
- value="${eclipse-home}/plugins/${plugin-name}" />
- </ant>
-
- <copy
- failonerror="false"
- file="${workspace}/.metadata/.log"
- tofile="${buildDirectory}/${buildLabel}/testResults/consolelogs/${plugin-name}.consolelog.txt" />
-
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- <!-- usually no need to delete workspace until next run, and leaving it allows inspection -->
- <!-- <delete dir="${workspace}" quiet="true" /> -->
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target
- name="run"
- depends="init,suite,cleanup">
- <ant
- target="collect"
- antfile="${library-file}"
- dir="${eclipse-home}">
- <property
- name="includes"
- value="${plugin-name}.*xml" />
- <property
- name="output-file"
- value="${plugin-name}.xml" />
- </ant>
- </target>
-
-</project>
\ No newline at end of file
diff --git a/org.eclipse.wst.common.snippets.tests/testfiles/testInsertIntoActiveEditor.txt b/org.eclipse.wst.common.snippets.tests/testfiles/testInsertIntoActiveEditor.txt
deleted file mode 100644
index e69de29..0000000
--- a/org.eclipse.wst.common.snippets.tests/testfiles/testInsertIntoActiveEditor.txt
+++ /dev/null