Bug 779949 (SOA-2309) - SOA-P EDS Adminshell interpreter is not handling annotations Groovy scripts
Summary: SOA-P EDS Adminshell interpreter is not handling annotations Groovy scripts
Keywords:
Status: CLOSED WONTFIX
Alias: SOA-2309
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: EDS
Version: 5.1.0.ER1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: FUTURE
Assignee: Van Halbert
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-13 02:59 UTC by Len DiMaggio
Modified: 2011-12-02 19:40 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-02 19:40:46 UTC
Type: Feature Request


Attachments (Terms of Use)
demotestng.groovy (585 bytes, application/octet-stream)
2010-09-13 02:59 UTC, Len DiMaggio
no flags Details
demojunit.groovy (419 bytes, application/octet-stream)
2010-09-13 02:59 UTC, Len DiMaggio
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 780392 0 high CLOSED EDS adminshell fails to connect to server with IBM JDK 2021-02-22 00:41:40 UTC
Red Hat Issue Tracker SOA-2309 0 None None None Never

Internal Links: 780392

Description Len DiMaggio 2010-09-13 02:59:12 UTC
project_key: SOA

The error that I'm seeing with TestNG is:

FATAL: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
groovysh_parse: 6: unexpected token: @ @ line 6, column 5.
       @BeforeClass
       ^

---------------


And - for the Junit script - the only output produced is: 
===> true

This is the case regardless of the number of test methods included.

Comment 1 Len DiMaggio 2010-09-13 02:59:42 UTC
Attachment: Added: demotestng.groovy
Attachment: Added: demojunit.groovy


Comment 2 Len DiMaggio 2010-09-15 02:43:59 UTC
There is an easy workaround - call the adminshell from the test script:

import static org.teiid.adminshell.AdminShell.*
import org.testng.annotations.*
import org.testng.TestNG
import org.testng.TestListenerAdapter

public class SimpleTest {

    @BeforeClass
    def setUp() { 
    }

    @Test
    void shouldBeConn1 () {
        connectAsAdmin("mm://localhost:31443", "admin", "admin", "conn-1")
        println( "Getting default connection name " + getConnectionName() )
                assert getConnectionName() == "conn-1"
    }

}

def testng = new TestNG()
testng.setTestClasses(SimpleTest)
testng.addListener(new TestListenerAdapter())
testng.run()


Comment 3 Len DiMaggio 2010-09-17 12:46:50 UTC
Original summary was:
   SOA-P EDS Adminshell interpreter is not handling TestNG annotations or Junit in Groovy scripts

I resolved this JIRA as a workaround exists for building tests with TestNG - but customers may still want to make use of annotations in Groovy scripts. Re-opening as a feature request.


Comment 4 Len DiMaggio 2010-10-04 15:50:31 UTC
Still an issue in the ER2 build:

sh ./adminshell.sh . demotestng.groovy
======================================================================

  Teiid AdminShell Bootstrap Environment

  TEIID_HOME  = /jboss/local/51_ER2/jboss-soa-p-5/eds/teiid/adminshell
  CLASSPATH   = /jboss/local/51_ER2/jboss-soa-p-5/eds/teiid/adminshell/lib/patches/*:/jboss/local/51_ER2/jboss-soa-p-5/eds/teiid/adminshell/lib/teiid-adminshell-7.1.1.jar:/jboss/local/51_ER2/jboss-soa-p-5/eds/teiid/adminshell/lib/*
  JAVA        = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0//bin/java

======================================================================

===> [import static org.teiid.adminshell.AdminShell.*; import static org.teiid.adminshell.GroovySqlExtensions.*; import org.teiid.adminapi.*;]
===> [import static org.teiid.adminshell.AdminShell.*; import static org.teiid.adminshell.GroovySqlExtensions.*; import org.teiid.adminapi.*;, import org.testng.annotations.*]
===> [import static org.teiid.adminshell.AdminShell.*; import static org.teiid.adminshell.GroovySqlExtensions.*; import org.teiid.adminapi.*;, import org.testng.annotations.*, import org.testng.TestNG]
===> [import static org.teiid.adminshell.AdminShell.*; import static org.teiid.adminshell.GroovySqlExtensions.*; import org.teiid.adminapi.*;, import org.testng.annotations.*, import org.testng.TestNG, import org.testng.TestListenerAdapter]
FATAL: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
groovysh_parse: 6: unexpected token: @ @ line 6, column 5.
       @BeforeClass
       ^

1 error

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
groovysh_parse: 6: unexpected token: @ @ line 6, column 5.
       @BeforeClass
       ^

1 error

        at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:296)
        at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:103)
        at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:142)
        at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:113)
        at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:125)
        at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:353)
        at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:104)
        at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:71)
        at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:249)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:121)
        at org.codehaus.groovy.tools.shell.RigidParser.parse(Parser.groovy:148)
        at org.codehaus.groovy.tools.shell.RigidParser$parse.call(Unknown Source)
        at org.codehaus.groovy.tools.shell.Parser.parse(Parser.groovy:67)
        at org.codehaus.groovy.tools.shell.Parser$parse.call(Unknown Source)
        at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:130)
        at org.codehaus.groovy.tools.shell.Groovysh$execute.callCurrent(Unknown Source)
        at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:114)
        at org.codehaus.groovy.tools.shell.Shell$leftShift$0.call(Unknown Source)
        at org.codehaus.groovy.tools.shell.commands.LoadCommand$_load_closure1.doCall(LoadCommand.groovy:80)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:273)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
        at groovy.lang.Closure.call(Closure.java:276)
        at groovy.lang.Closure.call(Closure.java:289)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.callClosureForLine(DefaultGroovyMethods.java:2303)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.eachLine(DefaultGroovyMethods.java:10556)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.eachLine(DefaultGroovyMethods.java:10445)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.eachLine(DefaultGroovyMethods.java:10476)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.eachLine(DefaultGroovyMethods.java:10460)
        at org.codehaus.groovy.runtime.dgm$134.invoke(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:270)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at org.codehaus.groovy.tools.shell.commands.LoadCommand.load(LoadCommand.groovy:79)
        at org.codehaus.groovy.tools.shell.commands.LoadCommand$load.callCurrent(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151)
        at org.codehaus.groovy.tools.shell.commands.LoadCommand.execute(LoadCommand.groovy:68)
        at org.codehaus.groovy.tools.shell.Command$execute.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at org.codehaus.groovy.tools.shell.CommandAlias.execute(CommandAlias.groovy:67)
        at org.codehaus.groovy.tools.shell.Command$execute.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
        at org.codehaus.groovy.tools.shell.Command$execute.call(Unknown Source)
        at org.codehaus.groovy.tools.shell.Shell.execute(Shell.groovy:101)
        at org.codehaus.groovy.tools.shell.Groovysh.super$2$execute(Groovysh.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:127)
        at org.codehaus.groovy.tools.shell.Groovysh.executeCommand(Groovysh.groovy:164)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:266)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151)
        at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:112)
        at org.codehaus.groovy.tools.shell.Groovysh$execute.callCurrent(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151)
        at org.codehaus.groovy.tools.shell.Groovysh.run(Groovysh.groovy:398)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:225)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151)
        at org.codehaus.groovy.tools.shell.Groovysh.run(Groovysh.groovy:371)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:225)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:63)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at org.codehaus.groovy.tools.shell.Main.main(Main.groovy:130)
        at org.teiid.adminshell.GroovyAdminShell.main(GroovyAdminShell.java:30)



Comment 5 Steven Hawkins 2010-10-05 15:59:17 UTC
This is an issue with GroovyShell.  It is not something that Teiid can address directly.  What we can do is add another set of launch scripts (e.g. adminshell-run.sh) that functions the same as groovy.sh (not groovysh.sh).  Just like the graphical environment, shell commands would not be supported with that style of launch.

Comment 6 Len DiMaggio 2011-01-19 17:19:07 UTC
Link: Added: This issue related SOA-2814



Note You need to log in before you can comment on or make changes to this bug.