Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EasyMock is already being used on the HaskellCorePluginTest, but we need to gradully convert other tests to use it. EclipseFP's developer SDK is getting quite large. There are at least two Eclipse plugins already (antlr and easymock). Maybe we should package this as a feature or something. darcs-hash:20060510143547-49d33-e40b59ee1e1d1e1356b0d6800ed1ff103fb35b5b.gz
- Loading branch information
1 parent
7693409
commit dbe565a
Showing
9 changed files
with
68 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 15 additions & 4 deletions
19
...psefp.haskell.core.test/src/net/sf/eclipsefp/haskell/core/test/HaskellCorePluginTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,33 @@ | ||
package net.sf.eclipsefp.haskell.core.test; | ||
|
||
import net.sf.eclipsefp.haskell.core.HaskellCorePlugin; | ||
import net.sf.eclipsefp.haskell.core.test.internal.doubles.MockWorkspace; | ||
import net.sf.eclipsefp.haskell.core.test.internal.doubles.StubBundleContext; | ||
|
||
import org.eclipse.core.resources.IResourceChangeListener; | ||
import org.eclipse.core.resources.IWorkspace; | ||
import org.eclipse.core.resources.ResourcesPlugin; | ||
import org.eclipse.core.runtime.Plugin; | ||
|
||
import junit.framework.TestCase; | ||
import static org.easymock.EasyMock.*; | ||
|
||
public class HaskellCorePluginTest extends TestCase { | ||
|
||
public void testRegistersResourceChangeListener() throws Exception { | ||
//TODO use a mock library here | ||
MockWorkspace workspace = new MockWorkspace(); | ||
IWorkspace workspace = createMock(IWorkspace.class); | ||
|
||
workspace.addResourceChangeListener((IResourceChangeListener) anyObject(), anyInt()); | ||
expectLastCall().times(1); | ||
|
||
expect(workspace.getRoot()). | ||
andReturn(ResourcesPlugin.getWorkspace().getRoot()); | ||
|
||
replay(workspace); | ||
|
||
Plugin corePlugin = new HaskellCorePlugin(workspace); | ||
corePlugin.start(new StubBundleContext()); | ||
|
||
workspace.verify(); | ||
verify(workspace); | ||
} | ||
|
||
} |
226 changes: 0 additions & 226 deletions
226
...kell.core.test/src/net/sf/eclipsefp/haskell/core/test/internal/doubles/MockWorkspace.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry exported="true" sourcepath="/tmp/easymock2.2/src.zip" kind="lib" path="lib/easymock.jar"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="output" path=""/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.easymock</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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: Easymock | ||
Bundle-SymbolicName: org.easymock | ||
Bundle-Version: 2.2 | ||
Bundle-Vendor: eclipsefp.sourceforge.net | ||
Bundle-Localization: plugin | ||
Bundle-ClassPath: lib/easymock.jar | ||
Export-Package: org.easymock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
output.. = bin/ | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
lib/,\ | ||
lib/easymock.jar | ||
src.includes = lib/ |
Binary file not shown.