01: /**
02: *
03: * Copyright 2004 The Apache Software Foundation
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.ws.scout.registry.infomodel;
17:
18: import javax.xml.registry.JAXRException;
19: import javax.xml.registry.UnsupportedCapabilityException;
20: import javax.xml.registry.infomodel.PersonName;
21:
22: import junit.framework.TestCase;
23:
24: /**
25: * @version $Rev$ $Date$
26: */
27: public class PersonNameTest extends TestCase {
28: private PersonName name;
29:
30: public void testLevel1Methods() throws JAXRException {
31: try {
32: name.getFirstName();
33: fail("Expected UnsupportedCapabilityException");
34: } catch (UnsupportedCapabilityException e) {
35: // OK
36: }
37: try {
38: name.getMiddleName();
39: fail("Expected UnsupportedCapabilityException");
40: } catch (UnsupportedCapabilityException e) {
41: // OK
42: }
43: try {
44: name.getLastName();
45: fail("Expected UnsupportedCapabilityException");
46: } catch (UnsupportedCapabilityException e) {
47: // OK
48: }
49: try {
50: name.setFirstName(null);
51: fail("Expected UnsupportedCapabilityException");
52: } catch (UnsupportedCapabilityException e) {
53: // OK
54: }
55: try {
56: name.setMiddleName(null);
57: fail("Expected UnsupportedCapabilityException");
58: } catch (UnsupportedCapabilityException e) {
59: // OK
60: }
61: try {
62: name.setLastName(null);
63: fail("Expected UnsupportedCapabilityException");
64: } catch (UnsupportedCapabilityException e) {
65: // OK
66: }
67: }
68:
69: public void testLevel0Methods() throws JAXRException {
70:
71: name.setFullName("foo");
72:
73: assertEquals("foo", name.getFullName());
74: }
75:
76: protected void setUp() throws Exception {
77: super .setUp();
78: name = new PersonNameImpl();
79: }
80: }
|