KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > collections > comparators > TestComparableComparator


1 /*
2  * Copyright 2001-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.comparators;
17
18 import java.util.Comparator JavaDoc;
19 import java.util.LinkedList JavaDoc;
20 import java.util.List JavaDoc;
21
22 import junit.framework.Test;
23 import junit.framework.TestSuite;
24
25 /**
26  * Tests for ComparableComparator.
27  *
28  * @version $Revision: 1.6 $ $Date: 2004/02/18 01:20:34 $
29  *
30  * @author Unknown
31  */

32 public class TestComparableComparator extends AbstractTestComparator {
33
34     public TestComparableComparator(String JavaDoc testName) {
35         super(testName);
36     }
37
38     public static Test suite() {
39         return new TestSuite(TestComparableComparator.class);
40     }
41
42     public Comparator JavaDoc makeComparator() {
43         return new ComparableComparator();
44     }
45
46     public List JavaDoc getComparableObjectsOrdered() {
47         List JavaDoc list = new LinkedList JavaDoc();
48         list.add(new Integer JavaDoc(1));
49         list.add(new Integer JavaDoc(2));
50         list.add(new Integer JavaDoc(3));
51         list.add(new Integer JavaDoc(4));
52         list.add(new Integer JavaDoc(5));
53         return list;
54     }
55
56 }
57
Popular Tags