Re: Re: Spindle compatability test suite

"Hugo Palma" <[email protected]> Tue, 16 May 2006 18:18:40 +0100
Newsgroups gmane.comp.ide.eclipse.spindle.devel
Message-ID <[email protected]>
------=_Part_66023_1451736.1147799920429
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Just hope you and your kids get well soon......

Cheers

Hugo

On 5/15/06, Geoff Longman <[email protected]> wrote:
>
> Hey guy. My kids had the flu last week and on Thursday night I got
> hit. Just made it out of bed yesterday afternoon and so am a but
> behind.
>
> G
>
> On 5/13/06, Hugo Palma <[email protected]> wrote:
> > Ok, i've uploaded the files. I used the tapidea svn repo for this.
> > You have web access to it, if you like, here
> > http://svn.javaforge.com/svn/tapidea/spindle-test-suite/trunk/.
> > You can also find my(unfinished) implementation of IFixture here
> >
> http://svn.javaforge.com/svn/tapidea/tapidea-core/trunk/src/main/java/org=
/intellij/tapestry/test/Fixture.java
> .
> >
> > I thought a little more about the tested classes implementation issue
> > and i think i came up with a much better solution. Instead of having to
> > declare a service for each tested class i think we can assume that if w=
e
> > have the IDE specific implementation of ITapestryProject and
> > TapestryCore we can get any other instance of a class that we want to
> > test from that. The current implementation only gets the
> > ITapestryProject implementation but a similiar approach can be taken to
> > get the TapestryCore impl.
> > Do you think this assumption is correct ?
> >
> >
> >
> > Geoff Longman wrote:
> > > Ok. I see what you have. A fixture is an interface to build a
> > > "project" with context and classpath for testing. Can provide or poin=
t
> > > me to (in you repo) an example of a Test?
> > >
> > >
> > > On 5/10/06, Hugo Palma <[email protected]> wrote:
> > >> Forgot to mention how the tested class implementation would be serve=
d
> to
> > >> the test class.
> > >
> > > ok, I'm lost at this point. "tested class implementation" is?
> > >
> > >
> > > Geoff
> > >
> > >> I got this working by declaring a hivemind service for each tested
> class
> > >> in spindle-tests and then providing the implementation in the IDE
> > >> implementation module. There's also an utility method in
> > >> AbstractSpindleTestCase that gets the tested class implementation.
> > >> I'm not crazy about having to declare every tested class in the
> hivemind
> > >> descriptor but i couldn't find a better way of doing this.
> > >>
> > >>
> > >> Hugo Palma wrote:
> > >> > I told you i wouldn't let you forget about this :o)
> > >> >
> > >> > I took advantage of a few dead hours in my day job to give this
> some
> > >> > thought. After some experimenting i came up with some ideas and
> some
> > >> > code also.
> > >> >
> > >> > There should be a separate module(spindle-tests) with all the
> > >> > framework classes and the tests themselves.
> > >> >
> > >> > The framework consists of one interface, one class and one hivemin=
d
> > >> > descriptor. The interface is IFixture, it provides the signature
> for
> > >> > all operations that can be executed in a fixture. A fresh instance
> of
> > >> > the fixture will be provided to each test class at every test run.
> > >> > I've come up with the following code for now, still some operation=
s
> > >> > missing but good for getting the main picture:
> > >> >
> > >> > /**
> > >> >  * A test fixture. Should have an implementation for each IDE.
> > >> >  */
> > >> > public interface IFixture<W, F>
> > >> > {
> > >> >     /**
> > >> >      * Adds a web root.
> > >> >      *
> > >> >      * @param filePath     the absolute path to the web root
> > >> directory.
> > >> >      * @param relativePath the relative path of the web root. Some
> > >> > IDEs let the user specify a different relative path for each web
> root,
> > >> > changing the default "/" path.
> > >> >      * @return the added web root.
> > >> >      */
> > >> >     W addWebRoot(String filePath, String relativePath);
> > >> >
> > >> >     /**
> > >> >      * Adds a web root with the default "/" relative path.
> > >> >      *
> > >> >      * @param filePath the absolute path to the web root directory=
.
> > >> >      * @return the added web root.
> > >> >      */
> > >> >     W addWebRoot(String filePath);
> > >> >
> > >> >     /**
> > >> >      * Adds an empty file to a web root.
> > >> >      *
> > >> >      * @param webRoot the web root to add the file to.
> > >> >      * @param path    the absolute path of the file to be added.
> > >> >      * @return the added file.
> > >> >      */
> > >> >     F addFileToWebRoot(W webRoot, String path);
> > >> >
> > >> >     /**
> > >> >      * Adds a source root.
> > >> >      *
> > >> >      * @param filePath the absolute path to the source root
> directory.
> > >> >      * @return the added source root.
> > >> >      */
> > >> >     F addSourceRoot(String filePath);
> > >> >
> > >> >     /**
> > >> >      * Adds an empty class to a source root.
> > >> >      *
> > >> >      * @param root        the source root to add the class to.
> > >> >      * @param packageName the class package.
> > >> >      * @param className   the class name.
> > >> >      */
> > >> >     void addClassToSourceRoot(F root, String packageName, String
> > >> > className);
> > >> >
> > >> >     /**
> > >> >      * Adds a .jar file to the classpath.
> > >> >      *
> > >> >      * @param jarFile the .jar file to add to the classpath.
> > >> >      */
> > >> >     void addJarToClasspath(F jarFile);
> > >> >
> > >> >     /**
> > >> >      * Adds a file to a source root.
> > >> >      *
> > >> >      * @param root        the source root to add the file to.
> > >> >      * @param packageName the package to add the file to.
> > >> >      * @param fileName    the absolute path to the file to be
> added.
> > >> >      */
> > >> >     void addFileToSourceRoot(F root, String packageName, String
> > >> > fileName);
> > >> >
> > >> >     /**
> > >> >      * Tears down the fixture.
> > >> >      */
> > >> >     void tearDown();
> > >> > }
> > >> >
> > >> >
> > >> > The base class for all tests is also provided. I called it
> > >> > AbstractSpindleTestCase. This class provides a getFixture() method
> to
> > >> > every subclass and is responsible for getting the fresh fixture
> > >> > instance from Hivemind at every test run. Here's the code i came u=
p
> > >> with:
> > >> >
> > >> > /**
> > >> >  * Base class for all test classes.
> > >> >  *
> > >> >  * @author Hugo Palma
> > >> >  */
> > >> > public abstract class AbstractSpindleTestCase extends TestCase
> > >> > {
> > >> >     private IFixture _fixture;
> > >> >     private static Registry _registry;
> > >> >
> > >> >     {
> > >> >         _registry =3D RegistryBuilder.constructDefaultRegistry();
> > >> >     }
> > >> >
> > >> >     /**
> > >> >      * {@inheritDoc}
> > >> >      */
> > >> >     protected void setUp() throws Exception
> > >> >     {
> > >> >         super.setUp();
> > >> >
> > >> >         // Allows getting a brand new IFixture instance every time=
.
> > >> >         _registry.cleanupThread();
> > >> >         _registry.setupThread();
> > >> >
> > >> >         _fixture =3D (IFixture) _registry.getService(IFixture.clas=
s);
> > >> >     }
> > >> >
> > >> >     /**
> > >> >      * {@inheritDoc}
> > >> >      */
> > >> >     protected void tearDown() throws Exception
> > >> >     {
> > >> >         super.tearDown();
> > >> >
> > >> >         // Cleanup the fixture.
> > >> >         _fixture.tearDown();
> > >> >         _fixture =3D null;
> > >> >     }
> > >> >
> > >> >     protected IFixture getFixture()
> > >> >     {
> > >> >         return _fixture;
> > >> >     }
> > >> > }
> > >> >
> > >> > The only thing missing is the hivemodule.xml in the spindle-tests
> > >> module:
> > >> >
> > >> > <module id=3D" net.sf.spindle.tests" version=3D"1.0.0">
> > >> >     <service-point id=3D"fixture"
> > >> > interface=3D"net.sf.spindle.tests.IFixture"/>
> > >> > </module>
> > >> >
> > >> > So, given this, all the IDE has to do is:
> > >> >
> > >> > - Create an implementation of the IFixture interface.
> > >> > - Provide a hivemodule.xml file in it's spindle-core implementatio=
n
> > >> > module with something like:
> > >> >
> > >> >   <module id=3D"org.intellij.tapestry" version=3D" 1.0.0">
> > >> >     <dependency module-id=3D"net.sf.spindle.tests" version=3D"1.0.=
0"/>
> > >> >
> > >> >     <implementation service-id=3D"net.sf.spindle.tests.fixture">
> > >> >         <invoke-factory model=3D"threaded">
> > >> >             <construct class=3D"org.intellij.tapestry.test.Fixture=
"/>
> > >> >         </invoke-factory>
> > >> >     </implementation>
> > >> > </module>
> > >> > - Execute the tests. I managed to run the tests from IDEA with no
> > >> > problem. I'm going to see how/if i can run tests from a jar file
> with
> > >> > Maven2.
> > >> >
> > >> >
> > >> > Thoughts ?
> > >>
> > >>
> > >> -------------------------------------------------------
> > >> Using Tomcat but need to do more? Need to support web services,
> > >> security?
> > >> Get stuff done quickly with pre-integrated technology to make your
> > >> job easier
> > >> Download IBM WebSphere Application Server v.1.0.1 based on Apache
> > >> Geronimo
> > >>
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=
=3D121642
> > >> _______________________________________________
> > >> Spindle-developer mailing list
> > >> [email protected]
> > >> https://lists.sourceforge.net/lists/listinfo/spindle-developer
> > >>
> > >
> > >
> >
> >
> > -------------------------------------------------------
> > Using Tomcat but need to do more? Need to support web services,
> security?
> > Get stuff done quickly with pre-integrated technology to make your job
> easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=
=3D121642
> > _______________________________________________
> > Spindle-developer mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/spindle-developer
> >
>
>
> --
> The Spindle guy. http://spindle.sf.net
> Blog:                  http://jroller.com/page/glongman
> Other interests:  http://www.squidoo.com/spaceelevator/
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim=
o
> http://sel.as-us.falkag.net/sel?cmdlnk&kid=120709&bid&3057&dat=121642
> _______________________________________________
> Spindle-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/spindle-developer
>

------=_Part_66023_1451736.1147799920429
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Just hope you and your kids get well soon......<br><br>Cheers<br><br>Hugo<b=
r><br><div><span class=3D"gmail_quote">On 5/15/06, <b class=3D"gmail_sender=
name">Geoff Longman</b> &lt;<a href=3D"mailto:[email protected]">glongman@=
gmail.com
</a>&gt; wrote:</span><blockquote class=3D"gmail_quote" style=3D"border-lef=
t: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1=
ex;">Hey guy. My kids had the flu last week and on Thursday night I got<br>
hit. Just made it out of bed yesterday afternoon and so am a but<br>behind.=
<br><br>G<br><br>On 5/13/06, Hugo Palma &lt;<a href=3D"mailto:hugo.m.palma@=
gmail.com">[email protected]</a>&gt; wrote:<br>&gt; Ok, i've uploaded =
the files. I used the tapidea svn repo for this.
<br>&gt; You have web access to it, if you like, here<br>&gt; <a href=3D"ht=
tp://svn.javaforge.com/svn/tapidea/spindle-test-suite/trunk/">http://svn.ja=
vaforge.com/svn/tapidea/spindle-test-suite/trunk/</a>.<br>&gt; You can also=
 find my(unfinished) implementation of IFixture here
<br>&gt; <a href=3D"http://svn.javaforge.com/svn/tapidea/tapidea-core/trunk=
/src/main/java/org/intellij/tapestry/test/Fixture.java">http://svn.javaforg=
e.com/svn/tapidea/tapidea-core/trunk/src/main/java/org/intellij/tapestry/te=
st/Fixture.java
</a>.<br>&gt;<br>&gt; I thought a little more about the tested classes impl=
ementation issue<br>&gt; and i think i came up with a much better solution.=
 Instead of having to<br>&gt; declare a service for each tested class i thi=
nk we can assume that if we
<br>&gt; have the IDE specific implementation of ITapestryProject and<br>&g=
t; TapestryCore we can get any other instance of a class that we want to<br=
>&gt; test from that. The current implementation only gets the<br>&gt; ITap=
estryProject implementation but a similiar approach can be taken to
<br>&gt; get the TapestryCore impl.<br>&gt; Do you think this assumption is=
 correct ?<br>&gt;<br>&gt;<br>&gt;<br>&gt; Geoff Longman wrote:<br>&gt; &gt=
; Ok. I see what you have. A fixture is an interface to build a<br>&gt; &gt=
; &quot;project&quot; with context and classpath for testing. Can provide o=
r point
<br>&gt; &gt; me to (in you repo) an example of a Test?<br>&gt; &gt;<br>&gt=
; &gt;<br>&gt; &gt; On 5/10/06, Hugo Palma &lt;<a href=3D"mailto:hugo.m.pal=
[email protected]">[email protected]</a>&gt; wrote:<br>&gt; &gt;&gt; Forgot=
 to mention how the tested class implementation would be served to
<br>&gt; &gt;&gt; the test class.<br>&gt; &gt;<br>&gt; &gt; ok, I'm lost at=
 this point. &quot;tested class implementation&quot; is?<br>&gt; &gt;<br>&g=
t; &gt;<br>&gt; &gt; Geoff<br>&gt; &gt;<br>&gt; &gt;&gt; I got this working=
 by declaring a hivemind service for each tested class
<br>&gt; &gt;&gt; in spindle-tests and then providing the implementation in=
 the IDE<br>&gt; &gt;&gt; implementation module. There's also an utility me=
thod in<br>&gt; &gt;&gt; AbstractSpindleTestCase that gets the tested class=
 implementation.
<br>&gt; &gt;&gt; I'm not crazy about having to declare every tested class =
in the hivemind<br>&gt; &gt;&gt; descriptor but i couldn't find a better wa=
y of doing this.<br>&gt; &gt;&gt;<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Hugo Pa=
lma wrote:
<br>&gt; &gt;&gt; &gt; I told you i wouldn't let you forget about this :o)<=
br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; I took advantage of a few dead =
hours in my day job to give this some<br>&gt; &gt;&gt; &gt; thought. After =
some experimenting i came up with some ideas and some
<br>&gt; &gt;&gt; &gt; code also.<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &g=
t; There should be a separate module(spindle-tests) with all the<br>&gt; &g=
t;&gt; &gt; framework classes and the tests themselves.<br>&gt; &gt;&gt; &g=
t;
<br>&gt; &gt;&gt; &gt; The framework consists of one interface, one class a=
nd one hivemind<br>&gt; &gt;&gt; &gt; descriptor. The interface is IFixture=
, it provides the signature for<br>&gt; &gt;&gt; &gt; all operations that c=
an be executed in a fixture. A fresh instance of
<br>&gt; &gt;&gt; &gt; the fixture will be provided to each test class at e=
very test run.<br>&gt; &gt;&gt; &gt; I've come up with the following code f=
or now, still some operations<br>&gt; &gt;&gt; &gt; missing but good for ge=
tting the main picture:
<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; /**<br>&gt; &gt;&gt; &gt;&nbsp=
;&nbsp;* A test fixture. Should have an implementation for each IDE.<br>&gt=
; &gt;&gt; &gt;&nbsp;&nbsp;*/<br>&gt; &gt;&gt; &gt; public interface IFixtu=
re&lt;W, F&gt;<br>
&gt; &gt;&gt; &gt; {<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; /**<br>&=
gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* Adds a web root.<br>=
&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<br>&gt; &gt;&gt; &g=
t;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* @param filePath&nbsp;&nbsp;&nbsp;&n=
bsp; the absolute path to the web root<br>&gt; &gt;&gt; directory.
<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* @param relative=
Path the relative path of the web root. Some<br>&gt; &gt;&gt; &gt; IDEs let=
 the user specify a different relative path for each web root,<br>&gt; &gt;=
&gt; &gt; changing the default &quot;/&quot; path.
<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* @return the add=
ed web root.<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/<br=
>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; W addWebRoot(String filePath, S=
tring relativePath);<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp=
;&nbsp;&nbsp; /**<br>
&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* Adds a web root wit=
h the default &quot;/&quot; relative path.<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;*<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;* @param filePath the absolute path to the web root directory.<br>=
&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* @return the added w=
eb root.
<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/<br>&gt; &gt;&g=
t; &gt;&nbsp;&nbsp;&nbsp;&nbsp; W addWebRoot(String filePath);<br>&gt; &gt;=
&gt; &gt;<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; /**<br>&gt; &gt;&gt=
; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* Adds an empty file to a web roo=
t.<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* @param webRoot =
the web root to add the file to.<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;* @param path&nbsp;&nbsp;&nbsp;&nbsp;the absolute path of th=
e file to be added.<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;* @return the added file.<br>
&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/<br>&gt; &gt;&gt; &=
gt;&nbsp;&nbsp;&nbsp;&nbsp; F addFileToWebRoot(W webRoot, String path);<br>=
&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; /**<br>&gt=
; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* Adds a source root.<br=
>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* @param filePath=
 the absolute path to the source root directory.<br>&gt; &gt;&gt; &gt;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* @return the added source root.<br>&gt; &gt=
;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/<br>&gt; &gt;&gt; &gt;&nbsp=
;&nbsp;&nbsp;&nbsp; F addSourceRoot(String filePath);
<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; /**<br=
>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* Adds an empty clas=
s to a source root.<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;*<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* @param root&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the source root to add the c=
lass to.
<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* @param packageN=
ame the class package.<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;* @param className&nbsp;&nbsp; the class name.<br>&gt; &gt;&gt; &gt;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp=
;&nbsp; void addClassToSourceRoot(F root, String packageName, String
<br>&gt; &gt;&gt; &gt; className);<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &=
gt;&nbsp;&nbsp;&nbsp;&nbsp; /**<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;* Adds a .jar file to the classpath.<br>&gt; &gt;&gt; &gt;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;* @param jarFile the .jar file to add to the classpath.
<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/<br>&gt; &gt;&g=
t; &gt;&nbsp;&nbsp;&nbsp;&nbsp; void addJarToClasspath(F jarFile);<br>&gt; =
&gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; /**<br>&gt; &gt=
;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* Adds a file to a source roo=
t.<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* @param root&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the source root to add the file=
 to.<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* @param pack=
ageName the package to add the file to.<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;* @param fileName&nbsp;&nbsp;&nbsp;&nbsp;the absolute=
 path to the file to be added.
<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/<br>&gt; &gt;&g=
t; &gt;&nbsp;&nbsp;&nbsp;&nbsp; void addFileToSourceRoot(F root, String pac=
kageName, String<br>&gt; &gt;&gt; &gt; fileName);<br>&gt; &gt;&gt; &gt;<br>=
&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; /**<br>&gt; &gt;&gt; &gt;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* Tears down the fixture.
<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/<br>&gt; &gt;&g=
t; &gt;&nbsp;&nbsp;&nbsp;&nbsp; void tearDown();<br>&gt; &gt;&gt; &gt; }<br=
>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; The base cl=
ass for all tests is also provided. I called it
<br>&gt; &gt;&gt; &gt; AbstractSpindleTestCase. This class provides a getFi=
xture() method to<br>&gt; &gt;&gt; &gt; every subclass and is responsible f=
or getting the fresh fixture<br>&gt; &gt;&gt; &gt; instance from Hivemind a=
t every test run. Here's the code i came up
<br>&gt; &gt;&gt; with:<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; /**<br>=
&gt; &gt;&gt; &gt;&nbsp;&nbsp;* Base class for all test classes.<br>&gt; &g=
t;&gt; &gt;&nbsp;&nbsp;*<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;* @author Hugo Pa=
lma<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;*/
<br>&gt; &gt;&gt; &gt; public abstract class AbstractSpindleTestCase extend=
s TestCase<br>&gt; &gt;&gt; &gt; {<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&=
nbsp; private IFixture _fixture;<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nb=
sp; private static Registry _registry;
<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&=
gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _registry=
 =3D RegistryBuilder.constructDefaultRegistry();<br>&gt; &gt;&gt; &gt;&nbsp=
;&nbsp;&nbsp;&nbsp; }<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;&nbsp;&nbs=
p;&nbsp;&nbsp; /**<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;* {@inheritDoc}
<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/<br>&gt; &gt;&g=
t; &gt;&nbsp;&nbsp;&nbsp;&nbsp; protected void setUp() throws Exception<br>=
&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&gt; &gt;&gt; &gt;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super.setUp();<br>&gt; &gt;&gt; &gt=
;<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // =
Allows getting a brand new IFixture instance every time.
<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _reg=
istry.cleanupThread();<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp; _registry.setupThread();<br>&gt; &gt;&gt; &gt;<br>&gt; &g=
t;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _fixture =3D (I=
Fixture) _registry.getService(IFixture.class
 );<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt; &gt;&gt; &gt;<b=
r>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; /**<br>&gt; &gt;&gt; &gt;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* {@inheritDoc}<br>&gt; &gt;&gt; &gt;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbs=
p; protected void tearDown() throws Exception
<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&gt; &gt;&gt; &gt;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super.tearDown();<br>&gt; &gt;&=
gt; &gt;<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; // Cleanup the fixture.<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp; _fixture.tearDown();<br>&gt; &gt;&gt; &gt;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _fixture =3D null;
<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt; &gt;&gt; &gt;<br>&=
gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; protected IFixture getFixture()<b=
r>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&gt; &gt;&gt; &gt;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return _fixture;<br>&gt; &gt;&gt;=
 &gt;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt; &gt;&gt; &gt; }
<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; The only thing missing is the =
hivemodule.xml in the spindle-tests<br>&gt; &gt;&gt; module:<br>&gt; &gt;&g=
t; &gt;<br>&gt; &gt;&gt; &gt; &lt;module id=3D&quot; net.sf.spindle.tests
&quot; version=3D&quot;1.0.0&quot;&gt;<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nb=
sp;&nbsp; &lt;service-point id=3D&quot;fixture&quot;<br>&gt; &gt;&gt; &gt; =
interface=3D&quot;net.sf.spindle.tests.IFixture&quot;/&gt;<br>&gt; &gt;&gt;=
 &gt; &lt;/module&gt;<br>
&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; So, given this, all the IDE has to=
 do is:<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; - Create an implementat=
ion of the IFixture interface.<br>&gt; &gt;&gt; &gt; - Provide a hivemodule=
.xml
 file in it's spindle-core implementation<br>&gt; &gt;&gt; &gt; module with=
 something like:<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp; &l=
t;module id=3D&quot;org.intellij.tapestry&quot; version=3D&quot; 1.0.0&quot=
;&gt;<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dependency module-i=
d=3D&quot;
net.sf.spindle.tests&quot; version=3D&quot;1.0.0&quot;/&gt;<br>&gt; &gt;&gt=
; &gt;<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;implementation ser=
vice-id=3D&quot;net.sf.spindle.tests.fixture&quot;&gt;<br>&gt; &gt;&gt; &gt=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;invoke-factory model=
=3D&quot;threaded&quot;&gt;
<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; &lt;construct class=3D&quot;org.intellij.tapestry.test.=
Fixture&quot;/&gt;<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp; &lt;/invoke-factory&gt;<br>&gt; &gt;&gt; &gt;&nbsp;&nbsp;&nbs=
p;&nbsp; &lt;/implementation&gt;<br>&gt; &gt;&gt; &gt; &lt;/module&gt;
<br>&gt; &gt;&gt; &gt; - Execute the tests. I managed to run the tests from=
 IDEA with no<br>&gt; &gt;&gt; &gt; problem. I'm going to see how/if i can =
run tests from a jar file with<br>&gt; &gt;&gt; &gt; Maven2.<br>&gt; &gt;&g=
t; &gt;
<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Thoughts ?<br>&gt; &gt;&gt;<br=
>&gt; &gt;&gt;<br>&gt; &gt;&gt; -------------------------------------------=
------------<br>&gt; &gt;&gt; Using Tomcat but need to do more? Need to sup=
port web services,
<br>&gt; &gt;&gt; security?<br>&gt; &gt;&gt; Get stuff done quickly with pr=
e-integrated technology to make your<br>&gt; &gt;&gt; job easier<br>&gt; &g=
t;&gt; Download IBM WebSphere Application Server v.1.0.1 based on Apache
<br>&gt; &gt;&gt; Geronimo<br>&gt; &gt;&gt; <a href=3D"http://sel.as-us.fal=
kag.net/sel?cmd=3Dlnk&amp;kid=3D120709&amp;bid=3D263057&amp;dat=3D121642">h=
ttp://sel.as-us.falkag.net/sel?cmd=3Dlnk&amp;kid=3D120709&amp;bid=3D263057&=
amp;dat=3D121642
</a><br>&gt; &gt;&gt; _______________________________________________<br>&g=
t; &gt;&gt; Spindle-developer mailing list<br>&gt; &gt;&gt; <a href=3D"mail=
to:[email protected]">[email protected]=
orge.net
</a><br>&gt; &gt;&gt; <a href=3D"https://lists.sourceforge.net/lists/listin=
fo/spindle-developer">https://lists.sourceforge.net/lists/listinfo/spindle-=
developer</a><br>&gt; &gt;&gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt;<br>&gt;<br=
>
&gt; -------------------------------------------------------<br>&gt; Using =
Tomcat but need to do more? Need to support web services, security?<br>&gt;=
 Get stuff done quickly with pre-integrated technology to make your job eas=
ier
<br>&gt; Download IBM WebSphere Application Server v.1.0.1 based on Apache =
Geronimo<br>&gt; <a href=3D"http://sel.as-us.falkag.net/sel?cmd=3Dlnk&amp;k=
id=3D120709&amp;bid=3D263057&amp;dat=3D121642">http://sel.as-us.falkag.net/=
sel?cmd=3Dlnk&amp;kid=3D120709&amp;bid=3D263057&amp;dat=3D121642
</a><br>&gt; _______________________________________________<br>&gt; Spindl=
e-developer mailing list<br>&gt; <a href=3D"mailto:Spindle-developer@lists.=
sourceforge.net">[email protected]</a><br>&gt; <a hre=
f=3D"https://lists.sourceforge.net/lists/listinfo/spindle-developer">
https://lists.sourceforge.net/lists/listinfo/spindle-developer</a><br>&gt;<=
br><br><br>--<br>The Spindle guy. <a href=3D"http://spindle.sf.net">http://=
spindle.sf.net</a><br>Blog:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=3D"http=
://jroller.com/page/glongman">
http://jroller.com/page/glongman</a><br>Other interests:&nbsp;&nbsp;<a href=
=3D"http://www.squidoo.com/spaceelevator/">http://www.squidoo.com/spaceelev=
ator/</a><br><br><br>------------------------------------------------------=
-<br>Using Tomcat but need to do more? Need to support web services, securi=
ty?
<br>Get stuff done quickly with pre-integrated technology to make your job =
easier<br>Download IBM WebSphere Application Server v.1.0.1 based on Apache=
 Geronimo<br><a href=3D"http://sel.as-us.falkag.net/sel?cmdlnk&amp;kid=1207=
09&amp;bid&amp;3057&amp;dat=121642">
http://sel.as-us.falkag.net/sel?cmdlnk&amp;kid=120709&amp;bid&amp;3057&amp;=
dat=121642</a><br>_______________________________________________<br>Spindl=
e-developer mailing list<br><a href=3D"mailto:[email protected]=
eforge.net">
[email protected]</a><br><a href=3D"https://lists.sou=
rceforge.net/lists/listinfo/spindle-developer">https://lists.sourceforge.ne=
t/lists/listinfo/spindle-developer</a><br></blockquote></div><br>

------=_Part_66023_1451736.1147799920429--


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642