Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 23324 invoked from network); 10 Oct 2006 20:58:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Oct 2006 20:58:47 -0000 Received: (qmail 51130 invoked by uid 500); 10 Oct 2006 20:58:46 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 51099 invoked by uid 500); 10 Oct 2006 20:58:46 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 51078 invoked by uid 99); 10 Oct 2006 20:58:46 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Oct 2006 13:58:46 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Oct 2006 13:58:45 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 60A771A981A; Tue, 10 Oct 2006 13:58:25 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r462562 - in /geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory: UserTest.java model/User.java Date: Tue, 10 Oct 2006 20:58:25 -0000 To: scm@geronimo.apache.org From: dain@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061010205825.60A771A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: dain Date: Tue Oct 10 13:58:24 2006 New Revision: 462562 URL: http://svn.apache.org/viewvc?view=rev&rev=462562 Log: Added a simpler test case Added: geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/UserTest.java geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/model/User.java Added: geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/UserTest.java URL: http://svn.apache.org/viewvc/geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/UserTest.java?view=auto&rev=462562 ============================================================================== --- geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/UserTest.java (added) +++ geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/UserTest.java Tue Oct 10 13:58:24 2006 @@ -0,0 +1,50 @@ +/** + * + * Copyright 2006 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.xbean.factory; + +import junit.framework.TestCase; +import org.apache.xbean.factory.model.User; + +/** + * @version $Rev$ $Date$ + */ +public class UserTest extends TestCase { + private User user; + + public void test() { + User testUser = loadUser(); + assertNotNull(testUser); + assertEquals(user.getPk(), testUser.getPk()); + assertEquals(user.getName(), testUser.getName()); + assertEquals(user.getFullName(), testUser.getFullName()); + assertEquals(user.getPhoneNumber(), testUser.getPhoneNumber()); + assertEquals(user, testUser); + } + + public User loadUser() { + User testUser = new User(42, "dain", "Dain Sundstrom"); + testUser.setPhoneNumber("(310) XXX-XXXX"); + return testUser; + } + + + protected void setUp() throws Exception { + super.setUp(); + user = new User(42, "dain", "Dain Sundstrom"); + user.setPhoneNumber("(310) XXX-XXXX"); + } +} Added: geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/model/User.java URL: http://svn.apache.org/viewvc/geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/model/User.java?view=auto&rev=462562 ============================================================================== --- geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/model/User.java (added) +++ geronimo/xbean/sandbox/xbean-factory/src/test/java/org/apache/xbean/factory/model/User.java Tue Oct 10 13:58:24 2006 @@ -0,0 +1,91 @@ +/** + * + * Copyright 2006 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.xbean.factory.model; + +/** + * @version $Rev$ $Date$ + */ +public class User { + private long pk; + private String name; + private String fullName; + private String phoneNumber; + + public User() { + } + + public User(long pk, String name, String fullName) { + this.pk = pk; + this.name = name; + this.fullName = fullName; + } + + public long getPk() { + return pk; + } + + public void setPk(long pk) { + this.pk = pk; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + final User user = (User) o; + + if (pk != user.pk) return false; + if (fullName != null ? !fullName.equals(user.fullName) : user.fullName != null) return false; + if (name != null ? !name.equals(user.name) : user.name != null) return false; + if (phoneNumber != null ? !phoneNumber.equals(user.phoneNumber) : user.phoneNumber != null) return false; + + return true; + } + + public int hashCode() { + int result; + result = (int) (pk ^ (pk >>> 32)); + result = 29 * result + (name != null ? name.hashCode() : 0); + result = 29 * result + (fullName != null ? fullName.hashCode() : 0); + result = 29 * result + (phoneNumber != null ? phoneNumber.hashCode() : 0); + return result; + } +}