use of org.jboss.galleon.cli.config.mvn.MavenConfig in project galleon by wildfly.
the class MavenConfigTestCase method testLocalRepository.
@Test
public void testLocalRepository() throws Exception {
MavenConfig config = cli.getSession().getPmConfiguration().getMavenConfig();
Path defaultOriginalPath = config.getLocalRepository();
Path foo = cli.newDir("foo", true);
Assert.assertFalse(config.getLocalRepository().endsWith("foo"));
cli.execute("maven set-local-repository " + foo.toFile().getAbsolutePath());
Assert.assertEquals(foo, config.getLocalRepository());
Assert.assertEquals(foo, Configuration.parse().getMavenConfig().getLocalRepository());
cli.execute("maven get-info");
Assert.assertTrue(cli.getOutput().contains(foo.toFile().getAbsolutePath()));
cli.execute("maven reset-local-repository");
Assert.assertEquals(defaultOriginalPath, config.getLocalRepository());
Assert.assertEquals(defaultOriginalPath, Configuration.parse().getMavenConfig().getLocalRepository());
}
use of org.jboss.galleon.cli.config.mvn.MavenConfig in project galleon by wildfly.
the class MavenConfigTestCase method testOffline.
@Test
public void testOffline() throws Exception {
MavenConfig config = cli.getSession().getPmConfiguration().getMavenConfig();
Assert.assertTrue(config.isOffline());
try {
cli.execute("maven enable-offline foo");
throw new Exception("Should have failed");
} catch (CommandException ex) {
// XXX OK
}
cli.execute("maven enable-offline false");
Assert.assertFalse(config.isOffline());
Assert.assertFalse(Configuration.parse().getMavenConfig().isOffline());
cli.execute("maven reset-offline");
Assert.assertFalse(config.isOffline());
Assert.assertFalse(Configuration.parse().getMavenConfig().isOffline());
}
Aggregations