Package org.apache.jackrabbit.ocm.testmodel.proxy

Examples of org.apache.jackrabbit.ocm.testmodel.proxy.Detail


  public void testBeanProxy() {

    try {
      ObjectContentManager ocm = this.getObjectContentManager();

      Detail detail = new Detail();
      detail.setField("FieldValue");     
     
      Detail proxyDetail = new Detail();
      proxyDetail.setField("ProxyFieldValue");
     
      Main main = new Main();
      main.setPath("/test");
      main.setDetail(detail);
      main.setProxyDetail(proxyDetail);
             
            ocm.insert(main);
      ocm.save();
     
     
      //---------------------------------------------------------------------------------------------------------
      // Retrieve the main object
      //---------------------------------------------------------------------------------------------------------           
      main = (Main) ocm.getObject( "/test");
      assertNotNull("detail is null", main.getDetail());
      assertTrue("Invalid detail bean", main.getDetail().getField().equals("FieldValue"));

      assertNotNull("proxydetail is null", main.getProxyDetail());
      Object proxyObject = main.getProxyDetail();
      assertTrue("Invalid class specify for the proxy bean", proxyObject  instanceof Detail);
      assertTrue("Invalid proxy detail bean",proxyDetail .getField().equals("ProxyFieldValue"));
     
      Detail nullDetail = main.getNullDetail();
      assertNull("nulldetail is not  null",nullDetail );

     
      //---------------------------------------------------------------------------------------------------------
      // Update 
      //---------------------------------------------------------------------------------------------------------           
       detail = new Detail();
      detail.setField("AnotherFieldValue");     
     
      proxyDetail = new Detail();
      proxyDetail.setField("AnotherProxyFieldValue");
     
      main.setDetail(detail);
      main.setProxyDetail(proxyDetail);
     
View Full Code Here


      ObjectContentManager ocm = this.getObjectContentManager();

      ArrayList  details= new ArrayList();
      for(int i=1; i<=100;i++)
      {
        Detail detail = new Detail();
        detail.setField("field" + i);       
        details.add(detail);
      }
     
      Main main = new Main();
      main.setProxyCollection(details);
      main.setPath("/test");             
            ocm.insert(main);
      ocm.save();
     
     
      //---------------------------------------------------------------------------------------------------------
      // Retrieve the main object
      //---------------------------------------------------------------------------------------------------------           
      main = (Main) ocm.getObject( "/test");
      assertNotNull("main is null", main);

            Collection result = main.getProxyCollection();
            assertEquals("Invalide size", result.size(), 100);
            assertNull("nullcollectionproxy  is not null", main.getNullProxyCollection());
     
      //---------------------------------------------------------------------------------------------------------
      // Update 
      //---------------------------------------------------------------------------------------------------------
           
            Detail detail = new Detail();
      detail.setField("newFieldValue");     
      result.add(detail);
      main.setProxyCollection(result);
      ocm.update(main);
      ocm.save();
View Full Code Here

  public void testBeanProxy() {

    try {
      ObjectContentManager ocm = this.getObjectContentManager();

      Detail detail = new Detail();
      detail.setField("FieldValue");     
     
      Detail proxyDetail = new Detail();
      proxyDetail.setField("ProxyFieldValue");
     
      Main main = new Main();
      main.setPath("/test");
      main.setDetail(detail);
      main.setProxyDetail(proxyDetail);
             
            ocm.insert(main);
      ocm.save();
     
     
      //---------------------------------------------------------------------------------------------------------
      // Retrieve the main object
      //---------------------------------------------------------------------------------------------------------           
      main = (Main) ocm.getObject( "/test");
      assertNotNull("detail is null", main.getDetail());
      assertTrue("Invalid detail bean", main.getDetail().getField().equals("FieldValue"));

      assertNotNull("proxydetail is null", main.getProxyDetail());
      Object proxyObject = main.getProxyDetail();
      assertTrue("Invalid class specify for the proxy bean", proxyObject  instanceof Detail);
      assertTrue("Invalid proxy detail bean",proxyDetail .getField().equals("ProxyFieldValue"));
     
      Detail nullDetail = main.getNullDetail();
      assertNull("nulldetail is not  null",nullDetail );

     
      //---------------------------------------------------------------------------------------------------------
      // Update 
      //---------------------------------------------------------------------------------------------------------           
       detail = new Detail();
      detail.setField("AnotherFieldValue");     
     
      proxyDetail = new Detail();
      proxyDetail.setField("AnotherProxyFieldValue");
     
      main.setDetail(detail);
      main.setProxyDetail(proxyDetail);
     
View Full Code Here

      ObjectContentManager ocm = this.getObjectContentManager();

      ArrayList  details= new ArrayList();
      for(int i=1; i<=100;i++)
      {
        Detail detail = new Detail();
        detail.setField("field" + i);       
        details.add(detail);
      }
     
      Main main = new Main();
      main.setProxyCollection(details);
      main.setPath("/test");             
            ocm.insert(main);
      ocm.save();
     
     
      //---------------------------------------------------------------------------------------------------------
      // Retrieve the main object
      //---------------------------------------------------------------------------------------------------------           
      main = (Main) ocm.getObject( "/test");
      assertNotNull("main is null", main);

            Collection result = main.getProxyCollection();
            assertEquals("Invalide size", result.size(), 100);
            assertNull("nullcollectionproxy  is not null", main.getNullProxyCollection());
     
      //---------------------------------------------------------------------------------------------------------
      // Update 
      //---------------------------------------------------------------------------------------------------------
           
            Detail detail = new Detail();
      detail.setField("newFieldValue");     
      result.add(detail);
      main.setProxyCollection(result);
      ocm.update(main);
      ocm.save();
View Full Code Here

  public void testBeanProxy() {

    try {
      ObjectContentManager ocm = getObjectContentManager();

      Detail detail = new Detail();
      detail.setField("FieldValue");     
     
      Detail proxyDetail = new Detail();
      proxyDetail.setField("ProxyFieldValue");
     
      Main main = new Main();
      main.setPath("/test");
      main.setDetail(detail);
      main.setProxyDetail(proxyDetail);
             
            ocm.insert(main);
      ocm.save();
     
     
      //---------------------------------------------------------------------------------------------------------
      // Retrieve the main object
      //---------------------------------------------------------------------------------------------------------           
      main = (Main) ocm.getObject( "/test");
      assertNotNull("detail is null", main.getDetail());
      assertTrue("Invalid detail bean", main.getDetail().getField().equals("FieldValue"));

      assertNotNull("proxydetail is null", main.getProxyDetail());
      Object proxyObject = main.getProxyDetail();
      assertTrue("Invalid class specify for the proxy bean", proxyObject  instanceof Detail);
      assertTrue("Invalid proxy detail bean",proxyDetail .getField().equals("ProxyFieldValue"));
     
      Detail nullDetail = main.getNullDetail();
      assertNull("nulldetail is not  null",nullDetail );

     
      //---------------------------------------------------------------------------------------------------------
      // Update
      //---------------------------------------------------------------------------------------------------------           
       detail = new Detail();
      detail.setField("AnotherFieldValue");     
     
      proxyDetail = new Detail();
      proxyDetail.setField("AnotherProxyFieldValue");
     
      main.setDetail(detail);
      main.setProxyDetail(proxyDetail);
     
View Full Code Here

      ObjectContentManager ocm = getObjectContentManager();

      ArrayList  details= new ArrayList();
      for(int i=1; i<=100;i++)
      {
        Detail detail = new Detail();
        detail.setField("field" + i);       
        details.add(detail);
      }
     
      Main main = new Main();
      main.setProxyCollection(details);
      main.setPath("/test");             
            ocm.insert(main);
      ocm.save();
     
     
      //---------------------------------------------------------------------------------------------------------
      // Retrieve the main object
      //---------------------------------------------------------------------------------------------------------           
      main = (Main) ocm.getObject( "/test");
      assertNotNull("main is null", main);

            Collection result = main.getProxyCollection();
            assertEquals("Invalide size", result.size(), 100);
            assertNull("nullcollectionproxy  is not null", main.getNullProxyCollection());
     
      //---------------------------------------------------------------------------------------------------------
      // Update
      //---------------------------------------------------------------------------------------------------------

            Detail detail = new Detail();
      detail.setField("newFieldValue");     
      result.add(detail);
      main.setProxyCollection(result);
      ocm.update(main);
      ocm.save();
View Full Code Here

  public void testBeanProxy() {

    try {
      ObjectContentManager ocm = getObjectContentManager();

      Detail detail = new Detail();
      detail.setField("FieldValue");     
     
      Detail proxyDetail = new Detail();
      proxyDetail.setField("ProxyFieldValue");
     
      Main main = new Main();
      main.setPath("/test");
      main.setDetail(detail);
      main.setProxyDetail(proxyDetail);
             
            ocm.insert(main);
      ocm.save();
     
     
      //---------------------------------------------------------------------------------------------------------
      // Retrieve the main object
      //---------------------------------------------------------------------------------------------------------           
      main = (Main) ocm.getObject( "/test");
      assertNotNull("detail is null", main.getDetail());
      assertTrue("Invalid detail bean", main.getDetail().getField().equals("FieldValue"));

      assertNotNull("proxydetail is null", main.getProxyDetail());
      Object proxyObject = main.getProxyDetail();
      assertTrue("Invalid class specify for the proxy bean", proxyObject  instanceof Detail);
      assertTrue("Invalid proxy detail bean",proxyDetail .getField().equals("ProxyFieldValue"));
     
      Detail nullDetail = main.getNullDetail();
      assertNull("nulldetail is not  null",nullDetail );

     
      //---------------------------------------------------------------------------------------------------------
      // Update
      //---------------------------------------------------------------------------------------------------------           
       detail = new Detail();
      detail.setField("AnotherFieldValue");     
     
      proxyDetail = new Detail();
      proxyDetail.setField("AnotherProxyFieldValue");
     
      main.setDetail(detail);
      main.setProxyDetail(proxyDetail);
     
View Full Code Here

      ObjectContentManager ocm = getObjectContentManager();

      ArrayList  details= new ArrayList();
      for(int i=1; i<=100;i++)
      {
        Detail detail = new Detail();
        detail.setField("field" + i);       
        details.add(detail);
      }
     
      Main main = new Main();
      main.setProxyCollection(details);
      main.setPath("/test");             
            ocm.insert(main);
      ocm.save();
     
     
      //---------------------------------------------------------------------------------------------------------
      // Retrieve the main object
      //---------------------------------------------------------------------------------------------------------           
      main = (Main) ocm.getObject( "/test");
      assertNotNull("main is null", main);

            Collection result = main.getProxyCollection();
            assertEquals("Invalide size", result.size(), 100);
            assertNull("nullcollectionproxy  is not null", main.getNullProxyCollection());
     
      //---------------------------------------------------------------------------------------------------------
      // Update
      //---------------------------------------------------------------------------------------------------------

            Detail detail = new Detail();
      detail.setField("newFieldValue");     
      result.add(detail);
      main.setProxyCollection(result);
      ocm.update(main);
      ocm.save();
View Full Code Here

  public void testBeanProxy() {

    try {
      ObjectContentManager ocm = this.getObjectContentManager();

      Detail detail = new Detail();
      detail.setField("FieldValue");     
     
      Detail proxyDetail = new Detail();
      proxyDetail.setField("ProxyFieldValue");
     
      Main main = new Main();
      main.setPath("/test");
      main.setDetail(detail);
      main.setProxyDetail(proxyDetail);
             
            ocm.insert(main);
      ocm.save();
     
     
      //---------------------------------------------------------------------------------------------------------
      // Retrieve the main object
      //---------------------------------------------------------------------------------------------------------           
      main = (Main) ocm.getObject( "/test");
      assertNotNull("detail is null", main.getDetail());
      assertTrue("Invalid detail bean", main.getDetail().getField().equals("FieldValue"));

      assertNotNull("proxydetail is null", main.getProxyDetail());
      Object proxyObject = main.getProxyDetail();
      assertTrue("Invalid class specify for the proxy bean", proxyObject  instanceof Detail);
      assertTrue("Invalid proxy detail bean",proxyDetail .getField().equals("ProxyFieldValue"));
     
      Detail nullDetail = main.getNullDetail();
      assertNull("nulldetail is not  null",nullDetail );

     
      //---------------------------------------------------------------------------------------------------------
      // Update
      //---------------------------------------------------------------------------------------------------------           
       detail = new Detail();
      detail.setField("AnotherFieldValue");     
     
      proxyDetail = new Detail();
      proxyDetail.setField("AnotherProxyFieldValue");
     
      main.setDetail(detail);
      main.setProxyDetail(proxyDetail);
     
View Full Code Here

      ObjectContentManager ocm = this.getObjectContentManager();

      ArrayList  details= new ArrayList();
      for(int i=1; i<=100;i++)
      {
        Detail detail = new Detail();
        detail.setField("field" + i);       
        details.add(detail);
      }
     
      Main main = new Main();
      main.setProxyCollection(details);
      main.setPath("/test");             
            ocm.insert(main);
      ocm.save();
     
     
      //---------------------------------------------------------------------------------------------------------
      // Retrieve the main object
      //---------------------------------------------------------------------------------------------------------           
      main = (Main) ocm.getObject( "/test");
      assertNotNull("main is null", main);

            Collection result = main.getProxyCollection();
            assertEquals("Invalide size", result.size(), 100);
            assertNull("nullcollectionproxy  is not null", main.getNullProxyCollection());
     
      //---------------------------------------------------------------------------------------------------------
      // Update
      //---------------------------------------------------------------------------------------------------------

            Detail detail = new Detail();
      detail.setField("newFieldValue");     
      result.add(detail);
      main.setProxyCollection(result);
      ocm.update(main);
      ocm.save();
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.ocm.testmodel.proxy.Detail

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.