MoreUnit Plugin for Intellij - intellij-idea

I am looking for a moreUnit like plugin for Intellij
This are the features I mostly use and miss in Intellij:
create a new test method from the method under test
Marker on method under test indicating that a corresponding test method exist
jump to the test method (not only the class) from method under test.
execute corresponding test method from method under test.
I saw there is plugin called MoreUnit but the only thing it does is jump to test/to class under test. This is function does intellij out of the box with CMD+SHIFT+T.

After a few years there is now a port of moreunit to intellij
https://github.com/MoreUnit/org.moreunit.intellij.plugin

Related

Using 'Run with code coverage' with Intellj idea gets ClassFormatError

Recently I use JMockit and Junit4 for unit tests in intellj idea. When I run my test using the 'Run' button or the 'debug' button, it works fine. When I try to get my code coverage result using the 'Run with coverage' button, it gets ClassFormatError.
java.lang.ClassFormatError at
sun.instrument.InstrumentationImpl.redefineClasses0(Native Method)
It happens only when I try to mock a method in the class which I want to test, like
new Expectations(BaseValidator.class) {
{
BaseValidator.isExistAirLineByTwoCode(anyString);
returns(false, true);
}
};
I test another method in class 'BaseValidator' which calls the method 'isExistAirLineByTwoCode'.
I don't know if the cause of this problem is from idea or jmokit, even junit. By the way, I use jacoco for code coverage reports.
How can I fix this problem?
I found a workaround by switching to jacoco runner:
In the menu, click Run --> Edit Configuration --> choose your test under JUNIT category
change coverage runner to Jacoco .

Intelllij IDEA Ultimate 2018.1 groovy code completion does not work

I can create a Groovy project and even run it. But when I type main or print there are no auto-complete / code completion suggestions at all. I have groovy-2.4.1 in the external library folder along with Java 1.8. I find Intellij frustrating and non-intuitive to use.
In a groovy script main does show correct code completion but when I click enter it puts "main()" without the String[] args that I can see in the suggestion.
You have created a Groovy class where code has to be embedded into a class to be executable and where only class member declarations are expected (e.g. functions, fields). Select to create a Groovy script (or just delete class declaration) to be able to write executable code in top level file. See also Scripts versus classes.
I was having the same problem when I was in a rush and forgot to add a method in which to write the code. Just type 'psvm + Enter' inside the class. This will create a main method in which code completion will work. Also, you can remove the public keyword as classes and methods in Groovy are by default public.

Scratch file not running on IntelliJ IDEA

I am trying to run a Kotlin scratch file in IntelliJ just like you would run a Java scratch file, but it doesn't work.
I created a new Kotlin scratch file, but can't run the code even after attempting the following:
Create a main function and print something inside.
Print something with println outside of the main function.
Create a class with a main function inside and println something.
When I create a new kotlin project, the project runs fine.
The issue happens only with scratch files. I am using kotlin plugin version 1.1.51 on IntelliJ 2017.1
As the screenshot shows, the icon that allows you to run kotlin code doesn't show up on the left of the editor window:
Your observations are correct, and this is a known issue.

Selenium ide code library

I was going through the selenium ide. Under the reference tab it shows the documentation of function like this:
assertAttributeFromAllWindows(attributeName, pattern)
Generated from getAttributeFromAllWindows(attributeName)
Arguments:
attributeName - name of an attribute on the windows
Returns:
the set of values of this attribute from all known windows.
Returns an array of JavaScript property values from all known windows having one.
Doubt: where can I find the implementation logic of this function. Like in java we can see from jar file, where the logic for all the function is residing? How can I get that code?
You can view all the source code on github. https://github.com/SeleniumHQ/selenium/tree/master/ide

Running single test with TestNG in Intellij IDEA

How do you guys run single tests with IDEA's TestNG plugin? I tried creating a focus group, but it seems the TestNG plugin does not resolve dependencies to other tests automatically. Even when I comment out dependsOnMethods, it seems #BeforeMethod is not run.
Advice is greatly appreciated,
Robin
If you mean a single test method inside a test class there is a right-click option called Run "testMethod" where testMethod is the actual method name.
The short cut is ctrl+shift+F10.
If you put the cursor between methods (even outside the javadoc) or outside the entire class it will test all methods in that file.
Bring the class into focus in the editor, and then simply right-click, select run?