Java Code Examples for org.springframework.tests.sample.beans.DerivedTestBean#setTouchy()

The following examples show how to use org.springframework.tests.sample.beans.DerivedTestBean#setTouchy() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BeanUtilsTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void testCopyPropertiesWithDifferentTypes1() throws Exception {
	DerivedTestBean tb = new DerivedTestBean();
	tb.setName("rod");
	tb.setAge(32);
	tb.setTouchy("touchy");
	TestBean tb2 = new TestBean();
	assertTrue("Name empty", tb2.getName() == null);
	assertTrue("Age empty", tb2.getAge() == 0);
	assertTrue("Touchy empty", tb2.getTouchy() == null);
	BeanUtils.copyProperties(tb, tb2);
	assertTrue("Name copied", tb2.getName().equals(tb.getName()));
	assertTrue("Age copied", tb2.getAge() == tb.getAge());
	assertTrue("Touchy copied", tb2.getTouchy().equals(tb.getTouchy()));
}
 
Example 2
Source File: BeanUtilsTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void testCopyPropertiesWithDifferentTypes1() throws Exception {
	DerivedTestBean tb = new DerivedTestBean();
	tb.setName("rod");
	tb.setAge(32);
	tb.setTouchy("touchy");
	TestBean tb2 = new TestBean();
	assertTrue("Name empty", tb2.getName() == null);
	assertTrue("Age empty", tb2.getAge() == 0);
	assertTrue("Touchy empty", tb2.getTouchy() == null);
	BeanUtils.copyProperties(tb, tb2);
	assertTrue("Name copied", tb2.getName().equals(tb.getName()));
	assertTrue("Age copied", tb2.getAge() == tb.getAge());
	assertTrue("Touchy copied", tb2.getTouchy().equals(tb.getTouchy()));
}
 
Example 3
Source File: BeanUtilsTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void testCopyPropertiesWithDifferentTypes1() throws Exception {
	DerivedTestBean tb = new DerivedTestBean();
	tb.setName("rod");
	tb.setAge(32);
	tb.setTouchy("touchy");
	TestBean tb2 = new TestBean();
	assertTrue("Name empty", tb2.getName() == null);
	assertTrue("Age empty", tb2.getAge() == 0);
	assertTrue("Touchy empty", tb2.getTouchy() == null);
	BeanUtils.copyProperties(tb, tb2);
	assertTrue("Name copied", tb2.getName().equals(tb.getName()));
	assertTrue("Age copied", tb2.getAge() == tb.getAge());
	assertTrue("Touchy copied", tb2.getTouchy().equals(tb.getTouchy()));
}