I am developing on Eclipse on Windows and Code gets deployed on Unix. I am fetching the system property values using System.getProperty(\"key\") ... How do I pass this in Ec
You can use java System.properties, for using them from eclipse you could:
-Dlabel="label_value" in the VM arguments of the test Run Configuration like this:Then run the test:
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class Main {
@Test
public void test(){
System.out.println(System.getProperty("label"));
assertEquals("label_value", System.getProperty("label"));
}
}
Finally it should pass the test and output this in the console:
label_value