|
From: <caw...@us...> - 2007-01-07 00:36:06
|
Revision: 1758
http://svn.sourceforge.net/rubyeclipse/?rev=1758&view=rev
Author: cawilliams
Date: 2007-01-06 16:36:02 -0800 (Sat, 06 Jan 2007)
Log Message:
-----------
start doing some test cleanup
Modified Paths:
--------------
trunk/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources/ShamFile.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/TS_Core.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/AbstractRubyModelTest.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/ModifyingResourceTest.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/TC_RubyCore.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_MassIndexUpdater.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/model/
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/model/BufferTests.java
Modified: trunk/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources/ShamFile.java
===================================================================
--- trunk/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources/ShamFile.java 2007-01-06 21:40:11 UTC (rev 1757)
+++ trunk/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources/ShamFile.java 2007-01-07 00:36:02 UTC (rev 1758)
@@ -170,7 +170,7 @@
}
public boolean exists() {
- throw new RuntimeException("Unimplemented method in sham");
+ return true;
}
public IMarker findMarker(long id) throws CoreException {
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/TS_Core.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/TS_Core.java 2007-01-06 21:40:11 UTC (rev 1757)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/TS_Core.java 2007-01-07 00:36:02 UTC (rev 1758)
@@ -14,6 +14,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.rubypeople.rdt.core.tests.model.BufferTests;
import org.rubypeople.rdt.internal.core.TS_InternalCore;
import org.rubypeople.rdt.internal.core.builder.TS_InternalCoreBuilder;
import org.rubypeople.rdt.internal.core.parser.TS_InternalCoreParser;
@@ -31,7 +32,7 @@
suite.addTest(TS_InternalCore.suite());
suite.addTest(TS_InternalFormatter.suite());
suite.addTest(TS_Util.suite());
-
+ suite.addTestSuite(BufferTests.class);
return suite;
}
}
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/AbstractRubyModelTest.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/AbstractRubyModelTest.java 2007-01-06 21:40:11 UTC (rev 1757)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/AbstractRubyModelTest.java 2007-01-07 00:36:02 UTC (rev 1758)
@@ -631,4 +631,48 @@
IProject project = getProject(name);
return RubyCore.create(project);
}
+
+ /*
+ * Asserts that the given actual source (usually coming from a file content) is equal to the expected one.
+ * Note that 'expected' is assumed to have the '\n' line separator.
+ * The line separators in 'actual' are converted to '\n' before the comparison.
+ */
+ protected void assertSourceEquals(String message, String expected, String actual) {
+ if (actual == null) {
+ assertEquals(message, expected, null);
+ return;
+ }
+ actual = org.rubypeople.rdt.core.tests.util.Util.convertToIndependantLineDelimiter(actual);
+ if (!actual.equals(expected)) {
+ System.out.print(org.rubypeople.rdt.core.tests.util.Util.displayString(actual.toString(), 2));
+ System.out.println(this.endChar);
+ }
+ assertEquals(message, expected, actual);
+ }
+
+ protected IFolder createFolder(IPath path) throws CoreException {
+ final IFolder folder = getWorkspaceRoot().getFolder(path);
+ getWorkspace().run(new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ IContainer parent = folder.getParent();
+ if (parent instanceof IFolder && !parent.exists()) {
+ createFolder(parent.getFullPath());
+ }
+ folder.create(true, true, null);
+ }
+ },
+ null);
+
+ return folder;
+ }
+
+ protected IRubyScript getRubyScript(String path) {
+ return (IRubyScript)RubyCore.create(getFile(path));
+ }
+
+ public static void waitUntilIndexesReady() {
+
+ // TODO Find some way to wait until the indexes are ready from SymbolIndex/build process
+
+ }
}
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/ModifyingResourceTest.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/ModifyingResourceTest.java 2007-01-06 21:40:11 UTC (rev 1757)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/ModifyingResourceTest.java 2007-01-07 00:36:02 UTC (rev 1758)
@@ -1,11 +1,14 @@
package org.rubypeople.rdt.core.tests;
import java.io.ByteArrayInputStream;
+import java.io.IOException;
import java.io.InputStream;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
public class ModifyingResourceTest extends AbstractRubyModelTest {
@@ -19,4 +22,27 @@
file.setContents(input, IResource.FORCE, null);
return file;
}
+
+ protected IFolder createFolder(String path) throws CoreException {
+ return createFolder(new Path(path));
+ }
+
+ protected IFile createFile(String path, String content) throws CoreException {
+ return createFile(path, content.getBytes());
+ }
+
+ protected IFile createFile(String path, byte[] content) throws CoreException {
+ return createFile(path, new ByteArrayInputStream(content));
+ }
+
+ protected IFile createFile(String path, InputStream content) throws CoreException {
+ IFile file = getFile(path);
+ file.create(content, true, null);
+ try {
+ content.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return file;
+ }
}
Added: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/model/BufferTests.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/model/BufferTests.java (rev 0)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/model/BufferTests.java 2007-01-07 00:36:02 UTC (rev 1758)
@@ -0,0 +1,476 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 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.rubypeople.rdt.core.tests.model;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.rubypeople.rdt.core.BufferChangedEvent;
+import org.rubypeople.rdt.core.IBuffer;
+import org.rubypeople.rdt.core.IBufferChangedListener;
+import org.rubypeople.rdt.core.IRubyScript;
+import org.rubypeople.rdt.core.tests.ModifyingResourceTest;
+
+public class BufferTests extends ModifyingResourceTest implements IBufferChangedListener {
+ protected ArrayList events = null;
+public BufferTests(String name) {
+ super(name);
+}
+/**
+ * Cache the event
+ */
+public void bufferChanged(BufferChangedEvent bufferChangedEvent) {
+ this.events.add(bufferChangedEvent);
+}
+protected IBuffer createBuffer(String path, String content) throws CoreException {
+ waitUntilIndexesReady(); // ensure that the indexer is not reading the file
+ this.createFile(path, content);
+ IRubyScript cu = this.getRubyScript(path);
+ IBuffer buffer = cu.getBuffer();
+ buffer.addBufferChangedListener(this);
+ this.events = new ArrayList();
+ return buffer;
+}
+protected void deleteBuffer(IBuffer buffer) throws CoreException {
+ buffer.removeBufferChangedListener(this);
+ IResource resource = buffer.getUnderlyingResource();
+ if (resource != null) {
+ deleteResource(resource);
+ }
+}
+
+@Override
+protected void setUp() throws Exception {
+ super.setUp();
+ try {
+ this.createRubyProject("P", new String[] {""});
+ this.createFolder("P/x/y");
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+}
+
+@Override
+protected void tearDown() throws Exception {
+ super.tearDown();
+ this.deleteProject("P");
+}
+
+
+/**
+ * Tests appending to a buffer.
+ */
+public void testAppend() throws CoreException {
+ IBuffer buffer = this.createBuffer(
+ "P/x/y/A.rb",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}"
+ );
+ try {
+ int oldLength= buffer.getLength();
+ buffer.append("\nclass B {}");
+ assertBufferEvent(oldLength, 0, "\nclass B {}");
+ assertSourceEquals(
+ "unexpected buffer contents",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}\n" +
+ "class B {}",
+ buffer.getContents()
+ );
+ assertTrue("should have unsaved changes", buffer.hasUnsavedChanges());
+ } finally {
+ this.deleteBuffer(buffer);
+ }
+}
+
+public void testClose() throws CoreException {
+ IBuffer buffer = this.createBuffer(
+ "P/x/y/A.rb",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}"
+ );
+ try {
+ buffer.close();
+ assertBufferEvent(0, 0, null);
+ } finally {
+ this.deleteBuffer(buffer);
+ }
+}
+
+
+/**
+ * Tests getting the underlying resource of a buffer.
+ */
+public void testGetUnderlyingResource() throws CoreException {
+ IBuffer buffer = this.createBuffer(
+ "P/x/y/A.rb",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}"
+ );
+ IRubyScript copy = null;
+ try {
+ IFile file = this.getFile("P/x/y/A.rb");
+ assertEquals("Unexpected underlying resource", file, buffer.getUnderlyingResource());
+
+ copy = this.getRubyScript("P/x/y/A.rb").getWorkingCopy(null);
+ assertEquals("Unexpected underlying resource 2", file, copy.getBuffer().getUnderlyingResource());
+ } finally {
+ this.deleteBuffer(buffer);
+ if (copy != null) {
+ copy.discardWorkingCopy();
+ }
+ }
+}
+/**
+ * Tests deleting text at the beginning of a buffer.
+ */
+public void testDeleteBeginning() throws CoreException {
+ IBuffer buffer = this.createBuffer(
+ "P/x/y/A.rb",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}"
+ );
+ try {
+ buffer.replace(0, 13, "");
+ assertBufferEvent(0, 13, null);
+ assertSourceEquals(
+ "unexpected buffer contents",
+ "public class A {\n" +
+ "}",
+ buffer.getContents()
+ );
+ assertTrue("should have unsaved changes", buffer.hasUnsavedChanges());
+ } finally {
+ this.deleteBuffer(buffer);
+ }
+}
+/**
+ * Tests deleting text in the middle of a buffer.
+ */
+public void testDeleteMiddle() throws CoreException {
+ IBuffer buffer = this.createBuffer(
+ "P/x/y/A.rb",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}"
+ );
+ try {
+ // delete "public "
+ buffer.replace(13, 7, "");
+ assertBufferEvent(13, 7, null);
+ assertSourceEquals(
+ "unexpected buffer contents",
+ "package x.y;\n" +
+ "class A {\n" +
+ "}",
+ buffer.getContents()
+ );
+ assertTrue("should have unsaved changes", buffer.hasUnsavedChanges());
+ } finally {
+ this.deleteBuffer(buffer);
+ }
+}
+/**
+ * Tests deleting text at the end of a buffer.
+ */
+public void testDeleteEnd() throws CoreException {
+ IBuffer buffer = this.createBuffer(
+ "P/x/y/A.rb",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}"
+ );
+ try {
+ // delete "public class A {\n}"
+ buffer.replace(13, 18, "");
+ assertBufferEvent(13, 18, null);
+ assertSourceEquals(
+ "unexpected buffer contents",
+ "package x.y;\n",
+ buffer.getContents()
+ );
+ assertTrue("should have unsaved changes", buffer.hasUnsavedChanges());
+ } finally {
+ this.deleteBuffer(buffer);
+ }
+}
+/**
+ * Tests the buffer char retrieval via source position
+ */
+public void testGetChar() throws CoreException {
+ IBuffer buffer = this.createBuffer(
+ "P/x/y/A.rb",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}"
+ );
+ try {
+ assertEquals("Unexpected char at position 17", 'i', buffer.getChar(17));
+ } finally {
+ this.deleteBuffer(buffer);
+ }
+}
+/**
+ * Tests the buffer char retrieval via source position doesn't throw an exception if the buffer is closed.
+ * (regression test for bug 46040 NPE in Eclipse console)
+ */
+public void testGetChar2() throws CoreException {
+ IBuffer buffer = this.createBuffer(
+ "P/x/y/A.rb",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}"
+ );
+ buffer.close();
+ try {
+ assertEquals("Unexpected char at position 17", Character.MIN_VALUE, buffer.getChar(17));
+ } finally {
+ this.deleteBuffer(buffer);
+ }
+}
+/**
+ * Tests the buffer getLength()
+ */
+public void testGetLength() throws CoreException {
+ IBuffer buffer = this.createBuffer(
+ "P/x/y/A.rb",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}"
+ );
+ try {
+ assertEquals("Unexpected length", 31, buffer.getLength());
+ } finally {
+ this.deleteBuffer(buffer);
+ }
+}
+/**
+ * Tests the buffer text retrieval via source position
+ */
+public void testGetText() throws CoreException {
+ IBuffer buffer = this.createBuffer(
+ "P/x/y/A.rb",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}"
+ );
+ try {
+ assertSourceEquals("Unexpected text (1)", "p", buffer.getText(0, 1));
+ assertSourceEquals("Unexpected text (2)", "public", buffer.getText(13, 6));
+ assertSourceEquals("Unexpected text (3)", "", buffer.getText(10, 0));
+ } finally {
+ this.deleteBuffer(buffer);
+ }
+}
+/**
+ * Tests inserting text at the beginning of a buffer.
+ */
+public void testInsertBeginning() throws CoreException {
+ IBuffer buffer = this.createBuffer(
+ "P/x/y/A.rb",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}"
+ );
+ try {
+ buffer.replace(0, 0, "/* copyright mycompany */\n");
+ assertBufferEvent(0, 0, "/* copyright mycompany */\n");
+ assertSourceEquals(
+ "unexpected buffer contents",
+ "/* copyright mycompany */\n" +
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}",
+ buffer.getContents()
+ );
+ assertTrue("should have unsaved changes", buffer.hasUnsavedChanges());
+ } finally {
+ this.deleteBuffer(buffer);
+ }
+}
+/**
+ * Tests replacing text at the beginning of a buffer.
+ */
+public void testReplaceBeginning() throws CoreException {
+ IBuffer buffer = this.createBuffer(
+ "P/x/y/A.rb",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}"
+ );
+ try {
+ buffer.replace(0, 13, "package other;\n");
+ assertBufferEvent(0, 13, "package other;\n");
+ assertSourceEquals(
+ "unexpected buffer contents",
+ "package other;\n" +
+ "public class A {\n" +
+ "}",
+ buffer.getContents()
+ );
+ assertTrue("should have unsaved changes", buffer.hasUnsavedChanges());
+ } finally {
+ this.deleteBuffer(buffer);
+ }
+}
+/**
+ * Tests replacing text in the middle of a buffer.
+ */
+public void testReplaceMiddle() throws CoreException {
+ IBuffer buffer = this.createBuffer(
+ "P/x/y/A.rb",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}"
+ );
+ try {
+ // replace "public class A" after the \n of package statement
+ buffer.replace(13, 14, "public class B");
+ assertBufferEvent(13, 14, "public class B");
+ assertSourceEquals(
+ "unexpected buffer contents",
+ "package x.y;\n" +
+ "public class B {\n" +
+ "}",
+ buffer.getContents()
+ );
+ assertTrue("should have unsaved changes", buffer.hasUnsavedChanges());
+ } finally {
+ this.deleteBuffer(buffer);
+ }
+}
+/**
+ * Tests replacing text at the end of a buffer.
+ */
+public void testReplaceEnd() throws CoreException {
+ IBuffer buffer = this.createBuffer(
+ "P/x/y/A.rb",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}"
+ );
+ try {
+ // replace "}" at the end of cu with "}\n"
+ int end = buffer.getLength();
+ buffer.replace(end-1, 1, "}\n");
+ assertBufferEvent(end-1, 1, "}\n");
+ assertSourceEquals(
+ "unexpected buffer contents",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}\n",
+ buffer.getContents()
+ );
+ assertTrue("should have unsaved changes", buffer.hasUnsavedChanges());
+ } finally {
+ this.deleteBuffer(buffer);
+ }
+}
+/**
+ * Tests inserting text in the middle of a buffer.
+ */
+public void testInsertMiddle() throws CoreException {
+ IBuffer buffer = this.createBuffer(
+ "P/x/y/A.rb",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}"
+ );
+ try {
+ // insert after the \n of package statement
+ buffer.replace(13, 0, "/* class comment */\n");
+ assertBufferEvent(13, 0, "/* class comment */\n");
+ assertSourceEquals(
+ "unexpected buffer contents",
+ "package x.y;\n" +
+ "/* class comment */\n" +
+ "public class A {\n" +
+ "}",
+ buffer.getContents()
+ );
+ assertTrue("should have unsaved changes", buffer.hasUnsavedChanges());
+ } finally {
+ this.deleteBuffer(buffer);
+ }
+}
+/**
+ * Tests inserting text at the end of a buffer.
+ */
+public void testInsertEnd() throws CoreException {
+ IBuffer buffer = this.createBuffer(
+ "P/x/y/A.rb",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}"
+ );
+ try {
+ // insert after the \n of package statement
+ int end = buffer.getLength();
+ buffer.replace(end, 0, "\nclass B {}");
+ assertBufferEvent(end, 0, "\nclass B {}");
+ assertSourceEquals(
+ "unexpected buffer contents",
+ "package x.y;\n" +
+ "public class A {\n" +
+ "}\n" +
+ "class B {}",
+ buffer.getContents()
+ );
+ assertTrue("should have unsaved changes", buffer.hasUnsavedChanges());
+ } finally {
+ this.deleteBuffer(buffer);
+ }
+}
+
+/**
+ * Verify the buffer changed event.
+ * The given text must contain '\n' line separators.
+ */
+protected void assertBufferEvent(int offset, int length, String text) {
+ assertTrue("events should not be null", this.events != null);
+ assertTrue("events should not be empty", !this.events.isEmpty());
+ BufferChangedEvent event = (BufferChangedEvent) this.events.get(0);
+ assertEquals("unexpected offset", offset, event.getOffset());
+ assertEquals("unexpected length", length, event.getLength());
+ if (text == null) {
+ assertTrue("text should be null", event.getText() == null);
+ } else {
+ assertSourceEquals("unexpected text", text, event.getText());
+ }
+}
+
+protected void assertBufferEvents(String expected) {
+ StringBuffer buffer = new StringBuffer();
+ if (this.events == null)
+ buffer.append("<null>");
+ else {
+ for (int i = 0, length = this.events.size(); i < length; i++) {
+ BufferChangedEvent event = (BufferChangedEvent) this.events.get(i);
+ buffer.append('(');
+ buffer.append(event.getOffset());
+ buffer.append(", ");
+ buffer.append(event.getLength());
+ buffer.append(") ");
+ buffer.append(event.getText());
+ if (i < length-1)
+ buffer.append("\n");
+ }
+ }
+ assertSourceEquals("Unexpected buffer events", expected, buffer.toString());
+}
+}
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/TC_RubyCore.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/TC_RubyCore.java 2007-01-06 21:40:11 UTC (rev 1757)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/TC_RubyCore.java 2007-01-07 00:36:02 UTC (rev 1758)
@@ -1,33 +1,44 @@
package org.rubypeople.rdt.internal.core;
-import junit.framework.TestCase;
-
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
-import org.rubypeople.eclipse.shams.resources.ShamFile;
-import org.rubypeople.eclipse.shams.resources.ShamProject;
+import org.eclipse.core.runtime.CoreException;
import org.rubypeople.eclipse.testutils.ResourceTools;
import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.RubyCore;
-import org.rubypeople.rdt.core.RubyModelException;
+import org.rubypeople.rdt.core.tests.ModifyingResourceTest;
-public class TC_RubyCore extends TestCase {
+public class TC_RubyCore extends ModifyingResourceTest {
public TC_RubyCore(String name) {
super(name);
}
-
- public void testCreate() throws RubyModelException {
- ShamFile file = new ShamFile("some/folder/theFile.rb");
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ try {
+ this.createRubyProject("P", new String[] {""});
+ this.createFolder("P/x/y");
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ this.deleteProject("P");
+ }
+
+ public void testCreate() throws CoreException {
+ IFile file = createFile("P/x/y/theFile.rb", "");
IRubyScript rubyFile = RubyCore.create(file);
assertNotNull("The core should create an IRubyScript when the resource is a file with .rb extension.", rubyFile);
assertEquals("The core should place the resource into the RubyFile.", file, rubyFile.getUnderlyingResource());
-
- file = new ShamFile("some/folder/theFile.xyz");
+
+ file = createFile("P/x/y/theFile.xyz", "");
assertNull("The core should not create a RubyFile when the resource is a file without the .rb extension.", RubyCore.create(file));
-
- ShamProject project = new ShamProject("aProject");
- project.addNature(RubyCore.NATURE_ID);
- assertNotNull("The core should create a RubyProject when the resource has the RubyProjectNature.", RubyCore.create(project));
}
public void testAddRubyNature() throws Exception {
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_MassIndexUpdater.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_MassIndexUpdater.java 2007-01-06 21:40:11 UTC (rev 1757)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_MassIndexUpdater.java 2007-01-07 00:36:02 UTC (rev 1758)
@@ -24,6 +24,7 @@
public class TC_MassIndexUpdater extends TestCase {
public void testUpdateProjects() throws Exception {
+ // What exactly does this test?
ShamRubyParser parser = new ShamRubyParser();
ShamIndexUpdater updater = new ShamIndexUpdater();
MassIndexUpdater massUpdater = new MassIndexUpdater(updater, parser);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|