01: /*
02: * Copyright 2004 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.apache.commons.collections.collection;
17:
18: import java.util.ArrayList;
19: import java.util.Arrays;
20: import java.util.Collection;
21:
22: import junit.framework.Test;
23: import junit.framework.TestSuite;
24:
25: /**
26: * Extension of {@link AbstractTestCollection} for exercising the
27: * {@link SynchronizedCollection} implementation.
28: *
29: * @since Commons Collections 3.1
30: * @version $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
31: *
32: * @author Phil Steitz
33: * @author Stephen Colebourne
34: */
35: public class TestSynchronizedCollection extends AbstractTestCollection {
36:
37: public TestSynchronizedCollection(String testName) {
38: super (testName);
39: }
40:
41: public static Test suite() {
42: return new TestSuite(TestSynchronizedCollection.class);
43: }
44:
45: public static void main(String args[]) {
46: String[] testCaseName = { TestSynchronizedCollection.class
47: .getName() };
48: junit.textui.TestRunner.main(testCaseName);
49: }
50:
51: //-----------------------------------------------------------------------
52: public Collection makeCollection() {
53: return SynchronizedCollection.decorate(new ArrayList());
54: }
55:
56: public Collection makeConfirmedCollection() {
57: ArrayList list = new ArrayList();
58: return list;
59: }
60:
61: public Collection makeConfirmedFullCollection() {
62: ArrayList list = new ArrayList();
63: list.addAll(Arrays.asList(getFullElements()));
64: return list;
65: }
66:
67: public String getCompatibilityVersion() {
68: return "3.1";
69: }
70:
71: // public void testCreate() throws Exception {
72: // resetEmpty();
73: // writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/SynchronizedCollection.emptyCollection.version3.1.obj");
74: // resetFull();
75: // writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/SynchronizedCollection.fullCollection.version3.1.obj");
76: // }
77:
78: }
|