[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/pojo ...

Galder Zamarreno galder.zamarreno at jboss.com
Wed May 16 08:33:59 EDT 2007


  User: gzamarreno
  Date: 07/05/16 08:33:59

  Modified:    tests/functional/org/jboss/cache/pojo 
                        ReplicatedPutWithBulkRemoveTest.java
  Log:
  [JBCACHE-1000] JBossCache tutorial demo has been refactored to accomodate PojoCache one so that it uses the same embedded beanshell. PojoCache tutorial has been rewritten to have more similarities with JBossCache one, and has been extended with a section on Collections. Person and Address fields have been made private to promote encapsulation. Person no has a setLanguages(List<String>) to be consistent with get operation. This required fixing the ReplicatedPutWithBulkRemoveTest.
  
  Revision  Changes    Path
  1.3       +16 -3     JBossCache/tests/functional/org/jboss/cache/pojo/ReplicatedPutWithBulkRemoveTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ReplicatedPutWithBulkRemoveTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/ReplicatedPutWithBulkRemoveTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- ReplicatedPutWithBulkRemoveTest.java	16 Apr 2007 17:37:10 -0000	1.2
  +++ ReplicatedPutWithBulkRemoveTest.java	16 May 2007 12:33:59 -0000	1.3
  @@ -135,25 +135,34 @@
         p1.setAge(10);
         p1.setAddress(getAddress("Sunnyvale"));
   
  -      List<Address> lang = new ArrayList<Address>();
  -      lang.add(getAddress("Taipei"));
  -      lang.add(getAddress("Tainan"));
  +      List<String> lang = new ArrayList<String>();
  +      lang.add("English");
  +      lang.add("Spanish");
         p1.setLanguages(lang);
   
         cache_.attach("/a", p1);
         Person result = (Person) cache_.find("/a");
         assertEquals(" ", p1, result);
  +      assertEquals("English", result.getLanguages().get(0));
  +      assertEquals("Spanish", result.getLanguages().get(1));
   
         Person result1 = (Person) cache1_.find("/a");
         assertEquals("Age should be ", 10, result1.getAge());
         assertEquals("Zip should be ", 95123, result1.getAddress().getZip());
  +      assertEquals("English", result1.getLanguages().get(0));
  +      assertEquals("Spanish", result1.getLanguages().get(1));
   
         Person p2 = new Person();
         p2.setName("joe");
         p2.setAge(20);
  +      List<String> lang2 = new ArrayList<String>();
  +      lang2.add("French");
  +      p2.setLanguages(lang2);
  +
         cache_.attach("/a", p2);
         Person joe1 = (Person) cache_.find("/a");
         assertEquals("Age should be ", 20, joe1.getAge());
  +      assertEquals("French", joe1.getLanguages().get(0));
   
         // put p1 again
         cache_.attach("/a", p1);
  @@ -161,9 +170,13 @@
         // remove p1
         Person p3 = (Person) cache_.detach("/a");
         assertEquals("Zip should be ", 95123, p3.getAddress().getZip());
  +      assertEquals("English", p3.getLanguages().get(0));
  +      assertEquals("Spanish", p3.getLanguages().get(1));
   
         assertEquals("Age should be ", 10, result.getAge());
         assertEquals("Zip should be ", 95123, result.getAddress().getZip());
  +      assertEquals("English", result.getLanguages().get(0));
  +      assertEquals("Spanish", result.getLanguages().get(1));      
      }
   
      public static Test suite() throws Exception
  
  
  



More information about the jboss-cvs-commits mailing list