KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > collections > collection > TestSynchronizedCollection


1 /*
2  * Copyright 2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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 JavaDoc;
19 import java.util.Arrays JavaDoc;
20 import java.util.Collection JavaDoc;
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: 1.1 $ $Date: 2004/06/01 23:07:12 $
31  *
32  * @author Phil Steitz
33  * @author Stephen Colebourne
34  */

35 public class TestSynchronizedCollection extends AbstractTestCollection {
36     
37     public TestSynchronizedCollection(String JavaDoc 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 JavaDoc args[]) {
46         String JavaDoc[] testCaseName = { TestSynchronizedCollection.class.getName()};
47         junit.textui.TestRunner.main(testCaseName);
48     }
49
50     //-----------------------------------------------------------------------
51
public Collection JavaDoc makeCollection() {
52         return SynchronizedCollection.decorate(new ArrayList JavaDoc());
53     }
54     
55     public Collection JavaDoc makeConfirmedCollection() {
56         ArrayList JavaDoc list = new ArrayList JavaDoc();
57         return list;
58     }
59
60     public Collection JavaDoc makeConfirmedFullCollection() {
61         ArrayList JavaDoc list = new ArrayList JavaDoc();
62         list.addAll(Arrays.asList(getFullElements()));
63         return list;
64     }
65
66     public String JavaDoc getCompatibilityVersion() {
67         return "3.1";
68     }
69
70 // public void testCreate() throws Exception {
71
// resetEmpty();
72
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/SynchronizedCollection.emptyCollection.version3.1.obj");
73
// resetFull();
74
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/SynchronizedCollection.fullCollection.version3.1.obj");
75
// }
76

77 }
78
Popular Tags