commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r1066341 - in /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3: CharSequenceUtilsTest.java event/EventUtilsTest.java reflect/FieldUtilsTest.java
Date Wed, 02 Feb 2011 06:21:53 GMT
Author: bayard
Date: Wed Feb  2 06:21:53 2011
New Revision: 1066341

URL: http://svn.apache.org/viewvc?rev=1066341&view=rev
Log:
Adding tests to ensure the public constructors remain

Modified:
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/CharSequenceUtilsTest.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/event/EventUtilsTest.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/CharSequenceUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/CharSequenceUtilsTest.java?rev=1066341&r1=1066340&r2=1066341&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/CharSequenceUtilsTest.java
(original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/CharSequenceUtilsTest.java
Wed Feb  2 06:21:53 2011
@@ -16,6 +16,9 @@
  */
 package org.apache.commons.lang3;
 
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Modifier;
+
 import junit.framework.Assert;
 import junit.framework.TestCase;
 
@@ -27,6 +30,17 @@ import junit.framework.TestCase;
  */
 public class CharSequenceUtilsTest extends TestCase {
 
+    //-----------------------------------------------------------------------
+    public void testConstructor() {
+        assertNotNull(new CharSequenceUtils());
+        Constructor<?>[] cons = CharSequenceUtils.class.getDeclaredConstructors();
+        assertEquals(1, cons.length);
+        assertEquals(true, Modifier.isPublic(cons[0].getModifiers()));
+        assertEquals(true, Modifier.isPublic(CharSequenceUtils.class.getModifiers()));
+        assertEquals(false, Modifier.isFinal(CharSequenceUtils.class.getModifiers()));
+    }
+    
+    //-----------------------------------------------------------------------
     public void testSubSequence() {
         //
         // null input

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/event/EventUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/event/EventUtilsTest.java?rev=1066341&r1=1066340&r2=1066341&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/event/EventUtilsTest.java
(original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/event/EventUtilsTest.java
Wed Feb  2 06:21:53 2011
@@ -20,8 +20,10 @@ import javax.naming.event.ObjectChangeLi
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.beans.VetoableChangeListener;
+import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 import java.lang.reflect.Proxy;
 import java.util.Date;
 import java.util.Map;
@@ -35,6 +37,16 @@ import junit.framework.TestCase;
  */
 public class EventUtilsTest extends TestCase
 {
+
+    public void testConstructor() {
+        assertNotNull(new EventUtils());
+        Constructor<?>[] cons = EventUtils.class.getDeclaredConstructors();
+        assertEquals(1, cons.length);
+        assertEquals(true, Modifier.isPublic(cons[0].getModifiers()));
+        assertEquals(true, Modifier.isPublic(EventUtils.class.getModifiers()));
+        assertEquals(false, Modifier.isFinal(EventUtils.class.getModifiers()));
+    }
+    
     public void testAddEventListener()
     {
         final PropertyChangeSource src = new PropertyChangeSource();

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java?rev=1066341&r1=1066340&r2=1066341&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java
(original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java
Wed Feb  2 06:21:53 2011
@@ -16,7 +16,9 @@
  */
 package org.apache.commons.lang3.reflect;
 
+import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
 
 import junit.framework.TestCase;
 
@@ -56,6 +58,15 @@ public class FieldUtilsTest extends Test
         privatelyShadowedChild = new PrivatelyShadowedChild();
     }
 
+    public void testConstructor() {
+        assertNotNull(new FieldUtils());
+        Constructor<?>[] cons = FieldUtils.class.getDeclaredConstructors();
+        assertEquals(1, cons.length);
+        assertEquals(true, Modifier.isPublic(cons[0].getModifiers()));
+        assertEquals(true, Modifier.isPublic(FieldUtils.class.getModifiers()));
+        assertEquals(false, Modifier.isFinal(FieldUtils.class.getModifiers()));
+    }
+    
     public void testGetField() {
         assertEquals(Foo.class, FieldUtils.getField(PublicChild.class, "VALUE").getDeclaringClass());
         assertEquals(parentClass, FieldUtils.getField(PublicChild.class, "s").getDeclaringClass());



Mime
View raw message