initial revision
diff --git a/org.eclipse.wst.common.snippets.tests/.classpath b/org.eclipse.wst.common.snippets.tests/.classpath
new file mode 100644
index 0000000..751c8f2
--- /dev/null
+++ b/org.eclipse.wst.common.snippets.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<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
new file mode 100644
index 0000000..6368168
--- /dev/null
+++ b/org.eclipse.wst.common.snippets.tests/.cvsignore
@@ -0,0 +1,4 @@
+bin
+build.xml
+temp.folder
+snippettests.jar
diff --git a/org.eclipse.wst.common.snippets.tests/.project b/org.eclipse.wst.common.snippets.tests/.project
new file mode 100644
index 0000000..726c4ef
--- /dev/null
+++ b/org.eclipse.wst.common.snippets.tests/.project
@@ -0,0 +1,28 @@
+<?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/META-INF/MANIFEST.MF b/org.eclipse.wst.common.snippets.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..2fe9674
--- /dev/null
+++ b/org.eclipse.wst.common.snippets.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Snippets View Tests Plug-in
+Bundle-SymbolicName: org.eclipse.wst.common.snippets.tests; singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.eclipse.wst.common.snippets.tests.TestsPlugin
+Bundle-Vendor: Eclipse.org
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.junit,
+ org.eclipse.wst.common.snippets,
+ org.eclipse.core.resources,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.text
+Eclipse-AutoStart: true
diff --git a/org.eclipse.wst.common.snippets.tests/about.html b/org.eclipse.wst.common.snippets.tests/about.html
new file mode 100644
index 0000000..6f6b96c
--- /dev/null
+++ b/org.eclipse.wst.common.snippets.tests/about.html
@@ -0,0 +1,22 @@
+<!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">
+<h2>About This Content</h2>
+ 
+<p>February 24, 2005</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's 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.</p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/org.eclipse.wst.common.snippets.tests/build.properties b/org.eclipse.wst.common.snippets.tests/build.properties
new file mode 100644
index 0000000..d0656ea
--- /dev/null
+++ b/org.eclipse.wst.common.snippets.tests/build.properties
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               test.xml,\
+               plugin.xml
+src.includes = src/,\
+               build.properties,\
+               test.xml
diff --git a/org.eclipse.wst.common.snippets.tests/plugin.properties b/org.eclipse.wst.common.snippets.tests/plugin.properties
new file mode 100644
index 0000000..be905db
--- /dev/null
+++ b/org.eclipse.wst.common.snippets.tests/plugin.properties
@@ -0,0 +1,11 @@
+# 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
diff --git a/org.eclipse.wst.common.snippets.tests/plugin.xml b/org.eclipse.wst.common.snippets.tests/plugin.xml
new file mode 100644
index 0000000..c899451
--- /dev/null
+++ b/org.eclipse.wst.common.snippets.tests/plugin.xml
@@ -0,0 +1,33 @@
+<?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>
+
+</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
new file mode 100644
index 0000000..b683ed1
--- /dev/null
+++ b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/core/tests/SnippetCoreTests.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 0000000..6783855
--- /dev/null
+++ b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/AllTests.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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.tests;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.wst.common.snippets.core.tests.SnippetCoreTests;
+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(SnippetUITests.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
new file mode 100644
index 0000000..102b528
--- /dev/null
+++ b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/tests/TestsPlugin.java
@@ -0,0 +1,54 @@
+package org.eclipse.wst.common.snippets.tests;
+
+import org.eclipse.ui.plugin.*;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class TestsPlugin extends AbstractUIPlugin {
+
+	//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/ui/tests/SnippetUITests.java b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/ui/tests/SnippetUITests.java
new file mode 100644
index 0000000..332306c
--- /dev/null
+++ b/org.eclipse.wst.common.snippets.tests/src/org/eclipse/wst/common/snippets/ui/tests/SnippetUITests.java
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * 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.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();
+		SnippetsView view = null;
+		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
new file mode 100644
index 0000000..d9e0b92
--- /dev/null
+++ b/org.eclipse.wst.common.snippets.tests/test.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0"?>
+
+<project
+	name="testsuite"
+	default="run"
+	basedir=".">
+	<!-- The property ${eclipse-home} should be passed into this script -->
+	<!-- Set a meaningful default value for when it is not. -->
+	<!-- <property name="eclipse-home" value="${basedir}\..\.." /> -->
+
+	<echo message="basedir ${basedir}" />
+	<echo message="eclipse place ${eclipse-home}" />
+
+	<!-- sets the properties plugin-name, and library-file -->
+	<property
+		name="plugin-name"
+		value="org.eclipse.wst.common.snippets.tests" />
+	<property
+		name="library-file"
+		value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml" />
+
+	<!-- 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="org.eclipse.wst.common.snippets.tests.*xml" />
+		</delete>
+	</target>
+
+	<!-- This target defines the tests that need to be run. -->
+	<target name="suite">
+		<property
+			name="wst-folder"
+			value="${eclipse-home}/wst_folder" />
+		<delete
+			dir="${wst-folder}"
+			quiet="true" />
+		<ant
+			target="core-test"
+			antfile="${library-file}"
+			dir="${eclipse-home}">
+			<property
+				name="data-dir"
+				value="${wst-folder}" />
+			<property
+				name="plugin-name"
+				value="${plugin-name}" />
+			<property
+				name="classname"
+				value="org.eclipse.wst.common.snippets.tests.AllTests" />
+			<property
+				name="plugin-path"
+				value="${eclipse-home}/plugins/${plugin-name}" />
+		</ant>
+	</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">
+		<!--<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="org.eclipse.wst.common.snippets.tests.*xml" />
+			<property
+				name="output-file"
+				value="${plugin-name}.xml" />
+		</ant>
+		<!--		<emailResults resultsFile="${build-results-home}/${plugin-name}.xml" addresslist="david_williams@us.ibm.com" /> -->
+	</target>
+
+</project>
\ No newline at end of file