groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [groovy] 01/03: remove codenarc warnings
Date Tue, 16 Apr 2019 07:29:06 GMT
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 645b91492ddf563fc37322920bde5aedae6bb060
Author: Paul King <paulk@asert.com.au>
AuthorDate: Tue Apr 16 16:51:35 2019 +1000

    remove codenarc warnings
---
 .../reflection/GroovyClassValueFactoryTest.groovy  | 30 ++++++++++------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/src/test/org/codehaus/groovy/reflection/GroovyClassValueFactoryTest.groovy b/src/test/org/codehaus/groovy/reflection/GroovyClassValueFactoryTest.groovy
index e265758..c3033d1 100644
--- a/src/test/org/codehaus/groovy/reflection/GroovyClassValueFactoryTest.groovy
+++ b/src/test/org/codehaus/groovy/reflection/GroovyClassValueFactoryTest.groovy
@@ -18,29 +18,27 @@
  */
 package org.codehaus.groovy.reflection
 
-import java.util.concurrent.atomic.AtomicInteger;
-
-import groovy.util.GroovyTestCase;
+import java.util.concurrent.atomic.AtomicInteger
 
 import org.codehaus.groovy.reflection.GroovyClassValue.ComputeValue
 
 class GroovyClassValueFactoryTest extends GroovyTestCase {
-	public void testCreateGroovyClassValue(){
-		final AtomicInteger counter = new AtomicInteger();
+	void testCreateGroovyClassValue(){
+		final AtomicInteger counter = new AtomicInteger()
 		GroovyClassValue<String> classValue = GroovyClassValueFactory.createGroovyClassValue(new
ComputeValue<String>(){
 			String computeValue(Class<?> type){
 				counter.incrementAndGet()
-				return type.name;
+				return type.name
 			}
-		});
-		assertEquals("retrieved String class value", String.class.getName(), classValue.get(String.class))
-		assertEquals("computeValue correctly invoked 1 time", 1, counter.value)
-		assertEquals("retrieved String class value", String.class.getName(), classValue.get(String.class))
-		assertEquals("computeValue correctly invoked 1 time", 1, counter.value)
-		assertEquals("retrieved Integer class value", Integer.class.getName(), classValue.get(Integer.class))
-		assertEquals("computeValue correctly invoked 2 times", 2, counter.value)
-		classValue.remove(String.class)
-		assertEquals("retrieved String class value", String.class.getName(), classValue.get(String.class))
-		assertEquals("computeValue correctly invoked 3 times", 3, counter.value)
+		})
+		assertEquals("retrieved String class value", String.name, classValue.get(String))
+		assertEquals("computeValue correctly invoked 1 time", 1, counter.get())
+		assertEquals("retrieved String class value", String.name, classValue.get(String))
+		assertEquals("computeValue correctly invoked 1 time", 1, counter.get())
+		assertEquals("retrieved Integer class value", Integer.name, classValue.get(Integer))
+		assertEquals("computeValue correctly invoked 2 times", 2, counter.get())
+		classValue.remove(String)
+		assertEquals("retrieved String class value", String.name, classValue.get(String))
+		assertEquals("computeValue correctly invoked 3 times", 3, counter.get())
 	}
 }


Mime
View raw message