[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/aop/test ...
Manik Surtani
msurtani at jboss.com
Fri Jul 21 15:51:35 EDT 2006
User: msurtani
Date: 06/07/21 15:51:35
Added: tests/functional/org/jboss/cache/aop/test
Address.java CacheObject.java IdObject.java
Link.java NetworkAdmin.java NetworkDomain.java
NetworkElement.java NetworkNode.java
NodeManager.java Person.java SerializedAddress.java
Student.java TestNode.java ValueObject.java
Log:
Restored
Revision Changes Path
1.5 +0 -0 JBossCache/tests/functional/org/jboss/cache/aop/test/Address.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Address.java
===================================================================
RCS file: Address.java
diff -N Address.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Address.java 21 Jul 2006 19:51:35 -0000 1.5
@@ -0,0 +1,68 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.cache.aop.test;
+
+import java.util.Collection;
+import java.util.Vector;
+import java.util.Iterator;
+
+
+/**
+ * Test class for TreeCacheAOP.
+ *
+ * @version $Revision: 1.5 $
+ * <p>Below is the annotation that signifies this class is "prepared" under JBossAop. This is used in
+ * conjunction with a special jboss-aop.xml (supplied by JBossCache). In addition, this is JDK1.4 style,
+ * so a annoc Ant build target is needed to pre-compile it.</p>
+ * <p>To use this approach, just apply this line to your pojo and run annoc (and possibly aopc).</p>
+ * @@org.jboss.cache.aop.AopMarker
+ */
+public class Address
+{
+ String street = null;
+ String city = null;
+ int zip = 0;
+
+ public String getStreet()
+ {
+ return street;
+ }
+
+ public void setStreet(String street)
+ {
+ this.street = street;
+ }
+
+ public String getCity()
+ {
+ return city;
+ }
+
+ public void setCity(String city)
+ {
+ this.city = city;
+ }
+
+ public int getZip()
+ {
+ return zip;
+ }
+
+ public void setZip(int zip)
+ {
+ this.zip = zip;
+ }
+
+ public String toString()
+ {
+ return "street=" + getStreet() + ", city=" + getCity() + ", zip=" + getZip();
+ }
+
+// public Object writeReplace() {
+// return this;
+// }
+}
1.3 +0 -0 JBossCache/tests/functional/org/jboss/cache/aop/test/CacheObject.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheObject.java
===================================================================
RCS file: CacheObject.java
diff -N CacheObject.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ CacheObject.java 21 Jul 2006 19:51:35 -0000 1.3
@@ -0,0 +1,30 @@
+package org.jboss.cache.aop.test;
+
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Object to bind in cache
+ */
+public class CacheObject implements Serializable
+{
+ private String id;
+ private Set identities;
+
+ public CacheObject(String id)
+ {
+ this.id = id;
+ this.identities = new HashSet();
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public Set getIdentities()
+ {
+ return identities;
+ }
+}
1.4 +0 -0 JBossCache/tests/functional/org/jboss/cache/aop/test/IdObject.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: IdObject.java
===================================================================
RCS file: IdObject.java
diff -N IdObject.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ IdObject.java 21 Jul 2006 19:51:35 -0000 1.4
@@ -0,0 +1,46 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.cache.aop.test;
+
+/**
+ * Key object that overrides the hashCode that can cause problem for aop.
+ * @@org.jboss.cache.aop.InstanceOfAopMarker
+ */
+public class IdObject{
+
+ private String id;
+
+ public IdObject() {
+ } // IdObject
+
+ public IdObject(String aId) {
+ id = aId;
+ } // IdObject
+
+
+ public String toString() {
+ return id;
+ } // toString
+
+ public boolean equals(Object aObject) {
+ boolean result = false;
+
+ if ((aObject != null) &&
+ (aObject.getClass().getName().equals( this.getClass().getName()))) {
+ if (id.equals(((IdObject)aObject).id)) {
+ result = true;
+ } // if
+ } // if
+
+ return result;
+ } // equals
+
+ public int hashCode() {
+ return id.hashCode();
+ } // hashCode
+} // class IdObject
+
1.3 +0 -0 JBossCache/tests/functional/org/jboss/cache/aop/test/Link.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Link.java
===================================================================
RCS file: Link.java
diff -N Link.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Link.java 21 Jul 2006 19:51:35 -0000 1.3
@@ -0,0 +1,63 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.cache.aop.test;
+
+
+
+
+/**
+ * Test class for TreeCacheAOP for circular references.
+ * Link is a POJO that will be instrumentet with CacheInterceptor
+ *
+ * @version $Revision: 1.3 $
+ * <p>Below is the annotation that signifies this class is "prepared" under JBossAop. This is used in
+ * conjunction with a special jboss-aop.xml (supplied by JBossCache). In addition, this is JDK1.4 style,
+ * so a annoc Ant build target is needed to pre-compile it.</p>
+ * <p>To use this approach, just apply this line to your pojo and run annoc (and possibly aopc).</p>
+ * @@org.jboss.cache.aop.AopMarker
+ */
+public class Link
+{
+ Link link_;
+ String name_;
+
+ public Link()
+ {
+ }
+
+ public Link(String name)
+ {
+ name_ = name;
+ }
+
+ public void setName(String linkName)
+ {
+ name_ = linkName;
+ }
+
+ public String getName()
+ {
+ return name_;
+ }
+
+ public void setLink(Link link)
+ {
+ link_ = link;
+ }
+
+ public Link getLink()
+ {
+ return link_;
+ }
+
+ public String toString()
+ {
+ StringBuffer buf = new StringBuffer();
+ buf.append("Link: name " + name_);
+ return buf.toString();
+ }
+}
1.3 +0 -0 JBossCache/tests/functional/org/jboss/cache/aop/test/NetworkAdmin.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NetworkAdmin.java
===================================================================
RCS file: NetworkAdmin.java
diff -N NetworkAdmin.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ NetworkAdmin.java 21 Jul 2006 19:51:35 -0000 1.3
@@ -0,0 +1,41 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.cache.aop.test;
+
+import java.util.*;
+
+/**
+ * Sample object that contains administration details.
+ * <p>This object is used to illustrate the pojo cache capability of JBossCache. Note the absence of <code>Serializable</code>
+ * interface.</p>
+ *
+ * @author <a href="mailto:ben.wang at jboss.com">Ben Wang</a>
+ *
+ * @@org.jboss.cache.aop.AopMarker
+ */
+public class NetworkAdmin
+{
+ String id_;
+
+ public String getId()
+ {
+ return id_;
+ }
+
+ public void setId(String id)
+ {
+ id_ = id;
+ }
+
+ public String toString()
+ {
+ StringBuffer sb=new StringBuffer();
+ sb.append(" id = ").append(getId());
+ return sb.toString();
+ }
+
+}
1.4 +0 -0 JBossCache/tests/functional/org/jboss/cache/aop/test/NetworkDomain.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NetworkDomain.java
===================================================================
RCS file: NetworkDomain.java
diff -N NetworkDomain.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ NetworkDomain.java 21 Jul 2006 19:51:35 -0000 1.4
@@ -0,0 +1,98 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.cache.aop.test;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * <p>Top level sample Pojo for a sample network management software. It is a logical object that can be presented to
+ * the user. Example of domain is like temperature or vibration sensor domains.</p>
+ * <p>This object is used to illustrate the pojo cache capability of JBossCache. Note the absence of <code>Serializable</code>
+ * interface.</p>
+ *
+ * @author <a href="mailto:ben.wang at jboss.com">Ben Wang</a>
+ *
+ * @@org.jboss.cache.aop.InstanceOfAopMarker
+ */
+public class NetworkDomain
+{
+ String name_;
+ // The associated nodes from the elements
+ List nodes_;
+ // All the elements to be managed in this domain
+ List elements_;
+ // Adminstration such id, pass
+ NetworkAdmin admin_;
+
+ static final int TEMP_SENSOR = 0;
+ static final int VIBRATION_SENSOR = 1;
+
+ public String getName()
+ {
+ return name_;
+ }
+
+ public void setName(String name)
+ {
+ name_ = name;
+ }
+
+ public List getNodes()
+ {
+ return nodes_;
+ }
+
+ protected void setNodes(List nodes)
+ {
+ nodes_ = nodes;
+ }
+
+ public List getElements()
+ {
+ return nodes_;
+ }
+
+ protected void addNode(NetworkNode node)
+ {
+ if(nodes_ == null)
+ nodes_ = new ArrayList();
+
+ nodes_.add(node);
+ }
+
+ public void addElement(NetworkElement element)
+ {
+ if(elements_ == null)
+ elements_ = new ArrayList();
+
+ elements_.add(element);
+
+ if(element.getParentNode() == null)
+ throw new RuntimeException("NetworkDomain.addElement(): parent node of element is null: " +element);
+
+ addNode(element.getParentNode());
+ }
+
+ public NetworkAdmin getAdmin()
+ {
+ return admin_;
+ }
+
+ public void setAdmin(NetworkAdmin admin)
+ {
+ admin_ = admin;
+ }
+
+ public String toString()
+ {
+ StringBuffer sb=new StringBuffer();
+ sb.append("* Damain * name= ").append(getName()).append(" + admin +: ").append(getAdmin());
+ sb.append(" + nodes +: ").append(getNodes());
+ return sb.toString();
+ }
+}
1.4 +0 -0 JBossCache/tests/functional/org/jboss/cache/aop/test/NetworkElement.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NetworkElement.java
===================================================================
RCS file: NetworkElement.java
diff -N NetworkElement.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ NetworkElement.java 21 Jul 2006 19:51:35 -0000 1.4
@@ -0,0 +1,85 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.cache.aop.test;
+
+import java.util.*;
+
+/**
+ * Can represent both software or devices (e.g., sensor).
+ * <p>This object is used to illustrate the pojo cache capability of JBossCache. Note the absence of <code>Serializable</code>
+ * interface.</p>
+ *
+ * @author <a href="mailto:ben.wang at jboss.com">Ben Wang</a>
+ *
+ * @@org.jboss.cache.aop.InstanceOfAopMarker
+ */
+public class NetworkElement
+{
+ // Unique id
+ int id_;
+ // Element type
+ int type_;
+ String name_;
+ int status_;
+ Date startDate_;
+ NetworkNode parentNode_;
+
+ public int getId() { return id_;}
+ public void setId(int id) { id_ = id; }
+
+ public int getType() { return type_; }
+ public void setType(int type) { type_ = type; }
+
+ public String getName()
+ {
+ return name_;
+ }
+
+ public void setName(String name)
+ {
+ name_ = name;
+ }
+
+ public int getStatus()
+ {
+ return status_;
+ }
+
+ public void setStatus(int status)
+ {
+ status_ = status;
+ }
+
+ public Date getStartDate()
+ {
+ return startDate_;
+ }
+
+ public void setStartDate(Date startDate)
+ {
+ startDate_ = startDate;
+ }
+
+ public NetworkNode getParentNode()
+ {
+ return parentNode_;
+ }
+
+ public void setParentNode(NetworkNode parentNode)
+ {
+ parentNode_ = parentNode;
+ }
+
+ public String toString()
+ {
+ StringBuffer sb=new StringBuffer();
+ sb.append(" name= ").append(getName()).append(" status= ").append(getStatus());
+ sb.append(" parentNode= ").append(getParentNode().getName());
+ return sb.toString();
+ }
+
+}
1.4 +0 -0 JBossCache/tests/functional/org/jboss/cache/aop/test/NetworkNode.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NetworkNode.java
===================================================================
RCS file: NetworkNode.java
diff -N NetworkNode.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ NetworkNode.java 21 Jul 2006 19:51:35 -0000 1.4
@@ -0,0 +1,74 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.cache.aop.test;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * Usually corresponds to the physical machine that comparises of various devices.
+ * <p>This object is used to illustrate the pojo cache capability of JBossCache. Note the absence of <code>Serializable</code>
+ * interface.</p>
+ *
+ * @author <a href="mailto:ben.wang at jboss.com">Ben Wang</a>
+ *
+ * @@org.jboss.cache.aop.InstanceOfAopMarker
+ */
+public class NetworkNode
+{
+ String name_;
+ List elements_;
+ String ipAddress_;
+
+ public String getName()
+ {
+ return name_;
+ }
+
+ public void setName(String name)
+ {
+ name_ = name;
+ }
+
+ public List getElements()
+ {
+ return elements_;
+ }
+
+ protected void setElements(List elements)
+ {
+ elements_ = elements;
+ }
+
+ public void addElement(NetworkElement element)
+ {
+ if(elements_ == null)
+ elements_ = new ArrayList();
+
+ elements_.add(element);
+ element.setParentNode(this);
+ }
+
+ public String getIpAddress()
+ {
+ return ipAddress_;
+ }
+
+ public void setIpAddress(String ipAddress)
+ {
+ ipAddress_ = ipAddress;
+ }
+
+ public String toString()
+ {
+ StringBuffer sb=new StringBuffer();
+ sb.append(" name= ").append(getName()).append(" ipAddress= ").append(getIpAddress());
+ sb.append(" elements=").append(getElements());
+ return sb.toString();
+ }
+
+}
1.3 +0 -0 JBossCache/tests/functional/org/jboss/cache/aop/test/NodeManager.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NodeManager.java
===================================================================
RCS file: NodeManager.java
diff -N NodeManager.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ NodeManager.java 21 Jul 2006 19:51:35 -0000 1.3
@@ -0,0 +1,89 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.cache.aop.test;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.List;
+
+
+/**
+ * Test class for TreeCacheAOP for circular references.
+ * Link is a POJO that will be instrumentet with CacheInterceptor
+ *
+ * @version $Revision: 1.3 $
+ * <p>Below is the annotation that signifies this class is "prepared" under JBossAop. This is used in
+ * conjunction with a special jboss-aop.xml (supplied by JBossCache). In addition, this is JDK1.4 style,
+ * so a annoc Ant build target is needed to pre-compile it.</p>
+ * <p>To use this approach, just apply this line to your pojo and run annoc (and possibly aopc).</p>
+ * @@org.jboss.cache.aop.AopMarker
+ */
+public class NodeManager
+{
+ private TestNode rootNode_;
+
+ private Map nodeMap_ = new HashMap();
+
+ public NodeManager()
+ {
+ }
+
+ public void setRootNode(String rdn)
+ {
+ this.rootNode_ = new TestNode();
+ rootNode_.setNodeFDN(rdn);
+ rootNode_.setNodeRDN(rdn);
+
+ registMap(rootNode_);
+ }
+
+ public void addNode(String parentFdn, String rdn)
+ {
+ TestNode parent = findNode(parentFdn);
+ if (parent != null)
+ {
+ TestNode node = new TestNode();
+ node.setNodeFDN(parentFdn + "." + rdn);
+ node.setNodeRDN(rdn);
+
+ node.setParentNode(parent);
+ parent.addChildNode(node);
+
+ registMap(node);
+ }
+ }
+
+ public TestNode findNode(String fdn)
+ {
+ return (TestNode) nodeMap_.get(fdn);
+ }
+
+ private void registMap(TestNode node)
+ {
+ this.nodeMap_.put(node.getNodeFDN(), node);
+ }
+
+ public void printNodes()
+ {
+ printNode(rootNode_, "");
+ }
+
+ private void printNode(TestNode node, String prefix)
+ {
+ System.out.println(prefix + node.getNodeRDN());
+
+ String childPrefix = prefix + " + ";
+ List children = node.getChildren();
+ int size = children.size();
+ for (int idx = 0; idx < size; idx++)
+ {
+ TestNode child = (TestNode) children.get(idx);
+ printNode(child, childPrefix);
+ }
+ }
+
+}
1.3 +0 -0 JBossCache/tests/functional/org/jboss/cache/aop/test/Person.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Person.java
===================================================================
RCS file: Person.java
diff -N Person.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Person.java 21 Jul 2006 19:51:35 -0000 1.3
@@ -0,0 +1,177 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.cache.aop.test;
+
+import java.util.*;
+
+
+/**
+ * Test class for TreeCacheAOP.
+ * Person is a POJO that will be instrumented with CacheInterceptor
+ *
+ * @version $Revision: 1.3 $
+ * <p>Below is the annotation that signifies this class is "prepared" under JBossAop. This is used in
+ * conjunction with a special jboss-aop.xml (supplied by JBossCache). In addition, this is JDK1.4 style,
+ * so a annoc Ant build target is needed to pre-compile it.</p>
+ * <p>To use this approach, just apply this line to your pojo and run annoc (and possibly aopc).</p>
+ * @@org.jboss.cache.aop.InstanceOfAopMarker
+ */
+public class Person
+{
+ String name = null;
+ int age = 0;
+ Map hobbies = null;
+ Address address = null;
+ Set skills;
+ List languages;
+ // Test for transient field non-replication
+ transient String currentStatus = "Active";
+ // Test swapping out the Collection ref with proxy one
+ // medication will be different when age limit is exceeded.
+ List medication = null;
+ static final int AGE1 = 50;
+ static final int AGE2 = 60;
+
+ public Person() {
+
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public void setCurrentStatus(String status) {
+ currentStatus = status;
+ }
+
+ public String getCurrentStatus() {
+ return currentStatus;
+ }
+
+ public void setName(Object obj)
+ {
+ this.name = (String)obj;
+ }
+
+ public int getAge()
+ {
+ return age;
+ }
+
+ public void setAge(int age)
+ {
+
+ this.age = age;
+
+ // This will swap out the reference dynamically
+ if(age < AGE1) {
+ if(medication != null) {
+ medication.clear();
+ medication=null;
+ }
+ }
+ else {
+ if( age >= AGE1 ) {
+ addMedication("Lipitor");
+ }
+
+ if (age >= AGE2) {
+ addMedication("Vioxx");
+ }
+ }
+
+
+ }
+
+ void addMedication(String name) {
+ if( medication == null )
+ medication = new ArrayList();
+ if(!medication.contains(name))
+ medication.add(name);
+ }
+
+ public Map getHobbies()
+ {
+ return hobbies;
+ }
+
+ public void setHobbies(Map hobbies)
+ {
+ this.hobbies = hobbies;
+ }
+
+ public Address getAddress()
+ {
+ return address;
+ }
+
+ public void setAddress(Address address)
+ {
+ this.address = address;
+ }
+
+ public Set getSkills()
+ {
+ return skills;
+ }
+
+ public void setSkills(Set skills)
+ {
+ this.skills = skills;
+ }
+
+ public List getMedication()
+ {
+ return medication;
+ }
+
+ public void setMedication(List medication)
+ {
+ this.medication = medication;
+ }
+
+ public List getLanguages()
+ {
+ return languages;
+ }
+
+ public void setLanguages(List languages)
+ {
+ this.languages = languages;
+ }
+
+ public String toString()
+ {
+ StringBuffer sb=new StringBuffer();
+ sb.append("name=").append(getName()).append(", age=").append(getAge()).append(", hobbies=")
+ .append(print(getHobbies())).append(", address=").append(getAddress()).append(", skills=")
+ .append(skills).append(", languages=").append(languages).toString();
+ if(medication != null)
+ sb.append(", medication=" + medication);
+ return sb.toString();
+ }
+
+ public String print(Map m)
+ {
+ StringBuffer sb = new StringBuffer();
+ Map.Entry entry;
+ if (m != null) {
+ for (Iterator it = m.entrySet().iterator(); it.hasNext();) {
+ entry = (Map.Entry) it.next();
+ sb.append(entry.getKey()).append(": ").append(entry.getValue());
+ sb.append("\n");
+ }
+ }
+ return sb.toString();
+ }
+}
1.3 +0 -0 JBossCache/tests/functional/org/jboss/cache/aop/test/SerializedAddress.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SerializedAddress.java
===================================================================
RCS file: SerializedAddress.java
diff -N SerializedAddress.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ SerializedAddress.java 21 Jul 2006 19:51:35 -0000 1.3
@@ -0,0 +1,61 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.cache.aop.test;
+
+import java.io.Serializable;
+
+
+/**
+ * Test class for TreeCacheAOP.
+ *
+ * @version $Revision: 1.3 $
+ */
+public class SerializedAddress implements Serializable
+{
+ String street = null;
+ String city = null;
+ int zip = 0;
+
+ public String getStreet()
+ {
+ return street;
+ }
+
+ public void setStreet(String street)
+ {
+ this.street = street;
+ }
+
+ public String getCity()
+ {
+ return city;
+ }
+
+ public void setCity(String city)
+ {
+ this.city = city;
+ }
+
+ public int getZip()
+ {
+ return zip;
+ }
+
+ public void setZip(int zip)
+ {
+ this.zip = zip;
+ }
+
+ public String toString()
+ {
+ return "street=" + getStreet() + ", city=" + getCity() + ", zip=" + getZip();
+ }
+
+// public Object writeReplace() {
+// return this;
+// }
+}
1.3 +0 -0 JBossCache/tests/functional/org/jboss/cache/aop/test/Student.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Student.java
===================================================================
RCS file: Student.java
diff -N Student.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Student.java 21 Jul 2006 19:51:35 -0000 1.3
@@ -0,0 +1,53 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.cache.aop.test;
+
+
+/**
+ * Test class for TreeCacheAOP.
+ * Student is a POJO that will be instrumentet with CacheInterceptor
+ *
+ * @version $Revision: 1.3 $
+ * No need to declare annotation here since Person is an instanceof already.
+ */
+public class Student extends Person
+{
+
+ private String year;
+ // co is Serializable not Advised
+ private CacheObject co1;
+ private CacheObject co2;
+
+ public String getYear() { return year; }
+ public void setYear(String year) { this.year = year; }
+
+ public CacheObject getCO1()
+ {
+ return co1;
+ }
+
+ public void setCO1(CacheObject co)
+ {
+ this.co1 = co;
+ }
+
+ public CacheObject getCO2()
+ {
+ return co2;
+ }
+
+ public void setCO2(CacheObject co)
+ {
+ this.co2 = co;
+ }
+
+ public String toString()
+ {
+ return "year=" + getYear() + " " + super.toString();
+ }
+
+}
1.4 +0 -0 JBossCache/tests/functional/org/jboss/cache/aop/test/TestNode.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TestNode.java
===================================================================
RCS file: TestNode.java
diff -N TestNode.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ TestNode.java 21 Jul 2006 19:51:35 -0000 1.4
@@ -0,0 +1,68 @@
+package org.jboss.cache.aop.test;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ *
+ * @@org.jboss.cache.aop.AopMarker
+ */
+public class TestNode
+{
+ private String rdn_;
+
+ private String fdn_;
+
+ private List childNodes_ = new ArrayList();
+
+ private TestNode parentNode_;
+
+ public TestNode()
+ {
+ }
+
+ public void setNodeRDN(String rdn)
+ {
+ this.rdn_ = rdn;
+ }
+
+ public String getNodeRDN()
+ {
+ return this.rdn_;
+ }
+
+ public void setNodeFDN(String fdn)
+ {
+ this.fdn_ = fdn;
+ }
+
+ public String getNodeFDN()
+ {
+ return this.fdn_;
+ }
+
+ public void addChildNode(TestNode child)
+ {
+ childNodes_.add(child);
+ }
+
+ public List getChildren()
+ {
+ return childNodes_;
+ }
+
+ public void setParentNode(TestNode parent)
+ {
+ parentNode_ = parent;
+ }
+
+ public TestNode getParentNode()
+ {
+ return this.parentNode_;
+ }
+
+ public String toString()
+ {
+ return getNodeFDN();
+ }
+}
1.4 +0 -0 JBossCache/tests/functional/org/jboss/cache/aop/test/ValueObject.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ValueObject.java
===================================================================
RCS file: ValueObject.java
diff -N ValueObject.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ValueObject.java 21 Jul 2006 19:51:35 -0000 1.4
@@ -0,0 +1,52 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.cache.aop.test;
+
+/**
+ * Object to test non-primitive key.
+ * @@org.jboss.cache.aop.InstanceOfAopMarker
+ */
+public class ValueObject {
+
+ private IdObject idObj;
+ private float value;
+
+ public ValueObject() {
+ } // ValueObject
+
+ public ValueObject(IdObject aIdObj, float aValue) {
+ idObj = aIdObj;
+ value = aValue;
+ } // ValueObject
+
+ public IdObject getIdObj() {
+ return idObj;
+ }
+
+ public float getValue() {
+ return value;
+ }
+
+ public String toString() {
+ return idObj + ": " + value;
+ } // toString
+
+ public boolean equals(Object aObject) {
+ boolean result = false;
+
+ if ((aObject != null) &&
+ (aObject.getClass().getName().equals( this.getClass().getName()))) {
+ result = idObj.equals(((ValueObject)aObject).idObj);
+ } // if
+
+ return result;
+ } // equals
+
+ public int hashCode() {
+ return idObj.hashCode();
+ } // hashCode
+} // class ValueObject
More information about the jboss-cvs-commits
mailing list