01: /* Copyright 2004 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.services.persondir.support.merger;
07:
08: import java.util.HashMap;
09:
10: import junit.framework.TestCase;
11:
12: /**
13: * Abstract test for the IAttributeMerger interface.
14: * @author andrew.petro@yale.edu
15: * @version $Revision: 35128 $ $Date: 2004-12-13 16:27:49 -0700 (Mon, 13 Dec 2004) $
16: */
17: public abstract class AttributeMergerAbstractTest extends TestCase {
18:
19: /**
20: * Test that attempting to merge attributes into a null Map results in
21: * an illegal argument exception.
22: */
23: public void testNullToModify() {
24: try {
25: getAttributeMerger().mergeAttributes(null, new HashMap());
26: } catch (IllegalArgumentException iae) {
27: // good
28: return;
29: }
30: fail("Should have thrown IAE on null argument.");
31: }
32:
33: /**
34: * Test that attempting to merge attributes into a null Map results in
35: * an illegal argument exception.
36: */
37: public void testNullToConsider() {
38: try {
39: getAttributeMerger().mergeAttributes(new HashMap(), null);
40: } catch (IllegalArgumentException iae) {
41: // good
42: return;
43: }
44: fail("Should have thrown IAE on null argument.");
45: }
46:
47: protected abstract IAttributeMerger getAttributeMerger();
48:
49: }
|