01: /*
02: * CaseInsensitiveComparatorTest.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.gui.tools;
13:
14: import workbench.util.CaseInsensitiveComparator;
15: import java.util.Comparator;
16: import junit.framework.TestCase;
17:
18: /**
19: * @author support@sql-workbench.net
20: */
21: public class CaseInsensitiveComparatorTest extends TestCase {
22: public CaseInsensitiveComparatorTest(String testName) {
23: super (testName);
24: }
25:
26: public void testComparator() {
27: Comparator<String> c = new CaseInsensitiveComparator();
28: int i = c.compare("Test", "TEST");
29: assertEquals(0, i);
30:
31: i = c.compare("TEST", "test");
32: assertEquals(0, i);
33:
34: i = c.compare("test", "test");
35: assertEquals(0, i);
36:
37: i = c.compare("test", "tesd");
38: assertEquals(false, (i == 0));
39: }
40: }
|