// Path: src/org/plugin/dot/DotIcons.java
// public class DotIcons {
//     public static final Icon FILE = IconLoader.getIcon("/org/plugin/dot/icons/jar-gray.png");
// 
//     public static final Icon SAVE = IconLoader.getIcon("/org/plugin/dot/icons/save.png");
// }
// 
// Path: src/org/plugin/dot/psi/DotElementFactory.java
// public class DotElementFactory {
// 
//   public static PsiElement createCRLF(Project project) {
//     final DotFile file = createFile(project, "\n");
//     return file.getFirstChild();
//   }
// 
//   public static DotFile createFile(Project project, String text) {
//     String name = "dummy.dot";
//     return (DotFile) PsiFileFactory.getInstance(project).
//         createFileFromText(name, DotFileType.INSTANCE, text);
//   }
// 
//   public static DotId createDotId(Project project, String newName) {
//     final DotFile file = createFile(project, "digraph "  + newName + "{}");
//     return ((DotDotgraphStmt)file.getFirstChild()).getId();
//   }
// }
// 
// Path: gen/org/plugin/dot/psi/DotId.java
// public interface DotId extends DotNamedElement {
// 
//   @Nullable
//   PsiElement getHtmlId();
// 
//   @Nullable
//   PsiElement getNumeralId();
// 
//   @Nullable
//   PsiElement getQuotedAny();
// 
//   @Nullable
//   PsiElement getSimpleId();
// 
//   String getName();
// 
//   PsiElement setName(String newName);
// 
//   PsiElement getNameIdentifier();
// 
//   ItemPresentation getPresentation();
// 
// }


import com.intellij.openapi.application.PluginPathManager;
import com.intellij.psi.PsiElement;
import com.intellij.testFramework.fixtures.BasePlatformTestCase;
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
import org.jetbrains.annotations.NotNull;
import org.junit.Assert;
import org.junit.Test;
import org.plugin.dot.DotIcons;
import org.plugin.dot.psi.DotElementFactory;
import org.plugin.dot.psi.DotId;
package org.plugin.dot.psi.impl;


public class DotPsiImplUtilTest extends BasePlatformTestCase {
    @NotNull
    @Override
    protected String getTestDataPath() {
        return "testData";
    }

    @Test
    public void testGetName() {
        DotId id = DotElementFactory.createDotId(getProject(), "test_name");
        Assert.assertEquals("test_name", DotPsiImplUtil.getName(id));
    }

    @Test
    public void testSetName() {
        DotId id = DotElementFactory.createDotId(getProject(), "test_name");
        PsiElement e  = DotPsiImplUtil.setName(id, "new_name");
        Assert.assertEquals("new_name", ((DotId) e).getName());
    }

    @Test
    public void testSetNameAnotherKind() {
        DotId id = DotElementFactory.createDotId(getProject(), "<another_kind>");
        PsiElement e  = DotPsiImplUtil.setName(id, "new_name");
// Path: src/org/plugin/dot/DotIcons.java
// public class DotIcons {
//     public static final Icon FILE = IconLoader.getIcon("/org/plugin/dot/icons/jar-gray.png");
// 
//     public static final Icon SAVE = IconLoader.getIcon("/org/plugin/dot/icons/save.png");
// }
// 
// Path: src/org/plugin/dot/psi/DotElementFactory.java
// public class DotElementFactory {
// 
//   public static PsiElement createCRLF(Project project) {
//     final DotFile file = createFile(project, "\n");
//     return file.getFirstChild();
//   }
// 
//   public static DotFile createFile(Project project, String text) {
//     String name = "dummy.dot";
//     return (DotFile) PsiFileFactory.getInstance(project).
//         createFileFromText(name, DotFileType.INSTANCE, text);
//   }
// 
//   public static DotId createDotId(Project project, String newName) {
//     final DotFile file = createFile(project, "digraph "  + newName + "{}");
//     return ((DotDotgraphStmt)file.getFirstChild()).getId();
//   }
// }
// 
// Path: gen/org/plugin/dot/psi/DotId.java
// public interface DotId extends DotNamedElement {
// 
//   @Nullable
//   PsiElement getHtmlId();
// 
//   @Nullable
//   PsiElement getNumeralId();
// 
//   @Nullable
//   PsiElement getQuotedAny();
// 
//   @Nullable
//   PsiElement getSimpleId();
// 
//   String getName();
// 
//   PsiElement setName(String newName);
// 
//   PsiElement getNameIdentifier();
// 
//   ItemPresentation getPresentation();
// 
// }


// Path: tests/org/plugin/dot/psi/impl/DotPsiImplUtilTest.java
import com.intellij.openapi.application.PluginPathManager;
import com.intellij.psi.PsiElement;
import com.intellij.testFramework.fixtures.BasePlatformTestCase;
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
import org.jetbrains.annotations.NotNull;
import org.junit.Assert;
import org.junit.Test;
import org.plugin.dot.DotIcons;
import org.plugin.dot.psi.DotElementFactory;
import org.plugin.dot.psi.DotId;

package org.plugin.dot.psi.impl;


public class DotPsiImplUtilTest extends BasePlatformTestCase {
    @NotNull
    @Override
    protected String getTestDataPath() {
        return "testData";
    }

    @Test
    public void testGetName() {
        DotId id = DotElementFactory.createDotId(getProject(), "test_name");
        Assert.assertEquals("test_name", DotPsiImplUtil.getName(id));
    }

    @Test
    public void testSetName() {
        DotId id = DotElementFactory.createDotId(getProject(), "test_name");
        PsiElement e  = DotPsiImplUtil.setName(id, "new_name");
        Assert.assertEquals("new_name", ((DotId) e).getName());
    }

    @Test
    public void testSetNameAnotherKind() {
        DotId id = DotElementFactory.createDotId(getProject(), "<another_kind>");
        PsiElement e  = DotPsiImplUtil.setName(id, "new_name");
        Assert.assertEquals("new_name", ((DotId) e).getName());