Re: Cactus/Junit Question

2008-01-04 Thread Petar Tahchiev
Hi Corry,

and sorry for the late response. As Cactus being an extension of JUnit I
think that the
answer to both the questions is 'yes'.

Kind regards Petar.

2007/12/28, Cory Lum <[EMAIL PROTECTED]>:
>
> For JUnit, instance variables are not shared among test methods. In other
> words, if I have an instance variable int x and set x=10 in testMethod1,
> testMethod2 doesn't know x=10. Does this apply for cactus?
>
> For JUnit, it's not guarantee that the test cases are executed in the
> order of the class. For example:
> class someTest() extends TestCase{
> setUp(){ ... }
> testMethod1() {...}
> testMethod2() {...}
> testMethod3() {...}
> tearDown(){...}
> }
>
> is not guarantee to execute in the following order:
> setUp(){ ... }, testMethod1() {...}, tearDown(){...}
> setUp(){ ... }, testMethod2() {...}, tearDown(){...}
> setUp(){ ... }, testMethod3() {...}, tearDown(){...}
>
> Does this apply to cactus?
>
>
>
>   
> 
> Looking for last minute shopping deals?
> Find them fast with Yahoo! Search.
> http://tools.search.yahoo.com/newsearch/category.php?category=shopping




-- 
Regards, Petar!
Karlovo, Bulgaria.

EOOXML Objections
http://www.grokdoc.net/index.php/EOOXML_objections

Public PGP Key at:
https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611
Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611


Re: Problem to run a Cactus test using Jetty integration

2008-01-04 Thread Petar Tahchiev
Hi Rene,

can you please tell us what is the version of Jetty you are using?
And can you try downgrading to, lets say Jetty 5?


2008/1/4, Rene Döring <[EMAIL PROTECTED]>:
>
> Hello
>
> I'm using Cactus for the first time, so I have some difficulties to get
> it working. I want to test some servlets, therefore I'm using the Jetty
> integration.
>
> I try to run Cactus with Ant and my task looks something like this:
> 
>  printsummary="yes"
>showoutput="true">
>
> http://localhost:8989/test
> "/>
>
> 
> 
>  location="/home/.../lib/jetty-util-6.1.6rc0.jar"/>
> 
> [...]
> 
> 
>
> 
> 
> 
> 
> 
>
> 
>   
>
>
> The only class which should be tested is the following:
>
> public class TestJettyAll extends TestCase
> {
> public static Test suite()
> {
> TestSuite suite = new TestSuite();
> suite.addTestSuite(TestSLabel.class);
>
> return new JettyTestSetup(suite);
> }
> }
>
>
> And the TestSLabel class looks as follows (only to test whether it works
> or not):
>
> public class TestSLabel extends TestCase{
> public void testSButton(){
> int i=5;
> assertEquals(i,5);
> }
> }
>
>
> And now my problem. When I run the ant target, I receive the following
> output:
>
> Testcase: unknown took 0 sec
> Caused an ERROR
> org.mortbay.jetty.Server.addListener(java.lang.String)
> java.lang.NoSuchMethodException:
> org.mortbay.jetty.Server.addListener(java.lang.String)
> at java.lang.Class.getMethod(Class.java:1605)
> at
> org.apache.cactus.extension.jetty.JettyTestSetup.createServer(
> JettyTestSetup.java:361)
> at
> org.apache.cactus.extension.jetty.JettyTestSetup.setUp(JettyTestSetup.java
> :209)
> at
> org.apache.cactus.extension.jetty.JettyTestSetup$1.protect(
> JettyTestSetup.java:165)
> at
> org.apache.cactus.extension.jetty.JettyTestSetup.run_aroundBody0(
> JettyTestSetup.java:174)
> at
> org.apache.cactus.extension.jetty.JettyTestSetup.run_aroundBody1$advice(
> JettyTestSetup.java:224)
> at org.apache.cactus.extension.jetty.JettyTestSetup.run(
> JettyTestSetup.java)
>
> What is the problem? The org.mortbay.jetty.Server class is in the
> classpath. I have no idea how I can solve the problem :-(
> Is there anyone how can help me?
>
> Thanks
>
> Rene
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Regards, Petar!
Karlovo, Bulgaria.

EOOXML Objections
http://www.grokdoc.net/index.php/EOOXML_objections

Public PGP Key at:
https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611
Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611


Problem to run a Cactus test using Jetty integration

2008-01-04 Thread Rene Döring

Hello

I'm using Cactus for the first time, so I have some difficulties to get 
it working. I want to test some servlets, therefore I'm using the Jetty 
integration.


I try to run Cactus with Ant and my task looks something like this:
   
   printsummary="yes"

  showoutput="true">

   http://localhost:8989/test"/>

   
   
   location="/home/.../lib/jetty-util-6.1.6rc0.jar"/>

   
   [...]
   
   

   
   
   
   
   

   
 


The only class which should be tested is the following:

public class TestJettyAll extends TestCase
{
   public static Test suite()
   {
   TestSuite suite = new TestSuite();
   suite.addTestSuite(TestSLabel.class);
 
   return new JettyTestSetup(suite);

   }
}


And the TestSLabel class looks as follows (only to test whether it works 
or not):


public class TestSLabel extends TestCase{
   public void testSButton(){
   int i=5;
   assertEquals(i,5);
   }
}


And now my problem. When I run the ant target, I receive the following 
output:


Testcase: unknown took 0 sec
Caused an ERROR
org.mortbay.jetty.Server.addListener(java.lang.String)
java.lang.NoSuchMethodException: 
org.mortbay.jetty.Server.addListener(java.lang.String)

at java.lang.Class.getMethod(Class.java:1605)
at 
org.apache.cactus.extension.jetty.JettyTestSetup.createServer(JettyTestSetup.java:361)
at 
org.apache.cactus.extension.jetty.JettyTestSetup.setUp(JettyTestSetup.java:209)
at 
org.apache.cactus.extension.jetty.JettyTestSetup$1.protect(JettyTestSetup.java:165)
at 
org.apache.cactus.extension.jetty.JettyTestSetup.run_aroundBody0(JettyTestSetup.java:174)
at 
org.apache.cactus.extension.jetty.JettyTestSetup.run_aroundBody1$advice(JettyTestSetup.java:224)

at org.apache.cactus.extension.jetty.JettyTestSetup.run(JettyTestSetup.java)

What is the problem? The org.mortbay.jetty.Server class is in the 
classpath. I have no idea how I can solve the problem :-(

Is there anyone how can help me?

Thanks

Rene


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