[GRADLE-950] java plugin test task passes core system properties to forked vm Created: 01/Jun/10  Updated: 04/Jan/13  Resolved: 04/Jun/10

Status: Resolved
Project: Gradle
Affects Version/s: 0.9
Fix Version/s: None

Type: New Feature
Reporter: Szczepan Faber Assignee: Hans Dockter
Resolution: Fixed Votes: 0


 Description   

Given following configuration of test task:

task mytests (type: Test) {
testClassesDir = file('../automatedbuild/classes')
classpath = files(file('../automatedbuild/classes'))
scanForTestClasses = false
include('*/MyTest')
forkEvery = null
}

Forked vm that executes tests does not contain following system properties:

  • user.name
  • java.class.path
    Possibly other "default" properties are missing as well. Above 2 properties are used by my tests and hence I discovered this.

Other tools: ant, IDEA, eclipse are passing those properties to forked vms. It would be nice if Gradle java plugin did it as well



 Comments   
Comment by Szczepan Faber [ 01/Jun/10 ]

More info: when I tried to set java.class.path in gradle via systemProperties('java.class.path' : 'myclasspath') it is overridden later in the game by: somepath\gradle-core-worker-0.9-preview-1.jar

Comment by Adam Murdoch [ 02/Jun/10 ]

Could you try this using 0.9-preview-2?

Comment by Szczepan Faber [ 02/Jun/10 ]

Yes, I tried and sys properies are passed correctly. Thanks!

Generated at Wed Jun 30 11:43:03 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.