[GRADLE-2245] Cannot pass systemProperties to tests runtime Created: 20/Apr/12  Updated: 04/Jan/13  Resolved: 26/Apr/12

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-rc-1
Fix Version/s: 1.1-rc-1

Type: Bug
Reporter: Davide Cavestro Assignee: Unassigned
Resolution: Fixed Votes: 1

Attachments: Zip Archive test.zip    

 Description   

I usually made system properties available for tests runtime using the following closure

test {
    systemProperties['file.encoding'] = 'ISO-8859-1'
    ...
}

On gradle 1.0-rc-1 the following test case fails

MyTest.java
import org.junit.Test;
import static org.junit.Assert.assertEquals;

public class MyTest {
	@Test
	public void test1() {
		assertEquals ("ISO-8859-1", System.getProperty ("file.encoding"));
	}
}

It seems a regression, as it worked properly at least on milestone 5, 7 and 8a.
I tried even the latest nightly gradle-1.0-rc-2-20120420064434+0200 just to check if GRADLE-2226 fixed itm, but it still fails.

I've attached the test project.



 Comments   
Comment by Stephane Gallès [ 14/Jun/12 ]

Was this issue closed on purpose ? it does not work for Gradle 1.0

Comment by Davide Cavestro [ 14/Jun/12 ]

I guess gradle guys closed it for gradle 1.1-rc-1 (the fix should be available from that release on).

Comment by Stephane Gallès [ 14/Jun/12 ]

Oops ! OK, it makes sense, thank you.

Generated at Wed Jun 30 12:16:39 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.