Hi Martin,

In that regards, Cactus works in the same way than JUnit does. Whatever
your class to unit test is, do the following:

public void testXXX()
{
   MyClassToTest instance = new MyClassToTest();
   // whatever else needs to be set up

   MyResult result = instance.methodToTest(param1, �, paramN);

   // asserts results
   assertXXX[�]
}

EJB visibility or any other class visibility does not matter at all.
Cactus is about unit testing, not functional testing, thus you are not
hindered whether the class is visible remotely or not... That�s the
beauty of it ;-)

Hope it helps,
-Vincent

-----Original Message-----
From: Bayly, Martin [mailto:[EMAIL PROTECTED] 
Sent: 24 June 2003 19:56
To: [EMAIL PROTECTED]
Subject: Server Side Testing ejb implementation code

Hi 
We're looking into using Cactus to improve integration unit testing.�
We're planning on using Cactus primarily for testing our ejb interfaces,
but ideally we'd like to use it for server side testing of lower level
classes in the ejb implementations e.g. data access classes for example.
This raises the issue of visibility of those classes to the web tier
where the cactus unit tests run. 
Currently, our deployed build is pretty loose and everything can see
pretty much everything else.� However, we're in the process of
tightening this up with the intention being that the web tier will only
be able to see the ejb interfaces and the classes exposed by those
interfaces.� However, it won't 'conceptually' be able to see ejb
implementation details.
To a certain extent this depends on the class loading scheme used by the
container - we're currently using weblogic 6 and in the current weblogic
class loading scheme the web app can see all the classes in the ejb, as
all ejbs are loaded using a single class loader, and the web app is
loaded as a child class loader of the ejb class loader.
However, we don't particularly want to be tied to the current weblogic
scheme. 
I was just wondering if other people have come across this issue and how
have they tackled it.� Does it mean we're going to have to deploy with a
different structure for running server unit tests?� I was kind of hoping
the only difference in our test/production build would be the deployed
test cases and cactus jars.
Cheers, 
Martin 



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

Reply via email to