use of com.intellij.codeInsight.intention.IntentionAction in project intellij-community by JetBrains.
the class MavenModuleCompletionAndResolutionTest method testCreatePomQuickFix.
public void testCreatePomQuickFix() throws Throwable {
createProjectPom("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<packaging>pom</packaging>");
importProject();
createProjectPom("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<packaging>pom</packaging>" + "<modules>" + " <module>subDir/new<caret>Module</module>" + "</modules>");
IntentionAction i = getIntentionAtCaret(CREATE_MODULE_INTENTION);
assertNotNull(i);
myFixture.launchAction(i);
assertCreateModuleFixResult("subDir/newModule/pom.xml", "<?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" + " <modelVersion>4.0.0</modelVersion>\n" + "\n" + " <groupId>test</groupId>\n" + " <artifactId>newModule</artifactId>\n" + " <version>1</version>\n" + "\n" + " \n" + "</project>");
}
use of com.intellij.codeInsight.intention.IntentionAction in project intellij-community by JetBrains.
the class MavenModuleCompletionAndResolutionTest method testCreateModuleWithParentQuickFix.
public void testCreateModuleWithParentQuickFix() throws Throwable {
createProjectPom("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<packaging>pom</packaging>");
importProject();
createProjectPom("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<packaging>pom</packaging>" + "<modules>" + " <module>new<caret>Module</module>" + "</modules>");
IntentionAction i = getIntentionAtCaret(CREATE_MODULE_WITH_PARENT_INTENTION);
assertNotNull(i);
myFixture.launchAction(i);
assertCreateModuleFixResult("newModule/pom.xml", "<?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" + " <modelVersion>4.0.0</modelVersion>\n" + "\n" + " <parent>\n" + " <groupId>test</groupId>\n" + " <artifactId>project</artifactId>\n" + " <version>1</version>\n" + " </parent>\n" + "\n" + " <groupId>test</groupId>\n" + " <artifactId>newModule</artifactId>\n" + " <version>1</version>\n" + "\n" + " \n" + "</project>");
}
use of com.intellij.codeInsight.intention.IntentionAction in project intellij-community by JetBrains.
the class MavenModuleCompletionAndResolutionTest method testCreatePomQuickFixWithProperties.
public void testCreatePomQuickFixWithProperties() throws Throwable {
createProjectPom("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<packaging>pom</packaging>");
importProject();
createProjectPom("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<properties>" + " <dirName>subDir</dirName>" + "</properties>" + "<modules>" + " <module>${dirName}/new<caret>Module</module>" + "</modules>");
IntentionAction i = getIntentionAtCaret(CREATE_MODULE_INTENTION);
assertNotNull(i);
myFixture.launchAction(i);
VirtualFile pom = myProjectRoot.findFileByRelativePath("subDir/newModule/pom.xml");
assertNotNull(pom);
}
use of com.intellij.codeInsight.intention.IntentionAction in project intellij-community by JetBrains.
the class MavenModuleCompletionAndResolutionTest method testCreateModuleWithParentQuickFix2.
public void testCreateModuleWithParentQuickFix2() throws Throwable {
createProjectPom("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<packaging>pom</packaging>");
importProject();
createProjectPom("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<packaging>pom</packaging>" + "<modules>" + " <module>ppp/new<caret>Module</module>" + "</modules>");
IntentionAction i = getIntentionAtCaret(CREATE_MODULE_WITH_PARENT_INTENTION);
assertNotNull(i);
myFixture.launchAction(i);
assertCreateModuleFixResult("ppp/newModule/pom.xml", "<?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" + " <modelVersion>4.0.0</modelVersion>\n" + "\n" + " <parent>\n" + " <groupId>test</groupId>\n" + " <artifactId>project</artifactId>\n" + " <version>1</version>\n" + " <relativePath>../..</relativePath>\n" + " </parent>\n" + "\n" + " <groupId>test</groupId>\n" + " <artifactId>newModule</artifactId>\n" + " <version>1</version>\n" + "\n" + " \n" + "</project>");
}
use of com.intellij.codeInsight.intention.IntentionAction in project intellij-community by JetBrains.
the class MavenModuleCompletionAndResolutionTest method testCreatePomQuickFixTakesGroupAndVersionFromSuperParent.
public void testCreatePomQuickFixTakesGroupAndVersionFromSuperParent() throws Throwable {
createProjectPom("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<packaging>pom</packaging>");
importProject();
createProjectPom("<artifactId>project</artifactId>" + "<packaging>pom</packaging>" + "<parent>" + " <groupId>parentGroup</groupId>" + " <artifactId>parent</artifactId>" + " <version>parentVersion</version>" + "</parent>" + "<modules>" + " <module>new<caret>Module</module>" + "</modules>");
IntentionAction i = getIntentionAtCaret(CREATE_MODULE_INTENTION);
assertNotNull(i);
myFixture.launchAction(i);
assertCreateModuleFixResult("newModule/pom.xml", "<?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" + " <modelVersion>4.0.0</modelVersion>\n" + "\n" + " <groupId>parentGroup</groupId>\n" + " <artifactId>newModule</artifactId>\n" + " <version>parentVersion</version>\n" + "\n" + " \n" + "</project>");
}
Aggregations