while running the test-app command , i only get the below Test Case summary report if i REMOVE the xalan-2.4.0 from Lib directory in grails project.
Tests with failure and errors
Package summary
Show all tests
Can anyone suggest me what will be the reason behind that ?
Related
I downloaded EclEmma 2.3.3 from Eclipse Marketplace to my Kepler Service Release 2. I ran a JUnit test with the test coverage option, but am getting the following error:
Error while loading coverage session (code 5001).
Error while analyzing package fragment root java at F/xxx/target/test-classes (code 5007).
Error while analyzing XXXClass.class.
I am able to run maven build and test within Eclipse with the Maven plugin and can also run tests as JUnit tests. The XXXClass file is not related to the test I ran the coverage on.
I upgraded to IDEA 14 (from 13) and when I attempt to run my grails 2.2.0 application, I am getting the following error:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/gdboling/Projects/GenRocket/web/build.gradle' line: 92
* What went wrong:
A problem occurred evaluating root project 'web'.
> No such property: environment for class: org.gradle.api.internal.project.DefaultProject_Decorated
It would seem that IDEA is attempting to use my build.gradle as part of the grails build process. IDEA 13 didn't do this. I use the build.gradle for some other non-grails related tasks for the project.
If I remove the build.gradle file all together, I get this error:
FAILURE: Build failed with an exception.
* What went wrong:
Task 'grails-run-app' not found in root project 'web'.
* Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I do see the Grails View in the IDE but when I try and do a Make, it is telling me to re-import the gradle project. So it would seem that IntelliJ think this is a gradle project. How I can tell it that is is just a grails project?
To confirm my suspicions, I've opened a grails project that did not contain a build.gradle and it works just fine.
I had faced similar issue when unknowingly kept on hit next next in hurry. So, you probably mistakenly created a gradle project as shown in screenshot.
And when you recreated the project created it as "Create project from existing source" which idea well knows as grails-app (default for idea).
See if you can reproduce the error by re-importing the project using import project form external module.
I have the following dependency declaration in BuildConfig.groovy:
plugins {
test ':build-test-data:2.2.1'
test ':fixtures:1.3'
}
I've already run refresh-dependencies on both the terminal, and my IDE (Eclipse) but every time I run the test I get:
grails.plugin.fixtures.exception.FixtureException: build feature is unavailable as build-test-data plugin is not installed
at grails.plugin.fixtures.builder.FixtureBuilder.assertBuildTestDataPluginInstalledIfNeeded(FixtureBuilder.groovy:135)
at grails.plugin.fixtures.builder.FixtureBuilder.beans(FixtureBuilder.groovy:104)
at grails.plugin.fixtures.builder.FixtureBuilder.build(FixtureBuilder.groovy:82)
at grails.plugin.fixtures.Fixture.build(Fixture.groovy:48)
at grails.plugin.fixtures.FixtureLoader.build(FixtureLoader.groovy:54)
I checked the FixtureBuilder code, and found the following line:
Holders.pluginManager.hasGrailsPlugin('build-test-data')
I created a separate test to check what this line returns, but no matter what plugin (declared in BuildConfig.groovy) I replace 'build-test-data' with, it always returns false.
How do I fix this?
In BuildConfig there are four possible options to configure a plugin:
build
compile
runtime
test
Fixture and Build plugins are configured to be use in test you should to change it to runtime to use them in BootStrap when running the app.
Lately I've been trying to run my spock tests in IntelliJ (which used to work beautifully and had great debugging / specific test re-running on failure features) and in the past few months I've began getting the following error:
| Error Error executing script TestApp:
(class: com/company/MyServiceSpec, method: super$2$oldImpl signature:
(Ljava/lang/Object;)Ljava/lang/Object;)
Illegal use of nonvirtual function call (Use --stacktrace to see the full trace)
It's a spock test that runs just fine from the command line, individually (by specifying the class) or in the entire test-app series. Virtually all of the spock and plain old Unit or Integration tests I have on this project give similar failures in IntelliJ.
I've tried twiddling with the run features of the test (having classpath on or off, running an individual method, a whole test class, or the entire test series) with no luck to remedying the situation. I've also done a grails clean and tried re-running them from IntelliJ : that looked as if it worked once and I was able to run the tests for a little while, but then quickly after doing some work the problem now persists.
I know this is a bit of a vague question, but has anyone seen similar failures and found a reliable remedy? I'm on Grails 2.1 and Spock 0.7, same problem in both IntelliJ 12 and 13
I managed to solve this problem adding the following env variable in my configuration:
_JAVA_OPTIONS='-Xverify:none'
First check your configurations and clear out the test that you have ran that are now failing. It is possible you ran the tests as JUnit and now when you are running them again them they are defaulting this behavior.
Note: You can determine if this the issue by running your tests via the command line (e.g. grails test-app unit com.yourPackage.Whatever) if they pass as expected then follow the steps below to clear your saved test configurations in IntelliJ
IntelliJ Steps
Click Run
Click Edit Configurations
In the left pane of the pop up click the arrow to unroll the jUnit tests
Next Click on a test and then click the minus icon ( do this for each to clear them all )
Go to your test you want to run and right click it and make sure you select the grails choice and not jUnit.
Does anybody know if there is a way to debug integration tets using the built in functionality of Spring STS ?
I don't know if this is what you meant, but you can right click on your test file in the project explorer and then select Debug As -> Grails Command (test-app). This will load grails and run your test in debug mode.
What I haven't figured out is how to re-run the test through the JUnit view, once the test has been run once. It keeps throwing a warning saying that tests must be run in debug mode and that I need to have "Keep Junit running" in the launch configuration. There is no such setting for integration tests and I suspect that it might be because the framework gets reloaded on every test run.
there is an open issue....
https://issuetracker.springsource.com/browse/STS-551
but there appears to be a work around
http://www.pubbs.net/201003/grails/8778-re-grails-user-how-to-debug-in-sts.html