001/* 002 * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. 003 * Copyright (C) 2000-2010 The Gridarta Developers. 004 * 005 * This program is free software; you can redistribute it and/or modify 006 * it under the terms of the GNU General Public License as published by 007 * the Free Software Foundation; either version 2 of the License, or 008 * (at your option) any later version. 009 * 010 * This program is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU General Public License for more details. 014 * 015 * You should have received a copy of the GNU General Public License along 016 * with this program; if not, write to the Free Software Foundation, Inc., 017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 018 */ 019 020package net.sf.gridarta.model.archetypetype; 021 022import java.util.Iterator; 023import org.junit.Assert; 024import org.junit.Test; 025 026/** 027 * Regression tests for {@link ArchetypeTypeSet}. 028 * @author Andreas Kirschbaum 029 */ 030public class ArchetypeTypeSetTest { 031 032 /** 033 * Checks that {@link ArchetypeTypeSet#iterator()} returns a read-only 034 * iterator. 035 */ 036 @Test(expected = UnsupportedOperationException.class) 037 public void testIteratorReadOnly() { 038 final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); 039 archetypeTypeSet.addArchetypeType(new ArchetypeType("name", 0, "", false, null, false, null, null, new ArchetypeAttributesDefinition())); 040 final Iterator<ArchetypeType> iterator = archetypeTypeSet.iterator(); 041 Assert.assertTrue(iterator.hasNext()); 042 iterator.next(); 043 iterator.remove(); 044 } 045 046}