Examples of TestBean


Examples of org.apache.commons.beanutils.TestBean

    /**
     * Test copy properties where the target bean only
     * has an indexed setter.
     */
    public void testIssue_BEANUTILS_92_copyProperties_indexed_only_setter() throws Exception {
        PropertyUtils.copyProperties(new Jira92TestBean(), new TestBean());
    }
View Full Code Here

Examples of org.apache.commons.beanutils.bugs.other.Jira61BeanFactory.TestBean

     * Test {@link PropertyUtils#copyProperties(Object, Object)}
     * to a read-only WrapDynaBean property.
     */
    public void testIssue_BEANUTILS_61_PropertyUtils_copyProperties_from_WrapDynaBean() {
        String value = "ORIG TARGET VALUE";
        TestBean targetBean = Jira61BeanFactory.createBean();
        targetBean.setSimpleWriteOnly(value);
        try {
            PropertyUtils.copyProperties(targetBean, wrapDynaBean);
        } catch (Throwable t) {
            log.error("ERROR " + t, t);
            fail("copyProperties Threw exception: " + t);
        }
        assertTrue("Target value='" + targetBean.getSimpleReadOnly() + "'", value.equals(targetBean.getSimpleReadOnly()));
    }
View Full Code Here

Examples of org.apache.commons.dbutils.TestBean

    super(name);
  }

  public void testHandle() throws SQLException {
    ResultSetHandler h = new BeanHandler(TestBean.class);
        TestBean results = (TestBean) h.handle(this.rs);
       
    assertNotNull(results);
    assertEquals("1", results.getOne());
    assertEquals("2", results.getTwo());
    assertEquals("3", results.getThree());
        assertEquals("not set", results.getDoNotSet());
  }
View Full Code Here

Examples of org.apache.commons.jxpath.TestBean

    public void testRootAsCollection() {
        assertXPathValue(context, ".[1]/string", "string");
    }

    public void testCreatePath() {
        context = JXPathContext.newContext(new TestBean());
        context.setFactory(new TestMixedModelFactory());

        TestBean bean = (TestBean) context.getContextBean();
        bean.setMap(null);

        assertXPathCreatePath(
            context,
            "/map[@name='TestKey5']/nestedBean/int",
            new Integer(1),
            "/map[@name='TestKey5']/nestedBean/int");

        bean.setMap(null);
        assertXPathCreatePath(
            context,
            "/map[@name='TestKey5']/beans[2]/int",
            new Integer(1),
            "/map[@name='TestKey5']/beans[2]/int");
View Full Code Here

Examples of org.apache.commons.jxpath.TestBean

            }
            ((Map) parent).put(name, v);
            return true;
        }
        else if (name.equals("TestKey4")) {
            ((Map) parent).put(name, new Object[] { new TestBean()});
            return true;
        }
        return false;
    }
View Full Code Here

Examples of org.apache.commons.jxpath.TestBean

//        s.addTest(new DynaBeanModelTest("testAxisParent"));
//        return s;
    }

    protected Object createContextBean() {
        return new WrapDynaBean(new TestBean());
    }
View Full Code Here

Examples of org.apache.commons.jxpath.TestBean

        super(name);
    }

    public void setUp() {
        if (context == null) {
            context = JXPathContext.newContext(new TestBean());
            context.setFactory(new TestDynamicPropertyFactory());
        }
    }
View Full Code Here

Examples of org.apache.commons.jxpath.TestBean

    public void testSetNewKey() {
        assertXPathSetValue(context, "map/Key4", new Integer(7));
    }

    public void testCreatePath() {
        TestBean bean = (TestBean) context.getContextBean();
        bean.setMap(null);

        // Calls factory.createObject(..., testBean, "map"), then
        // sets the value
        assertXPathCreatePath(
            context,
View Full Code Here

Examples of org.apache.commons.jxpath.TestBean

            "",
            "/map[@name='TestKey1']");
    }

    public void testCreatePathAndSetValue() {
        TestBean bean = (TestBean) context.getContextBean();
        bean.setMap(null);

        // Calls factory.createObject(..., testBean, "map"), then
        // sets the value
        assertXPathCreatePathAndSetValue(
            context,
View Full Code Here

Examples of org.apache.commons.jxpath.TestBean

            "Test",
            "/map[@name='TestKey1']");
    }

    public void testCreatePathCreateBean() {
        TestBean bean = (TestBean) context.getContextBean();
        bean.setMap(null);

        // Calls factory.createObject(..., testBean, "map"), then
        // then factory.createObject(..., map, "TestKey2"), then
        // sets the value
        assertXPathCreatePath(
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.