Grails 1.3.3 and Functional Test plugin 1.2.7 issues - grails

Has anyone had any trouble getting Functional Test plugin working in Grails 1.3.3? I've used it in previous projects with no problem, but just tried installing it into my latest project with no luck.
Installation seems to go fine.
Running the script: grails create-functional-test XXXXX results in no test file. Here's the output:
Running script /Users/dan/.grails/1.3.3/projects/connect/plugins/functional-test-1.2.7/scripts/CreateFunctionalTest.groovy
Environment set to development
[copy] Copying 1 resource to /Users/dan/dev/code/sterling/applications/grails/connect/trunk/connect
[unjar] Expanding: /Users/dan/dev/code/sterling/applications/grails/connect/trunk/connect/grails-shared-files.jar into /Users/dan/dev/code/sterling/applications/grails/connect/trunk/connect
[delete] Deleting: /Users/dan/dev/code/sterling/applications/grails/connect/trunk/connect/grails-shared-files.jar
[copy] Copying 1 resource to /Users/dan/dev/code/sterling/applications/grails/connect/trunk/connect
[unjar] Expanding: /Users/dan/dev/code/sterling/applications/grails/connect/trunk/connect/grails-app-files.jar into /Users/dan/dev/code/sterling/applications/grails/connect/trunk/connect
[delete] Deleting: /Users/dan/dev/code/sterling/applications/grails/connect/trunk/connect/grails-app-files.jar
I tried creating a test script by had and pasted in the demo Twitter search test from the plugin page. It failed as well. Here's the error and stack trace:
functionaltestplugin.FunctionalTestException: TypeError: Cannot find function forEach in object twttr,Observer. (FunctionalTestCase.groovy#752)
junit.framework.AssertionFailedError: functionaltestplugin.FunctionalTestException: TypeError: Cannot find function forEach in object twttr,Observer. (FunctionalTestCase.groovy#752)
at functionaltestplugin.FunctionalTestCase.invokeMethod(FunctionalTestCase.groovy:205)
at functionaltestplugin.FunctionalTestCase.get(FunctionalTestCase.groovy:526)
at functionaltestplugin.FunctionalTestCase.invokeMethod(FunctionalTestCase.groovy:201)
at functionaltestplugin.FunctionalTestCase.get(FunctionalTestCase.groovy)
at functionaltestplugin.FunctionalTestCase.invokeMethod(FunctionalTestCase.groovy:201)
at functionaltestplugin.FunctionalTestCase.doFollowRedirect(FunctionalTestCase.groovy:309)
at functionaltestplugin.FunctionalTestCase.invokeMethod(FunctionalTestCase.groovy:201)
at functionaltestplugin.FunctionalTestCase.handleRedirects(FunctionalTestCase.groovy:496)
at functionaltestplugin.FunctionalTestCase.invokeMethod(FunctionalTestCase.groovy:201)
at functionaltestplugin.FunctionalTestCase.makeRequest(FunctionalTestCase.groovy:490)
at functionaltestplugin.FunctionalTestCase.invokeMethod(FunctionalTestCase.groovy:201)
at functionaltestplugin.FunctionalTestCase.get(FunctionalTestCase.groovy:526)
at functionaltestplugin.FunctionalTestCase.invokeMethod(FunctionalTestCase.groovy:201)
at functionaltestplugin.FunctionalTestCase.get(FunctionalTestCase.groovy)
at functionaltestplugin.FunctionalTestCase.invokeMethod(FunctionalTestCase.groovy:201)
at AccessControlTests.testSearch(AccessControlTests.groovy:3)
Thoughts?
Thanks,
Dan

Yes there is a bug with the functional test plugin with grails 1.3.x that according to Marc Palmer is being fixed now http://grails.1312388.n4.nabble.com/Functional-Test-plugin-doesn-t-work-td2265500.html
I tried installing the 1.3 version of the plugin but there were dependency issues.
The errors above are probably due to a lack of imports, maybe?

Related

Grails 1.3.4 plugin downloading issues

I am running application on grails 1.3.4 but I am getting this error while running applicaton.
Base Directory: /projects/upwork/jhon/jbilling-community-3.1.0_2
WARNING: Configurational method [inherits] in grails-app/conf/BuildConfig.groovy doesn't exist. Ignoring..
Resolving dependencies...
Dependencies resolved in 804ms.
Running script /apps/grails-1.3.4/scripts/RunApp.groovy
Environment set to development
Plugin [release-2.2.1] not installed. ...
Plugin [release-1.0.0] not installed. ...
Plugin [rest-client-builder-1.0.3] not installed. ...
Resolving new plugins. Please wait... ...
Installing zip /Users/bilalshah/.ivy2/cache/org.grails.plugins/release/zips/release-2.2.1.zip... ...
[mkdir] Created dir: /Users/bilalshah/.grails/1.3.4/projects/jbilling-community-3.1.0_2/plugins/release-2.2.1
[unzip] Expanding: /Users/bilalshah/.ivy2/cache/org.grails.plugins/release/zips/release-2.2.1.zip into /Users/bilalshah/.grails/1.3.4/projects/jbilling-community-3.1.0_2/plugins/release-2.2.1
Installed plugin release-2.2.1 to location /Users/bilalshah/.grails/1.3.4/projects/jbilling-community-3.1.0_2/plugins/release-2.2.1. ...
Plugin release-2.2.1 requires version [2.0 > *] of Grails which your current Grails installation does not meet. Please try install a different version of the plugin or Grails.
[delete] Deleting directory /Users/bilalshah/.grails/1.3.4/projects/jbilling-community-3.1.0_2/plugins/release-2.2.1
Process finished with exit code 1
I haven't mentioned any plugin named above in my application.properties file. Here it is:
#Grails Metadata file
#Wed Jun 15 19:34:11 PKT 2016
app.grails.version=1.3.4
app.name=jbilling
app.servlet.version=2.4
app.version=community-3.1.0
plugins.cookie=0.2
plugins.cxf=0.5.1
plugins.hibernate=1.3.4
plugins.include=0.3
plugins.jquery=1.11.1
plugins.jquery-ui=1.8.7
plugins.log4j-xml=0.2
plugins.remote-pagination=0.2.4
plugins.remoting=1.1
plugins.spring-security-core=1.0.1
plugins.tomcat=1.3.4
plugins.webflow=1.3.8
Can anyone let me know why it is happening and its solution.

Grails 3 scaffolding issue

I'm trying to port my project from Grails 2.4 to 3.0. Nothing fancy: 12 Domains, 13 Controllers and a service.
Everything works fine, except when I try to include the Scaffolding plugin. I literally follow the manual here, but the syntax must be wrong. Adding the plugin line as specified:
plugins {
…
compile ":scaffolding:2.0.0"
…
}
leads to this:
BUILD FAILED
Total time: 1.559 secs
| Error Error initializing classpath: startup failed:
build file 'E:\GrailsIdeaProjects\HcaServer\build.gradle': 17: only id(String) method calls allowed in plugins {} script block
See http://gradle.org/docs/2.3/userguide/plugins.html#sec:plugins_block for information on the plugins {} block
# line 17, column 5.
compile ":scaffolding:2.0.0"
^
1 error
(Use --stacktrace to see the full trace)
Somebody knows the right syntax to include the Scaffolding plugin in Grails 3?
EDIT: Thanks to Casey for pointing me in the right direction: Scaffolding plugin is actually already included in default build.gradle. Anyway, i still get a webpage like this on every controller:
Error: Page Not Found (404)
Path: /*controllerName*/index
I've been using the same syntax as per the manual, declaring a static scaffold = true on each controller. Why do I get a 404 page then? I do have index.gsp, error.gsp and notFound.gsp in my views folder.
It looks like that documentation hasn't been updated for Grails 3.0 yet. Your build.gradle file should have a dependencies block, where you can specify the dependency:
dependencies {
// ...
runtime "org.grails.plugins:scaffolding"
}
You can also see this by creating a new app using Grails 3.0 and checking out the default build.gradle file.
After researching for a while, turns out dynamic scaffolding hasn't made it yet into Grails 3:
https://groups.google.com/forum/m/#!topic/grails-dev-discuss/6R2YaF96Uts
Try this, It works for me.
dependencies {
compile "org.grails.plugins:scaffolding"
}
I am using grails 3.09.

forked execution breaks includeTargets in Grails _Events.groovy plugin

seem to have more stupid issues with forked Execution in grails than anything else
using grails 2.4.4 on GGTS 3.6.3, groovy 2.3.7, 64bit
trying to repair another plugin (its out of date and i'm trying to fixit). had problems. pared all back to a simple plugin and demo project that includes the plugin from the local workspace
in DemoProject I do the local include of the plugin like this in buildConfig.groovy
grails.plugin.location.DummyPlugin = "../DummyPlugin"
so far so good. without adding an _Events.grooy and running the DemoProject all starts ok and plugin loads.
now add an _Events.groovy to the plugins /script folder. In that file I have this line right at top
import grails.util.BuildSettingsHolder as build
import groovy.xml.MarkupBuilder
includeTargets << grailsScript("_GrailsPackage")
now when you run the demo project you get an error like this
|Running Grails application
Error |
Error loading event script from file [E:\workspace\ggts3.6.2-workspace\DummyPlugin\scripts\_Events.groovy] No such property: classLoader for class: java.lang.Object (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
groovy.lang.MissingPropertyException: No such property: classLoader for class: java.lang.Object
at grails.util.BuildSettings$1.doCall(BuildSettings.groovy:409)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
at _Events.run(_Events.groovy:29)
at org.grails.plugins.tomcat.fork.ForkedTomcatServer.createEventListener(ForkedTomcatServer.groovy:147)
at org.grails.plugins.tomcat.fork.ForkedTomcatServer.createTomcatRunner(ForkedTomcatServer.groovy:104)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
at org.grails.plugins.tomcat.fork.ForkedTomcatServer.runInternal(ForkedTomcatServer.groovy:82)
at org.grails.plugins.tomcat.fork.ForkedTomcatServer.run(ForkedTomcatServer.groovy:66)
at org.grails.plugins.tomcat.fork.ForkedTomcatServer$run.call(Unknown Source)
at org.grails.plugins.tomcat.fork.ForkedTomcatServer.main(ForkedTomcatServer.groovy:60)
Error |
Error loading event script from file [E:\workspace\ggts3.6.2-workspace\DummyPlugin\scripts\_Events.groovy] No such property: classLoader for class: java.lang.Object
|Server running. Browse to http://localhost:8080/DemoDummyProject
if you got back to the DemoProject and stopped forked Execection by setting grails.project.fork =[] and run again it all works fine - no errors.
so essentially forked execution screws up the plugins includeTargets action.
how do you fix this whilst std forked config is now enabled as default - any clues? advice requested

The rule 'OCLint:ivar assignment outside accessors or init' does not exist

I am trying to integrate SonarQube to generate report on my iOS project,
I am using Objective-C Sonar plugin
When i run ./run-sonar.sh
OCLint generates a compile_commands.json file in my root directory.
and after that getting following error
11:24:39.782 INFO - Processing OCLint report /Users/.......app/./sonar-reports/oclint.xml
11:24:39.899 ERROR - Reporting 1073 violations.
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 16.240s
Final Memory: 6M/86M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: The rule 'OCLint:ivar assignment outside accessors or init' does not exist.
Can any one help me on this issue?
Thanks
AMR
Thnaks
I had a similar error. My sonar server had two objective-c code analyser plugin. The Sonar Plugin for Objective C (free) and SonarSource Objective-C plugin (commercial)
When I removed (uninstalled) one of the plugin from sonar server the error stopped to occur
I had a similar error too with the last version of this plugin which is a fork of the one you used.
I downgrade my OCLint version from 0.11 to 0.10.1 and everything work perfectly.
It seems that the OCLint rules defined in the plugin was different of the OCLint version installed on my server.
I am not sure what version of the objective-c-sonar plugin that you were using.
I solved similar issue before.
Goto ${SONAR_INSTALLATION_FOLDER}/extensions/plugins/, copy the sonar-objective-c-plugin-${version}.jar to somewhere else.
unzip the jar file, and edit below file
org/sonar/plugins/objectivec/profile-oclint.xml
Add the rule you are missing following the layout of the xml file,
may be look similar below
<rule>
<repositoryKey>OCLint</repositoryKey>
<key>ivar assignment outside accessors or init</key>
</rule>
And edit another file org/sonar/plugins/objectivec/rules-oclint.xml
<rule>
<key>ivar assignment outside accessors or init</key>
<name>ivar assignment outside accessors or init</name>
<priority>MAJOR</priority>
<description>ivar assignment outside accessors or init</description>
</rule>
And then using zip to package the files unpacked as the new jar file.
Override the original plugin jar file in ${SONAR_INSTALLATION_FOLDER}/extensions/plugins/, restart the sonar, issue could be gone.
Repeat the step for all similar issues you encountered.

grails ui plugin not working with grails 2.1.0

I wanted to test some of the features like expandablePannels etc before putting into another project, so I created a new project with a CRUD just so I can use grails ui
I am using Intellij 11, so I installed the plugin and was responded with the following error:
Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- org.grails.plugins:yui:[2.6.0,)
IDEA hook: Grails not found!
| Error java.lang.NullPointerException
| Error at org.jetbrains.groovy.grails.rt.Agent$2.run(Agent.java:99)
| Error at java.lang.Thread.run(Thread.java:680)
Anyone else having issues using this plugin ?
Yet easier:
Edit BuildConfig.groovy and change the lines of the plugin dependency by these:
compile ":yui:2.8.2.1"
compile (":grails-ui:1.2.3") {
excludes 'yui'
}
Just in case it's useful to you.
I ran into same problem while upgrading my app from grails 1.3.7 to 2.1.0. yui is a dependency for grails-ui plugin (as grails-ui needs bubbling, and bubbling needs yui :-/) This is what I did :
Goto .grails/ivy-cache/org.grails.plugin/grails-ui folder
Open the file ivy-(version).xml (ivy-1.2.3.xml)
Look for this line : <dependency org="org.grails.plugins" name="yui" rev="**[2.6.0,)**" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)">
Replace [2.6.0,) with 2.8.2, so final line will look like this : <dependency org="org.grails.plugins" name="yui" rev="2.8.2" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)">
grails clean and grails compile
After this, this error was gone for good.
Hope this helps.
UPDATE :
Thanks to predicador37 ; Much cleaner & groovy-way of doing this - Put this under plugins in BuildConfig.groovy :
compile ":yui:2.8.2.1"
compile (":grails-ui:1.2.3") {
excludes 'yui'
}

Resources