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