The critial line here are:
Assert.assertArrayEquals(new String[0], batch.parseLine("def SYSTEMROOT = ${systemEnv['SystemRoot']}")); Assert.assertTrue(StringUtils.equalsIgnoreCase(variables.get("SYSTEMROOT"), "c:\\windows"));
Although the test works when executed in Eclipse, it fails when executed with Maven.
The reason is that Maven expect environment variables to be in upper case:
Note: Environment variables like FOO are available as properties of the form env.FOO. Further note that environment variable names are normalized to all upper-case on Windows.
Source: http://maven.apache.org/guides/introduction/introduction-to-profiles.html