1 16 package org.apache.commons.collections.collection; 17 18 import java.util.ArrayList ; 19 import java.util.Arrays ; 20 import java.util.Collection ; 21 import java.util.List ; 22 23 import junit.framework.Test; 24 import junit.framework.TestSuite; 25 26 36 public class TestUnmodifiableCollection extends AbstractTestCollection { 37 38 public TestUnmodifiableCollection(String testName) { 39 super(testName); 40 } 41 42 public static Test suite() { 43 return new TestSuite(TestUnmodifiableCollection.class); 44 } 45 46 public static void main(String args[]) { 47 String [] testCaseName = { TestUnmodifiableCollection.class.getName()}; 48 junit.textui.TestRunner.main(testCaseName); 49 } 50 51 public Collection makeCollection() { 53 return UnmodifiableCollection.decorate(new ArrayList ()); 54 } 55 56 public Collection makeFullCollection() { 57 List list = new ArrayList (); 58 list.addAll(Arrays.asList(getFullElements())); 59 return UnmodifiableCollection.decorate(list); 60 } 61 62 public Collection makeConfirmedCollection() { 63 ArrayList list = new ArrayList (); 64 return list; 65 } 66 67 public Collection makeConfirmedFullCollection() { 68 ArrayList list = new ArrayList (); 69 list.addAll(Arrays.asList(getFullElements())); 70 return list; 71 } 72 73 public boolean isAddSupported() { 74 return false; 75 } 76 77 public boolean isRemoveSupported() { 78 return false; 79 } 80 81 public String getCompatibilityVersion() { 82 return "3.1"; 83 } 84 85 92 } 93 | Popular Tags |