Right-click on a test class does not show the "run" options

Running IDEA 12.1.1 on a new MacBook Pro to which I migrated using my Time Machine backup.
Everything works properly, except that right-clicking a test class does not display the Run options (Run as JUnit / Specs2 / ScataTest etc).
I tried invalidating caches and re-importing the project from the POM files, to no avail. I am able to run the tests by manually creating a run configuration.

I saw this SO thread but I'm reluctant to completely obliterate my IDEA installation unless no other options is available.

Has anyone experienced this or has an idea what I can do to resolve the issue?

Thanks

9 comments

Hi, just a guess, but could you make sure the source root is mark as a test source root?   (Go to the project window, find this class, then find the source root directory.  Then right click, choose "Mark Directory As" menu item, and then click "Test Source Root".)

(With my settings, the test classes now have a pale light green background and I can right-click on a test class and see the Run/Debug menu items for it.)

Matt

0

Yes, of course it is. I also tried unmarking and remarking, no go. This is definitely something to do with the move to the new computer and the way Apple implements migration usin Time Machine restore.

0

Hi Shai,

Could you provide a sample project which shows the problem at your environment?

Denis

0

Attached.
Right clicking the test class in this project on my computer doesn't display the Run option in the context menu. However, I sent this project to a colleague, and it does display the option on his machine. Meaning, it's something with my local copy of IDEA or its settings.



Attachment(s):
test-context-menu-issue.zip
0

Your project works just fine at my environment - ContextMenuTest is successfully run via context menu action.

Please try to execute 'main menu | file | invalidate caches' and check if it helps.

Also provide your idea.log (main menu | help | show log), it might contain relevant error messages.

Denis

0

As I already wrote in my original post, I tried invalidating caches.
Log file attached.



Attachment(s):
idea.log.gz
0

The log shows the problem:

2013-04-23 11:37:33,108 [147451904]  ERROR - penapi.actionSystem.impl.Utils - update failed for AnAction with ID=RunClass
java.lang.NoSuchMethodError: com.intellij.ide.browsers.WebBrowserService.getUrlToOpen(Lcom/intellij/psi/PsiElement;)Ljava/lang/String;
    at com.intellij.javascript.debugger.execution.JavaScriptDebugConfigurationProducer.createConfigurationByLocation(JavaScriptDebugConfigurationProducer.java:85)



I.e. there was an error during preparing 'run' action for the context menu. Checking further

Denis
0

Apparently re-installing IDEA did solve the issue, as opposed to the experience of the guy form the SO post. Not that it explains what caused the issue originally, but at least my problem is solved :)

Thanks

0

It looks like your IJ binaries were somehow broken because I've just checked that IU 12.1.1 has that method at the binary distribution (namely, $IJ_HOME/lib/openapi.jar).

Denis

0

Please sign in to leave a comment.