Bug 350995 - Remove JUnit test dependencies from non-test projects. Relax version constraints.
diff --git a/org.eclipse.amp.agf/plugins/org.eclipse.amp.agf.chart/.classpath b/org.eclipse.amp.agf/plugins/org.eclipse.amp.agf.chart/.classpath
index f3b093b..64c5e31 100644
--- a/org.eclipse.amp.agf/plugins/org.eclipse.amp.agf.chart/.classpath
+++ b/org.eclipse.amp.agf/plugins/org.eclipse.amp.agf.chart/.classpath
@@ -3,6 +3,5 @@
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="test"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/org.eclipse.amp.agf/plugins/org.eclipse.amp.agf.chart/META-INF/MANIFEST.MF b/org.eclipse.amp.agf/plugins/org.eclipse.amp.agf.chart/META-INF/MANIFEST.MF
index c38de51..29e4091 100644
--- a/org.eclipse.amp.agf/plugins/org.eclipse.amp.agf.chart/META-INF/MANIFEST.MF
+++ b/org.eclipse.amp.agf/plugins/org.eclipse.amp.agf.chart/META-INF/MANIFEST.MF
@@ -13,9 +13,7 @@
  org.eclipse.amp.axf.core,
  org.eclipse.amp.axf.views,
  org.eclipse.amp.agf.core,
- com.ibm.icu,
- org.junit;bundle-version="4.8.1",
- org.junit4;bundle-version="4.8.1"
+ com.ibm.icu
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Bundle-ActivationPolicy: lazy
 Export-Package: 
diff --git a/org.eclipse.amp.agf/tests/org.eclipse.amp.agf.chart.test/.classpath b/org.eclipse.amp.agf/tests/org.eclipse.amp.agf.chart.test/.classpath
new file mode 100644
index 0000000..ad32c83
--- /dev/null
+++ b/org.eclipse.amp.agf/tests/org.eclipse.amp.agf.chart.test/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.amp.agf/tests/org.eclipse.amp.agf.chart.test/.project b/org.eclipse.amp.agf/tests/org.eclipse.amp.agf.chart.test/.project
new file mode 100644
index 0000000..8785de1
--- /dev/null
+++ b/org.eclipse.amp.agf/tests/org.eclipse.amp.agf.chart.test/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.amp.agf.chart.test</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.amp.agf/tests/org.eclipse.amp.agf.chart.test/META-INF/MANIFEST.MF b/org.eclipse.amp.agf/tests/org.eclipse.amp.agf.chart.test/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..1f0aa07
--- /dev/null
+++ b/org.eclipse.amp.agf/tests/org.eclipse.amp.agf.chart.test/META-INF/MANIFEST.MF
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Tests for org.eclipse.amp.agf.chart
+Bundle-SymbolicName: org.eclipse.amp.agf.chart.test
+Bundle-Version: 0.9.0.qualifier
+Fragment-Host: org.eclipse.amp.agf.chart
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.junit;bundle-version="4.8.1"
diff --git a/org.eclipse.amp.agf/tests/org.eclipse.amp.agf.chart.test/build.properties b/org.eclipse.amp.agf/tests/org.eclipse.amp.agf.chart.test/build.properties
new file mode 100644
index 0000000..34d2e4d
--- /dev/null
+++ b/org.eclipse.amp.agf/tests/org.eclipse.amp.agf.chart.test/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .
diff --git a/org.eclipse.amp.agf/plugins/org.eclipse.amp.agf.chart/test/org/eclipse/amp/agf/chart/ResourceManagerTest.java b/org.eclipse.amp.agf/tests/org.eclipse.amp.agf.chart.test/src/org/eclipse/amp/agf/chart/ResourceManagerTest.java
similarity index 75%
rename from org.eclipse.amp.agf/plugins/org.eclipse.amp.agf.chart/test/org/eclipse/amp/agf/chart/ResourceManagerTest.java
rename to org.eclipse.amp.agf/tests/org.eclipse.amp.agf.chart.test/src/org/eclipse/amp/agf/chart/ResourceManagerTest.java
index 20e4298..bfdcfc3 100644
--- a/org.eclipse.amp.agf/plugins/org.eclipse.amp.agf.chart/test/org/eclipse/amp/agf/chart/ResourceManagerTest.java
+++ b/org.eclipse.amp.agf/tests/org.eclipse.amp.agf.chart.test/src/org/eclipse/amp/agf/chart/ResourceManagerTest.java
@@ -1,6 +1,5 @@
 package org.eclipse.amp.agf.chart;
 
-
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -10,66 +9,74 @@
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
 public class ResourceManagerTest {
-	
+
 	private ResourceManager classToTest;
+
+	private Shell shell;
+
 	@Before
 	public void setUp() throws Exception {
+		shell = new Shell();
 		classToTest = new ChartEditPart().getResourceManager();
 	}
+
+	@After
+	public void tearDown() {
+		shell.dispose();
+	}
+
 	/**
-	 * Would old gc be desposed?
-	 * Can we set null to dispose the gc
+	 * Will the old {@link GC} be disposed? Can we use <code>null</code> to
+	 * dispose the {@link GC}?
 	 */
 	@Test
-	public void testSetGc(){
-		Shell shell = new Shell();
+	public void testSetGc() {
 		GC gc = new GC(shell);
 		assertFalse(gc.isDisposed());
-		
+
 		classToTest.setGc(gc);
 		assertFalse(gc.isDisposed());
-		
+
 		GC gc2 = new GC(shell);
 		classToTest.setGc(gc2);
 		assertTrue(gc.isDisposed());
 		assertFalse(gc2.isDisposed());
-		
-		try{
+
+		try {
 			classToTest.setGc(null);
 			assertTrue(gc2.isDisposed());
-		}catch(Exception e){
+		} catch (Exception e) {
 			fail(e.getMessage());
 		}
-		shell.dispose();
 	}
+
 	/**
-	 * Would old image be desposed?
-	 * Can we set null to dispose the image
+	 * Will the old {@link Image} be disposed? Can we use <code>null</code> to
+	 * dispose the {@link Image}?
 	 */
 	@Test
-	public void testSetImage(){
-		Shell shell = new Shell();
+	public void testSetImage() {
 		Image image = new Image(Display.getCurrent(), 10, 10);
 		assertFalse(image.isDisposed());
-		
+
 		classToTest.setImage(image);
 		assertFalse(image.isDisposed());
-		
+
 		Image image2 = new Image(Display.getCurrent(), 10, 10);
 		classToTest.setImage(image2);
 		assertTrue(image.isDisposed());
 		assertFalse(image2.isDisposed());
-		
-		try{
+
+		try {
 			classToTest.setImage(null);
 			assertTrue(image2.isDisposed());
-		}catch(Exception e){
+		} catch (Exception e) {
 			fail(e.getMessage());
 		}
-		shell.dispose();
 	}
 }