01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.config.schema;
05:
06: import com.tc.test.EqualityChecker;
07: import com.tc.test.TCTestCase;
08:
09: /**
10: * Unit test for {@link L2ConfigForL1}.
11: */
12: public class L2ConfigForL1Test extends TCTestCase {
13:
14: public void testL2Data() throws Exception {
15: try {
16: new L2ConfigForL1.L2Data(null, 20);
17: fail("Didn't get NPE on no host");
18: } catch (NullPointerException npe) {
19: // ok
20: }
21:
22: try {
23: new L2ConfigForL1.L2Data("", 20);
24: fail("Didn't get IAE on empty host");
25: } catch (IllegalArgumentException iae) {
26: // ok
27: }
28:
29: try {
30: new L2ConfigForL1.L2Data(" ", 20);
31: fail("Didn't get IAE on blank host");
32: } catch (IllegalArgumentException iae) {
33: // ok
34: }
35:
36: L2ConfigForL1.L2Data config = new L2ConfigForL1.L2Data(
37: "foobar", 20);
38: assertEquals("foobar", config.host());
39: assertEquals(20, config.dsoPort());
40:
41: EqualityChecker.checkArraysForEquality(new Object[] {
42: new L2ConfigForL1.L2Data("foobar", 20),
43: new L2ConfigForL1.L2Data("foobaz", 20),
44: new L2ConfigForL1.L2Data("foobar", 2),
45: new L2ConfigForL1.L2Data("foobar", 30) }, new Object[] {
46: new L2ConfigForL1.L2Data("foobar", 20),
47: new L2ConfigForL1.L2Data("foobaz", 20),
48: new L2ConfigForL1.L2Data("foobar", 2),
49: new L2ConfigForL1.L2Data("foobar", 30) });
50: }
51:
52: }
|