Package org.springmodules.javaspaces.gigaspaces.app

Examples of org.springmodules.javaspaces.gigaspaces.app.SimpleBean


    assertNotNull("The admin is null!", admin);
  }

  public void testWriteMultiple() throws Throwable
  {
    SimpleBean bean1 = new SimpleBean("lior_multi1", 1);
    SimpleBean bean2 = new SimpleBean("lior_multi2", 1);
    template.writeMultiple(new Object[] { bean1, bean2 }, -1);
    SimpleBean templateBean = new SimpleBean("lior_multi1", 1);
    SimpleBean taken = (SimpleBean) template.take(/*bean1*/templateBean, -1);
    assertEquals("The bean are not equals!", bean1, taken);
  }
View Full Code Here


  }

  public void testReadMultiple() throws Throwable
  {
    template.clean();
    SimpleBean bean1 = new SimpleBean("lior_read2", 1);
    SimpleBean bean2 = new SimpleBean("lior_read1", 1);
    template.writeMultiple(new Object[] { bean1, bean2 }, -1);
    SimpleBean templateBean = new SimpleBean(null, 1);
    Object[] taken = template.readMultiple(templateBean,  2);
    assertEquals("The bean are null!", 2, taken.length);
  }
View Full Code Here

    assertEquals("The bean are null!", 2, taken.length);
  }

  public void testTakeMultiple() throws Throwable
  {
    SimpleBean bean1 = new SimpleBean("lior_take1", 1);
    SimpleBean bean2 = new SimpleBean("lior_take2", 1);
    template.writeMultiple(new Object[] { bean1, bean2 }, -1);
    SimpleBean templateBean = new SimpleBean(null, 1);
    Object[] taken = template.takeMultiple(templateBean, 2);
    assertEquals("The bean are null!", 2, taken.length);
  }
View Full Code Here

  }
*/
  public void testUpdate() throws Throwable
  {
    template.clean();
    SimpleBean bean = new SimpleBean("lior_Update1", 1);
    template.write(bean,  Lease.FOREVER);
    SimpleBean templateBean = new SimpleBean("lior_Update1", 2);
    SimpleBean taken = (SimpleBean) template.update(templateBean/*bean*/,

                            Lease.FOREVER,
                            Lease.FOREVER);
    assertNotSame("The bean are equal!", templateBean, taken);
  }
View Full Code Here

  }

  public void testUpdateModifier() throws Throwable
  {
    template.clean();
    SimpleBean bean = new SimpleBean("lior_UpdateModifier2", 1);
    template.write(bean,  Lease.FOREVER);
    SimpleBean templateBean = new SimpleBean("lior_UpdateModifier2", 2);
    SimpleBean taken = (SimpleBean) template.update(templateBean,
                            Lease.FOREVER,
                            Lease.FOREVER,
                            UpdateModifiers.UPDATE_OR_WRITE);
    assertNotSame("The bean are equal!", templateBean, taken);
  }
View Full Code Here

  }

  public void testUpdateMultiple() throws Throwable
  {
    template.clean();
    SimpleBean bean1 = new SimpleBean("lior_Update1", 1);
    SimpleBean bean2 = new SimpleBean("lior_Update2", 1);
    template.write(bean1,  Lease.FOREVER);
    template.write(bean2,  Lease.FOREVER);
    bean1.setAge(3);
    bean2.setAge(3);
    SimpleBean templateBean1 = new SimpleBean("lior_Update1", 2);
    SimpleBean templateBean2 = new SimpleBean("lior_Update2", 3);
    Object[] list = template.updateMultiple(new SimpleBean[] { templateBean1,
        templateBean2/*bean1,bean2 */}, new long[] { Lease.FOREVER,
        Lease.FOREVER });
    assertEquals("The bean are equal!", 2, list.length);
  }
View Full Code Here

  }

  public void testUpdateMultipleModifier() throws Throwable
  {
    template.clean();
    SimpleBean bean1 = new SimpleBean("lior_Update1", 1);
    SimpleBean bean2 = new SimpleBean("lior_Update2", 1);
    template.write(bean1,  Lease.FOREVER);
    template.write(bean2,  Lease.FOREVER);
    SimpleBean templateBean1 = new SimpleBean("lior_Update1", 2);
    SimpleBean templateBean2 = new SimpleBean("lior_Update2", 3);
    Object[] taken = template.updateMultiple(new SimpleBean[] {templateBean1,
        templateBean2/*bean1,bean2*/ }new long[] { Lease.FOREVER,
        Lease.FOREVER }, UpdateModifiers.UPDATE_ONLY);
    assertEquals("The bean are equal!", 2, taken.length);
  }
View Full Code Here

    assertNotNull("The isSecured is null!", new Boolean(isSec));
  }

  public void testDropClass() throws Throwable
  {
    SimpleBean bean1 = new SimpleBean("lior_dropClass", 1);
    template.write(bean1, Lease.FOREVER);
    template.dropClass(SimpleBean.class.getName());
    SimpleBean taken = (SimpleBean) template.takeIfExists(bean1, 1000);
    assertNull("The dropClass is not null!", taken);
  }
View Full Code Here



  public void testRead() throws Throwable
  {
    SimpleBean bean = new SimpleBean("lior_Read", 1);
    template.write(bean, -1);
    SimpleBean templateBean = new SimpleBean("lior_Read", 1);
    SimpleBean taken = (SimpleBean) template.readtemplateBean/*bean*/,

                            Lease.ANY);
    assertNotNull("Read object is null!", taken);
  }
View Full Code Here

    assertNotNull("Read object is null!", taken);
  }

  public void testReadIfExist() throws Throwable
  {
    SimpleBean bean = new SimpleBean("lior_ReadIfExists", 1);
    template.write(bean, -1);
    SimpleBean templateBean = new SimpleBean("lior_ReadIfExists", 1);
    SimpleBean taken = (SimpleBean) template.readIfExiststemplateBean/*bean*/,

                                2000);
    assertNotNull("Read object is null!", taken);
  }
View Full Code Here

TOP

Related Classes of org.springmodules.javaspaces.gigaspaces.app.SimpleBean

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.