diff options
Diffstat (limited to 'jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java')
-rw-r--r-- | jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java deleted file mode 100644 index 98697897b7..0000000000 --- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.utility.tests.internal.iterators; - -import java.util.Enumeration; -import java.util.NoSuchElementException; -import junit.framework.TestCase; -import org.eclipse.jpt.utility.internal.iterators.EmptyEnumeration; - -public class EmptyEnumerationTests extends TestCase { - - public EmptyEnumerationTests(String name) { - super(name); - } - - public void testHasMoreElements() { - int i = 0; - for (Enumeration<Object> stream = EmptyEnumeration.instance(); stream.hasMoreElements();) { - stream.nextElement(); - i++; - } - assertEquals(0, i); - } - - public void testNextElement() { - for (Enumeration<Object> stream = EmptyEnumeration.instance(); stream.hasMoreElements();) { - fail("bogus element: " + stream.nextElement()); - } - } - - public void testNoSuchElementException() { - boolean exCaught = false; - Enumeration<Object> stream = EmptyEnumeration.instance(); - Object element = null; - while (stream.hasMoreElements()) { - element = stream.nextElement(); - } - try { - element = stream.nextElement(); - } catch (NoSuchElementException ex) { - exCaught = true; - } - assertTrue("NoSuchElementException not thrown: " + element, exCaught); - } - -} |