History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-21857
Type: Exception Exception
Status: Resolved Resolved
Resolution: Obsolete
Priority: Major Major
Assignee: Anna Kozlova
Reporter: Exception Analyzer
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

[#7348] NPE: LaunchSuite$ClassesAndMethodsSuite.initContentBuffer

Created: 01 Oct 07 16:21   Updated: 10 Apr 09 13:26
Component/s: None
Fix Version/s: Undefined

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 7,312


 Description  « Hide
exception://7348/
Last updated by lloix
Error message: No message
java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:394)
at java.util.Properties.setProperty(Properties.java:143)
at org.testng.xml.LaunchSuite$ClassesAndMethodsSuite.initContentBuffer(LaunchSuite.java:314)
at org.testng.xml.LaunchSuite$CustomizedSuite.createContentBuffer(LaunchSuite.java:146)
at org.testng.xml.LaunchSuite$CustomizedSuite.getSuiteBuffer(LaunchSuite.java:160)
at org.testng.xml.LaunchSuite$CustomizedSuite.save(LaunchSuite.java:181)
at com.theoryinpractice.testng.configuration.TestNGRunnableState.createJavaParameters(TestNGRunnableState.java:281)
at com.intellij.execution.configurations.JavaCommandLineState.getJavaParameters(JavaCommandLineState.java:30)
at com.intellij.execution.runners.RunStrategyImpl.executeCommandLine(RunStrategyImpl.java:151)
at com.intellij.execution.runners.RunStrategyImpl.doExecute(RunStrategyImpl.java:119)
at com.intellij.execution.runners.RunStrategyImpl.access$200(RunStrategyImpl.java:30)
at com.intellij.execution.runners.RunStrategyImpl$3.run(RunStrategyImpl.java:233)
at com.intellij.execution.impl.ExecutionManagerImpl$1.run(ExecutionManagerImpl.java:123)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:298)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:476)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:469)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:355)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

 All   Comments   Work Log   Change History      Sort Order:
Exception Analyzer - 23 Apr 08 14:35
Build 7810
Reported by Eugene Petrenko
Linked by Anna Kozlova
Error message: No message
java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:394)
at java.util.Properties.setProperty(Properties.java:143)
at org.testng.xml.LaunchSuite$ClassesAndMethodsSuite.initContentBuffer(LaunchSuite.java:314)
at org.testng.xml.LaunchSuite$CustomizedSuite.createContentBuffer(LaunchSuite.java:146)
at org.testng.xml.LaunchSuite$CustomizedSuite.getSuiteBuffer(LaunchSuite.java:160)
at org.testng.xml.LaunchSuite$CustomizedSuite.save(LaunchSuite.java:181)
at com.theoryinpractice.testng.configuration.TestNGRunnableState.createJavaParameters(TestNGRunnableState.java:286)
at com.intellij.execution.configurations.JavaCommandLineState.getJavaParameters(JavaCommandLineState.java:30)
at com.intellij.execution.runners.RunStrategyImpl.executeCommandLine(RunStrategyImpl.java:151)
at com.intellij.execution.runners.RunStrategyImpl.doExecute(RunStrategyImpl.java:119)
at com.intellij.execution.runners.RunStrategyImpl.access$200(RunStrategyImpl.java:166)
at com.intellij.execution.runners.RunStrategyImpl$3.run(RunStrategyImpl.java:233)
at com.intellij.execution.impl.ExecutionManagerImpl$1.run(ExecutionManagerImpl.java:123)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:298)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:485)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:478)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:359)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

Mark Derricutt - 29 Apr 08 13:34
It looks like PsiClass.getQualifiedName() is returning null for a class being added to the test profile.

Does anyone know what the test class/code which triggered this looked like? Currently I'm not able to reproduce this.

I have a small patch which will skip any PsiClass which doesn't return a qualified name, but I'd rather know what I'm potentially ignoring (could this be a bug in PsiClass)?


Mark Derricutt - 29 Apr 08 13:38
For reference : com.theoryinpractice.testng.configuration.TestNGRunnableState:264 -
if (classes.size() > 0) {
  Map<String, Collection<String>> map = new HashMap<String, Collection<String>>();
  for (Map.Entry<PsiClass, Collection<PsiMethod>> entry : classes.entrySet()) {
    Collection<String> methods = new HashSet<String>(entry.getValue().size());
    for (PsiMethod method : entry.getValue()) {
      methods.add(method.getName());
    }
    map.put(entry.getKey().getQualifiedName(), methods);
  }

The map allows a null key to be added, however when this is used lower down inside TestNG, the Map.Entry's key is stored inside a Properties instance, which doesn't allow nulls and throws the NullPointerException.


Dmitry Jemerov - 29 Apr 08 13:45
getQualifiedName() returns null for anonymous and local classes.

Mark Derricutt - 29 Apr 08 14:24
Reproduced the problem with the following test class:
public class EmptyMapTest {
  public void someMethod() {
    class FooTest {
      @Test(groups = "test")
      public void thisTestBreaksThings() {
        assert true;
      }
    }
  }

  @Test(dependsOnGroups = "test")
  public void thisTestTriggersABreak() {
    assert true;
  }
}

When running the TestNG plugin attempts to resolve the dependencies of the thisTestTriggersABreak test method, the local class FooTest is pulled in as a dependent test container.

The plugin has been patched to trap and report such dependency issues in the Diana branch, for some reason I can't currently compile locally so once I confirm the problem is trapped cleanly, I'll back port the change to Selena and resolve the issue.