|
From: <caw...@us...> - 2007-01-06 21:40:12
|
Revision: 1757
http://svn.sourceforge.net/rubyeclipse/?rev=1757&view=rev
Author: cawilliams
Date: 2007-01-06 13:40:11 -0800 (Sat, 06 Jan 2007)
Log Message:
-----------
add some more tests
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/TC_RubyProject.java
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/TC_RubyProject.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/TC_RubyProject.java 2007-01-06 21:23:21 UTC (rev 1756)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/TC_RubyProject.java 2007-01-06 21:40:11 UTC (rev 1757)
@@ -2,7 +2,9 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.RubyModelException;
@@ -84,4 +86,56 @@
assertTrue("incorrect corresponding resource", corr.equals(res));
assertEquals("Project is incorrect for the ruby script", "RubyProjectTests", corr.getProject().getName());
}
+
+ /*
+ * Ensures that opening a project update the project references
+ * (regression test for bug 73253 [model] Project references not set on project open)
+ */
+ public void testProjectOpen() throws CoreException {
+ try {
+ createRubyProject("P1");
+ createRubyProject("P2", new String[0], new String[0], new String[] {"/P1"});
+ IProject p2 = getProject("P2");
+ p2.close(null);
+ p2.open(null);
+ IProject[] references = p2.getDescription().getDynamicReferences();
+ assertResourcesEqual(
+ "Unexpected referenced projects",
+ "/P1",
+ references);
+ } finally {
+ deleteProjects(new String[] {"P1", "P2"});
+ }
+ }
+
+ /*
+ * Ensures that importing a project correctly update the project references
+ * (regression test for bug 121569 [Import/Export] Importing projects in workspace, the default build order is alphabetical instead of by dependency)
+ */
+ public void testProjectImport() throws CoreException {
+ try {
+ createRubyProject("P1");
+ IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ createRubyProject("P2");
+ editFile(
+ "/P2/.loadpath",
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
+ "<loadpath>\n" +
+ " <pathentry type=\"src\" path=\"/P1\"/>\n" +
+ "</loadpath>"
+ );
+ }
+ };
+ getWorkspace().run(runnable, null);
+ waitForAutoBuild();
+ IProject[] referencedProjects = getProject("P2").getReferencedProjects();
+ assertResourcesEqual(
+ "Unexpected project references",
+ "/P1",
+ referencedProjects);
+ } finally {
+ deleteProjects(new String[] {"P1", "P2"});
+ }
+ }
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|