Running Unit Tests On An IDEA Plugin Project Under Teamcity

Has anyone gotten this to work? I cant seem to get TeamCity to properly run unit tests for my custom language plugin.

2 comments
Comment actions Permalink

Here is an example of an exception in my unit test. It shows that my file isn't even read as my custom language on the TeamCity server.

junit.framework.ComparisonFailure: null expected:<[Lua script: test.lua(0,7)
   Local Declaration(0,7)
     PsiElement(local)('local')(0,5)
     PsiWhiteSpace(' ')(5,6)
     Identifier List (Count 1)(6,7)
       Local Decl: a(6,7)
         PsiElement(identifier)('a')(6],7)> but was:<[PsiFile(plain text):test.lua(0,7)
   PsiPlainText('local a')(0],7)>
     at junit.framework.Assert.assertEquals(Assert.java:81)
     at junit.framework.Assert.assertEquals(Assert.java:87)
     at com.sylvanaar.idea.Lua.lang.parser.LuaParsingTestCase.checkParsing(LuaParsingTestCase.java:50)
     at com.sylvanaar.idea.Lua.lang.parser.LuaParsingTestCase.doTest(LuaParsingTestCase.java:44)
     at com.sylvanaar.idea.Lua.lang.parser.LuaParsingTestCase.doTest(LuaParsingTestCase.java:36)
     at com.sylvanaar.idea.Lua.lang.parser.StatementsParsingTests.testDeclaration$decl1(StatementsParsingTests.java:32)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at junit.framework.TestCase.runTest(TestCase.java:168)
     at com.intellij.testFramework.UsefulTestCase.access$001(UsefulTestCase.java:63)
     at com.intellij.testFramework.UsefulTestCase$1.run(UsefulTestCase.java:199)
     at com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:1448)
     at com.intellij.testFramework.UsefulTestCase.invokeTestRunnable(UsefulTestCase.java:227)
     at com.intellij.testFramework.UsefulTestCase.runTest(UsefulTestCase.java:215)
     at junit.framework.TestCase.runBare(TestCase.java:134)
     at com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCase.java:232)
     at com.intellij.testFramework.UsefulTestCase$2.run(UsefulTestCase.java:242)
     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

0
Comment actions Permalink

Hello Jon,

Just as a quick check: please try to define -Didea.config.path in the VM
options pointing to a clean temp directory somewhere on the filesystem.

Here is an example of an exception in my unit test. It shows that my
file isn't even read as my custom language on the TeamCity server.

junit.framework.ComparisonFailure: null expected:<[Lua script:
test.lua(0,7)
Local Declaration(0,7)
PsiElement(local)('local')(0,5)
PsiWhiteSpace(' ')(5,6)
Identifier List (Count 1)(6,7)
Local Decl: a(6,7)
PsiElement(identifier)('a')(6],7)> but was:<[PsiFile(plain
text):test.lua(0,7)
PsiPlainText('local a')(0],7)>
at junit.framework.Assert.assertEquals(Assert.java:81)
at junit.framework.Assert.assertEquals(Assert.java:87)
at
com.sylvanaar.idea.Lua.lang.parser.LuaParsingTestCase.checkParsing(Lua
ParsingTestCase.java:50)
at
com.sylvanaar.idea.Lua.lang.parser.LuaParsingTestCase.doTest(LuaParsin
gTestCase.java:44)
at
com.sylvanaar.idea.Lua.lang.parser.LuaParsingTestCase.doTest(LuaParsin
gTestCase.java:36)
at
com.sylvanaar.idea.Lua.lang.parser.StatementsParsingTests.testDeclarat
ion$decl1(StatementsParsingTests.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
ava:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
orImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at
com.intellij.testFramework.UsefulTestCase.access$001(UsefulTestCase.ja
va:63)
at
com.intellij.testFramework.UsefulTestCase$1.run(UsefulTestCase.java:19
9)
at
com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:1448)
at
com.intellij.testFramework.UsefulTestCase.invokeTestRunnable(UsefulTes
tCase.java:227)
at
com.intellij.testFramework.UsefulTestCase.runTest(UsefulTestCase.java:
215)
at junit.framework.TestCase.runBare(TestCase.java:134)
at
com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCas
e.java:232)
at
com.intellij.testFramework.UsefulTestCase$2.run(UsefulTestCase.java:24
2)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThrea
d.java:269)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.j
ava:184)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThrea
d.java:174)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
---
Original message URL:
http://devnet.jetbrains.net/message/5307398#5307398


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.