Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullpointer when generating test cases in 13.1.eap #41

Open
Khoulaiz opened this issue Feb 27, 2014 · 3 comments
Open

Nullpointer when generating test cases in 13.1.eap #41

Khoulaiz opened this issue Feb 27, 2014 · 3 comments

Comments

@Khoulaiz
Copy link

Used one @should annotation in an interface and pressed "generate test case" button.
Selectect testng as framework (which is available in the project as lib)
Got this after that step:

null
java.lang.NullPointerException
    at com.intellij.generatetestcases.testframework.AbstractTestFrameworkStrategy.isTestFrameworkLibraryAvailable(AbstractTestFrameworkStrategy.java:79)
    at com.intellij.generatetestcases.actions.GenerateTestMethods.actionPerformed(GenerateTestMethods.java:130)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:162)
    at com.intellij.openapi.actionSystem.impl.ActionButton.a(ActionButton.java:170)
    at com.intellij.openapi.actionSystem.impl.ActionButton.a(ActionButton.java:133)
    at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:311)
    at java.awt.Component.processEvent(Component.java:6270)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4861)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2719)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:708)
    at java.awt.EventQueue$4.run(EventQueue.java:706)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
    at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:697)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:520)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
@haixiliu
Copy link
Collaborator

Hi Khoulaiz,

I tested it with an interface in my IntelliJ IDEA Ultimate 12.1.2, and was not able to reproduce the problem you are seeing. Are you using version 13?

My method looks like this:

/**
 * @should return result of Export
 * @param bidSheetId
 * @param config
 * @return
 */
@POST
@Path("/overlap/warnings/{id}/export")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
Response exportOverlappingBidSheetProductsWarnings(@PathParam("id") final Long bidSheetId, @FormParam("") final ExportRequestConfig config);

And my generated test looks like this:

package com.tt.enterprise.resource.bidmaster.bidsheet;

import org.testng.Assert;
import org.testng.annotations.Test;

public class UT_BidSheetResource {
/**
* @verifies return result of Export
* @see BidSheetResource#exportOverlappingBidSheetProductsWarnings(Long, com.crunchtime.enterprise.dto.base.ExportRequestConfig)
*/
@test
public void exportOverlappingBidSheetProductsWarnings_shouldReturnResultOfExport() throws Exception {
//TODO auto-generated
Assert.fail("Not yet implemented");
}
}

@Khoulaiz
Copy link
Author

Have you read the subject of this bug? :-)

I think I had to disable a couple of plugins in 13.1.eap so they prolly changed something of the plugin interface.

You can download the 13.1.eap here: http://confluence.jetbrains.com/display/IDEADEV/IDEA+13.1+EAP

@haixiliu
Copy link
Collaborator

I saw it, but I did not know what eap means. I should have just looked it up.

Have you used this plugin in 12? - just wanted to see whether it worked for you in 12. I looked at the code and everything (around the NullPointerException) looks fine. I think something internal to IntelliJ changed that caused this error.

The company I work for will upgrade to ultimate 13 soon, so I can test it out and try to fix it.

If you have time, please feel free to download the source code and try to figure it out yourself :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants