|
From: <caw...@us...> - 2007-01-15 14:19:12
|
Revision: 1768
http://svn.sourceforge.net/rubyeclipse/?rev=1768&view=rev
Author: cawilliams
Date: 2007-01-15 06:19:08 -0800 (Mon, 15 Jan 2007)
Log Message:
-----------
fix broken tests
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/TC_ResourceAdapterFactory.java
Modified: trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/TC_ResourceAdapterFactory.java
===================================================================
--- trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/TC_ResourceAdapterFactory.java 2007-01-15 13:49:34 UTC (rev 1767)
+++ trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/TC_ResourceAdapterFactory.java 2007-01-15 14:19:08 UTC (rev 1768)
@@ -1,19 +1,20 @@
package org.rubypeople.rdt.internal.ui;
-import junit.framework.TestCase;
-
-import org.rubypeople.eclipse.shams.resources.ShamFile;
-import org.rubypeople.eclipse.shams.resources.ShamProject;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.IRubyScript;
-import org.rubypeople.rdt.core.RubyCore;
+import org.rubypeople.rdt.core.tests.ModifyingResourceTest;
import org.rubypeople.rdt.internal.core.RubyProject;
import org.rubypeople.rdt.internal.core.RubyScript;
-public class TC_ResourceAdapterFactory extends TestCase {
+public class TC_ResourceAdapterFactory extends ModifyingResourceTest {
+ private static final String PROJECT_NAME = "adapterTest";
private ResourceAdapterFactory factory;
+ private IProject project;
public TC_ResourceAdapterFactory(String name) {
super(name);
@@ -21,24 +22,30 @@
protected void setUp() throws Exception {
super.setUp();
+ this.project = createProject(PROJECT_NAME);
factory = new ResourceAdapterFactory();
}
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ deleteProject(PROJECT_NAME);
+ }
- public void testGetAdapterForRBFile() {
- ShamFile file = new ShamFile("mustBeA.rb");
+ public void testGetAdapterForRBFile() throws CoreException {
+ IFile file = createFile(PROJECT_NAME + "/mustBeA.rb", "");
assertEquals(RubyScript.class, factory.getAdapter(file, IRubyElement.class).getClass());
assertTrue(factory.getAdapter(file, IRubyElement.class) instanceof IRubyScript);
}
- public void testGetAdapterForRBWFile() {
- ShamFile file = new ShamFile("mustBeA.rbw");
+ public void testGetAdapterForRBWFile() throws CoreException {
+ IFile file = createFile(PROJECT_NAME + "/mustBeA.rbw", "");
assertEquals(RubyScript.class, factory.getAdapter(file, IRubyElement.class).getClass());
assertTrue(factory.getAdapter(file, IRubyElement.class) instanceof IRubyScript);
}
- public void testGetAdapterForProject() {
- ShamProject project = new ShamProject("AProject");
- project.addNature(RubyCore.NATURE_ID);
+ public void testGetAdapterForProject() throws CoreException {
+ addRubyNature(PROJECT_NAME);
assertEquals(RubyProject.class, factory.getAdapter(project, IRubyElement.class).getClass());
assertTrue(factory.getAdapter(project, IRubyElement.class) instanceof IRubyProject);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|