incubator-kitty-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovar...@apache.org
Subject svn commit: r1299262 - in /incubator/kitty/trunk: ./ src/main/groovy/org/apache/kitty/ src/main/groovy/org/apache/kitty/client/ src/main/groovy/org/apache/kitty/client/jmxmp/ src/test/groovy/org/apache/kitty/client/ src/test/groovy/org/apache/kitty/test/
Date Sat, 10 Mar 2012 19:56:27 GMT
Author: anovarini
Date: Sat Mar 10 19:56:26 2012
New Revision: 1299262

URL: http://svn.apache.org/viewvc?rev=1299262&view=rev
Log:
Updated build file to new versions of Groovy and Grails, replaced deprecated plugin, fixed
codeNarc problems

Modified:
    incubator/kitty/trunk/build.gradle
    incubator/kitty/trunk/src/main/groovy/org/apache/kitty/CmdShell.groovy
    incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/Client.groovy
    incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/jmxmp/JMXMPClient.groovy
    incubator/kitty/trunk/src/test/groovy/org/apache/kitty/client/ClientTest.groovy
    incubator/kitty/trunk/src/test/groovy/org/apache/kitty/test/TestGroovyShell.groovy

Modified: incubator/kitty/trunk/build.gradle
URL: http://svn.apache.org/viewvc/incubator/kitty/trunk/build.gradle?rev=1299262&r1=1299261&r2=1299262&view=diff
==============================================================================
--- incubator/kitty/trunk/build.gradle (original)
+++ incubator/kitty/trunk/build.gradle Sat Mar 10 19:56:26 2012
@@ -19,8 +19,9 @@ apply plugin: 'eclipse'			// adds suppor
 apply plugin: 'idea'			// adds support for idea project generation
 apply plugin: 'java'			// adds support for java
 apply plugin: 'groovy'			// adds support for groovy
-apply plugin: 'application'		// adds support for building the app
-apply plugin: 'code-quality'	// adds support for code analysis
+apply plugin: 'application'		// adds support for building the application
+apply plugin: 'checkstyle'
+apply plugin: 'codenarc'
 
 defaultTasks 'assemble'
 
@@ -36,8 +37,8 @@ applicationName = 'kitty'
 // --------------------------------------------------------------------
 // dependency versions
 
-gradleVersion = '1.0-milestone-5'
-groovyVersion = '1.8.4'
+gradleVersion = '1.0-milestone-8a'
+groovyVersion = '1.8.6'
 jlineVersion = '0.9.94'
 junitVersion = '4.8.2'
 accliVersion = '1.2'
@@ -99,21 +100,6 @@ distZip {
 	baseName = "$packageName"
 }
 
-// --------------------------------------------------------------------
-// task definitions
-
-task docs(dependsOn: ["groovydoc", "javadoc"]) {
-    //
-}
-
-task checkstyle(type: Checkstyle) << {
-	source = 'src/main/java'
-}
-
-task codeNarc(type: CodeNarc) << {
-	source = 'src/main/java'
-}
-
 task gradleWrapper(type: Wrapper, description: "Kitty Task: Create a Gradle self-download
wrapper") {
 	gradleVersion = "$gradleVersion"
 }

Modified: incubator/kitty/trunk/src/main/groovy/org/apache/kitty/CmdShell.groovy
URL: http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/CmdShell.groovy?rev=1299262&r1=1299261&r2=1299262&view=diff
==============================================================================
--- incubator/kitty/trunk/src/main/groovy/org/apache/kitty/CmdShell.groovy (original)
+++ incubator/kitty/trunk/src/main/groovy/org/apache/kitty/CmdShell.groovy Sat Mar 10 19:56:26
2012
@@ -18,8 +18,6 @@
 
 package org.apache.kitty
 
-import java.io.File
-
 import jline.ConsoleReader
 import jline.History
 import jline.SimpleCompletor
@@ -44,9 +42,9 @@ class CmdShell {
 
 	def static final PROMPT = "kitty> "
 
-	static String HOST = "localhost"
+	static final String HOST = "localhost"
 
-	static String PORT = "1099"
+	static final String PORT = "1099"
 
 	static Client client
 

Modified: incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/Client.groovy
URL: http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/Client.groovy?rev=1299262&r1=1299261&r2=1299262&view=diff
==============================================================================
--- incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/Client.groovy (original)
+++ incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/Client.groovy Sat Mar 10
19:56:26 2012
@@ -18,8 +18,6 @@
 
 package org.apache.kitty.client
 
-import java.io.IOException
-
 import javax.management.Attribute
 import javax.management.ObjectName
 import javax.management.remote.JMXConnectorFactory
@@ -53,11 +51,11 @@ class Client {
 	def url
 	def mbean
 
-	public connect(def _host, def _port) {
-		connect(_host, _port, null, null)
+	public connect(def host, def port) {
+		connect(host, port, null, null)
 	}
 
-	public connect(def _host, def _port, def _username, def _password) {
+	public connect(def host, def port, def username, def password) {
 
 		def serviceURL
 		def properties = new HashMap()
@@ -66,12 +64,12 @@ class Client {
 			disconnect()
 		}
 
-		if ((_username != null) && (_password != null)) {
-			properties.put JMXConnector.CREDENTIALS, [_username, _password] as String[]
+		if ((username != null) && (password != null)) {
+			properties.put JMXConnector.CREDENTIALS, [username, password] as String[]
 		}
 
 		try {
-			serviceURL = "service:jmx:rmi:///jndi/rmi://$_host:$_port/jmxrmi"
+			serviceURL = "service:jmx:rmi:///jndi/rmi://$host:$port/jmxrmi"
 			this.url = new JMXServiceURL(serviceURL)
 
 			// TODO add auth & credentials to properties
@@ -85,8 +83,8 @@ class Client {
 		}
 		finally {
 			if (this.remote != null) {
-				this.host = _host
-				this.port = _port
+				this.host = host
+				this.port = port
 			}
 		}
 	}
@@ -126,22 +124,22 @@ class Client {
 	 * <pre>
 	 * Assign a value to the domain
 	 * </pre>
-	 * @param _domain
+	 * @param domain
 	 * @return
 	 */
-	public setDomain(def _domain) {
+	public setDomain(def domain) {
 		if (this.remote) {
 
 			this.domainList = remote.getDomains()
 
-            def domainFound = domainList.findAll { it == _domain }
+            def domainFound = domainList.findAll { it == domain }
 
 			if (domainFound.size() == 1) {
-					this.domain = _domain
+					this.domain = domain
 					this.mBeansPath = []
 			}
             else {
-                println "domain $_domain not found"
+                println "domain $domain not found"
             }
         }
 	}

Modified: incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/jmxmp/JMXMPClient.groovy
URL: http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/jmxmp/JMXMPClient.groovy?rev=1299262&r1=1299261&r2=1299262&view=diff
==============================================================================
--- incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/jmxmp/JMXMPClient.groovy
(original)
+++ incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/jmxmp/JMXMPClient.groovy
Sat Mar 10 19:56:26 2012
@@ -38,14 +38,14 @@ import org.apache.kitty.client.Client
 class JMXMPClient extends Client {
 
 	@Override
-	public connect(def _host, def _port) {
+	public connect(def host, def port) {
 
 		if (this.remote != null) {
 			disconnect()
 		}
 
 		try {
-			def serviceURL = "service:jmx:jmxmp://$_host:$_port"
+			def serviceURL = "service:jmx:jmxmp://$host:$port"
 			this.url = new JMXServiceURL(serviceURL)
 			this.connector = JMXConnectorFactory.connect(this.url)
 			this.remote = this.connector.getMBeanServerConnection()
@@ -56,8 +56,8 @@ class JMXMPClient extends Client {
 		}
 		finally {
 			if(this.remote != null) {
-				this.host = _host
-				this.port = _port
+				this.host = host
+				this.port = port
 			}
 		}
 	}

Modified: incubator/kitty/trunk/src/test/groovy/org/apache/kitty/client/ClientTest.groovy
URL: http://svn.apache.org/viewvc/incubator/kitty/trunk/src/test/groovy/org/apache/kitty/client/ClientTest.groovy?rev=1299262&r1=1299261&r2=1299262&view=diff
==============================================================================
--- incubator/kitty/trunk/src/test/groovy/org/apache/kitty/client/ClientTest.groovy (original)
+++ incubator/kitty/trunk/src/test/groovy/org/apache/kitty/client/ClientTest.groovy Sat Mar
10 19:56:26 2012
@@ -18,22 +18,22 @@
 package org.apache.kitty.client;
 
 import static org.junit.Assert.*;
-import org.apache.kitty.client.Client
-import javax.management.MBeanServerConnection
+
 import org.junit.Test
-import groovy.mock.interceptor.MockFor
+import javax.management.MBeanServerConnection
 import javax.management.ObjectName
+import groovy.mock.interceptor.MockFor
 import org.apache.kitty.exceptions.DomainIsNoneException;
 
 class ClientTest {
 
     @Test
     public void shouldCorrectlySetNewDomain() {
-        def mbean_server_connection = {
+        def final mbeanServerConnection = {
             ['a', 'b', 'c']as String[]
         } as MBeanServerConnection
         Client client = new Client()
-        client.remote = mbean_server_connection
+        client.remote = mbeanServerConnection
 
         assert client.domain == null
         assert client.mBeansPath == null
@@ -46,11 +46,11 @@ class ClientTest {
 
     @Test
     public void shouldKeepActualDomainWhenSettingWithInvalidValue() throws Exception {
-        def mbean_server_connection = {
+        def final mbeanServerConnection = {
             ['a', 'b', 'c'] as String[]
         } as MBeanServerConnection
         Client client = new Client()
-        client.remote = mbean_server_connection
+        client.remote = mbeanServerConnection
         client.domain = 'a'
         client.mBeansPath = []
 
@@ -99,10 +99,10 @@ class ClientTest {
     public void shouldChangeDirectoryToParent() throws Exception {
 
         def client = new Client()
-        def mbean_server_connection = {
+        def final mbeanServerConnection = {
             ['a', 'b', 'c'] as String[]
         } as MBeanServerConnection
-        client.remote = mbean_server_connection
+        client.remote = mbeanServerConnection
         client.domain = 'a'
 
         client.mBeansPath = ["a" , "b" , "c"]

Modified: incubator/kitty/trunk/src/test/groovy/org/apache/kitty/test/TestGroovyShell.groovy
URL: http://svn.apache.org/viewvc/incubator/kitty/trunk/src/test/groovy/org/apache/kitty/test/TestGroovyShell.groovy?rev=1299262&r1=1299261&r2=1299262&view=diff
==============================================================================
--- incubator/kitty/trunk/src/test/groovy/org/apache/kitty/test/TestGroovyShell.groovy (original)
+++ incubator/kitty/trunk/src/test/groovy/org/apache/kitty/test/TestGroovyShell.groovy Sat
Mar 10 19:56:26 2012
@@ -18,8 +18,6 @@
 
 package org.apache.kitty.test
 
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
 import org.apache.kitty.utils.Help;
 
 /**



Mime
View raw message