Action and Inspection (LightCodeInsightFixtureTestCase) tests work in IntelliJ, but not in ant

I have tests for Inspections that mark errors (like ambiguous commas, parentheses or missing end of expression) and testing the New File action.  Both test classes extend LightCodeInsightFixtureTestCase and their test cases work in Intellij, but not run with ant.  I need them to run with ant as I'm using ant to do the build on travis-ci.org.

Here is the action test:

 
package org.elixir_lang.action;

import
com.intellij.openapi.actionSystem.ActionManager;
import
com.intellij.openapi.vfs.VirtualFile;
import
com.intellij.psi.PsiDirectory;
import
com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
import
org.elixir_lang.psi.ElixirFile;

import
java.io.IOException;

/**
* @see <a href="https://confluence.jetbrains.com/display/IntelliJIDEA/Completion+Test">https://confluence.jetbrains.com/display/IntelliJIDEA/Completion+Test"</a>
*/
public class
CreateElixirModuleActionTest extends LightCodeInsightFixtureTestCase {
    public static final String TEMPLATE_NAME = "Elixir Module";

    public void testCamelCaseAliasIsLowerCaseUnderscored
() throws IOException {
        ActionManager actionManager = ActionManager.getInstance();
        
CreateElixirModuleAction elixirNewFileAction = (CreateElixirModuleAction) actionManager.getAction("Elixir.NewFile");

        // @see https://devnet.jetbrains.com/message/5539349#5539349
        
VirtualFile directoryVirtualFile = myFixture.getTempDirFixture().findOrCreateDir("");
        
PsiDirectory directory = myFixture.getPsiManager().findDirectory(directoryVirtualFile);

        
ElixirFile file = elixirNewFileAction.createFile("FooBar", TEMPLATE_NAME, directory);
        assertNotNull
("Expected CreateElixirModuleAction.createFile to create an ElixirFile", file);

        boolean
ignoreTrailingWhitespaces = true;

        myFixture
.checkResultByFile(
                "foo_bar.ex",
                "foo_bar.ex",
                
ignoreTrailingWhitespaces
        );
    
}

    @Override
    protected
String getTestDataPath() {
        return "testData/org/elixir_lang/action/create_elixir_module_action_test";
    
}
}


and the error when run with ant:

    [junit] Testcase: testCamelCaseAliasIsLowerCaseUnderscored(org.elixir_lang.action.CreateElixirModuleActionTest):    Caused an ERROR
    [junit] null
    [junit] java.lang.NullPointerException
    [junit]     at org.elixir_lang.action.CreateElixirModuleActionTest.testCamelCaseAliasIsLowerCaseUnderscored(CreateElixirModuleActionTest.java:25)
    [junit]     at com.intellij.testFramework.UsefulTestCase.access$001(UsefulTestCase.java:81)
    [junit]     at com.intellij.testFramework.UsefulTestCase$2.run(UsefulTestCase.java:298)
    [junit]     at com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:2125)
    [junit]     at com.intellij.testFramework.UsefulTestCase.invokeTestRunnable(UsefulTestCase.java:330)
    [junit]     at com.intellij.testFramework.UsefulTestCase.runTest(UsefulTestCase.java:314)
    [junit]     at com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCase.java:335)
    [junit]     at com.intellij.testFramework.UsefulTestCase$3.run(UsefulTestCase.java:348)
    [junit]     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
    [junit]     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
    [junit]     at java.awt.EventQueue.access$400(EventQueue.java:82)
    [junit]     at java.awt.EventQueue$2.run(EventQueue.java:676)
    [junit]     at java.awt.EventQueue$2.run(EventQueue.java:674)
    [junit]     at java.security.AccessController.doPrivileged(Native Method)
    [junit]     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    [junit]     at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
    [junit]     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    [junit]     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    [junit]     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    [junit]     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    [junit]     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    [junit]     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


The ant xml files are here https://github.com/KronicDeth/intellij-elixir/blob/4a5dcb8a55ca9a154c41db830d955e537dda5061/intellij-elixir.xml and here https://github.com/KronicDeth/intellij-elixir/blob/4a5dcb8a55ca9a154c41db830d955e537dda5061/module_intellij-elixir.xml and https://github.com/KronicDeth/intellij-elixir/blob/4a5dcb8a55ca9a154c41db830d955e537dda5061/idea.xml.  I assume I messed up setting up IDEA correctly for ant.

1 comment
Comment actions Permalink

I refreshed (https://github.com/KronicDeth/intellij-elixir/commit/c9638b8c6af1e5f613b2346c0fba088993f740f5) the list of jars in from the idea tarball fileset and the CreateElixirModuleAction test no longer fails, but the overall tests now fail with an error:

    [junit] ERROR: Problems during index shutdown
    [junit] java.lang.NullPointerException
    [junit]     at com.intellij.psi.stubs.StubUpdatingIndex$MyIndex.dispose(StubUpdatingIndex.java:429)
    [junit]     at com.intellij.util.indexing.FileBasedIndexImpl.performShutdown(FileBasedIndexImpl.java:663)
    [junit]     at com.intellij.util.indexing.FileBasedIndexImpl.access$1100(FileBasedIndexImpl.java:100)
    [junit]     at com.intellij.util.indexing.FileBasedIndexImpl$5.run(FileBasedIndexImpl.java:331)
    [junit]     at com.intellij.openapi.util.ShutDownTracker.run(ShutDownTracker.java:62)
    [junit]     at java.lang.Thread.run(Thread.java:695)
    [junit] ERROR: Problems during index shutdown
    [junit] java.lang.AssertionError: Problems during index shutdown
    [junit]     at com.intellij.testFramework.LoggedErrorProcessor.processError(LoggedErrorProcessor.java:56)
    [junit]     at com.intellij.testFramework.TestLogger.error(TestLogger.java:67)
    [junit]     at com.intellij.openapi.diagnostic.Logger.error(Logger.java:130)
    [junit]     at com.intellij.util.indexing.FileBasedIndexImpl.performShutdown(FileBasedIndexImpl.java:670)
    [junit]     at com.intellij.util.indexing.FileBasedIndexImpl.access$1100(FileBasedIndexImpl.java:100)
    [junit]     at com.intellij.util.indexing.FileBasedIndexImpl$5.run(FileBasedIndexImpl.java:331)
    [junit]     at com.intellij.openapi.util.ShutDownTracker.run(ShutDownTracker.java:62)
    [junit]     at java.lang.Thread.run(Thread.java:695)
    [junit] Exception in thread "Shutdown tracker" java.lang.AssertionError: Problems during index shutdown
    [junit]     at com.intellij.testFramework.LoggedErrorProcessor.processError(LoggedErrorProcessor.java:56)
    [junit]     at com.intellij.testFramework.TestLogger.error(TestLogger.java:67)
    [junit]     at com.intellij.openapi.diagnostic.Logger.error(Logger.java:134)
    [junit]     at com.intellij.openapi.util.ShutDownTracker.run(ShutDownTracker.java:65)
    [junit]     at java.lang.Thread.run(Thread.java:695)
    [junit] Tests FAILED
     [exec] ok
[junitreport] Processing /Users/luke.imhoff/git/KronicDeth/intellij-elixir/tmp/TESTS-TestSuites.xml to /var/folders/57/21vhc9mj54ggzc_2_ksgyk5nt9s_7q/T/null2004758143
[junitreport] Loading stylesheet jar:file:/usr/local/Cellar/ant/1.9.4/libexec/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Transform time: 1378ms
[junitreport] Deleting: /var/folders/57/21vhc9mj54ggzc_2_ksgyk5nt9s_7q/T/null2004758143
   [concat] Run: 2205, Failed: 0, Errors: 1


This happens at the very end of the run when all tests have passed and clean up is occurring for the enture junit task.

0

Please sign in to leave a comment.