Java Code Examples for org.springframework.tests.sample.beans.TestBean#setSomeNumber()

The following examples show how to use org.springframework.tests.sample.beans.TestBean#setSomeNumber() . 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: OptionTagTests.java    From spring-analysis-note with MIT License 6 votes vote down vote up
@Override
protected void extendRequest(MockHttpServletRequest request) {
	TestBean bean = new TestBean();
	bean.setName("foo");
	bean.setFavouriteColour(Colour.GREEN);
	bean.setStringArray(ARRAY);
	bean.setSpouse(new TestBean("Sally"));
	bean.setSomeNumber(new Float("12.34"));

	List friends = new ArrayList();
	friends.add(new TestBean("bar"));
	friends.add(new TestBean("penc"));
	bean.setFriends(friends);

	request.setAttribute("testBean", bean);
}
 
Example 2
Source File: OptionTagTests.java    From java-technology-stack with MIT License 6 votes vote down vote up
@Override
protected void extendRequest(MockHttpServletRequest request) {
	TestBean bean = new TestBean();
	bean.setName("foo");
	bean.setFavouriteColour(Colour.GREEN);
	bean.setStringArray(ARRAY);
	bean.setSpouse(new TestBean("Sally"));
	bean.setSomeNumber(new Float("12.34"));

	List friends = new ArrayList();
	friends.add(new TestBean("bar"));
	friends.add(new TestBean("penc"));
	bean.setFriends(friends);

	request.setAttribute("testBean", bean);
}
 
Example 3
Source File: OptionTagTests.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Override
protected void extendRequest(MockHttpServletRequest request) {
	TestBean bean = new TestBean();
	bean.setName("foo");
	bean.setFavouriteColour(Colour.GREEN);
	bean.setStringArray(ARRAY);
	bean.setSpouse(new TestBean("Sally"));
	bean.setSomeNumber(new Float("12.34"));

	List friends = new ArrayList();
	friends.add(new TestBean("bar"));
	friends.add(new TestBean("penc"));
	bean.setFriends(friends);

	request.setAttribute("testBean", bean);
}
 
Example 4
Source File: AspectJExpressionPointcutTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void testDynamicMatchingProxy() {
	String expression = "execution(void org.springframework.tests.sample.beans.TestBean.setSomeNumber(Number)) && args(Double)";
	CallCountingInterceptor interceptor = new CallCountingInterceptor();
	TestBean testBean = getAdvisedProxy(expression, interceptor);

	assertEquals("Calls should be 0", 0, interceptor.getCount());
	testBean.setSomeNumber(new Double(30));
	assertEquals("Calls should be 1", 1, interceptor.getCount());

	testBean.setSomeNumber(new Integer(90));
	assertEquals("Calls should be 1", 1, interceptor.getCount());
}
 
Example 5
Source File: AspectJExpressionPointcutTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void testDynamicMatchingProxy() {
	String expression = "execution(void org.springframework.tests.sample.beans.TestBean.setSomeNumber(Number)) && args(Double)";
	CallCountingInterceptor interceptor = new CallCountingInterceptor();
	TestBean testBean = getAdvisedProxy(expression, interceptor);

	assertEquals("Calls should be 0", 0, interceptor.getCount());
	testBean.setSomeNumber(new Double(30));
	assertEquals("Calls should be 1", 1, interceptor.getCount());

	testBean.setSomeNumber(new Integer(90));
	assertEquals("Calls should be 1", 1, interceptor.getCount());
}
 
Example 6
Source File: AspectJExpressionPointcutTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Test
public void testDynamicMatchingProxy() {
	String expression = "execution(void org.springframework.tests.sample.beans.TestBean.setSomeNumber(Number)) && args(Double)";

	CallCountingInterceptor interceptor = new CallCountingInterceptor();

	TestBean testBean = getAdvisedProxy(expression, interceptor);

	assertEquals("Calls should be 0", 0, interceptor.getCount());

	testBean.setSomeNumber(new Double(30));

	assertEquals("Calls should be 1", 1, interceptor.getCount());

	testBean.setSomeNumber(new Integer(90));

	assertEquals("Calls should be 1", 1, interceptor.getCount());
}