Running junit tests in Intellij with Java 6 & lombok annotations - java

Could someone please suggest me the required Intellij Idea setup to run a junit test refers to lombok annotations with Java 1.6.
My current setup:-
Intellij Version - 2020.3.3 with built-in lombok plugin
lombok dependency version - 1.16.18
My previous question on the issue:-
lombok annotations are not identified by junit in Intellij
I can build the project with maven but cannot run unit test with Intellij. When I changed to Java 8 and try to run unit tests, lombok error disappeared, but failed since project is not compatible with Java 8.
Therefore I'm looking for the ideal Intellij setup that works for this situation.
Thanks in advance!

Related

Failed to import junit

Is it a bug in Eclipse? I have tried to refresh the project, restart Eclipse and system. Confused.
Is it a bug in Eclipse?
Nope. It is a bug in the project setup. It looks like the project's maven dependency for junit is incorrect.
You are using the wrong Junit JAR file for the test code you are trying to compile. The junit.framework.TestCase class is from Junit 3, but you are using the JAR file for Junit 4.7. In Junit 4.x the package names changed to org.junit, and the TestCase class was dropped.
Solutions:
Find and use the JAR file for the last Junit 3.x release. (This might be what you need ...)
Update your testcases to use a newer version of Junit. (Preferably Junit 5.x)
(At the time of writing, the latest release of Junit 4.x is 4.13.)

Eclipse 2018-09 with jdk11 claims that package org.junit is missing even though it is included by maven

my maven project includes junit and builds including running the tests on the command line with maven. However eclipse claims that the package can not be found, I don't understand why eclipse would ignore the dependency.
I am depending on version 4.12 of junit
Right-click on the project, then use Maven>Update Project... to get the build path settings in sync with the pom.xml.
Please check the version of junit in the pom.xml.
The 3.x version is programmed and 4.x is the annotation method.

Integration Spock Testing Framework into Eclipse Neon2 v4.6.2

I'm using Eclipse Neon2 (4.6.2). I'm trying to use Spock Framework (http://spockframework.org/). Here's what I did so far:
Added the Groovy plugin to Eclipse. Since in the Eclipse Market there's no Groovy plug-in for this specific version of Eclipse (Neon2 V4.6.2), i followed the instructions mentioned here and specifically in the 'How To Install' section: https://github.com/groovy/groovy-eclipse/wiki
I right clicked on my Eclipse Project and converted it to a Groovy project.
I installed Spock Plugin 2.13 by Jspresso from the Eclipse Marketplace.
I right-clicked on my Eclipse project and added the 'Spock Nature' to it.
At this stage I'm able to create Groovy classes but the IDE still cannot identify Spock syntax. For example when extending Spock's Specification class, we get a class not found or package not found error.
I realize how this can be much easier using Maven or Gradle, but that's a long story now and I'm just trying to find out what i'm doing wrong so far.
Thanks.
Did you add Spock as a dependency of your project? It needs to be on the classpath when compiling your tests.

Migrating from JUnit to TestNG in IntelliJ IDEA

I found information about migrating from JUnit to TestNG in general (here for example) and about working in IntelliJ IDEA with JUnit and TestNG separately, but nothing about migrating from JUnit to TestNG in IntelliJ IDEA itself.
Can anyone describe the steps required to do this?

Tycho surefire JUnit tests fail only on 64 bit ubuntu

I build my xtext eclipse plugin project with maven and jenkins and the junit tests with tycho surefire. Jenkins runs on a 64 bit ubuntu and tests are failing with:
java.lang.IllegalStateException: Unresolved proxy http://url/from/mydsl#//element. Make sure the EPackage has been registered.
I tried to solve this problem with an overidden register function in the StandaloneSetup class like described at Switching from an inferred Ecore model to an imported one in your Xtext grammar but this didn't work for me.
I tried to run the tests on ubuntu 32 bit and it surprisingly works without failure.
I hope somebody can help me

Categories

Resources