package org.jetbrains.idea.maven.dom;

import java.io.IOException;

/**
 * @author Sergey Evdokimov
 */
public class MavenDependencyCompletionTest extends MavenDomWithIndicesTestCase {

  public void testCompletion() throws IOException {
    createProjectPom("<groupId>test</groupId>" +
                     "<artifactId>project</artifactId>" +
                     "<version>1</version>" +

                     "<dependencies>" +
                     "  <dependency>" +
                     "    jun<caret>" +
                     "  </dependency>" +
                     "</dependencies>");

    assertCompletionVariantsInclude(myProjectPom, "junit:junit");
  }

}

@@ -32,16 +32,130 @@
 n.dom;%0A%0A
+import com.intellij.codeInsight.completion.CompletionType;%0Aimport com.intellij.codeInsight.lookup.LookupElement;%0A%0A
 import j
@@ -174,16 +174,16 @@
 eption;%0A
-
 %0A/**%0A * 
@@ -605,19 +605,16 @@
    %22    
-jun
 %3Ccaret%3E%22
@@ -699,16 +699,16 @@
 es%3E%22);%0A%0A
-
     asse
@@ -770,10 +770,1235 @@
 );%0A  %7D%0A%0A
+  public void testInsertDependency() throws IOException %7B%0A    createProjectPom(%22%3CgroupId%3Etest%3C/groupId%3E%5Cn%22 +%0A                     %22%3CartifactId%3Eproject%3C/artifactId%3E%5Cn%22 +%0A                     %22%3Cversion%3E1%3C/version%3E%5Cn%22 +%0A%0A                     %22%3Cdependencies%3E%5Cn%22 +%0A                     %22  %3Cdependency%3Eju%3Ccaret%3E%3C/dependency%3E%5Cn%22 +%0A                     %22%3C/dependencies%3E%5Cn%22);%0A%0A    configTest(myProjectPom);%0A    myFixture.complete(CompletionType.SMART);%0A    assertContain(myFixture.getLookupElementStrings(), %224.0%22, %223.8.2%22);%0A%0A    myFixture.checkResult(createPomXml(%22%3CgroupId%3Etest%3C/groupId%3E%5Cn%22 +%0A                                       %22%3CartifactId%3Eproject%3C/artifactId%3E%5Cn%22 +%0A                                       %22%3Cversion%3E1%3C/version%3E%5Cn%22 +%0A%0A                                       %22%3Cdependencies%3E%5Cn%22 +%0A                                       %22    %3Cdependency%3E%5Cn%22 +%0A                                       %22        %3CgroupId%3Ejunit%3C/groupId%3E%5Cn%22 +%0A                                       %22        %3CartifactId%3Ejunit%3C/artifactId%3E%5Cn%22 +%0A                                       %22        %3Cversion%3E%3Ccaret%3E%3C/version%3E%5Cn%22 +%0A                                       %22    %3C/dependency%3E%5Cn%22 +%0A                                       %22%3C/dependencies%3E%5Cn%22));%0A  %7D%0A%0A
 %7D%0A

Add test for inserting maven dependency by smart completion