use of org.jetbrains.idea.maven.model.MavenId in project intellij-community by JetBrains.
the class MavenModuleBuilderTest method testAddingNewlyCreatedModuleToTheAggregator.
public void testAddingNewlyCreatedModuleToTheAggregator() throws Exception {
if (!hasMavenInstallation())
return;
importProject("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>");
setModuleNameAndRoot("module", getProjectPath() + "/module");
setAggregatorProject(myProjectPom);
createNewModule(new MavenId("org.foo", "module", "1.0"));
assertEquals(createPomXml("<groupId>test</groupId>" + "<artifactId>project</artifactId>\n" + " <packaging>pom</packaging>\n" + " <version>1</version>\n" + " <modules>\n" + " <module>module</module>\n" + " </modules>\n"), StringUtil.convertLineSeparators(VfsUtil.loadText(myProjectPom)));
}
use of org.jetbrains.idea.maven.model.MavenId in project intellij-community by JetBrains.
the class MavenModuleBuilderTest method testAddingParentWithInheritedProperties.
public void testAddingParentWithInheritedProperties() throws Exception {
if (!hasMavenInstallation())
return;
importProject("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>");
setModuleNameAndRoot("module", getProjectPath() + "/module");
setParentProject(myProjectPom);
setInheritedOptions(true, true);
createNewModule(new MavenId("org.foo", "module", "1.0"));
assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n" + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + " xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" + " <parent>\n" + " <artifactId>project</artifactId>\n" + " <groupId>test</groupId>\n" + " <version>1</version>\n" + " </parent>\n" + " <modelVersion>4.0.0</modelVersion>\n" + "\n" + " <artifactId>module</artifactId>\n" + "\n" + "\n" + "</project>", VfsUtil.loadText(myProjectRoot.findFileByRelativePath("module/pom.xml")));
}
use of org.jetbrains.idea.maven.model.MavenId in project intellij-community by JetBrains.
the class MavenModuleBuilderTest method testInheritJdkFromProject.
public void testInheritJdkFromProject() throws Exception {
if (!hasMavenInstallation())
return;
createNewModule(new MavenId("org.foo", "module", "1.0"));
ModuleRootManager manager = ModuleRootManager.getInstance(getModule("module"));
assertTrue(manager.isSdkInherited());
}
use of org.jetbrains.idea.maven.model.MavenId in project intellij-community by JetBrains.
the class MavenModuleBuilderTest method testAddingManagedProjectIfNoArrgerator.
public void testAddingManagedProjectIfNoArrgerator() throws Exception {
if (!hasMavenInstallation())
return;
importProject("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>");
assertEquals(1, myProjectsManager.getProjectsTreeForTests().getManagedFilesPaths().size());
setModuleNameAndRoot("module", getProjectPath() + "/module");
setAggregatorProject(null);
createNewModule(new MavenId("org.foo", "module", "1.0"));
myProjectRoot.findFileByRelativePath("module/pom.xml");
assertEquals(2, myProjectsManager.getProjectsTreeForTests().getManagedFilesPaths().size());
}
use of org.jetbrains.idea.maven.model.MavenId in project intellij-community by JetBrains.
the class MavenModuleBuilderTest method testAddingParent.
public void testAddingParent() throws Exception {
if (!hasMavenInstallation())
return;
importProject("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>");
setModuleNameAndRoot("module", getProjectPath() + "/module");
setParentProject(myProjectPom);
createNewModule(new MavenId("org.foo", "module", "1.0"));
assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n" + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + " xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" + " <parent>\n" + " <artifactId>project</artifactId>\n" + " <groupId>test</groupId>\n" + " <version>1</version>\n" + " </parent>\n" + " <modelVersion>4.0.0</modelVersion>\n" + "\n" + " <groupId>org.foo</groupId>\n" + " <artifactId>module</artifactId>\n" + " <version>1.0</version>\n" + "\n" + "\n" + "</project>", VfsUtil.loadText(myProjectRoot.findFileByRelativePath("module/pom.xml")));
}
Aggregations