1 4 package com.tc.config.schema; 5 6 import com.tc.test.EqualityChecker; 7 import com.tc.test.TCTestCase; 8 9 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 } 21 22 try { 23 new L2ConfigForL1.L2Data("", 20); 24 fail("Didn't get IAE on empty host"); 25 } catch (IllegalArgumentException iae) { 26 } 28 29 try { 30 new L2ConfigForL1.L2Data(" ", 20); 31 fail("Didn't get IAE on blank host"); 32 } catch (IllegalArgumentException iae) { 33 } 35 36 L2ConfigForL1.L2Data config = new L2ConfigForL1.L2Data("foobar", 20); 37 assertEquals("foobar", config.host()); 38 assertEquals(20, config.dsoPort()); 39 40 EqualityChecker.checkArraysForEquality( 41 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) }, 46 new Object [] { 47 new L2ConfigForL1.L2Data("foobar", 20), 48 new L2ConfigForL1.L2Data("foobaz", 20), 49 new L2ConfigForL1.L2Data("foobar", 2), 50 new L2ConfigForL1.L2Data("foobar", 30) }); 51 } 52 53 } 54 | Popular Tags |