db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Myrna van Lunteren (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2006) Add JUnit and JUnitReport task as a target in Ant script
Date Wed, 08 Nov 2006 02:42:52 GMT
    [ http://issues.apache.org/jira/browse/DERBY-2006?page=comments#action_12448010 ] 
            
Myrna van Lunteren commented on DERBY-2006:
-------------------------------------------

I played with this for (quite) a while, but with the current version I use to test j2ME on
Windows (wctme5.7 jcl foundation class), which has a problem with security manager (see: http://wiki.apache.org/db-derby/JunitVmIssues#head-0916dd3630b0667e49460439fbd041c720d93eaf),
I have to jump through quite a few hoops to get things working. In fact, I didn't actually
get things working.
I've gotten as far as hard-coding in a number of jvmargs in build.xml:
  <target name="junit-oneclass" depends="junit-init">
    <junit printsummary="on"
           fork="yes" forkmode="once"
           jvm="${derby.junit.jvm}"
           showoutput="yes"
           dir="junit_${derby.junit.DSTAMP}_${derby.junit.TSTAMP}/testout">
        <jvmarg value="-Dij.dataSource=org.apache.derby.jdbc.EmbeddedSimpleDataSource"/>

        <jvmarg value="-jcl:foun10"/> 
        <jvmarg value="-Xbootclasspath/a:c:/wctme5.7/ive/lib/jdbc.jar"/> 
        <jvmarg value="-DderbyTesting.serverhost=localhost"/>
        <jvmarg value="-DderbyTesting.clienthost=localhost"/>
        <jvmarg value="-DderbyTesting.codeclasses=file:/C:/derby/trunk/classes/"/>
        <jvmarg value="-Djava.security.policy=file:/C:/derby/trunk/classes/org/apache/derbyTesting/functionTests/util/derby_tests.policy"/>
        <jvmarg value="-Dderby.system.home=c:/derby/trunk/junit_${derby.junit.DSTAMP}_${derby.junit.TSTAMP}"/>
      <formatter type="xml"/>
      <test name="${derby.junit.testname}" todir="junit_${derby.junit.DSTAMP}_${derby.junit.TSTAMP}"/>
      <classpath>
        <pathelement path="${out.dir}"/>
        <pathelement path="${junit}"/>
      </classpath>
    </junit>
  </target>

But this results in:     
[junit] Exception in thread "main" java.security.AccessControlException: Access denied (java.lang.RuntimePermission
setIO )
    [junit] 	at java.security.AccessController.checkPermission(AccessController.java:74)
    [junit] 	at java.lang.SecurityManager.checkPermission(SecurityManager.java:612)
    [junit] 	at java.lang.System.setOut(System.java:76)
    [junit] 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:309)
    [junit] 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
    [junit] 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)
    [junit] Test org.apache.derbyTesting.functionTests.tests.tools._Suite FAILED
  [antcall] Exiting C:\derbyt\svn2\trunk\build.xml.

and the resulting _Suite.xml files are empty.

I suspect my specification of either the policy file or derby.system.home is off...
Anyways, this issue is closed, I think for now I'll just conclude that the ant target doesn't
work well with wctme5.7 - foundation.


> Add JUnit and JUnitReport task as a target in Ant script
> --------------------------------------------------------
>
>                 Key: DERBY-2006
>                 URL: http://issues.apache.org/jira/browse/DERBY-2006
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>    Affects Versions: 10.3.0.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Andrew McIntyre
>             Fix For: 10.3.0.0
>
>         Attachments: derby_2006_v1.diff, derby_2006_v2.diff, derby_2006_v3.diff, derby_2006_v4.diff,
derby_2006_v5.diff, derby_2006_v6.diff, example_output.zip
>
>
> Ant has an optional tasks called JUnit and JUnitReport that runs JUnit tests and produces
JUnit report respectively.  It will be nice to have these mechanism incorporated into the
Ant script so one can easily kick off a JUnit test and view the result. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message