[jboss-svn-commits] JBL Code SVN: r11366 - labs/jbossrules/trunk/drools-jbrms/src/test/java/org/drools.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Apr 26 12:56:09 EDT 2007


Author: mark.proctor at jboss.com
Date: 2007-04-26 12:56:09 -0400 (Thu, 26 Apr 2007)
New Revision: 11366

Added:
   labs/jbossrules/trunk/drools-jbrms/src/test/java/org/drools/Cheese.java
   labs/jbossrules/trunk/drools-jbrms/src/test/java/org/drools/Person.java
   labs/jbossrules/trunk/drools-jbrms/src/test/java/org/drools/PersonInterface.java
Log:
-added missing files

Added: labs/jbossrules/trunk/drools-jbrms/src/test/java/org/drools/Cheese.java
===================================================================
--- labs/jbossrules/trunk/drools-jbrms/src/test/java/org/drools/Cheese.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-jbrms/src/test/java/org/drools/Cheese.java	2007-04-26 16:56:09 UTC (rev 11366)
@@ -0,0 +1,84 @@
+package org.drools;
+
+import java.io.Serializable;
+
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * 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.
+ */
+
+public class Cheese
+    implements
+    Serializable {
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -1187540653710115339L;
+    private String            type;
+    private int               price;
+
+    public Cheese() {
+
+    }
+
+    public Cheese(final String type,
+                  final int price) {
+        super();
+        this.type = type;
+        this.price = price;
+    }
+
+    public int getPrice() {
+        return this.price;
+    }
+
+    public String getType() {
+        return this.type;
+    }
+
+    public void setType(final String type) {
+        this.type = type;
+    }
+
+    public void setPrice(final int price) {
+        this.price = price;
+    }
+
+    public String toString() {
+        return "Cheese( type='" + this.type + "', price=" + this.price + " )";
+    }
+
+    public int hashCode() {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + price;
+        result = PRIME * result + ((type == null) ? 0 : type.hashCode());
+        return result;
+    }
+
+    public boolean equals(Object obj) {
+        if ( this == obj ) return true;
+        if ( obj == null ) return false;
+        if ( getClass() != obj.getClass() ) return false;
+        final Cheese other = (Cheese) obj;
+        if ( price != other.price ) return false;
+        if ( type == null ) {
+            if ( other.type != null ) return false;
+        } else if ( !type.equals( other.type ) ) return false;
+        return true;
+    }
+    
+    
+
+}
\ No newline at end of file

Added: labs/jbossrules/trunk/drools-jbrms/src/test/java/org/drools/Person.java
===================================================================
--- labs/jbossrules/trunk/drools-jbrms/src/test/java/org/drools/Person.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-jbrms/src/test/java/org/drools/Person.java	2007-04-26 16:56:09 UTC (rev 11366)
@@ -0,0 +1,225 @@
+package org.drools;
+
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+public class Person
+    implements
+    Serializable,
+    PersonInterface {
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 2640286967578736742L;
+    private String            name;
+    private String            likes;
+    private int               age;
+    private BigDecimal        bigDecimal;
+    private BigInteger        bigInteger;
+    private String            hair;
+
+    private char              sex;
+
+    private boolean           alive;
+
+    private String            status;
+
+    private Cheese            cheese;
+
+    public Person() {
+
+    }
+
+    public Person(final String name) {
+        this( name,
+              "",
+              0 );
+    }
+
+    public Person(final String name,
+                  final String likes) {
+        this( name,
+              likes,
+              0 );
+    }
+
+    public Person(final String name,
+                  final String likes,
+                  final int age) {
+        this.name = name;
+        this.likes = likes;
+        this.age = age;
+    }
+
+    /* (non-Javadoc)
+     * @see org.drools.PersonInterface#getStatus()
+     */
+    public String getStatus() {
+        return this.status;
+    }
+
+    /* (non-Javadoc)
+     * @see org.drools.PersonInterface#setStatus(java.lang.String)
+     */
+    public void setStatus(final String status) {
+        this.status = status;
+    }
+
+    /* (non-Javadoc)
+     * @see org.drools.PersonInterface#getLikes()
+     */
+    public String getLikes() {
+        return this.likes;
+    }
+
+    /* (non-Javadoc)
+     * @see org.drools.PersonInterface#getName()
+     */
+    public String getName() {
+        return this.name;
+    }
+
+    public void setName(final String name) {
+        this.name = name;
+    }
+
+    /* (non-Javadoc)
+     * @see org.drools.PersonInterface#getAge()
+     */
+    public int getAge() {
+        return this.age;
+    }
+
+    public void setAge(final int age) {
+        this.age = age;
+    }
+
+    /* (non-Javadoc)
+     * @see org.drools.PersonInterface#isAlive()
+     */
+    public boolean isAlive() {
+        return this.alive;
+    }
+
+    /* (non-Javadoc)
+     * @see org.drools.PersonInterface#setAlive(boolean)
+     */
+    public void setAlive(final boolean alive) {
+        this.alive = alive;
+    }
+
+    /* (non-Javadoc)
+     * @see org.drools.PersonInterface#getSex()
+     */
+    public char getSex() {
+        return this.sex;
+    }
+
+    /* (non-Javadoc)
+     * @see org.drools.PersonInterface#setSex(char)
+     */
+    public void setSex(final char sex) {
+        this.sex = sex;
+    }
+
+    public String getHair() {
+        return this.hair;
+    }
+
+    public void setHair(final String hair) {
+        this.hair = hair;
+    }
+
+    public String toString() {
+        return "[Person name='" + this.name + "']";
+    }
+
+    /**
+     * @inheritDoc
+     */
+    public int hashCode() {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + this.age;
+        result = PRIME * result + (this.alive ? 1231 : 1237);
+        result = PRIME * result + ((this.name == null) ? 0 : this.name.hashCode());
+        result = PRIME * result + this.sex;
+        return result;
+    }
+
+    /**
+     * @inheritDoc
+     */
+    public boolean equals(final Object obj) {
+        if ( this == obj ) {
+            return true;
+        }
+        if ( obj == null ) {
+            return false;
+        }
+        if ( getClass() != obj.getClass() ) {
+            return false;
+        }
+        final Person other = (Person) obj;
+        if ( this.age != other.age ) {
+            return false;
+        }
+        if ( this.alive != other.alive ) {
+            return false;
+        }
+        if ( this.name == null ) {
+            if ( other.name != null ) {
+                return false;
+            }
+        } else if ( !this.name.equals( other.name ) ) {
+            return false;
+        }
+        if ( this.sex != other.sex ) {
+            return false;
+        }
+        return true;
+    }
+
+    /* (non-Javadoc)
+     * @see org.drools.PersonInterface#getBigDecimal()
+     */
+    public BigDecimal getBigDecimal() {
+        return this.bigDecimal;
+    }
+
+    /* (non-Javadoc)
+     * @see org.drools.PersonInterface#setBigDecimal(java.math.BigDecimal)
+     */
+    public void setBigDecimal(final BigDecimal bigDecimal) {
+        this.bigDecimal = bigDecimal;
+    }
+
+    /* (non-Javadoc)
+     * @see org.drools.PersonInterface#getBigInteger()
+     */
+    public BigInteger getBigInteger() {
+        return this.bigInteger;
+    }
+
+    /* (non-Javadoc)
+     * @see org.drools.PersonInterface#setBigInteger(java.math.BigInteger)
+     */
+    public void setBigInteger(final BigInteger bigInteger) {
+        this.bigInteger = bigInteger;
+    }
+
+    public void setLikes(final String likes) {
+        this.likes = likes;
+    }
+
+    public Cheese getCheese() {
+        return this.cheese;
+    }
+
+    public void setCheese(final Cheese cheese) {
+        this.cheese = cheese;
+    }
+
+}
\ No newline at end of file

Added: labs/jbossrules/trunk/drools-jbrms/src/test/java/org/drools/PersonInterface.java
===================================================================
--- labs/jbossrules/trunk/drools-jbrms/src/test/java/org/drools/PersonInterface.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-jbrms/src/test/java/org/drools/PersonInterface.java	2007-04-26 16:56:09 UTC (rev 11366)
@@ -0,0 +1,35 @@
+package org.drools;
+
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+public interface PersonInterface {
+
+    public abstract String getStatus();
+
+    public abstract void setStatus(String status);
+
+    public abstract String getLikes();
+
+    public abstract String getName();
+
+    public abstract int getAge();
+
+    public abstract boolean isAlive();
+
+    public abstract void setAlive(boolean alive);
+
+    public abstract char getSex();
+
+    public abstract void setSex(char sex);
+
+    public abstract BigDecimal getBigDecimal();
+
+    public abstract void setBigDecimal(BigDecimal bigDecimal);
+
+    public abstract BigInteger getBigInteger();
+
+    public abstract void setBigInteger(BigInteger bigInteger);
+
+}
\ No newline at end of file




More information about the jboss-svn-commits mailing list