You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2005/08/27 12:26:58 UTC
svn commit: r240401 -
/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java
Author: scolebourne
Date: Sat Aug 27 03:26:53 2005
New Revision: 240401
URL: http://svn.apache.org/viewcvs?rev=240401&view=rev
Log:
Fix license, style and svn properties
Modified:
jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java (contents, props changed)
Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java?rev=240401&r1=240400&r2=240401&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java (original)
+++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java Sat Aug 27 03:26:53 2005
@@ -1,128 +1,141 @@
-/*
- * Copyright 2005 Steven Caswell
- */
-package org.apache.commons.lang;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-/**
- *
- * @author Steven Caswell
- * @version $Id$
- */
-public class IntHashMapTest extends TestCase
-{
-
- public static void main(String[] args) {
- TestRunner.run(suite());
- }
-
- public static Test suite() {
- TestSuite suite = new TestSuite(IntHashMapTest.class);
- suite.setName("IntHashMapTest Tests");
- return suite;
- }
-
- public void testConstructor() {
- try {
- IntHashMap map = new IntHashMap(-1, 0.0f);
- fail();
- } catch (IllegalArgumentException e) {
- assertEquals("Illegal Capacity: -1", e.getMessage());
- }
- try {
- IntHashMap map = new IntHashMap(1, 0.0f);
- fail();
- } catch (IllegalArgumentException e) {
- assertEquals("Illegal Load: 0.0", e.getMessage());
- }
- IntHashMap map = new IntHashMap(0, 1.0f);
-
- try {
- IntHashMap map1 = new IntHashMap(-1);
- fail();
- } catch (IllegalArgumentException e) {
- assertEquals("Illegal Capacity: -1", e.getMessage());
- }
- IntHashMap map1 = new IntHashMap(0);
- }
-
- public void testClear() {
- IntHashMap map = new IntHashMap();
- assertNull(map.put(1, "hello"));
- assertNull(map.put(2, "world"));
- assertEquals(2, map.size());
- map.clear();
- assertEquals(0, map.size());
- }
-
- public void testContainsKey() {
- IntHashMap map = new IntHashMap();
- assertNull(map.put(1, "hello"));
- assertNull(map.put(2, "world"));
- assertEquals(2, map.size());
- assertTrue(map.containsKey(1));
- assertTrue(map.containsKey(2));
- assertFalse(map.containsKey(3));
- }
-
- public void testContains() {
- IntHashMap map = new IntHashMap();
- assertNull(map.put(1, "hello"));
- assertNull(map.put(2, "world"));
- assertEquals(2, map.size());
- assertTrue(map.containsValue("hello"));
- assertTrue(map.containsValue("world"));
- assertFalse(map.containsValue("goodbye"));
- try {
- map.containsValue(null);
- fail();
- } catch(NullPointerException e) {
- }
- }
-
- public void testContainsValue() {
- IntHashMap map = new IntHashMap();
- assertNull(map.put(1, "hello"));
- assertNull(map.put(2, "world"));
- assertEquals(2, map.size());
- assertTrue(map.containsValue("hello"));
- assertTrue(map.containsValue("world"));
- assertFalse(map.containsValue("goodbye"));
- try {
- map.containsValue(null);
- fail();
- } catch(NullPointerException e) {
- }
- }
-
- public void testIsEmpty() {
- IntHashMap map = new IntHashMap();
- assertTrue(map.isEmpty());
- assertNull(map.put(1, "hello"));
- assertEquals(1, map.size());
- assertFalse(map.isEmpty());
- }
-
- public void testPut() {
- IntHashMap map = new IntHashMap();
- assertNull(map.put(1, "hello"));
- assertNull(map.put(2, "world"));
- assertEquals(2, map.size());
- assertEquals("hello", map.put(1, "hellooooo"));
- }
-
- public void testRemove() {
- IntHashMap map = new IntHashMap();
- assertNull(map.put(1, "hello"));
- assertNull(map.put(2, "world"));
- assertEquals(2, map.size());
- assertEquals("hello", map.remove(1));
- assertEquals(1, map.size());
- assertNull(map.remove(3));
- }
-
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.lang;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * Tests for the IntHashMap class.
+ *
+ * @author Steven Caswell
+ * @version $Id$
+ */
+public class IntHashMapTest extends TestCase {
+
+ public static void main(String[] args) {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(IntHashMapTest.class);
+ suite.setName("IntHashMapTest Tests");
+ return suite;
+ }
+
+ public void testConstructor() {
+ try {
+ new IntHashMap(-1, 0.0f);
+ fail();
+ } catch (IllegalArgumentException e) {
+ assertEquals("Illegal Capacity: -1", e.getMessage());
+ }
+ try {
+ new IntHashMap(1, 0.0f);
+ fail();
+ } catch (IllegalArgumentException e) {
+ assertEquals("Illegal Load: 0.0", e.getMessage());
+ }
+ new IntHashMap(0, 1.0f);
+
+ try {
+ new IntHashMap(-1);
+ fail();
+ } catch (IllegalArgumentException e) {
+ assertEquals("Illegal Capacity: -1", e.getMessage());
+ }
+ IntHashMap map1 = new IntHashMap(0);
+ assertEquals(0, map1.size());
+ }
+
+ public void testClear() {
+ IntHashMap map = new IntHashMap();
+ assertNull(map.put(1, "hello"));
+ assertNull(map.put(2, "world"));
+ assertEquals(2, map.size());
+ map.clear();
+ assertEquals(0, map.size());
+ }
+
+ public void testContainsKey() {
+ IntHashMap map = new IntHashMap();
+ assertNull(map.put(1, "hello"));
+ assertNull(map.put(2, "world"));
+ assertEquals(2, map.size());
+ assertTrue(map.containsKey(1));
+ assertTrue(map.containsKey(2));
+ assertFalse(map.containsKey(3));
+ }
+
+ public void testContains() {
+ IntHashMap map = new IntHashMap();
+ assertNull(map.put(1, "hello"));
+ assertNull(map.put(2, "world"));
+ assertEquals(2, map.size());
+ assertTrue(map.containsValue("hello"));
+ assertTrue(map.containsValue("world"));
+ assertFalse(map.containsValue("goodbye"));
+ try {
+ map.containsValue(null);
+ fail();
+ } catch(NullPointerException e) {
+ }
+ }
+
+ public void testContainsValue() {
+ IntHashMap map = new IntHashMap();
+ assertNull(map.put(1, "hello"));
+ assertNull(map.put(2, "world"));
+ assertEquals(2, map.size());
+ assertTrue(map.containsValue("hello"));
+ assertTrue(map.containsValue("world"));
+ assertFalse(map.containsValue("goodbye"));
+ try {
+ map.containsValue(null);
+ fail();
+ } catch(NullPointerException e) {
+ }
+ }
+
+ public void testIsEmpty() {
+ IntHashMap map = new IntHashMap();
+ assertTrue(map.isEmpty());
+ assertNull(map.put(1, "hello"));
+ assertEquals(1, map.size());
+ assertFalse(map.isEmpty());
+ }
+
+ public void testPut() {
+ IntHashMap map = new IntHashMap();
+ assertNull(map.put(1, "hello"));
+ assertNull(map.put(2, "world"));
+ assertEquals(2, map.size());
+ assertEquals("hello", map.put(1, "hellooooo"));
+ }
+
+ public void testRemove() {
+ IntHashMap map = new IntHashMap();
+ assertNull(map.put(1, "hello"));
+ assertNull(map.put(2, "world"));
+ assertEquals(2, map.size());
+ assertEquals("hello", map.remove(1));
+ assertEquals(1, map.size());
+ assertNull(map.remove(3));
+ }
+
+}
Propchange: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: svn commit: r240401 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java
Posted by Steven Caswell <st...@gmail.com>.
I thought I had set up my Eclipse to put in the correct header but I
screwed it up.
With egg on my face thanks for catching this.
On 8/27/05, scolebourne@apache.org <sc...@apache.org> wrote:
> Author: scolebourne
> Date: Sat Aug 27 03:26:53 2005
> New Revision: 240401
>
> URL: http://svn.apache.org/viewcvs?rev=240401&view=rev
> Log:
> Fix license, style and svn properties
>
> Modified:
> jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java (contents, props changed)
>
> Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java
> URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java?rev=240401&r1=240400&r2=240401&view=diff
> ==============================================================================
> --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java (original)
> +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java Sat Aug 27 03:26:53 2005
> @@ -1,128 +1,141 @@
> -/*
>
> - * Copyright 2005 Steven Caswell
>
> - */
>
> -package org.apache.commons.lang;
>
> -
>
> -import junit.framework.Test;
>
> -import junit.framework.TestCase;
>
> -import junit.framework.TestSuite;
>
> -import junit.textui.TestRunner;
>
> -
>
> -/**
>
> - *
>
> - * @author Steven Caswell
>
> - * @version $Id$
>
> - */
>
> -public class IntHashMapTest extends TestCase
>
> -{
>
> -
>
> - public static void main(String[] args) {
>
> - TestRunner.run(suite());
>
> - }
>
> -
>
> - public static Test suite() {
>
> - TestSuite suite = new TestSuite(IntHashMapTest.class);
>
> - suite.setName("IntHashMapTest Tests");
>
> - return suite;
>
> - }
>
> -
>
> - public void testConstructor() {
>
> - try {
>
> - IntHashMap map = new IntHashMap(-1, 0.0f);
>
> - fail();
>
> - } catch (IllegalArgumentException e) {
>
> - assertEquals("Illegal Capacity: -1", e.getMessage());
>
> - }
>
> - try {
>
> - IntHashMap map = new IntHashMap(1, 0.0f);
>
> - fail();
>
> - } catch (IllegalArgumentException e) {
>
> - assertEquals("Illegal Load: 0.0", e.getMessage());
>
> - }
>
> - IntHashMap map = new IntHashMap(0, 1.0f);
>
> -
>
> - try {
>
> - IntHashMap map1 = new IntHashMap(-1);
>
> - fail();
>
> - } catch (IllegalArgumentException e) {
>
> - assertEquals("Illegal Capacity: -1", e.getMessage());
>
> - }
>
> - IntHashMap map1 = new IntHashMap(0);
>
> - }
>
> -
>
> - public void testClear() {
>
> - IntHashMap map = new IntHashMap();
>
> - assertNull(map.put(1, "hello"));
>
> - assertNull(map.put(2, "world"));
>
> - assertEquals(2, map.size());
>
> - map.clear();
>
> - assertEquals(0, map.size());
>
> - }
>
> -
>
> - public void testContainsKey() {
>
> - IntHashMap map = new IntHashMap();
>
> - assertNull(map.put(1, "hello"));
>
> - assertNull(map.put(2, "world"));
>
> - assertEquals(2, map.size());
>
> - assertTrue(map.containsKey(1));
>
> - assertTrue(map.containsKey(2));
>
> - assertFalse(map.containsKey(3));
>
> - }
>
> -
>
> - public void testContains() {
>
> - IntHashMap map = new IntHashMap();
>
> - assertNull(map.put(1, "hello"));
>
> - assertNull(map.put(2, "world"));
>
> - assertEquals(2, map.size());
>
> - assertTrue(map.containsValue("hello"));
>
> - assertTrue(map.containsValue("world"));
>
> - assertFalse(map.containsValue("goodbye"));
>
> - try {
>
> - map.containsValue(null);
>
> - fail();
>
> - } catch(NullPointerException e) {
>
> - }
>
> - }
>
> -
>
> - public void testContainsValue() {
>
> - IntHashMap map = new IntHashMap();
>
> - assertNull(map.put(1, "hello"));
>
> - assertNull(map.put(2, "world"));
>
> - assertEquals(2, map.size());
>
> - assertTrue(map.containsValue("hello"));
>
> - assertTrue(map.containsValue("world"));
>
> - assertFalse(map.containsValue("goodbye"));
>
> - try {
>
> - map.containsValue(null);
>
> - fail();
>
> - } catch(NullPointerException e) {
>
> - }
>
> - }
>
> -
>
> - public void testIsEmpty() {
>
> - IntHashMap map = new IntHashMap();
>
> - assertTrue(map.isEmpty());
>
> - assertNull(map.put(1, "hello"));
>
> - assertEquals(1, map.size());
>
> - assertFalse(map.isEmpty());
>
> - }
>
> -
>
> - public void testPut() {
>
> - IntHashMap map = new IntHashMap();
>
> - assertNull(map.put(1, "hello"));
>
> - assertNull(map.put(2, "world"));
>
> - assertEquals(2, map.size());
>
> - assertEquals("hello", map.put(1, "hellooooo"));
>
> - }
>
> -
>
> - public void testRemove() {
>
> - IntHashMap map = new IntHashMap();
>
> - assertNull(map.put(1, "hello"));
>
> - assertNull(map.put(2, "world"));
>
> - assertEquals(2, map.size());
>
> - assertEquals("hello", map.remove(1));
>
> - assertEquals(1, map.size());
>
> - assertNull(map.remove(3));
>
> - }
>
> -
>
> -}
>
> +/*
> + * Copyright 2005 The Apache Software Foundation.
> + *
> + * Licensed under the Apache License, Version 2.0 (the "License");
> + * you may not use this file except in compliance with the License.
> + * You may obtain a copy of the License at
> + *
> + * http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + * See the License for the specific language governing permissions and
> + * limitations under the License.
> + */
> +package org.apache.commons.lang;
> +
> +import junit.framework.Test;
> +import junit.framework.TestCase;
> +import junit.framework.TestSuite;
> +import junit.textui.TestRunner;
> +
> +/**
> + * Tests for the IntHashMap class.
> + *
> + * @author Steven Caswell
> + * @version $Id$
> + */
> +public class IntHashMapTest extends TestCase {
> +
> + public static void main(String[] args) {
> + TestRunner.run(suite());
> + }
> +
> + public static Test suite() {
> + TestSuite suite = new TestSuite(IntHashMapTest.class);
> + suite.setName("IntHashMapTest Tests");
> + return suite;
> + }
> +
> + public void testConstructor() {
> + try {
> + new IntHashMap(-1, 0.0f);
> + fail();
> + } catch (IllegalArgumentException e) {
> + assertEquals("Illegal Capacity: -1", e.getMessage());
> + }
> + try {
> + new IntHashMap(1, 0.0f);
> + fail();
> + } catch (IllegalArgumentException e) {
> + assertEquals("Illegal Load: 0.0", e.getMessage());
> + }
> + new IntHashMap(0, 1.0f);
> +
> + try {
> + new IntHashMap(-1);
> + fail();
> + } catch (IllegalArgumentException e) {
> + assertEquals("Illegal Capacity: -1", e.getMessage());
> + }
> + IntHashMap map1 = new IntHashMap(0);
> + assertEquals(0, map1.size());
> + }
> +
> + public void testClear() {
> + IntHashMap map = new IntHashMap();
> + assertNull(map.put(1, "hello"));
> + assertNull(map.put(2, "world"));
> + assertEquals(2, map.size());
> + map.clear();
> + assertEquals(0, map.size());
> + }
> +
> + public void testContainsKey() {
> + IntHashMap map = new IntHashMap();
> + assertNull(map.put(1, "hello"));
> + assertNull(map.put(2, "world"));
> + assertEquals(2, map.size());
> + assertTrue(map.containsKey(1));
> + assertTrue(map.containsKey(2));
> + assertFalse(map.containsKey(3));
> + }
> +
> + public void testContains() {
> + IntHashMap map = new IntHashMap();
> + assertNull(map.put(1, "hello"));
> + assertNull(map.put(2, "world"));
> + assertEquals(2, map.size());
> + assertTrue(map.containsValue("hello"));
> + assertTrue(map.containsValue("world"));
> + assertFalse(map.containsValue("goodbye"));
> + try {
> + map.containsValue(null);
> + fail();
> + } catch(NullPointerException e) {
> + }
> + }
> +
> + public void testContainsValue() {
> + IntHashMap map = new IntHashMap();
> + assertNull(map.put(1, "hello"));
> + assertNull(map.put(2, "world"));
> + assertEquals(2, map.size());
> + assertTrue(map.containsValue("hello"));
> + assertTrue(map.containsValue("world"));
> + assertFalse(map.containsValue("goodbye"));
> + try {
> + map.containsValue(null);
> + fail();
> + } catch(NullPointerException e) {
> + }
> + }
> +
> + public void testIsEmpty() {
> + IntHashMap map = new IntHashMap();
> + assertTrue(map.isEmpty());
> + assertNull(map.put(1, "hello"));
> + assertEquals(1, map.size());
> + assertFalse(map.isEmpty());
> + }
> +
> + public void testPut() {
> + IntHashMap map = new IntHashMap();
> + assertNull(map.put(1, "hello"));
> + assertNull(map.put(2, "world"));
> + assertEquals(2, map.size());
> + assertEquals("hello", map.put(1, "hellooooo"));
> + }
> +
> + public void testRemove() {
> + IntHashMap map = new IntHashMap();
> + assertNull(map.put(1, "hello"));
> + assertNull(map.put(2, "world"));
> + assertEquals(2, map.size());
> + assertEquals("hello", map.remove(1));
> + assertEquals(1, map.size());
> + assertNull(map.remove(3));
> + }
> +
> +}
>
> Propchange: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java
> ------------------------------------------------------------------------------
> svn:eol-style = native
>
> Propchange: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java
> ------------------------------------------------------------------------------
> svn:keywords = Date Author Id Revision HeadURL
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
--
Steven Caswell
steven.caswell@gmail.com
(c) 404-693-4148
(o) 404-260-2382
Take back the web - http://www.mozilla.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org