001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.commons.collections.primitives.decorators; 018 019import junit.framework.Test; 020import junit.framework.TestSuite; 021 022import org.apache.commons.collections.primitives.IntIterator; 023 024/** 025 * @version $Revision: 480451 $ $Date: 2006-11-29 02:45:08 -0500 (Wed, 29 Nov 2006) $ 026 * @author Rodney Waldhoff 027 */ 028public class TestUnmodifiableIntIterator extends BaseUnmodifiableIntIteratorTest { 029 030 // conventional 031 // ------------------------------------------------------------------------ 032 033 public TestUnmodifiableIntIterator(String testName) { 034 super(testName); 035 } 036 037 038 public static Test suite() { 039 return new TestSuite(TestUnmodifiableIntIterator.class); 040 } 041 042 // framework 043 // ------------------------------------------------------------------------ 044 045 protected IntIterator makeUnmodifiableIntIterator() { 046 return UnmodifiableIntIterator.wrap(makeIntIterator()); 047 } 048 049 // tests 050 // ------------------------------------------------------------------------ 051 052 public void testWrapNotNull() { 053 assertNotNull(UnmodifiableIntIterator.wrap(makeIntIterator())); 054 } 055 056 public void testWrapNull() { 057 assertNull(UnmodifiableIntIterator.wrap(null)); 058 } 059 060 public void testWrapUnmodifiableIntIterator() { 061 IntIterator iter = makeUnmodifiableIntIterator(); 062 assertSame(iter,UnmodifiableIntIterator.wrap(iter)); 063 } 064 065}