Package org.jboss.aop.array

Examples of org.jboss.aop.array.ArrayReference


      ClassForReference obj = new ClassForReference();
      obj.fieldA = arr;
      List<ArrayReference> references = registry.getArrayOwners(arr);

      assertEquals(1, references.size());
      ArrayReference reference = references.get(0);
      assertEquals(obj, reference.getRootObject());
      assertEquals("fieldA", reference.getRootField());
      assertNull(reference.getNestedArrayIndices());

      obj.fieldA = null;
      references = registry.getArrayOwners(arr);
      assertNull(references);
   }
View Full Code Here


      assertTrue("Did not find all references " + fields, fields.size() == 0);
     
      obj.fieldA = null;
      references = registry.getArrayOwners(arr);
      assertEquals(1, references.size());
      ArrayReference reference = references.get(0);
      assertEquals(obj, reference.getRootObject());
      assertEquals("fieldB", reference.getRootField());
      assertNull(reference.getNestedArrayIndices());
     
      obj.fieldB = null;
      references = registry.getArrayOwners(arr);
      assertNull(references);
   }
View Full Code Here

      assertTrue("Did not find all references " + rootObjects, rootObjects.size() == 0);
     
      obj.fieldA = null;
      references = registry.getArrayOwners(arr);
      assertEquals(1, references.size());
      ArrayReference reference = references.get(0);
      assertEquals(obj2, reference.getRootObject());
      assertEquals("fieldB", reference.getRootField());
      assertNull(reference.getNestedArrayIndices());
     
      obj2.fieldB = null;
      references = registry.getArrayOwners(arr);
      assertNull(references);
   }
View Full Code Here

      assertTrue("Did not find all references " + fields, fields.size() == 0);
     
      ClassForReference.staticA = null;
      references = registry.getArrayOwners(arr);
      assertEquals(1, references.size());
      ArrayReference reference = references.get(0);
      assertEquals(ClassForReference.class, reference.getRootObject());
      assertEquals("staticB", reference.getRootField());
      assertNull(reference.getNestedArrayIndices());
     
      ClassForReference.staticB = null;
      references = registry.getArrayOwners(arr);
      assertNull(references);
   }
View Full Code Here

      assertTrue("Did not find all references " + rootObjects, rootObjects.size() == 0);
     
      obj.fieldA = null;
      references = registry.getArrayOwners(arr);
      assertEquals(1, references.size());
      ArrayReference reference = references.get(0);
      assertEquals(ClassForReference.class, reference.getRootObject());
      assertEquals("staticA", reference.getRootField());
      assertNull(reference.getNestedArrayIndices());
     
      ClassForReference.staticA = null;
      references = registry.getArrayOwners(arr);
      assertNull(references);
   }
View Full Code Here

      ClassForReference obj = new ClassForReference();
      obj.fieldA = new Object[] {arr};
      List<ArrayReference> references = registry.getArrayOwners(arr);
     
      assertEquals(1, references.size());
      ArrayReference reference = references.get(0);
      assertEquals(obj, reference.getRootObject());
      assertEquals("fieldA", reference.getRootField());
      assertNotNull(reference.getNestedArrayIndices());
      assertEquals(1, reference.getNestedArrayIndices().size());
      assertEquals(new Integer(0), reference.getNestedArrayIndices().get(0));

      obj.fieldA[0] = null;
      references = registry.getArrayOwners(arr);
      assertNull(references);
   }
View Full Code Here

      obj.fieldA[2] = null;
     
      references = registry.getArrayOwners(arr);
     
      assertEquals(1, references.size());
      ArrayReference reference = references.get(0);
      assertEquals(obj, reference.getRootObject());
      assertEquals("fieldA", reference.getRootField());
      assertEquals(1, reference.getNestedArrayIndices().size());
      assertEquals(new Integer(0), reference.getNestedArrayIndices().get(0));

      obj.fieldA[0] = null;
      references = registry.getArrayOwners(arr);
      assertNull(references);
   }
View Full Code Here

      obj.fieldA[0] = null;
     
      references = registry.getArrayOwners(arr);
     
      assertEquals(1, references.size());
      ArrayReference reference = references.get(0);
      assertEquals(obj2, reference.getRootObject());
      assertEquals("fieldA", reference.getRootField());
      assertEquals(1, reference.getNestedArrayIndices().size());
      assertEquals(new Integer(0), reference.getNestedArrayIndices().get(0));

      obj2.fieldA[0] = null;
      references = registry.getArrayOwners(arr);
      assertNull(references);
   }
View Full Code Here

      ClassForReference.staticA[0] = null;
     
      references = registry.getArrayOwners(arr);
     
      assertEquals(1, references.size());
      ArrayReference reference = references.get(0);
      assertEquals(ClassForReference.class, reference.getRootObject());
      assertEquals("staticB", reference.getRootField());
      assertEquals(1, reference.getNestedArrayIndices().size());
      assertEquals(new Integer(1), reference.getNestedArrayIndices().get(0));

      ClassForReference.staticB[1] = null;
      references = registry.getArrayOwners(arr);
      assertNull(references);
   }
View Full Code Here

      assertTrue("Did not find all references " + elements, elements.size() == 0);

      fieldA[2][1][2][3] = null;
      references = registry.getArrayOwners(arr);
      assertEquals(1, references.size());
      ArrayReference reference = references.get(0);
      assertEquals(ClassForReference.class, reference.getRootObject());
      assertEquals("staticA", reference.getRootField());
      assertEquals(4, reference.getNestedArrayIndices().size());
      assertEquals(new Integer(0), reference.getNestedArrayIndices().get(0));
      assertEquals(new Integer(1), reference.getNestedArrayIndices().get(1));
      assertEquals(new Integer(2), reference.getNestedArrayIndices().get(2));
      assertEquals(new Integer(2), reference.getNestedArrayIndices().get(3));

      ((Object[])staticA[0][1][2])[2] = null;
      references = registry.getArrayOwners(arr);
      assertNull(references);
   }
View Full Code Here

TOP

Related Classes of org.jboss.aop.array.ArrayReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.