Hi, i have a string that i want to match to a regular expression. The string is methodName(paraT1 para1, paraT2.name2 para2, paraT3.name3 para3) Inside the () there can be multiple of "aaa.bbb ccc" and "ddd eee" patterns The regular expression i wrote was : (\w*)(\s*)\((((\w*\.\w*)\s*(\w*))|((\w*)\s*(\w*)))(\s*\,\s*(((\w*\.\w*)\s*(\w*))|((\w*)\s*(\w*))))*\) and the I get the first and the last (parameterType para) pattern but not the ones inbetween. How do i get the middle expression. appreciate a reply thanks in advance

Member Avatar
Member Avatar
+0 forum 6

How can I use seleium test case in groovy? such as clinking on links. test case <html> ... <body> <table> <tr> <td>open</td> <td>https://url.web:8010/</td> </tr> <tr> <td>clickAndWait</td> <td>link=service=homeLink</td> </tr> <tr> <td>clickAndWait</td> <td>link=name=contentLink,service=Queue</td> </tr> <tr> <td>clickAndWait</td> <td>link=BackLink</td> </tr> ... groovy script // Setup credentials def String[] credentials = new String[2] credentials[0] = "username" credentials[1] = "password" def jmxEnv = [(JMXConnector.CREDENTIALS):credentials] // Setup JMX connection with credentials def serverUrl = 'service:jmx:rmi:///jndi/rmi://url.web:8010/jmxrmi' def server = JmxFactory.connect(new JmxUrl(serverUrl), jmxEnv).MBeanServerConnection

Member Avatar
+0 forum 0

how to create groovy client? getting an error, below. ** # start up jboss with following paremater: # ** set JAVA_OPTS= -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=C:\Java\jdk1.7.0\jre\lib\management\jmxremote.password -Dcom.sun.management.jmxremote.access.file=C:\Java\jdk1.7.0\jre\lib\management\jmxremote.access" ** # test jboss is started: # ** http://localhost:9990/ username: abc password: abc1# ** # Groovy script: # ** import javax.management.ObjectName import javax.management.remote.JMXConnectorFactory as JmxFactory import javax.management.remote.JMXServiceURL as JmxUrl import groovy.swing.SwingBuilder import javax.swing.WindowConstants as WC // Connect to server def serverUrl = 'service:jmx:rmi:///jndi/rmi://localhost:9990/jmxrmi' def server = JmxFactory.connect(new JmxUrl(serverUrl)).MBeanServerConnection def serverInfo = new GroovyMBean(server, 'Catalina:type=Server').serverInfo println "Connected to: $serverInfo" ** # Error: # ** Exception thrown java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception …

Member Avatar
Member Avatar
+0 forum 2

Hi, I am trying to read a html page and convert into xml and copy the content into a txt file in the local drive. The code below is to read the html page: def cleaner = new HtmlCleaner() def node = cleaner.clean(address) // Convert from HTML to XML def props = cleaner.getProperties() def serializer = new SimpleXmlSerializer(props) def xml = serializer.getXmlAsString(node) // Parse the XML into a document we can work with return new XmlSlurper(false,false).parseText(xml) and the below code is to write it to a local txt file: static writeXml(page, fname) { def d1= new File(base + '/' + …

Member Avatar
+0 forum 0

Hi, Im just new to this language and I would like to know what does this groovy regular expression match too. I was not able to figure it by online articles.if some would would give an explanation i would greatly appreciate. the 3 regular expressions are : static propertyPattern = ~/@property\s*\([\w, =]+\)\s*(\w+)\s*(\*?)\w*/ static methodPattern1 = ~/(\-|\+)\s*\(((?:const)?)\s*(\w+)\s*(<[\w\s,]+>)?\s*(\*?)\)\s*(\w+)(:\s*\(((?:const)?)\s*(\w+)\s*(<[\w\s,]+>)?\s*(\*?)\)\s*(\w+))?\s*/ static methodPattern2 = ~/(\w+):\s*\(((?:const)?)\s*(\w+)\s*(<[\w\s,]+>)?\s*(\*?)\)\s*(\w+)/ static methodPattern3 = ~/,\s*(...)\s*$/ thanks appreicate a reply

Member Avatar
Member Avatar
+0 forum 7

Hi, i am new to groovy language. I was wondering if there will be anyone who will be able to help me understand the below code. static analyzeAPI(pkgname) { def refs = Yaml.load(new File(output_base + "/${pkgname}_PackageRefs.yml").text) refs.Classes.each { analyzeClassRef(pkgname, it.name) } } static analyzeClassRef(pkgname, name) { println "=== Analyze class ${pkgname} ${name}" def filename = pkgname ? "${pkgname}/${name}.xml" : "${name}.xml" def page = readXml(filename) assert page.head.title == "${name} | Android Developers" } Gratly appreciate a reply thanks you

Member Avatar
Member Avatar
+0 forum 4

Hi, I am implement a plugin project in eclipse in java language. I have a parse which is in s simple txt file. Below is the txt for the parser. id=app1 [String] #type=app [String] mainView=top name=First App [String] children: size=1 === child[0] === class=View id=top [String] #type=View [String] #line=8 [Integer] #info= name=View [String] parent=app1 #pos=0 [String] children: size=4 === child[0.0] === class=Widget id=l1 [String] #type=Label [String] text=Hello [String] #line=9 [Integer] #info= name=Label [String] parent=top #pos=0.0 [String] === child[0.1] === class=Widget id=b1 [String] #type=Button [String] text=Press [String] #line=10 [Integer] #info= name=Button [String] parent=top #pos=0.1 [String] im trying to implement the code …

Member Avatar
+0 forum 0

With the release last week of [Groovy 1.7](http://groovy.codehaus.org/), developers using the object-oriented scripting language for Java gained access to anonymous inner classes and nested classes, annotations, SQL and other features that could simplify development when mixing Groovy code with Java. Groovy's [Eclipse community](http://groovy.codehaus.org/Eclipse+Plugin) yesterday released Groovy-Eclipse 2.0.0, a nearly rewritten plug-in that it says delivers an Eclipse experience the same as when using Java. "The driving themes for version 2.0.0 have always been to optimize around the common developer actions of editing, building, running and testing code," wrote Groovy language developer Andrew Eisenberg in a [post](http://docs.codehaus.org/display/GROOVY/Groovy-Eclipse+2.0.0+New+and+Noteworthy) describing the release. To …

Member Avatar
+0 forum 0

The End.