You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tony Truong <to...@atlassian.com> on 2006/08/21 09:52:47 UTC

[m2] surefire and integration tests - discrepancy

Hi all,

I am currently running functional tests with surefire + cargo and IntelliJ
IDEA. I have set both to the same container (tomcat5).

When the tests are executed, I seem to get failures in surefire + cargo that
does not appear on IDEA. Could this be a test environment issue or a bug in
surefire (or in cargo)?
NOTE: Both are using the same jdk + junit version.

Tony.
-- 
View this message in context: http://www.nabble.com/-m2--surefire-and-integration-tests---discrepancy-tf2138839.html#a5902585
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: [m2] surefire and integration tests - discrepancy

Posted by Vincent Massol <vi...@massol.net>.
>From what you're showing the error is coming from your test as the
stacktrace shows an AssertionFailedError which comes from your assert
statement.

You're showing only a small portion of your test case. Do you have a setup()
method or some statics like a suite() method?

Are you sure you're setting the basedir environment variable to the same
location in IDEA as it's set up in Maven2?

-Vincent

> -----Original Message-----
> From: Tony Truong [mailto:tony@atlassian.com]
> Sent: lundi 21 août 2006 10:15
> To: users@maven.apache.org
> Subject: RE: [m2] surefire and integration tests - discrepancy
> 
> 
> This is the test case:
> 
>  public void testExportPdfWithPng() throws Exception
>     {
>         String confDir = getTestProperty("basedir");
>         File image;
>         //if statement included for compatability with maven 2 and IDEA
>         if (confDir == null)
>         {
>             image = new File("src/test/etc/starryNight.png");
>         } else
>         {
>             image = new File(confDir + "/src/test/etc/starryNight.png");
>         }
>         rpcCreateTestPage(rpcGetAdminToken());
>         rpcEditPage(rpcGetAdminToken(), TESTSPACE_KEY, TESTPAGE_TITLE,
> TESTPAGE_TITLE, "!" + image.getName() +"!");
>         viewPage(TESTSPACE_KEY, TESTPAGE_TITLE);
>         attachFile(image, "Vincent van Gogh (1889)");
>         viewPage(TESTSPACE_KEY, TESTPAGE_TITLE);
>         clickLinkWithText("Info");
>         clickLinkWithText("PDF");
> 
>         long imageLength = image.length();
>         int contentLength = getDialog().getResponse().getContentLength();
>         assertTrue("PDF should be bigger than included image (" +
> imageLength + " bytes), but was only " + contentLength + " bytes",
>                 contentLength > imageLength);
>     }
> 
> This is the error im getting:
> 
> [ stacktrace ] -----------------------------------------------------------
> 
> junit.framework.AssertionFailedError: PDF should be bigger than included
> image (616766 bytes), but was only 212647 bytes
> 
> 
> This test runs under IDEA with the same container deployed (i.e. Tomcat
> 5.5.17 jdk1.4 patched). This test case passes under IDEA.
> 
> Tony
> 
> 
> vmassol wrote:
> >
> > Hi Tony,
> >
> > It's not supposed to happen. You need to give us more information so
> that
> > we
> > can be of any help. Like the error you're getting, your test case,
> whether
> > there are any environment variables required by your tests, etc.
> >
> > Thanks
> > -Vincent
> >
> >> -----Original Message-----
> >> From: Tony Truong [mailto:tony@atlassian.com]
> >> Sent: lundi 21 août 2006 09:53
> >> To: users@maven.apache.org
> >> Subject: [m2] surefire and integration tests - discrepancy
> >>
> >>
> >> Hi all,
> >>
> >> I am currently running functional tests with surefire + cargo and
> >> IntelliJ
> >> IDEA. I have set both to the same container (tomcat5).
> >>
> >> When the tests are executed, I seem to get failures in surefire + cargo
> >> that
> >> does not appear on IDEA. Could this be a test environment issue or a
> bug
> >> in
> >> surefire (or in cargo)?
> >> NOTE: Both are using the same jdk + junit version.
> >>
> >> Tony.
> >> --
> >> View this message in context: http://www.nabble.com/-m2--surefire-and-
> >> integration-tests---discrepancy-tf2138839.html#a5902585
> >> Sent from the Maven - Users forum at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
> >  p5.vert.ukl.yahoo.com uncompressed Mon Aug 21 07:27:01 GMT 2006
> >
> >
> >
> __________________________________________________________________________
> _
> > Découvrez un nouveau moyen de poser toutes vos questions quelque soit le
> > sujet !
> > Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions
> et
> > vos expériences.
> > http://fr.answers.yahoo.com
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
> 
> --
> View this message in context: http://www.nabble.com/-m2--surefire-and-
> integration-tests---discrepancy-tf2138839.html#a5902875
> Sent from the Maven - Users forum at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


	
 p5.vert.ukl.yahoo.com uncompressed Mon Aug 21 08:27:01 GMT 2006 
	
		
___________________________________________________________________________ 
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! 
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences. 
http://fr.answers.yahoo.com 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: [m2] surefire and integration tests - discrepancy

Posted by Tony Truong <to...@atlassian.com>.
This is the test case:

 public void testExportPdfWithPng() throws Exception
    {
        String confDir = getTestProperty("basedir");
        File image;
        //if statement included for compatability with maven 2 and IDEA
        if (confDir == null)
        {
            image = new File("src/test/etc/starryNight.png");
        } else
        {
            image = new File(confDir + "/src/test/etc/starryNight.png");
        }
        rpcCreateTestPage(rpcGetAdminToken());
        rpcEditPage(rpcGetAdminToken(), TESTSPACE_KEY, TESTPAGE_TITLE,
TESTPAGE_TITLE, "!" + image.getName() +"!");
        viewPage(TESTSPACE_KEY, TESTPAGE_TITLE);
        attachFile(image, "Vincent van Gogh (1889)");
        viewPage(TESTSPACE_KEY, TESTPAGE_TITLE);
        clickLinkWithText("Info");
        clickLinkWithText("PDF");

        long imageLength = image.length();
        int contentLength = getDialog().getResponse().getContentLength();
        assertTrue("PDF should be bigger than included image (" +
imageLength + " bytes), but was only " + contentLength + " bytes",
                contentLength > imageLength);
    }

This is the error im getting:

[ stacktrace ] -----------------------------------------------------------

junit.framework.AssertionFailedError: PDF should be bigger than included
image (616766 bytes), but was only 212647 bytes


This test runs under IDEA with the same container deployed (i.e. Tomcat
5.5.17 jdk1.4 patched). This test case passes under IDEA.

Tony


vmassol wrote:
> 
> Hi Tony,
> 
> It's not supposed to happen. You need to give us more information so that
> we
> can be of any help. Like the error you're getting, your test case, whether
> there are any environment variables required by your tests, etc.
> 
> Thanks
> -Vincent
> 
>> -----Original Message-----
>> From: Tony Truong [mailto:tony@atlassian.com]
>> Sent: lundi 21 août 2006 09:53
>> To: users@maven.apache.org
>> Subject: [m2] surefire and integration tests - discrepancy
>> 
>> 
>> Hi all,
>> 
>> I am currently running functional tests with surefire + cargo and
>> IntelliJ
>> IDEA. I have set both to the same container (tomcat5).
>> 
>> When the tests are executed, I seem to get failures in surefire + cargo
>> that
>> does not appear on IDEA. Could this be a test environment issue or a bug
>> in
>> surefire (or in cargo)?
>> NOTE: Both are using the same jdk + junit version.
>> 
>> Tony.
>> --
>> View this message in context: http://www.nabble.com/-m2--surefire-and-
>> integration-tests---discrepancy-tf2138839.html#a5902585
>> Sent from the Maven - Users forum at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 	
>  p5.vert.ukl.yahoo.com uncompressed Mon Aug 21 07:27:01 GMT 2006
> 	
> 		
> ___________________________________________________________________________
> Découvrez un nouveau moyen de poser toutes vos questions quelque soit le
> sujet !
> Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et
> vos expériences.
> http://fr.answers.yahoo.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-m2--surefire-and-integration-tests---discrepancy-tf2138839.html#a5902875
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: [m2] surefire and integration tests - discrepancy

Posted by Vincent Massol <vi...@massol.net>.
Hi Tony,

It's not supposed to happen. You need to give us more information so that we
can be of any help. Like the error you're getting, your test case, whether
there are any environment variables required by your tests, etc.

Thanks
-Vincent

> -----Original Message-----
> From: Tony Truong [mailto:tony@atlassian.com]
> Sent: lundi 21 août 2006 09:53
> To: users@maven.apache.org
> Subject: [m2] surefire and integration tests - discrepancy
> 
> 
> Hi all,
> 
> I am currently running functional tests with surefire + cargo and IntelliJ
> IDEA. I have set both to the same container (tomcat5).
> 
> When the tests are executed, I seem to get failures in surefire + cargo
> that
> does not appear on IDEA. Could this be a test environment issue or a bug
> in
> surefire (or in cargo)?
> NOTE: Both are using the same jdk + junit version.
> 
> Tony.
> --
> View this message in context: http://www.nabble.com/-m2--surefire-and-
> integration-tests---discrepancy-tf2138839.html#a5902585
> Sent from the Maven - Users forum at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


	
 p5.vert.ukl.yahoo.com uncompressed Mon Aug 21 07:27:01 GMT 2006 
	
		
___________________________________________________________________________ 
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! 
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences. 
http://fr.answers.yahoo.com 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org