Examples of BasicDynaClass


Examples of org.apache.commons.beanutils.BasicDynaClass

    }

    @Test
    public void testInsertBasic() throws Exception {
        // setup our dynabeans
        BasicDynaClass dynaClass = setupDynaClass("Account");

        Map<String, Object> sforceMapping = new HashMap<String, Object>();
        sforceMapping.put("Name", "name" + System.currentTimeMillis());
        sforceMapping.put("Description", "the description");
        // Account number is set for easier test data cleanup
        sforceMapping.put("AccountNumber", ACCOUNT_NUMBER_PREFIX + System.currentTimeMillis());

        // now convert to a dynabean array for the client
        DynaBean sforceObj = dynaClass.newInstance();

        // This does an automatic conversion of types.
        BeanUtils.copyProperties(sforceObj, sforceMapping);

        List<DynaBean> beanList = new ArrayList<DynaBean>();
View Full Code Here

Examples of org.apache.commons.beanutils.BasicDynaClass

    @Test
    public void testUpdateBasic() throws Exception {
        String id = getRandomAccountId();

        // setup our dynabeans
        BasicDynaClass dynaClass = setupDynaClass("Account");

        Map<String, Object> sforceMapping = new HashMap<String, Object>();
        sforceMapping.put("Id", id);
        sforceMapping.put("Name", "newname" + System.currentTimeMillis());
        sforceMapping.put("Description", "the new description");
        // Account number is set for easier test data cleanup
        sforceMapping.put("AccountNumber", ACCOUNT_NUMBER_PREFIX + System.currentTimeMillis());

        // now convert to a dynabean array for the client
        DynaBean sforceObj = dynaClass.newInstance();

        // This does an automatic conversion of types.
        BeanUtils.copyProperties(sforceObj, sforceMapping);

        List<DynaBean> beanList = new ArrayList<DynaBean>();
View Full Code Here

Examples of org.apache.commons.beanutils.BasicDynaClass

     */
    @Test
    public void testUpdateFailBasic() throws Exception {

        // setup our dynabeans
        BasicDynaClass dynaClass = setupDynaClass("Account");

        Map<String, Object> sforceMapping = new HashMap<String, Object>();
        sforceMapping.put("Name", "newname" + System.currentTimeMillis());
        sforceMapping.put("Description", "the new description");
        // Account number is set for easier test data cleanup
        sforceMapping.put("AccountNumber", ACCOUNT_NUMBER_PREFIX + System.currentTimeMillis());

        // now convert to a dynabean array for the client
        DynaBean sforceObj = dynaClass.newInstance();
        // This does an automatic conversion of types.
        BeanUtils.copyProperties(sforceObj, sforceMapping);

        List<DynaBean> beanList = new ArrayList<DynaBean>();
        beanList.add(sforceObj);
View Full Code Here

Examples of org.apache.commons.beanutils.BasicDynaClass

    }

    private void doUpsert(String entity, Map<String, Object> sforceMapping) throws Exception {
        // now convert to a dynabean array for the client
        // setup our dynabeans
        BasicDynaClass dynaClass = setupDynaClass(entity);

        DynaBean sforceObj = dynaClass.newInstance();

        // This does an automatic conversion of types.
        BeanUtils.copyProperties(sforceObj, sforceMapping);

        List<DynaBean> beanList = new ArrayList<DynaBean>();
View Full Code Here

Examples of org.apache.commons.beanutils.BasicDynaClass

     * Basic failing - forgetting the external id or foreign key external id
     */
    private void doUpsertFailBasic(boolean upsertFk) throws Exception {

        // setup our dynabeans
        BasicDynaClass dynaClass = setupDynaClass("Account");

        Map<String, Object> sforceMapping = new HashMap<String, Object>();
        sforceMapping.put("Name", "newname" + System.currentTimeMillis());
        sforceMapping.put("Description", "the new description");
        // Account number is set for easier test data cleanup
        sforceMapping.put("AccountNumber", ACCOUNT_NUMBER_PREFIX + System.currentTimeMillis());

        // Add FAILURE for upsert on FK.
        String extIdField = setExtIdField(DEFAULT_ACCOUNT_EXT_ID_FIELD);
        Object extIdValue = getRandomExtId("Account", ACCOUNT_WHERE_CLAUSE, null);
        if (upsertFk) {
            sforceMapping.put(extIdField, extIdValue);
            // forget to set the foreign key external id value
            sforceMapping.put(ObjectField.formatAsString("Parent", extIdField), "bogus");
        }

        // now convert to a dynabean array for the client
        DynaBean sforceObj = dynaClass.newInstance();

        // This does an automatic conversion of types.
        BeanUtils.copyProperties(sforceObj, sforceMapping);

        List<DynaBean> beanList = new ArrayList<DynaBean>();
View Full Code Here

Examples of org.apache.commons.beanutils.BasicDynaClass

    @Test
    public void testDeleteBasic() throws Exception {
        String id = getRandomAccountId();

        // setup our dynabeans
        BasicDynaClass dynaClass = setupDynaClass("Account");

        Map<String, Object> sforceMapping = new HashMap<String, Object>();
        sforceMapping.put("Id", id);
        sforceMapping.put("Name", "name" + System.currentTimeMillis());
        sforceMapping.put("Description", "the description");
        // Account number is set for easier test data cleanup
        sforceMapping.put("AccountNumber", ACCOUNT_NUMBER_PREFIX + System.currentTimeMillis());

        // now convert to a dynabean array for the client
        DynaBean sforceObj = dynaClass.newInstance();

        // This does an automatic conversion of types.
        BeanUtils.copyProperties(sforceObj, sforceMapping);

        List<DynaBean> beanList = new ArrayList<DynaBean>();
View Full Code Here

Examples of org.apache.commons.beanutils.BasicDynaClass

     */
    @Test
    public void testDeleteFailBasic() throws Exception {

        // setup our dynabeans
        BasicDynaClass dynaClass = setupDynaClass("Account");

        Map<String, Object> sforceMapping = new HashMap<String, Object>();
        sforceMapping.put("name", "name" + System.currentTimeMillis());
        sforceMapping.put("description", "the description");
        // Account number is set for easier test data cleanup
        sforceMapping.put("AccountNumber", ACCOUNT_NUMBER_PREFIX + System.currentTimeMillis());

        // now convert to a dynabean array for the client
        DynaBean sforceObj = dynaClass.newInstance();

        // This does an automatic conversion of types.
        BeanUtils.copyProperties(sforceObj, sforceMapping);

        List<DynaBean> beanList = new ArrayList<DynaBean>();
View Full Code Here

Examples of org.apache.commons.beanutils.BasicDynaClass

        }

        getController().setFieldTypes();
        getController().setReferenceDescribes();
        DynaProperty[] dynaProps = SforceDynaBean.createDynaProps(getController().getPartnerClient().getFieldTypes(), getController());
        BasicDynaClass dynaClass = SforceDynaBean.getDynaBeanInstance(dynaProps);
        SforceDynaBean.registerConverters(getController().getConfig());
        return dynaClass;
    }
View Full Code Here

Examples of org.apache.commons.beanutils.BasicDynaClass

                            true);
       
    }
   
    private DynaClass createDynasaurClass() throws Exception {
        DynaClass dynaClass = new BasicDynaClass
                ("Dynasaur", null,
                        new DynaProperty[]{
                            new DynaProperty("Species", String.class),
                            new DynaProperty("isRaptor", Boolean.TYPE),
                            new DynaProperty("Period", String.class),
View Full Code Here

Examples of org.apache.commons.beanutils.BasicDynaClass

    public void testSimpleTest() throws Exception {
        DynaProperty[] dynaProperties = {
                new DynaProperty("alpha", Integer.class),
                new DynaProperty("beta", String.class)};
        BasicDynaClass dynaClass = new BasicDynaClass("ADynaBean", BasicDynaBean.class,
                dynaProperties);
        DynaBean dynaBean = dynaClass.newInstance();
       
        Context context = new Context();
        context.setBean(dynaBean);
       
        DynaBeanUpdater dynaBeanUpdater = new DynaBeanUpdater("beta", String.class);
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.