Examples of BusinessObject


Examples of ch.ralscha.extdirectspring.provider.RemoteProviderSimple.BusinessObject

        "aStr;;24", "aStr", 24, null);
  }

  @Test
  public void methodWithComplexCollections() throws Exception {
    BusinessObject bo1 = new BusinessObject(1, "one", new BigDecimal("1.11"));
    BusinessObject bo2 = new BusinessObject(2, "two", new BigDecimal("2.22"));
    BusinessObject bo3 = new BusinessObject(3, "three", new BigDecimal("3.33"));

    ControllerUtil.sendAndReceive(mockMvc, "remoteProviderSimple", "method25", "a;"
        + bo1.toString() + "-;1", "a", new BusinessObject[] { bo1 }, 1);

    ControllerUtil.sendAndReceive(mockMvc, "remoteProviderSimple", "method25", "b;"
View Full Code Here

Examples of ch.ralscha.extdirectspring.provider.RemoteProviderSimple.BusinessObject

        "d;;3", "d", null, 3);
  }

  @Test
  public void methodWithComplexArrays() throws Exception {
    BusinessObject bo1 = new BusinessObject(4, "four", new BigDecimal("4.44"));
    BusinessObject bo2 = new BusinessObject(5, "five", new BigDecimal("5.55"));
    BusinessObject bo3 = new BusinessObject(6, "six", new BigDecimal("6.66"));

    ControllerUtil.sendAndReceive(mockMvc, "remoteProviderSimple", "method26", "e;"
        + bo1.toString() + "-;4", "e", new BusinessObject[] { bo1 }, 4);

    ControllerUtil.sendAndReceive(mockMvc, "remoteProviderSimple", "method26", "f;"
View Full Code Here

Examples of com.tll.model.schema.BusinessObject

   * @param entityClass
   * @return Set of bk definitions or <code>null</code> if no business keys are
   *         defined for the given entity class.
   */
  private static <E extends IEntity> Set<IBusinessKeyDefinition<E>> discoverBusinessKeys(Class<E> entityClass) {
    BusinessObject bo = entityClass.getAnnotation(BusinessObject.class);
    if(bo == null) {
      // try the root entity
      bo = EntityUtil.getRootEntityClass(entityClass).getAnnotation(BusinessObject.class);
    }
    if(bo == null) {
      // no bks defined
      return null;
    }
    final Set<IBusinessKeyDefinition<E>> set = new HashSet<IBusinessKeyDefinition<E>>();
    for(final BusinessKeyDef def : bo.businessKeys()) {
      set.add(new BusinessKeyDefinition<E>(entityClass, def.name(), def.properties()));
    }
    return set;
  }
View Full Code Here

Examples of org.apache.bval.example.BusinessObject

    public void testValidate() {
        MetaBeanFinder finder = XMLMetaBeanManagerFactory.getFinder();
        XMLMetaBeanManagerFactory.getRegistry().addLoader(new XMLMetaBeanURLLoader(
              BusinessObject.class.getResource("test-beanInfos.xml")));
        MetaBean info = finder.findForClass(BusinessObject.class);
        BusinessObject object = new BusinessObject();
        object.setAddress(new BusinessObjectAddress());
        object.getAddress().setOwner(object);
        BeanValidator<ValidationResults> validator = new BeanValidator();
        ValidationResults results = validator.validate(object, info);
        assertTrue(results.hasErrorForReason(Reasons.MANDATORY));
        assertTrue(results.hasError(object, null));
        assertTrue(results.hasError(object.getAddress(), null));

        assertTrue(
              validator.validateProperty(object, info.getProperty("firstName")).hasError(
                    object, "firstName"));

        object.setUserId(1L);
        object.setFirstName("Hans");
        object.setLastName("Tester");
        object.setAddress(new BusinessObjectAddress());
        object.getAddress().setOwner(object);
        assertFalse(validator.validate(object, info).isEmpty());

        object.getAddress().setCountry("0123456789012345678");
        assertFalse(validator.validate(object, info).isEmpty());

        object.getAddress().setCountry("Germany");
        object.setAddresses(new ArrayList());
        object.getAddresses().add(object.getAddress());
        object.getAddresses().add(object.getAddress());
        object.getAddresses().add(object.getAddress());
        assertTrue(validator.validate(object, info).isEmpty());

        // 4th address is too much!
        object.getAddresses().add(object.getAddress());
        assertFalse(
              validator.validate(object, info).isEmpty()); // cardinality error found
    }
View Full Code Here

Examples of org.apache.bval.example.BusinessObject

    public void testValidate() {
        MetaBeanFinder finder = MetaBeanManagerFactory.getFinder();
        MetaBeanManagerFactory.getRegistry().addLoader(new XMLMetaBeanURLLoader(
              BusinessObject.class.getResource("test-beanInfos.xml")));
        MetaBean info = finder.findForClass(BusinessObject.class);
        BusinessObject object = new BusinessObject();
        object.setAddress(new BusinessObjectAddress());
        object.getAddress().setOwner(object);
        BeanValidator<ValidationResults> validator = new BeanValidator();
        ValidationResults results = validator.validate(object, info);
        assertTrue(results.hasErrorForReason(Reasons.MANDATORY));
        assertTrue(results.hasError(object, null));
        assertTrue(results.hasError(object.getAddress(), null));

        assertTrue(
              validator.validateProperty(object, info.getProperty("firstName")).hasError(
                    object, "firstName"));

        object.setUserId(1L);
        object.setFirstName("Hans");
        object.setLastName("Tester");
        object.setAddress(new BusinessObjectAddress());
        object.getAddress().setOwner(object);
        assertFalse(validator.validate(object, info).isEmpty());

        object.getAddress().setCountry("0123456789012345678");
        assertFalse(validator.validate(object, info).isEmpty());

        object.getAddress().setCountry("Germany");
        object.setAddresses(new ArrayList());
        object.getAddresses().add(object.getAddress());
        object.getAddresses().add(object.getAddress());
        object.getAddresses().add(object.getAddress());
        assertTrue(validator.validate(object, info).isEmpty());

        // 4th address is too much!
        object.getAddresses().add(object.getAddress());
        assertFalse(
              validator.validate(object, info).isEmpty()); // cardinality error found
    }
View Full Code Here

Examples of org.apache.bval.example.BusinessObject

    public void testValidate() {
        MetaBeanFinder finder = XMLMetaBeanManagerFactory.getFinder();
        XMLMetaBeanManagerFactory.getRegistry().addLoader(new XMLMetaBeanURLLoader(
              BusinessObject.class.getResource("test-beanInfos.xml")));
        MetaBean info = finder.findForClass(BusinessObject.class);
        BusinessObject object = new BusinessObject();
        object.setAddress(new BusinessObjectAddress());
        object.getAddress().setOwner(object);
        BeanValidator<ValidationResults> validator = new BeanValidator<ValidationResults>();
        ValidationResults results = validator.validate(object, info);
        assertTrue(results.hasErrorForReason(Reasons.MANDATORY));
        assertTrue(results.hasError(object, null));
        assertTrue(results.hasError(object.getAddress(), null));

        assertTrue(
              validator.validateProperty(object, info.getProperty("firstName")).hasError(
                    object, "firstName"));

        object.setUserId(1L);
        object.setFirstName("Hans");
        object.setLastName("Tester");
        object.setAddress(new BusinessObjectAddress());
        object.getAddress().setOwner(object);
        assertFalse(validator.validate(object, info).isEmpty());

        object.getAddress().setCountry("0123456789012345678");
        assertFalse(validator.validate(object, info).isEmpty());

        object.getAddress().setCountry("Germany");
        object.setAddresses(new ArrayList<BusinessObjectAddress>());
        object.getAddresses().add(object.getAddress());
        object.getAddresses().add(object.getAddress());
        object.getAddresses().add(object.getAddress());
        assertTrue(validator.validate(object, info).isEmpty());

        // 4th address is too much!
        object.getAddresses().add(object.getAddress());
        assertFalse(
              validator.validate(object, info).isEmpty()); // cardinality error found
    }
View Full Code Here

Examples of org.apache.bval.example.BusinessObject

    public void testValidate() {
        MetaBeanFinder finder = XMLMetaBeanManagerFactory.getFinder();
        XMLMetaBeanManagerFactory.getRegistry().addLoader(new XMLMetaBeanURLLoader(
              BusinessObject.class.getResource("test-beanInfos.xml")));
        MetaBean info = finder.findForClass(BusinessObject.class);
        BusinessObject object = new BusinessObject();
        object.setAddress(new BusinessObjectAddress());
        object.getAddress().setOwner(object);
        BeanValidator<ValidationResults> validator = new BeanValidator();
        ValidationResults results = validator.validate(object, info);
        assertTrue(results.hasErrorForReason(Reasons.MANDATORY));
        assertTrue(results.hasError(object, null));
        assertTrue(results.hasError(object.getAddress(), null));

        assertTrue(
              validator.validateProperty(object, info.getProperty("firstName")).hasError(
                    object, "firstName"));

        object.setUserId(1L);
        object.setFirstName("Hans");
        object.setLastName("Tester");
        object.setAddress(new BusinessObjectAddress());
        object.getAddress().setOwner(object);
        assertFalse(validator.validate(object, info).isEmpty());

        object.getAddress().setCountry("0123456789012345678");
        assertFalse(validator.validate(object, info).isEmpty());

        object.getAddress().setCountry("Germany");
        object.setAddresses(new ArrayList());
        object.getAddresses().add(object.getAddress());
        object.getAddresses().add(object.getAddress());
        object.getAddresses().add(object.getAddress());
        assertTrue(validator.validate(object, info).isEmpty());

        // 4th address is too much!
        object.getAddresses().add(object.getAddress());
        assertFalse(
              validator.validate(object, info).isEmpty()); // cardinality error found
    }
View Full Code Here

Examples of org.apache.isis.application.BusinessObject

public class ColorTest extends ValueTestCase {

    public void testEncodedString() {
        MockControl control = MockControl.createControl(BusinessObject.class);
        BusinessObject bo = (BusinessObject) control.getMock();
        bo.objectChanged();
        control.replay(); // finished recording

        Color color = new Color(bo);
        assertEquals("enc", "NULL", color.asEncodedString());
View Full Code Here

Examples of org.jboss.ejb3.core.test.ejbthree1520.BusinessObject

   }
  
   @Test
   public void test1() throws NamingException
   {
      BusinessObject bean = lookup("BusinessObjectBean/remote", BusinessObject.class);
      BusinessObject actual = bean.getBusinessObject();
      assertEquals(bean, actual);
   }
View Full Code Here

Examples of org.jboss.test.aop.declare.businesslayer.BusinessObject

      System.out.println("*** testLoadTimeDeclare");
      SystemOutDecorator out = null;
      try
      {
         out = SystemOutDecorator.initialise();
         BusinessObject bo = new BusinessObject();
         bo.createVehicles();
         ArrayList expected = getExpectedWarnings();
         ArrayList actual = out.getWarnings();
         compareWarnings(expected, actual);
      }
      finally
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.