Robolectric unit tests using legacy instead of binary resources only when running multi-module unit test run config - unit-testing

I have a multi-module android project. I have a bunch of unit tests in each module and I have always been able to run them all at once using a run configuration like this one:
Many of my tests use a base class that runs with RobolectricTestRunner. This base class looks like this:
#RunWith(RobolectricTestRunner::class)
#Config(application = AndroidTest.ApplicationStub::class,
manifest = Config.NONE,
sdk = [21])
abstract class AndroidTest {
#Suppress("LeakingThis")
#Rule #JvmField val injectMocks = InjectMocksRule.create(this#AndroidTest)
fun application(): Application = ApplicationProvider.getApplicationContext()
internal class ApplicationStub : Application()
}
**When running these tests using the above config, I get the error **
[Robolectric] NOTICE: legacy resources mode is deprecated; see http://robolectric.org/migrating/#migrating-to-40
This makes many of my tests fail with ResourceNotFoundException
However, when I run tests only in a specific module, everything passes. This is because Robolectric now uses Binary resources:
[Robolectric] sdk=21; resources=BINARY
I have followed the migration instructions in build.gradle files for each module, having added the following in each android block:
testOptions {
unitTests {
includeAndroidResources = true
returnDefaultValues = true
}
}
One clue I have found but have been unable to fix is this when I run the ALL UNIT TEST task:
WARNING: No manifest file found at build/intermediates/merged_manifests/debug/../../library_manifest/debug/AndroidManifest.xml.
Falling back to the Android OS resources only.
No such manifest file: build/intermediates/merged_manifests/debug/../../library_manifest/debug/AndroidManifest.xml
To remove this warning, annotate your test class with #Config(manifest=Config.NONE).
I have tried, as you have seen, to add the manifest=Config.NONE, which had no effect (and is now deprecated anyway).
Edit: Also tried android.enableUnitTestBinaryResources = true in settings.gradle, but this prevents the app from building due to it being a deprecated flag in the current gradle tools.
Thanks for any help provided!

So with the default unit test run platform being changed to Gradle in Android Studio, I managed to figure out a way to run unit tests in multiple modules all at once, circumventing the Robolectric bug.
First, go into run configurations and create a new Gradle Config.
Then, as the gradle project, select the top level project.
For arguments, use --tests "*"
And now for the gradle tasks, this is a little bit more error-prone. Here is an example of how I have it setup for my project:
:androidrma:cleanTestGoogleDebugUnitTest :androidrma:testGoogleDebugUnitTest
:calendar:cleanTestDebugUnitTest :calendar:testDebugUnitTest
:gamification:cleanTest :gamification:test
:player:cleanTest :player:test
:playlists:cleanTest :playlists:test
:sleepjournal:cleanTest :sleepjournal:test
:sound-content-filters:cleanTest :sound-content-filters:test
Please note that I inserted new lines between each module for more clarity here, in the tasks, just separate each entry with a space.
For your app module, in my case named androidrma, you must use your build variants name in the cleanTestUnitTest and testUnitTest , in my case being GoogleDebug.
If we look at the calendar module, it is an android module, , so it still operates with the same logic as the appModule.
However, if you look at player, playlists, sleepjournal, etc. those are pure kotlin modules. The tasks thus differ in their syntax.
Once you have entered all this information and everything is functioning, I recommend checking "store as project file" checkbox at the top right of the run config setup screen.
This works in Android Studio 4.2 as well as Arctic Fox, haven't tested on other versions.

Related

Running JUnits with JavaFX dependencies on Jenkins

I'm trying to setup pipeline on Jenkins for our JavaFX application. Everything works fine, but I have one problem by starting unit tests. Each test, which somehow uses JavaFX classes fails with following root cause:
Caused by: java.lang.IllegalAccessException: class net.bytebuddy.description.annotation.AnnotationDescription$ForLoadedAnnotation cannot access interface com.sun.javafx.beans.IDProperty (in module javafx.base) because module javafx.base does not export com.sun.javafx.beans to unnamed module #7ee955a8
I tried a following things:
setting env variable JAVA_OPTS
JAVA_OPTS=--module-path /path/to/javafx --add-modules javafx.controls,javafx.base
adding compiler options in gradle
tasks.withType(Test).configureEach {
doFirst {
options.compilerArgs += [
'--module-path', '/path/to/javafx',
'--add-modules', 'javafx.controls,javafx.base',
]
classpath = files()
}
}
but nothing changed. I'm using the OpenJDK compiled by Azul. I took the version with JavaFX (JDKFX) but I'm not able to make this tests running (tests without any references to JavaFX are running fine). I'm also able to compile the application. Do you have any sugestions?
The problem was, like mentioned in comments, that it should not be added to the compilerArgs but to the runtime and additionally I placed it in wrong build.gradle file. The final configuration which solved all problems was to add following to the main build.gradle file:
allprojects {
tasks.withType(Test).configureEach {
jvmArgs += [
'--add-modules', 'javafx.controls,javafx.base,javafx.graphics',
'--add-opens', 'javafx.graphics/com.sun.javafx.application=ALL-UNNAMED',
'--add-opens', 'javafx.base/com.sun.javafx.beans=ALL-UNNAMED',
]
}
}

How to create separate tests with Gradle and Kotlin?

I am working on a Kotlin project with Gradle that includes unit tests. I want to add some integration tests (or functional tests, never understood the difference between the two), but I want to be able to run them independently. Ideally, the source of the tests are in different folders.
I am using Gradle 4.5 and my build.gradle file looks something like this :
buildscript {
ext.kotlin_version = '1.2.21'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin'
apply plugin: 'application'
mainClassName = 'xyz.bobdudan.myproject.AppKt'
repositories {
maven { url "http://maven.stardog.com" }
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
testCompile 'io.kotlintest:kotlintest:2.0.7'
}
I have tried the method described here for java, but it doesn't work : the task also runs the unit tests, but they can't be found, and the integration tests are not executed at all.
What can i do ?
Edit :
Here is the result of gradle clean integTest with the solution of #lance-java:
:clean
:compileIntegTestKotlin
:compileIntegTestJava NO-SOURCE
:processIntegTestResources NO-SOURCE
:integTestClasses UP-TO-DATE
:integTest NO-SOURCE
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 1s
2 actionable tasks: 2 executed
So nothing is executed (I make sure that the tests are supposed to fail)
Note: I'm not a kotlin dev so will write in groovy.
You can add another SourceSet which will automatically add a JavaCompile task for the SourceSet and also a few Configuration instances to the model (eg integTestCompile, integTestCompileOnly, integTestRuntime etc)
sourceSets {
integTest {
java.srcDir 'src/integTest/java'
resources.srcDir 'src/integTest/resources'
}
}
configurations {
integTestCompile.extendsFrom compile
}
Then you can add another Test task
task integTest(type: Test) {
testClassesDir = sourceSets.integTest.output.classesDir
classpath = sourceSets.integTest.runtimeClasspath
}
You may wish to wire the integTest task into the normal DAG, or perhaps you'll leave this off and call it explicitly
check.dependsOn integTest
To tell long story short you have to:
create separate source sets,
create testTask for each test source,
set it up,
define order these tasks should be executed during build/check
and you are good to go.
Here is a guide in an answer to another question about how to do this for project using JUnit5 and Kotlin Spek test framework.

Running (x)Unit Tests on TFS Build Pipeline

I am merely a beginner and still trying to learn about TFS and its continuous integration workflow. Having that said, this could as well be a stupid question to ask as I might be missing on a simple detail, though any help or advice would be highly appreciated.
So, I have a fairly simple Unit Test example written using .NET Core 2.0, which I would like to run as a test task on our TFS Server's CI Build pipeline. It pretty much looks something like this:
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace MyUnitTest
{
[TestClass]
public class MyUnitTest
{
[TestMethod]
public void PassingTest()
{
Assert.AreEqual(4, Add(2, 2));
}
[TestMethod]
public void FailingTest()
{
Assert.AreEqual(5, Add(2, 2));
}
int Add(int x, int y)
{
return x + y;
}
}
}
When I try to run these tests in Visual Studio, it builds perfectly and the tests succeed and fail accordingly. So I commit my project and push it to our TFS git repository. Now, I similarly would like to integrate these tests in our build pipeline.
The Build Definition used in our CI builds looks like this. I have added Visual Studio Test - testAssemblies task in the build pipeline and configured the search pattern to find the assembly named MyUnitTest.dll and such. When I queue the build, I get the following warning in VSTest's log.
Warning: No test is available in C:\BuildAgent\_work\9\s\MyUnitTest\MyUnitTest\bin\release\netcoreapp1.1\MyUnitTest.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.
So, it seems to me that VSTest somehow cannot find tests to run in the target assembly. I am pretty positive that I might have misconfigured something, or forgotten to set some particular parameter appropriately. I will be more than grateful for any suggestion that would possibly pinpoint what I might be doing wrong.
Searching for solutions online, I have come across this question, which seems to have a similar problem.
First make sure your build agent environment is as same as your local develop machine. Such as Visual Studio version, MsTestAdapter ,xunit runner version and so on.
You could double confirm this by manually run the test directly on the build agent machine not through TFS.
Then use the below tasks in your build pipeline:
Add a dotnet restore task.
Then a dotnet build task.
Add a dotnet test task with the arguments --no-build --logger "trx;LogFileName=tests-log.trx
Add a Publish test results task with the following settings
More details please refer this tutorial blog: Running dotnet core xUnit tests on Visual Studio Team Services (VSTS)

All unit tests throwing BadImageFormatException with Moq?

I'm currently in the process of increasing code coverage on our software products and have ran into an issue; all of my unit tests (when compiled using 'Any CPU') are failing due to throwing a 'BadImageFormatException'.
This exception can be circumvented by building the solution using 'x86' instead of 'Any CPU', however the requirements are such that we need to be able to run them using Any CPU/x64 bit.
All unit tests involving Moq follow pretty much the same format:
[TestMethod]
public void GetProduct_ValidId_ProductReturned()
{
//Setting up the object
Product prod = new Product();
prod.ID = 7;
prod.Name = "Test";
//Create the mocks
var mockProductRepo = new Mock<IRepository<Product>>();
var testDb = new Mock<IUnitOfWork>();
//Setup what the repo needs to return, in this case it's a Product
mockProductRepo.Setup(m => m.getByID(7)).Returns(prod);
//Setup what the database needs to return, in this case it's our repo which we've already setup
testDb.SetupGet(m => m.ProductRepo).Returns(mockProductRepo.Object);
//Run the test
Product returnedProd = ProductHelper.getProduct(testDb.Object, 7);
Assert.IsNotNull(returnedProd);
}
I can confirm that this test is successful when it is built using x86. Does anyone have any ideas on how I can get Moq to play nice when built using 'Any CPU'?
As an aside I can also confirm that all my projects in the solution are build using the same value ('Any CPU'). I'm using Moq v4.0.
EDIT: Here is the full exception: Test method [ProductName and the method called] threw exception:
System.BadImageFormatException: Could not load file or assembly '[Product name], Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Ok so after some digging I finally found out what the issue was. Even if you select 'Build' and then 'Configuration Manager' from the toolbar and see that Platform is set to 'Any CPU' (as was my case), what I hadn't done was check the Target Platform in the project.
To check the Target Platform you need to do the following:
Right-click your project and select 'Properties'
Select the 'Build' tab on the left
Ensure that the Target Platform of your test project matches that of the project you are testing
In my case my test was targeting 'Any CPU' but my live project was targeting 'x64'. This is what was causing the issue.
This can be caused by missing project or other assembly references. Try making sure you have project references for all the projects in your solution.
This post has a further example.

Cannot run Grails Spec using JUnit on IntelliJ IDEA since version 2.3.2

I'm in the process of upgrading our application from Grails 2.2.4 to 2.3.4 and everything seems to go quite easy. The only thing that is driving me nuts is that I can't run a Tests or a Spec class (or a collection of them) using the JUnit runner within IDEA (both version 12 and 13).
I get this exception:
Class not found: "test.PersonControllerSpec"
Process finished with exit code 1
I can "make" the project successfully and I can run the tests using the Grails runner too.
Seems like IDEA doesn't compile the test code or something like that.
Funnily it works like a charm in STS so it can't come from Grails.
Here is the full target ... might help:
Z:\dev\frameworks\jdk1.7.0_45\bin\java -ea -Didea.launcher.port=7532 "-Didea.launcher.bin.path=Z:\dev\tools\IntelliJ IDEA 13.0\bin" -Dfile.encoding=UTF-8 -classpath "Z:\dev\tools\IntelliJ IDEA 13.0\lib\idea_rt.jar;Z:\dev\tools\IntelliJ IDEA 13.0\plugins\junit\lib\junit-rt.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\charsets.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\deploy.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\javaws.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\jce.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\jfr.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\jfxrt.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\jsse.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\management-agent.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\plugin.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\resources.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\rt.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\ext\access-bridge-64.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\ext\dnsns.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\ext\jaccess.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\ext\localedata.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\ext\sunec.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\ext\sunjce_provider.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\ext\sunmscapi.jar;Z:\dev\frameworks\jdk1.7.0_45\jre\lib\ext\zipfs.jar;Z:\dev\code\Test\out\test\Test;Z:\dev\code\Test\out\production\Test;C:\Users\Nico.m2\repository\org\liquibase\liquibase-core\2.0.5\liquibase-core-2.0.5.jar;C:\Users\Nico.m2\repository\org\eclipse\jdt\core\compiler\ecj\3.7.2\ecj-3.7.2.jar;C:\Users\Nico.m2\repository\bouncycastle\bcprov-jdk14\138\bcprov-jdk14-138.jar;C:\Users\Nico.m2\repository\org\javassist\javassist\3.16.1-GA\javassist-3.16.1-GA.jar;C:\Users\Nico.m2\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;C:\Users\Nico.m2\repository\org\grails\grails-datastore-web\1.1.9.RELEASE\grails-datastore-web-1.1.9.RELEASE.jar;C:\Users\Nico.m2\repository\org\springframework\data\spring-data-mongodb\1.2.1.RELEASE\spring-data-mongodb-1.2.1.RELEASE.jar;C:\Users\Nico.m2\repository\org\mongodb\mongo-java-driver\2.11.1\mongo-java-driver-2.11.1.jar;C:\Users\Nico.m2\repository\javax\activation\activation\1.1\activation-1.1.jar;C:\Users\Nico.m2\repository\javax\mail\mail\1.4.3\mail-1.4.3.jar;C:\Users\Nico.m2\repository\org\mozilla\rhino\1.7R4\rhino-1.7R4.jar;C:\Users\Nico.m2\repository\xml-apis\xml-apis\1.4.01\xml-apis-1.4.01.jar;C:\Users\Nico.m2\repository\com\google\guava\guava\14.0\guava-14.0.jar;C:\Users\Nico.m2\repository\org\json\json\20080701\json-20080701.jar;C:\Users\Nico.m2\repository\org\grails\grails-datastore-mongo\1.3.0.RELEASE\grails-datastore-mongo-1.3.0.RELEASE.jar;C:\Users\Nico.m2\repository\org\grails\grails-datastore-gorm-plugin-support\1.1.9.RELEASE\grails-datastore-gorm-plugin-support-1.1.9.RELEASE.jar;C:\Users\Nico.m2\repository\org\springframework\data\spring-data-commons-core\1.4.1.RELEASE\spring-data-commons-core-1.4.1.RELEASE.jar;C:\Users\Nico.m2\repository\org\springframework\data\spring-data-commons\1.5.1.RELEASE\spring-data-commons-1.5.1.RELEASE.jar;C:\Users\Nico.m2\repository\org\grails\grails-datastore-gorm-mongo\1.3.0.RELEASE\grails-datastore-gorm-mongo-1.3.0.RELEASE.jar;C:\Users\Nico.m2\repository\com\gmongo\gmongo\1.2\gmongo-1.2.jar;C:\Users\Nico.m2\repository\org\apache\httpcomponents\httpcore\4.2.1\httpcore-4.2.1.jar;C:\Users\Nico.m2\repository\org\apache\httpcomponents\httpclient\4.2.1\httpclient-4.2.1.jar;C:\Users\Nico.m2\repository\org\seleniumhq\selenium\selenium-api\2.35.0\selenium-api-2.35.0.jar;C:\Users\Nico.m2\repository\cglib\cglib-nodep\2.1_3\cglib-nodep-2.1_3.jar;C:\Users\Nico.m2\repository\org\seleniumhq\selenium\selenium-remote-driver\2.35.0\selenium-remote-driver-2.35.0.jar;C:\Users\Nico.m2\repository\asm\asm-tree\3.0\asm-tree-3.0.jar;C:\Users\Nico.m2\repository\net\sourceforge\cobertura\cobertura\1.9.4.1\cobertura-1.9.4.1.jar;C:\Users\Nico.m2\repository\org\gmetrics\GMetrics\0.5\GMetrics-0.5.jar;C:\Users\Nico.m2\repository\org\codenarc\CodeNarc\0.19\CodeNarc-0.19.jar;C:\Users\Nico.m2\repository\org\seleniumhq\selenium\selenium-support\2.35.0\selenium-support-2.35.0.jar;C:\Users\Nico.m2\repository\io\netty\netty\3.5.2.Final\netty-3.5.2.Final.jar;C:\Users\Nico.m2\repository\org\webbitserver\webbit\0.4.14\webbit-0.4.14.jar;C:\Users\Nico.m2\repository\org\seleniumhq\selenium\selenium-safari-driver\2.35.0\selenium-safari-driver-2.35.0.jar;C:\Users\Nico.m2\repository\org\seleniumhq\selenium\selenium-android-driver\2.35.0\selenium-android-driver-2.35.0.jar;C:\Users\Nico.m2\repository\org\seleniumhq\selenium\selenium-iphone-driver\2.35.0\selenium-iphone-driver-2.35.0.jar;C:\Users\Nico.m2\repository\org\seleniumhq\selenium\selenium-ie-driver\2.35.0\selenium-ie-driver-2.35.0.jar;C:\Users\Nico.m2\repository\org\seleniumhq\selenium\selenium-chrome-driver\2.35.0\selenium-chrome-driver-2.35.0.jar;C:\Users\Nico.m2\repository\org\seleniumhq\selenium\selenium-firefox-driver\2.35.0\selenium-firefox-driver-2.35.0.jar;C:\Users\Nico.m2\repository\org\eclipse\jetty\jetty-http\8.1.9.v20130131\jetty-http-8.1.9.v20130131.jar;C:\Users\Nico.m2\repository\org\eclipse\jetty\jetty-io\8.1.9.v20130131\jetty-io-8.1.9.v20130131.jar;C:\Users\Nico.m2\repository\org\eclipse\jetty\jetty-util\8.1.9.v20130131\jetty-util-8.1.9.v20130131.jar;C:\Users\Nico.m2\repository\org\eclipse\jetty\jetty-websocket\8.1.9.v20130131\jetty-websocket-8.1.9.v20130131.jar;C:\Users\Nico.m2\repository\org\w3c\css\sac\1.3\sac-1.3.jar;C:\Users\Nico.m2\repository\net\sourceforge\cssparser\cssparser\0.9.9\cssparser-0.9.9.jar;C:\Users\Nico.m2\repository\net\sourceforge\nekohtml\nekohtml\1.9.18\nekohtml-1.9.18.jar;C:\Users\Nico.m2\repository\xerces\xercesImpl\2.10.0\xercesImpl-2.10.0.jar;C:\Users\Nico.m2\repository\net\sourceforge\htmlunit\htmlunit-core-js\2.12\htmlunit-core-js-2.12.jar;C:\Users\Nico.m2\repository\org\apache\httpcomponents\httpmime\4.2.3\httpmime-4.2.3.jar;C:\Users\Nico.m2\repository\org\apache\commons\commons-lang3\3.1\commons-lang3-3.1.jar;C:\Users\Nico.m2\repository\xalan\xalan\2.7.1\xalan-2.7.1.jar;C:\Users\Nico.m2\repository\net\sourceforge\htmlunit\htmlunit\2.12\htmlunit-2.12.jar;C:\Users\Nico.m2\repository\org\seleniumhq\selenium\selenium-htmlunit-driver\2.35.0\selenium-htmlunit-driver-2.35.0.jar;C:\Users\Nico.m2\repository\net\java\dev\jna\platform\3.4.0\platform-3.4.0.jar;C:\Users\Nico.m2\repository\net\java\dev\jna\jna\3.4.0\jna-3.4.0.jar;C:\Users\Nico.m2\repository\org\apache\commons\commons-exec\1.1\commons-exec-1.1.jar;C:\Users\Nico.m2\repository\net\sf\ehcache\ehcache-core\2.4.6\ehcache-core-2.4.6.jar;C:\Users\Nico.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\7.0.42\tomcat-embed-core-7.0.42.jar;C:\Users\Nico.m2\repository\org\apache\tomcat\embed\tomcat-embed-jasper\7.0.42\tomcat-embed-jasper-7.0.42.jar;C:\Users\Nico.m2\repository\org\apache\tomcat\tomcat-catalina-ant\7.0.42\tomcat-catalina-ant-7.0.42.jar;C:\Users\Nico.m2\repository\joda-time\joda-time\2.3\joda-time-2.3.jar;C:\Users\Nico.m2\repository\org\apache\tomcat\embed\tomcat-embed-logging-log4j\7.0.42\tomcat-embed-logging-log4j-7.0.42.jar;C:\Users\Nico.m2\repository\org\spockframework\spock-grails-support\0.7-groovy-2.0\spock-grails-support-0.7-groovy-2.0.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-aether-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-async-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-bootstrap-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-core-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-databinding-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-docs-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-logging-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-async-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-codecs-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-controllers-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-converters-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-databinding-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-datasource-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-domain-class-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-filters-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-gsp-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-i18n-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-log4j-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-mimetypes-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-rest-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-services-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-servlets-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-testing-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-url-mappings-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-plugin-validation-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-resources-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-scripts-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-spring-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-test-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-web-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-wrapper-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\dist\grails-wrapper-support-2.3.4.jar;Z:\dev\frameworks\grails-2.3.4\lib\aopalliance\aopalliance\jars\aopalliance-1.0.jar;Z:\dev\frameworks\grails-2.3.4\lib\asm\asm\jars\asm-3.3.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\bouncycastle\bcmail-jdk14\jars\bcmail-jdk14-138.jar;Z:\dev\frameworks\grails-2.3.4\lib\bouncycastle\bcprov-jdk14\jars\bcprov-jdk14-138.jar;Z:\dev\frameworks\grails-2.3.4\lib\cglib\cglib\jars\cglib-2.2.2.jar;Z:\dev\frameworks\grails-2.3.4\lib\com.google.code.findbugs\jsr305\jars\jsr305-1.3.9.jar;Z:\dev\frameworks\grails-2.3.4\lib\com.google.code.gson\gson\jars\gson-2.2.4.jar;Z:\dev\frameworks\grails-2.3.4\lib\com.google.guava\guava\jars\guava-10.0.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\com.google.protobuf\protobuf-java\jars\protobuf-java-2.5.0.jar;Z:\dev\frameworks\grails-2.3.4\lib\com.googlecode.concurrentlinkedhashmap\concurrentlinkedhashmap-lru\jars\concurrentlinkedhashmap-lru-1.3.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\com.googlecode.json-simple\json-simple\jars\json-simple-1.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\com.h2database\h2\jars\h2-1.3.173.jar;Z:\dev\frameworks\grails-2.3.4\lib\com.lowagie\itext\jars\itext-2.0.8.jar;Z:\dev\frameworks\grails-2.3.4\lib\commons-beanutils\commons-beanutils\jars\commons-beanutils-1.8.3.jar;Z:\dev\frameworks\grails-2.3.4\lib\commons-cli\commons-cli\jars\commons-cli-1.2.jar;Z:\dev\frameworks\grails-2.3.4\lib\commons-codec\commons-codec\jars\commons-codec-1.6.jar;Z:\dev\frameworks\grails-2.3.4\lib\commons-collections\commons-collections\jars\commons-collections-3.2.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\commons-el\commons-el\jars\commons-el-1.0.jar;Z:\dev\frameworks\grails-2.3.4\lib\commons-fileupload\commons-fileupload\jars\commons-fileupload-1.2.2.jar;Z:\dev\frameworks\grails-2.3.4\lib\commons-io\commons-io\jars\commons-io-2.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\commons-lang\commons-lang\jars\commons-lang-2.6.jar;Z:\dev\frameworks\grails-2.3.4\lib\commons-validator\commons-validator\jars\commons-validator-1.3.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\hsqldb\hsqldb\jars\hsqldb-1.8.0.10.jar;Z:\dev\frameworks\grails-2.3.4\lib\javax.annotation\jsr250-api\jars\jsr250-api-1.0.jar;Z:\dev\frameworks\grails-2.3.4\lib\javax.enterprise\cdi-api\jars\cdi-api-1.0.jar;Z:\dev\frameworks\grails-2.3.4\lib\javax.inject\javax.inject\jars\javax.inject-1.jar;Z:\dev\frameworks\grails-2.3.4\lib\javax.servlet\javax.servlet-api\jars\javax.servlet-api-3.0.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\javax.servlet\jsp-api\jars\jsp-api-2.0.jar;Z:\dev\frameworks\grails-2.3.4\lib\javax.servlet\jstl\jars\jstl-1.1.2.jar;Z:\dev\frameworks\grails-2.3.4\lib\javax.servlet.jsp\jsp-api\jars\jsp-api-2.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\javax.transaction\jta\jars\jta-1.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\jline\jline\jars\jline-2.11.jar;Z:\dev\frameworks\grails-2.3.4\lib\junit\junit\jars\junit-4.11.jar;Z:\dev\frameworks\grails-2.3.4\lib\log4j\log4j\jars\log4j-1.2.17.jar;Z:\dev\frameworks\grails-2.3.4\lib\net.java.dev.jna\jna\jars\jna-4.0.0.jar;Z:\dev\frameworks\grails-2.3.4\lib\opensymphony\sitemesh\jars\sitemesh-2.4.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.apache.ant\ant\jars\ant-1.8.4.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.apache.ant\ant-junit\jars\ant-junit-1.8.4.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.apache.ant\ant-launcher\jars\ant-launcher-1.8.4.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.apache.ant\ant-trax\jars\ant-trax-1.7.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.apache.httpcomponents\httpclient\jars\httpclient-4.2.5.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.apache.httpcomponents\httpcore\jars\httpcore-4.2.4.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.apache.ivy\ivy\jars\ivy-2.3.0.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.apache.maven\maven-aether-provider\jars\maven-aether-provider-3.1.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.apache.maven\maven-model\jars\maven-model-3.1.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.apache.maven\maven-model-builder\jars\maven-model-builder-3.1.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.apache.maven\maven-repository-metadata\jars\maven-repository-metadata-3.1.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.apache.maven\maven-settings\jars\maven-settings-3.1.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.apache.maven\maven-settings-builder\jars\maven-settings-builder-3.1.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.apache.tomcat\tomcat-jdbc\jars\tomcat-jdbc-7.0.47.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.apache.tomcat.embed\tomcat-embed-logging-log4j\jars\tomcat-embed-logging-log4j-7.0.47.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.aspectj\aspectjrt\jars\aspectjrt-1.7.2.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.aspectj\aspectjweaver\jars\aspectjweaver-1.7.2.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.bouncycastle\bcpg-jdk15\jars\bcpg-jdk15-1.45.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.bouncycastle\bcprov-jdk15\jars\bcprov-jdk15-1.45.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.codehaus.gant\gant_groovy1.8\jars\gant_groovy1.8-1.9.6.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.codehaus.gpars\gpars\jars\gpars-1.1.0.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.codehaus.groovy\groovy-all\jars\groovy-all-2.1.9.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.codehaus.jsr166-mirror\jsr166y\jars\jsr166y-1.7.0.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.codehaus.plexus\plexus-classworlds\jars\plexus-classworlds-2.4.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.codehaus.plexus\plexus-component-annotations\jars\plexus-component-annotations-1.5.5.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.codehaus.plexus\plexus-interpolation\jars\plexus-interpolation-1.19.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.codehaus.plexus\plexus-utils\jars\plexus-utils-3.0.15.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.eclipse.aether\aether-api\jars\aether-api-0.9.0.M3.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.eclipse.aether\aether-connector-basic\jars\aether-connector-basic-0.9.0.M3.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.eclipse.aether\aether-connector-file\jars\aether-connector-file-0.9.0.M2.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.eclipse.aether\aether-impl\jars\aether-impl-0.9.0.M3.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.eclipse.aether\aether-spi\jars\aether-spi-0.9.0.M3.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.eclipse.aether\aether-transport-file\jars\aether-transport-file-0.9.0.M3.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.eclipse.aether\aether-transport-http\jars\aether-transport-http-0.9.0.M3.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.eclipse.aether\aether-util\jars\aether-util-0.9.0.M3.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.eclipse.sisu\org.eclipse.sisu.inject\jars\org.eclipse.sisu.inject-0.0.0.M5.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.eclipse.sisu\org.eclipse.sisu.plexus\jars\org.eclipse.sisu.plexus-0.0.0.M5.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.fusesource.jansi\jansi\jars\jansi-1.11.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.grails\grails-datastore-core\jars\grails-datastore-core-2.0.6.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.grails\grails-datastore-gorm\jars\grails-datastore-gorm-2.0.6.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.grails\grails-datastore-simple\jars\grails-datastore-simple-2.0.6.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.grails\grails-gdoc-engine\jars\grails-gdoc-engine-1.0.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.hamcrest\hamcrest-core\jars\hamcrest-core-1.3.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.hibernate.javax.persistence\hibernate-jpa-2.0-api\jars\hibernate-jpa-2.0-api-1.0.1.Final.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.javassist\javassist\jars\javassist-3.17.1-GA.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.multiverse\multiverse-core\jars\multiverse-core-0.7.0.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.objenesis\objenesis\jars\objenesis-1.4.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.slf4j\jcl-over-slf4j\jars\jcl-over-slf4j-1.7.5.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.slf4j\jul-to-slf4j\jars\jul-to-slf4j-1.7.5.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.slf4j\slf4j-api\jars\slf4j-api-1.7.5.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.slf4j\slf4j-simple\jars\slf4j-simple-1.7.5.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.sonatype.plexus\plexus-cipher\jars\plexus-cipher-1.4.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.sonatype.plexus\plexus-sec-dispatcher\jars\plexus-sec-dispatcher-1.3.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.sonatype.sisu\sisu-guice\jars\sisu-guice-3.1.0-no_aop.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.spockframework\spock-core\jars\spock-core-0.7-groovy-2.0.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.springframework\spring-aop\jars\spring-aop-3.2.5.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.springframework\spring-aspects\jars\spring-aspects-3.2.5.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.springframework\spring-beans\jars\spring-beans-3.2.5.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.springframework\spring-context\jars\spring-context-3.2.5.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.springframework\spring-context-support\jars\spring-context-support-3.2.5.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.springframework\spring-core\jars\spring-core-3.2.5.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.springframework\spring-expression\jars\spring-expression-3.2.5.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.springframework\spring-jdbc\jars\spring-jdbc-3.2.5.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.springframework\spring-jms\jars\spring-jms-3.2.5.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.springframework\spring-test\jars\spring-test-3.2.5.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.springframework\spring-tx\jars\spring-tx-3.2.5.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.springframework\spring-web\jars\spring-web-3.2.5.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.springframework\spring-webmvc\jars\spring-webmvc-3.2.5.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.springframework.uaa\org.springframework.uaa.client\jars\org.springframework.uaa.client-1.0.1.RELEASE.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.springsource.springloaded\springloaded-core\jars\springloaded-core-1.1.4.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.xhtmlrenderer\core-renderer\jars\core-renderer-R8.jar;Z:\dev\frameworks\grails-2.3.4\lib\org.yaml\snakeyaml\jars\snakeyaml-1.8.jar;Z:\dev\frameworks\grails-2.3.4\lib\oro\oro\jars\oro-2.0.8.jar;Z:\dev\frameworks\grails-2.3.4\lib\taglibs\standard\jars\standard-1.1.2.jar;Z:\dev\frameworks\grails-2.3.4\lib\xalan\serializer\jars\serializer-2.7.1.jar;Z:\dev\frameworks\grails-2.3.4\lib\xpp3\xpp3_min\jars\xpp3_min-1.1.4c.jar" com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 test.PersonControllerSpec
I believe I have discovered the problem. Look at the folder designation type. My IntelliJ12 project file marked the "test root" as "test resources root" and I was not paying close enough attention. Remove the "Mark Directory As" and set as "Test Root". I am now able to run Groovy test cases