Return-Path: Delivered-To: apmail-ws-scout-dev-archive@www.apache.org Received: (qmail 29337 invoked from network); 26 Dec 2004 01:38:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 26 Dec 2004 01:38:26 -0000 Received: (qmail 55618 invoked by uid 500); 26 Dec 2004 01:38:25 -0000 Delivered-To: apmail-ws-scout-dev-archive@ws.apache.org Received: (qmail 55592 invoked by uid 500); 26 Dec 2004 01:38:25 -0000 Mailing-List: contact scout-dev-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: scout-dev@ws.apache.org Delivered-To: mailing list scout-dev@ws.apache.org Received: (qmail 55575 invoked by uid 500); 26 Dec 2004 01:38:25 -0000 Delivered-To: apmail-ws-scout-cvs@ws.apache.org Received: (qmail 55571 invoked by uid 99); 26 Dec 2004 01:38:25 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sat, 25 Dec 2004 17:38:25 -0800 Received: (qmail 29321 invoked by uid 65534); 26 Dec 2004 01:38:24 -0000 Date: 26 Dec 2004 01:38:24 -0000 Message-ID: <20041226013824.29316.qmail@minotaur.apache.org> From: jboynes@apache.org To: scout-cvs@ws.apache.org Subject: svn commit: r123352 - /webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/PersonNameImpl.java /webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/registry/infomodel/PersonNameTest.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: jboynes Date: Sat Dec 25 17:38:22 2004 New Revision: 123352 URL: http://svn.apache.org/viewcvs?view=rev&rev=123352 Log: fix for SCOUT-4: Level 1 PersonName methods must throw UnsupportedCapabilityException Added: webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/registry/infomodel/PersonNameTest.java Modified: webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/PersonNameImpl.java Modified: webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/PersonNameImpl.java Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/PersonNameImpl.java?view=diff&rev=123352&p1=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/PersonNameImpl.java&r1=123351&p2=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/PersonNameImpl.java&r2=123352 ============================================================================== --- webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/PersonNameImpl.java (original) +++ webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/PersonNameImpl.java Sat Dec 25 17:38:22 2004 @@ -17,6 +17,7 @@ package org.apache.ws.scout.registry.infomodel; import javax.xml.registry.JAXRException; +import javax.xml.registry.UnsupportedCapabilityException; /** * Implements JAXR Interface. @@ -24,13 +25,9 @@ * * @author Anil Saldhana */ -public class PersonNameImpl - implements javax.xml.registry.infomodel.PersonName { +public class PersonNameImpl implements javax.xml.registry.infomodel.PersonName { - private String firstname = ""; private String fullname = ""; - private String lastname = ""; - private String middlename = ""; /** * Creates a new instance of PersonNameImpl @@ -38,46 +35,39 @@ public PersonNameImpl() { } - public PersonNameImpl(String fn, String mn, String ln) { - this.firstname = fn; - this.middlename = mn; - this.lastname = ln; - } - public PersonNameImpl(String fullname) { this.fullname = fullname; } - public String getFirstName() throws JAXRException { - return this.firstname; - } - public String getFullName() throws JAXRException { return this.fullname; } + public void setFullName(String str) throws JAXRException { + this.fullname = str; + } + + public String getFirstName() throws JAXRException { + throw new UnsupportedCapabilityException(); + } + public String getLastName() throws JAXRException { - return this.lastname; + throw new UnsupportedCapabilityException(); } public String getMiddleName() throws JAXRException { - return this.middlename; + throw new UnsupportedCapabilityException(); } public void setFirstName(String str) throws JAXRException { - this.firstname = str; - } - - public void setFullName(String str) throws JAXRException { - this.fullname = str; + throw new UnsupportedCapabilityException(); } public void setLastName(String str) throws JAXRException { - this.lastname = str; + throw new UnsupportedCapabilityException(); } public void setMiddleName(String str) throws JAXRException { - this.middlename = str; + throw new UnsupportedCapabilityException(); } - } Added: webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/registry/infomodel/PersonNameTest.java Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/registry/infomodel/PersonNameTest.java?view=auto&rev=123352 ============================================================================== --- (empty file) +++ webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/registry/infomodel/PersonNameTest.java Sat Dec 25 17:38:22 2004 @@ -0,0 +1,74 @@ +/** + * + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.ws.scout.registry.infomodel; + +import javax.xml.registry.infomodel.PersonName; +import javax.xml.registry.JAXRException; +import javax.xml.registry.UnsupportedCapabilityException; + +import junit.framework.TestCase; + +/** + * @version $Rev$ $Date$ + */ +public class PersonNameTest extends TestCase { + private PersonName name; + + public void testLevel1Methods() throws JAXRException { + try { + name.getFirstName(); + fail("Expected UnsupportedCapabilityException"); + } catch (UnsupportedCapabilityException e) { + // OK + } + try { + name.getMiddleName(); + fail("Expected UnsupportedCapabilityException"); + } catch (UnsupportedCapabilityException e) { + // OK + } + try { + name.getLastName(); + fail("Expected UnsupportedCapabilityException"); + } catch (UnsupportedCapabilityException e) { + // OK + } + try { + name.setFirstName(null); + fail("Expected UnsupportedCapabilityException"); + } catch (UnsupportedCapabilityException e) { + // OK + } + try { + name.setMiddleName(null); + fail("Expected UnsupportedCapabilityException"); + } catch (UnsupportedCapabilityException e) { + // OK + } + try { + name.setLastName(null); + fail("Expected UnsupportedCapabilityException"); + } catch (UnsupportedCapabilityException e) { + // OK + } + } + + protected void setUp() throws Exception { + super.setUp(); + name = new PersonNameImpl(); + } +} --------------------------------------------------------------------- To unsubscribe, e-mail: scout-dev-unsubscribe@ws.apache.org For additional commands, e-mail: scout-dev-help@ws.apache.org