// Path: src/main/java/org/antlr/jetbrains/st4plugin/psi/STGroupTokenTypes.java
// public static RuleIElementType getRuleElementType(@MagicConstant(valuesFromClass = STGParser.class) int ruleIndex) {
//     return RULE_ELEMENT_TYPES.get(ruleIndex);
// }
// 
// Path: src/main/java/org/antlr/jetbrains/st4plugin/Icons.java
// public class Icons {
//     public static final Icon STG_FILE = IconLoader.getIcon("/icons/st.png");
//     public static final Icon BIGSTRING = IconLoader.getIcon("/icons/bigstring.png");
//     public static final Icon BIGSTRING_NONL = IconLoader.getIcon("/icons/bigstring-nonl.png");
//     public static final Icon STRING = IconLoader.getIcon("/icons/string.png");
//     public static final Icon DICT = IconLoader.getIcon("/icons/dict.png");
// }
// 
// Path: src/main/java/org/antlr/jetbrains/st4plugin/STGroupFileType.java
// public class STGroupFileType extends LanguageFileType implements TemplateLanguageFileType {
//     public static final STGroupFileType INSTANCE = new STGroupFileType();
// 
//     protected STGroupFileType() {
//         super(STGroupLanguage.INSTANCE);
//     }
// 
//     @NotNull
//     @Override
//     public String getName() {
//         return "StringTemplate v4 template group file";
//     }
// 
//     @NotNull
//     @Override
//     public String getDescription() {
//         return "StringTemplate v4 template group file";
//     }
// 
//     @NotNull
//     @Override
//     public String getDefaultExtension() {
//         return "stg";
//     }
// 
//     @Nullable
//     @Override
//     public Icon getIcon() {
//         return Icons.STG_FILE;
//     }
// 
//     static class Factory extends FileTypeFactory {
//         @Override
//         public void createFileTypes(@NotNull FileTypeConsumer consumer) {
//             consumer.consume(STGroupFileType.INSTANCE);
//         }
//     }
// }


import static org.antlr.jetbrains.st4plugin.psi.STGroupTokenTypes.getRuleElementType;
import com.intellij.extapi.psi.ASTWrapperPsiElement;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiFileFactory;
import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
import javax.swing.Icon;
import org.antlr.jetbrains.st4plugin.Icons;
import org.antlr.jetbrains.st4plugin.STGroupFileType;
import org.antlr.jetbrains.st4plugin.parsing.STGParser;
import org.jetbrains.annotations.NotNull;
package org.antlr.jetbrains.st4plugin.structview;



public class STGroupTemplateDefItemPresentationTest extends CodeInsightFixtureTestCase {

    public void testIssue37() {
        // Given
        ASTWrapperPsiElement template = parseTemplate("A() ::= ");

        STGroupTemplateDefItemPresentation presentation = new STGroupTemplateDefItemPresentation(template);

        // When
        Icon icon = presentation.getIcon(false);

        // Then
        assertSame(template.getNode().getElementType(), getRuleElementType(STGParser.RULE_template));
// Path: src/main/java/org/antlr/jetbrains/st4plugin/psi/STGroupTokenTypes.java
// public static RuleIElementType getRuleElementType(@MagicConstant(valuesFromClass = STGParser.class) int ruleIndex) {
//     return RULE_ELEMENT_TYPES.get(ruleIndex);
// }
// 
// Path: src/main/java/org/antlr/jetbrains/st4plugin/Icons.java
// public class Icons {
//     public static final Icon STG_FILE = IconLoader.getIcon("/icons/st.png");
//     public static final Icon BIGSTRING = IconLoader.getIcon("/icons/bigstring.png");
//     public static final Icon BIGSTRING_NONL = IconLoader.getIcon("/icons/bigstring-nonl.png");
//     public static final Icon STRING = IconLoader.getIcon("/icons/string.png");
//     public static final Icon DICT = IconLoader.getIcon("/icons/dict.png");
// }
// 
// Path: src/main/java/org/antlr/jetbrains/st4plugin/STGroupFileType.java
// public class STGroupFileType extends LanguageFileType implements TemplateLanguageFileType {
//     public static final STGroupFileType INSTANCE = new STGroupFileType();
// 
//     protected STGroupFileType() {
//         super(STGroupLanguage.INSTANCE);
//     }
// 
//     @NotNull
//     @Override
//     public String getName() {
//         return "StringTemplate v4 template group file";
//     }
// 
//     @NotNull
//     @Override
//     public String getDescription() {
//         return "StringTemplate v4 template group file";
//     }
// 
//     @NotNull
//     @Override
//     public String getDefaultExtension() {
//         return "stg";
//     }
// 
//     @Nullable
//     @Override
//     public Icon getIcon() {
//         return Icons.STG_FILE;
//     }
// 
//     static class Factory extends FileTypeFactory {
//         @Override
//         public void createFileTypes(@NotNull FileTypeConsumer consumer) {
//             consumer.consume(STGroupFileType.INSTANCE);
//         }
//     }
// }


// Path: src/test/java/org/antlr/jetbrains/st4plugin/structview/STGroupTemplateDefItemPresentationTest.java
import static org.antlr.jetbrains.st4plugin.psi.STGroupTokenTypes.getRuleElementType;
import com.intellij.extapi.psi.ASTWrapperPsiElement;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiFileFactory;
import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
import javax.swing.Icon;
import org.antlr.jetbrains.st4plugin.Icons;
import org.antlr.jetbrains.st4plugin.STGroupFileType;
import org.antlr.jetbrains.st4plugin.parsing.STGParser;
import org.jetbrains.annotations.NotNull;

package org.antlr.jetbrains.st4plugin.structview;



public class STGroupTemplateDefItemPresentationTest extends CodeInsightFixtureTestCase {

    public void testIssue37() {
        // Given
        ASTWrapperPsiElement template = parseTemplate("A() ::= ");

        STGroupTemplateDefItemPresentation presentation = new STGroupTemplateDefItemPresentation(template);

        // When
        Icon icon = presentation.getIcon(false);

        // Then
        assertSame(template.getNode().getElementType(), getRuleElementType(STGParser.RULE_template));
        assertEquals(Icons.BIGSTRING, icon);