Why do Grails 3 unit tests throw StackOverflowError when run in GGTS (Eclipse)? - eclipse

Whenever I try to run any unit test in GGTS even as simple as:
void "Test"() {
expect:
true
}
I get StackOverflowError. I wonder if it has something to do with GrailsUnitTestMixin.
I've imported my Grails 3 project as a Gradle project in my IDE.

This is an issue with Grails 3.0.4/3.0.5. The fix will come with 3.0.6 release, which haven't been released yet at the time of writing.
In the meantime, anyone having problems with this can downgrade to 3.0.2 or 3.0.3, although 3.0.3 also has a bit of issue running unit tests in Eclipse, only not as critical as StackOverflowError. I suggest using 3.0.2 for now, though.

Related

What scala-library dependenecy version can be used with Gradle 7.2 for Gatling performance testing

I am trying to do performance testing for my API using Gatling and Scala.
Below are the plugins/libraries I am using
gradle version : 7.2
gradle.plugin.com.github.lkishalmi.gatling:gradle-gatling-plugin:3.3.0
dependency : gatling 'org.scala-lang:scala-library:2.13.10'
I get the below error when I try to resolve dependencies
A problem occurred evaluating project ':performance-test'.
> Could not find method compile() for arguments [org.scala-lang:scala-library:2.13.10] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
My guess is that the scala version 2.13.10 is not compatible with the gradle version 7.2. I tried changing the scala version to latest and many others, but nothing seems to work.
I have also seen another project using gradle 6.6 and scala version 2.12.2 which works. In my case I can't downgrade the gradle version, unfortunately.
Does anyone know what scala version is compatible with gradle 7.2?
The com.github.lkishalmi.gatling:gradle-gatling-plugin plugin has been deprecated for a long time. Please use the official plugin: https://gatling.io/docs/gatling/reference/current/extensions/gradle_plugin/

SpringBoot 2.5.2 and unit tests

My unit tests work inside Eclipse (Run with Junit Test) when my pom.xml is setup to use SpringBoot 2.3.12.RELEASE. When I try to use 2.5.2 they fail like this:
java.lang.NoSuchMethodError: org.springframework.test.context.TestContext.computeAttribute
They work when you do a Maven build inside or outside Eclipse.
Anybody else having these kind of issues?
Oh boy! It the things you overlook that get you. I had some project dependencies to other projects on my Eclipse project that I had not upgraded yet. As soon as I upgraded everything, all my unit tests started to run. My apologies.
Bob

Sbt 0.12.4+ required on project import

I'm currently reading the Play for Scala: Covers Play 2 book by Peter Hilton (publisher: Manning) , and trying to stick to the versions they've outlined in the book (Play version 2.1.1).
I downloaded the new IntelliJ IDEA 14 CE app and installed it. I'm currently importing the project, and it's failing because it wants a version of sbt that is 0.12.4 or greater.
This issue occurred in 13 the other day, but I haven't had time to resolve it, so please, no recommendations to go back to 13 :)
Here is the meat of the issue:
When I type sbt --version on the CLI, it prints sbt launcher version 0.13.6. I have a "greater" version, but it appears that IDEA doesn't recognize this.
In an effort to specify my own SBT launcher JAR, I pointed my custom launcher (in IDEAs global settings) to the one in /usr/local/Cellar/sbt/0.13.6/libexec/sbt-launch.jar, but the build also failed with the same error.
As you may have guessed at this point, I have used Homebrew to install and manage Scala and sbt. When I first started working with Scala back in February, I remember having to make a few small tweaks in my settings to get IDEA to find Scala, but my version of IDEA 14 is totally fresh -- I did not import any previous settings. I downloaded the Scala and sbt plugins and they appear to be properly configured after a cursory look and creation of a new test project.
Here is what I'm failing to understand:
First, and most obvious, why would an sbt version that meets the supposed requirement (0.12.4+) fail with version 0.13.*?
Second, is the bundled sbt with IDEA also greater than this version? Is there possibly an sbt flag somewhere in my system that's pointing it to an earlier version? A side note, I have a few versions of sbt in my "Cellar", but all are greater than 0.13.
Many thanks for your help!
I had a look at the code samples from Manning's website, and the project/build.properties files for each project specify sbt.version=0.12.2. My guess is that the Intellij Scala plugin only supports SBT 0.12.4, and cannot import you project which is configured to use an older version (hence why it recommends that you "update your project definition").
You should try using sbt.version=0.12.4 in the project/build.properties file.
Generally speaking, keep in mind that when an SBT version is specified in project/build.properties, the SBT launcher downloads the specified version and uses it to build the project. In your case, that means that the SBT 0.13.6 launcher will download SBT 0.12.2 and use that version to build the project.

Intellij IDEA 13: Error compiling sbt component

I have a Maven Scala project created with archetype:
archetypeGroupId=org.scala-tools.archetypes
archetypeArtifactId=scala-archetype-simple
version=1.3
I'm getting this when trying to run a simple main method:
Error compiling sbt component 'compiler-interface-2.8.0.final-51.0'
The Maven build works fine though... I'm new to Scala so this is probably some simple problem.
The good people over at JetBrains had a solution:
Looks like this plugin is quite old and generates pom with an old
scala version. Try 2.10.0
Meant to post this sooner but I forgot about this question.

Scala Compiler doesn't compile in ScalaIDE

I'm trying to develop on the Scala compiler project with the help of ScalaIDE. I followed this guide to set up the development environment. When I now try to build the mentioned projects, the reflect project won't get built. Instead, I get the following error via the console output:
uncaught exception during compilation: scala.reflect.internal.MissingRequirementError reflect Unknown Scala Problem
Having tried the provided ANT script of the project via the console, everything seems to work fine.
Does anyone know if I'm missing a hidden compiler flag, dependency or something like this?
Thanks!
With the IDE for Scala 2.10 you can only build the 2.10.x branch of the Scala compiler. If you want to work on master, you need to install a 2.11-based version of the IDE. We don't publicise IDE for 2.11 nightlies yet, but they are available at:
http://download.scala-ide.org/nightly/scala-ide-master-2.11.0-SNAPSHOT/