Package domain.jpetstore

Examples of domain.jpetstore.Product


    assertNull(richWithNull.getValue("richType.richProperty"));
  }

  @Test
  public void shouldVerifyHasReadablePropertiesReturnedByGetReadablePropertyNames() {
    MetaObject object = MetaObject.forObject(new Product());
    for (String readable : object.getGetterNames()) {
      assertTrue(object.hasGetter(readable));
    }
  }
View Full Code Here


    }
  }

  @Test
  public void shouldVerifyHasWriteablePropertiesReturnedByGetWriteablePropertyNames() {
    MetaObject object = MetaObject.forObject(new Product());
    for (String writeable : object.getSetterNames()) {
      assertTrue(object.hasSetter(writeable));
    }
  }
View Full Code Here

    }
  }

  @Test
  public void shouldSetAndGetProperties() {
    MetaObject object = MetaObject.forObject(new Product());
    for (String writeable : object.getSetterNames()) {
      if (!writeable.contains("$")) {
        object.setValue(writeable, "test");
        assertEquals("test", object.getValue(writeable));
      }
View Full Code Here

    }
  }

  @Test
  public void shouldVerifyPropertyTypes() {
    MetaObject object = MetaObject.forObject(new Product());
    for (String writeable : object.getSetterNames()) {
      if (!writeable.contains("$")) {
        assertEquals(String.class, object.getGetterType(writeable));
        assertEquals(String.class, object.getSetterType(writeable));
      }
View Full Code Here

    assertEquals("1 Some Street", address.get("street"));
  }
 
  @Test
  public void shouldNotUseObjectWrapperFactoryByDefault() {
    MetaObject meta = MetaObject.forObject(new Product());
    assertTrue(!meta.getObjectWrapper().getClass().equals(CustomBeanWrapper.class));
  }
View Full Code Here

    assertTrue(!meta.getObjectWrapper().getClass().equals(CustomBeanWrapper.class));
  }
 
  @Test
  public void shouldUseObjectWrapperFactoryWhenSet() {
    MetaObject meta = MetaObject.forObject(new Product(), MetaObject.DEFAULT_OBJECT_FACTORY, new CustomBeanWrapperFactory());
    assertTrue(meta.getObjectWrapper().getClass().equals(CustomBeanWrapper.class));
   
    // Make sure the old default factory is in place and still works
    meta = MetaObject.forObject(new Product());
    assertFalse(meta.getObjectWrapper().getClass().equals(CustomBeanWrapper.class));
  }
View Full Code Here

TOP

Related Classes of domain.jpetstore.Product

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.