commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons-sandbox/lang/src/test/org/apache/commons/lang NumbersTest.java
Date Thu, 04 Jul 2002 19:37:43 GMT
scolebourne    2002/07/04 12:37:43

  Modified:    lang/src/test/org/apache/commons/lang NumbersTest.java
  Log:
  Rename containsDigits to isDigits
  Test tighten null handling
  
  Revision  Changes    Path
  1.2       +19 -16    jakarta-commons-sandbox/lang/src/test/org/apache/commons/lang/NumbersTest.java
  
  Index: NumbersTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/lang/src/test/org/apache/commons/lang/NumbersTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NumbersTest.java	4 Jul 2002 19:24:10 -0000	1.1
  +++ NumbersTest.java	4 Jul 2002 19:37:43 -0000	1.2
  @@ -153,15 +153,6 @@
   
   	}
   
  -	public void testContainsDigits() {
  -		assertTrue("containsDigits(String) failed", Numbers.containsDigits(_12345Str));
  -		assertTrue("containsDigits(String) neg 1 failed", !Numbers.containsDigits(_1234dot5Str));
  -		assertTrue("containsDigits(String) neg 2 failed", !Numbers.containsDigits(emptyStr));
  -		assertTrue("containsDigits(String) neg 3 failed", !Numbers.containsDigits(null));
  -		assertTrue("containsDigits(String) neg 4 failed", !Numbers.containsDigits(_1abStr));
  -		assertTrue("containsDigits(String) neg 5 failed", !Numbers.containsDigits(abcStr));
  -	}
  -
   	public void testCreateFloat() {
   		assertEquals("createFloat(String) failed", new Float(_1234dot5Str), Numbers.createFloat(_1234dot5Str));
   	}
  @@ -225,13 +216,25 @@
   
   	}
   
  +    public void testIsDigits() {
  +        assertEquals("isDigits(null) failed", false, Numbers.isDigits(null));
  +        assertEquals("isDigits('') failed", false, Numbers.isDigits(""));
  +        assertEquals("isDigits(String) failed", true, Numbers.isDigits(_12345Str));
  +        assertEquals("isDigits(String) neg 1 failed", false, Numbers.isDigits(_1234dot5Str));
  +        assertEquals("isDigits(String) neg 2 failed", false, Numbers.isDigits(emptyStr));
  +        assertEquals("isDigits(String) neg 3 failed", false, Numbers.isDigits(_1abStr));
  +        assertEquals("isDigits(String) neg 4 failed", false, Numbers.isDigits(abcStr));
  +    }
  +
   	public void testIsNumber() {
  -		assertTrue("isNumber(String) 1 failed", Numbers.isNumber(_12345Str));
  -		assertTrue("isNumber(String) 2 failed", Numbers.isNumber(_1234dot5Str));
  -		assertTrue("isNumber(String) 3 failed", Numbers.isNumber(neg1234dot5Str));
  -		assertTrue("isNumber(String) 4 failed", Numbers.isNumber(neg12345Str));
  -		assertTrue("isNumber(String) neg 1 failed", !Numbers.isNumber(abcStr));
  -		assertTrue("isNumber(String) neg 2 failed", !Numbers.isNumber(_1234dot5DStr));
  +        assertEquals("isDigits(null) failed", false, Numbers.isNumber(null));
  +        assertEquals("isDigits('') failed", false, Numbers.isNumber(""));
  +		assertEquals("isNumber(String) 1 failed", true, Numbers.isNumber(_12345Str));
  +		assertEquals("isNumber(String) 2 failed", true, Numbers.isNumber(_1234dot5Str));
  +		assertEquals("isNumber(String) 3 failed", true, Numbers.isNumber(neg1234dot5Str));
  +		assertEquals("isNumber(String) 4 failed", true, Numbers.isNumber(neg12345Str));
  +		assertEquals("isNumber(String) neg 1 failed", false, Numbers.isNumber(abcStr));
  +		assertEquals("isNumber(String) neg 2 failed", false, Numbers.isNumber(_1234dot5DStr));
   	}
   
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message