On 3/5/07, tibi <[EMAIL PROTECTED]> wrote:
hi all,

i'm testing and trying your appfuse with most of the time a smile on my
face :-D

here is what i found.....(or not found ;) )

1) i miss a lot off appfuse (test) 2 docs (but i know its not there
officially so i will wait)

If you'd like, you can add issues in JIRA for documentation you'd like to see.

2a) cobertura is cool but the latest maven plugin (2.1) gives me all
100% covarege so i needed to add:
               <version>2.0</version>

I tried this in the tutorial-struts2 project from "appfuse-demos" on
Google Code and I still get an error from the Hibernate3 Plugin.  Can
you please enter an issue into JIRA for this?  We should really track
it.

More on this issue at:

http://www.nabble.com/Coerbertura-and-Hibernate3-Plugin-not-getting-along-tf3542203.html

I'm tempted to remove Corbertura since it doesn't work - and we don't
want a failing tool out-of-the-box.

2b)convention over configuration i would add (especcially because the
docs online have a bug (exludes tag is missing):
                 <plugin>
                   <groupId>org.codehaus.mojo</groupId>
                   <artifactId>cobertura-maven-plugin</artifactId>
               <version>2.0</version>
                   <configuration>
                     <instrumentation>
                       <excludes>
                           <exclude>mypackage/**/*Test.class</exclude>
                       </excludes>
                     </instrumentation>
                   </configuration>
                 </plugin>
(but i'm not sure if the excluding is needed. sometimes tests come up in
my reports)

3) i like jmock to easy and fast testing. but i found it difficult to
use a test case which extends 'BaseActionTestCase' and use Jmock (which
likes to extend 'BaseManagerMockTestCase').
to pass this little problem i did this:

=============================================================
package nl.tibi.janneke;

import org.appfuse.service.impl.BaseManagerMockTestCase;

/**
* just for extending baseamangerMocktestCase which is abstract.
*/
public class MyBaseManagerMockTestCaseDummy extends
BaseManagerMockTestCase {

}
===============================================================
package nl.tibi.janneke.action;

import nl.tibi.janneke.MyBaseManagerMockTestCaseDummy;
import nl.tibi.janneke.model.Person;

import org.appfuse.service.GenericManager;
import org.appfuse.service.impl.BaseManagerMockTestCase;
import org.appfuse.webapp.action.BaseActionTestCase;
import org.jmock.Mock;

public class PersonActionTest extends BaseActionTestCase {

   private PersonAction personAction;

   public void setPersonAction(PersonAction personAction) {
       this.personAction = personAction;
   }

   public void testSave() throws Exception {
       BaseManagerMockTestCase testManager = new
MyBaseManagerMockTestCaseDummy();
       Mock mockManager = testManager.mock(GenericManager.class);
       personAction.setPersonManager((GenericManager<Person, Long>)
mockManager.proxy());

       Person person = new Person();
       person.setFirstName("testFirstName");
       person.setLastName("testLastName");


mockManager.expects(testManager.once()).method("save").with(testManager.eq(person));

       personAction.setPerson(person);

       String result = personAction.save();
       assertEquals(result, PersonAction.FORM);
   }
}
==========================================================

mayby add someclass in appfuse to overcome this??

If you want to use jMock, it should be easy enough to extend
MockObjectTestCase - that's why we don't have a wrapper class.



4) to be able to run jetty on exploded code i needed to remove
struts.xml as well (besides the lib):
rm src/main/webapp/WEB-INF/classes/struts.xml

Yep, that's expected.  Maybe we should document it better?  Let us
know where you think we should add this tip - in the FAQ or in the
Struts 2 Tutorial?

Matt


i think thats it for now ;)


ciao,

tibi

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
http://raibledesigns.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to