Fix unused local variable warnings
This commit is contained in:
		
							parent
							
								
									6a1e841952
								
							
						
					
					
						commit
						065b1c0e46
					
				| 
						 | 
					@ -60,7 +60,7 @@ public abstract aspect AbstractTransactionAspect extends TransactionAspectSuppor
 | 
				
			||||||
	before(Object txObject) : transactionalMethodExecution(txObject) {
 | 
						before(Object txObject) : transactionalMethodExecution(txObject) {
 | 
				
			||||||
		MethodSignature methodSignature = (MethodSignature) thisJoinPoint.getSignature();
 | 
							MethodSignature methodSignature = (MethodSignature) thisJoinPoint.getSignature();
 | 
				
			||||||
		Method method = methodSignature.getMethod();
 | 
							Method method = methodSignature.getMethod();
 | 
				
			||||||
		TransactionInfo txInfo = createTransactionIfNecessary(method, txObject.getClass());
 | 
							createTransactionIfNecessary(method, txObject.getClass());
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@SuppressAjWarnings("adviceDidNotMatch")
 | 
						@SuppressAjWarnings("adviceDidNotMatch")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -211,6 +211,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase {
 | 
				
			||||||
		MailClientDependencyInjectionAspect.aspectOf().setMailSender(new JavaMailSenderImpl());
 | 
							MailClientDependencyInjectionAspect.aspectOf().setMailSender(new JavaMailSenderImpl());
 | 
				
			||||||
		Order testOrder = new Order();
 | 
							Order testOrder = new Order();
 | 
				
			||||||
		Order deserializedOrder = serializeAndDeserialize(testOrder);
 | 
							Order deserializedOrder = serializeAndDeserialize(testOrder);
 | 
				
			||||||
 | 
							assertNotNull(deserializedOrder);
 | 
				
			||||||
		assertNotNull("Interface driven injection didn't occur for deserialization", testOrder.mailSender);
 | 
							assertNotNull("Interface driven injection didn't occur for deserialization", testOrder.mailSender);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright 2002-2012 the original author or authors.
 | 
					 * Copyright 2002-2013 the original author or authors.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
					 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 * you may not use this file except in compliance with the License.
 | 
					 * you may not use this file except in compliance with the License.
 | 
				
			||||||
| 
						 | 
					@ -45,7 +45,6 @@ public final class CustomScopeConfigurerTests {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void testWithNoScopes() throws Exception {
 | 
						public void testWithNoScopes() throws Exception {
 | 
				
			||||||
		Scope scope = mock(Scope.class);
 | 
					 | 
				
			||||||
		CustomScopeConfigurer figurer = new CustomScopeConfigurer();
 | 
							CustomScopeConfigurer figurer = new CustomScopeConfigurer();
 | 
				
			||||||
		figurer.postProcessBeanFactory(factory);
 | 
							figurer.postProcessBeanFactory(factory);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,6 +17,7 @@
 | 
				
			||||||
package org.springframework.beans.factory.config;
 | 
					package org.springframework.beans.factory.config;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import static org.junit.Assert.assertEquals;
 | 
					import static org.junit.Assert.assertEquals;
 | 
				
			||||||
 | 
					import static org.junit.Assert.assertNotNull;
 | 
				
			||||||
import static org.junit.Assert.assertNull;
 | 
					import static org.junit.Assert.assertNull;
 | 
				
			||||||
import static org.junit.Assert.assertSame;
 | 
					import static org.junit.Assert.assertSame;
 | 
				
			||||||
import static org.junit.Assert.assertTrue;
 | 
					import static org.junit.Assert.assertTrue;
 | 
				
			||||||
| 
						 | 
					@ -644,6 +645,7 @@ public final class PropertyResourceConfigurerTests {
 | 
				
			||||||
		ppc.postProcessBeanFactory(factory);
 | 
							ppc.postProcessBeanFactory(factory);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		TestBean tb = (TestBean) factory.getBean("tb");
 | 
							TestBean tb = (TestBean) factory.getBean("tb");
 | 
				
			||||||
 | 
							assertNotNull(tb);
 | 
				
			||||||
		assertEquals(0, factory.getAliases("tb").length);
 | 
							assertEquals(0, factory.getAliases("tb").length);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -515,8 +515,7 @@ public class CallbacksSecurityTests {
 | 
				
			||||||
		perms.add(new AuthPermission("getSubject"));
 | 
							perms.add(new AuthPermission("getSubject"));
 | 
				
			||||||
		ProtectionDomain pd = new ProtectionDomain(null, perms);
 | 
							ProtectionDomain pd = new ProtectionDomain(null, perms);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		AccessControlContext acc = new AccessControlContext(
 | 
							new AccessControlContext(new ProtectionDomain[] { pd });
 | 
				
			||||||
				new ProtectionDomain[] { pd });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		final Subject subject = new Subject();
 | 
							final Subject subject = new Subject();
 | 
				
			||||||
		subject.getPrincipals().add(new TestPrincipal("user1"));
 | 
							subject.getPrincipals().add(new TestPrincipal("user1"));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -121,7 +121,7 @@ public abstract class AbstractBeanFactoryTests extends TestCase {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void testGetInstanceByNonmatchingClass() {
 | 
						public void testGetInstanceByNonmatchingClass() {
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			Object o = getBeanFactory().getBean("rod", BeanFactory.class);
 | 
								getBeanFactory().getBean("rod", BeanFactory.class);
 | 
				
			||||||
			fail("Rod bean is not of type BeanFactory; getBeanInstance(rod, BeanFactory.class) should throw BeanNotOfRequiredTypeException");
 | 
								fail("Rod bean is not of type BeanFactory; getBeanInstance(rod, BeanFactory.class) should throw BeanNotOfRequiredTypeException");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		catch (BeanNotOfRequiredTypeException ex) {
 | 
							catch (BeanNotOfRequiredTypeException ex) {
 | 
				
			||||||
| 
						 | 
					@ -155,7 +155,7 @@ public abstract class AbstractBeanFactoryTests extends TestCase {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void testGetSharedInstanceByNonmatchingClass() {
 | 
						public void testGetSharedInstanceByNonmatchingClass() {
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			Object o = getBeanFactory().getBean("rod", BeanFactory.class);
 | 
								getBeanFactory().getBean("rod", BeanFactory.class);
 | 
				
			||||||
			fail("Rod bean is not of type BeanFactory; getBeanInstance(rod, BeanFactory.class) should throw BeanNotOfRequiredTypeException");
 | 
								fail("Rod bean is not of type BeanFactory; getBeanInstance(rod, BeanFactory.class) should throw BeanNotOfRequiredTypeException");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		catch (BeanNotOfRequiredTypeException ex) {
 | 
							catch (BeanNotOfRequiredTypeException ex) {
 | 
				
			||||||
| 
						 | 
					@ -199,7 +199,7 @@ public abstract class AbstractBeanFactoryTests extends TestCase {
 | 
				
			||||||
	public void testNotThere() {
 | 
						public void testNotThere() {
 | 
				
			||||||
		assertFalse(getBeanFactory().containsBean("Mr Squiggle"));
 | 
							assertFalse(getBeanFactory().containsBean("Mr Squiggle"));
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			Object o = getBeanFactory().getBean("Mr Squiggle");
 | 
								getBeanFactory().getBean("Mr Squiggle");
 | 
				
			||||||
			fail("Can't find missing bean");
 | 
								fail("Can't find missing bean");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		catch (BeansException ex) {
 | 
							catch (BeansException ex) {
 | 
				
			||||||
| 
						 | 
					@ -223,7 +223,7 @@ public abstract class AbstractBeanFactoryTests extends TestCase {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void xtestTypeMismatch() {
 | 
						public void xtestTypeMismatch() {
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			Object o = getBeanFactory().getBean("typeMismatch");
 | 
								getBeanFactory().getBean("typeMismatch");
 | 
				
			||||||
			fail("Shouldn't succeed with type mismatch");
 | 
								fail("Shouldn't succeed with type mismatch");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		catch (BeanCreationException wex) {
 | 
							catch (BeanCreationException wex) {
 | 
				
			||||||
| 
						 | 
					@ -278,6 +278,7 @@ public abstract class AbstractBeanFactoryTests extends TestCase {
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public void testFactoryIsInitialized() throws Exception {
 | 
						public void testFactoryIsInitialized() throws Exception {
 | 
				
			||||||
		TestBean tb = (TestBean) getBeanFactory().getBean("singletonFactory");
 | 
							TestBean tb = (TestBean) getBeanFactory().getBean("singletonFactory");
 | 
				
			||||||
 | 
							assertNotNull(tb);
 | 
				
			||||||
		DummyFactory factory = (DummyFactory) getBeanFactory().getBean("&singletonFactory");
 | 
							DummyFactory factory = (DummyFactory) getBeanFactory().getBean("&singletonFactory");
 | 
				
			||||||
		assertTrue("Factory was initialized because it implemented InitializingBean", factory.wasInitialized());
 | 
							assertTrue("Factory was initialized because it implemented InitializingBean", factory.wasInitialized());
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright 2002-2012 the original author or authors.
 | 
					 * Copyright 2002-2013 the original author or authors.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 | 
					 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 | 
				
			||||||
 * use this file except in compliance with the License. You may obtain a copy of
 | 
					 * use this file except in compliance with the License. You may obtain a copy of
 | 
				
			||||||
| 
						 | 
					@ -51,6 +51,7 @@ public abstract class AbstractJmxAssemblerTests extends AbstractJmxTests {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void testRegisterOperations() throws Exception {
 | 
						public void testRegisterOperations() throws Exception {
 | 
				
			||||||
		IJmxTestBean bean = getBean();
 | 
							IJmxTestBean bean = getBean();
 | 
				
			||||||
 | 
							assertNotNull(bean);
 | 
				
			||||||
		MBeanInfo inf = getMBeanInfo();
 | 
							MBeanInfo inf = getMBeanInfo();
 | 
				
			||||||
		assertEquals("Incorrect number of operations registered",
 | 
							assertEquals("Incorrect number of operations registered",
 | 
				
			||||||
				getExpectedOperationCount(), inf.getOperations().length);
 | 
									getExpectedOperationCount(), inf.getOperations().length);
 | 
				
			||||||
| 
						 | 
					@ -58,6 +59,7 @@ public abstract class AbstractJmxAssemblerTests extends AbstractJmxTests {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void testRegisterAttributes() throws Exception {
 | 
						public void testRegisterAttributes() throws Exception {
 | 
				
			||||||
		IJmxTestBean bean = getBean();
 | 
							IJmxTestBean bean = getBean();
 | 
				
			||||||
 | 
							assertNotNull(bean);
 | 
				
			||||||
		MBeanInfo inf = getMBeanInfo();
 | 
							MBeanInfo inf = getMBeanInfo();
 | 
				
			||||||
		assertEquals("Incorrect number of attributes registered",
 | 
							assertEquals("Incorrect number of attributes registered",
 | 
				
			||||||
				getExpectedAttributeCount(), inf.getAttributes().length);
 | 
									getExpectedAttributeCount(), inf.getAttributes().length);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright 2002-2012 the original author or authors.
 | 
					 * Copyright 2002-2013 the original author or authors.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
					 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 * you may not use this file except in compliance with the License.
 | 
					 * you may not use this file except in compliance with the License.
 | 
				
			||||||
| 
						 | 
					@ -39,7 +39,7 @@ public class InterfaceBasedMBeanInfoAssemblerMappedTests extends AbstractJmxAsse
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void testWithUnknownClass() throws Exception {
 | 
						public void testWithUnknownClass() throws Exception {
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			InterfaceBasedMBeanInfoAssembler assembler = getWithMapping("com.foo.bar.Unknown");
 | 
								getWithMapping("com.foo.bar.Unknown");
 | 
				
			||||||
			fail("Should have thrown IllegalArgumentException");
 | 
								fail("Should have thrown IllegalArgumentException");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		catch (IllegalArgumentException ex) {
 | 
							catch (IllegalArgumentException ex) {
 | 
				
			||||||
| 
						 | 
					@ -49,7 +49,7 @@ public class InterfaceBasedMBeanInfoAssemblerMappedTests extends AbstractJmxAsse
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void testWithNonInterface() throws Exception {
 | 
						public void testWithNonInterface() throws Exception {
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			InterfaceBasedMBeanInfoAssembler assembler = getWithMapping("JmxTestBean");
 | 
								getWithMapping("JmxTestBean");
 | 
				
			||||||
			fail("Should have thrown IllegalArgumentException");
 | 
								fail("Should have thrown IllegalArgumentException");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		catch (IllegalArgumentException ex) {
 | 
							catch (IllegalArgumentException ex) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright 2002-2012 the original author or authors.
 | 
					 * Copyright 2002-2013 the original author or authors.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
					 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 * you may not use this file except in compliance with the License.
 | 
					 * you may not use this file except in compliance with the License.
 | 
				
			||||||
| 
						 | 
					@ -104,7 +104,7 @@ public class LabeledEnumTests extends TestCase {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void testDoesNotMatchWrongClass() {
 | 
						public void testDoesNotMatchWrongClass() {
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			LabeledEnum none = StaticLabeledEnumResolver.instance().getLabeledEnumByCode(Dog.class,
 | 
								StaticLabeledEnumResolver.instance().getLabeledEnumByCode(Dog.class,
 | 
				
			||||||
					new Short((short) 1));
 | 
										new Short((short) 1));
 | 
				
			||||||
			fail("Should have failed");
 | 
								fail("Should have failed");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -119,10 +119,11 @@ public class LabeledEnumTests extends TestCase {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@SuppressWarnings("serial")
 | 
						@SuppressWarnings({ "serial", "unused" })
 | 
				
			||||||
	private static class Other extends StaticLabeledEnum {
 | 
						private static class Other extends StaticLabeledEnum {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		public static final Other THING1 = new Other(1, "Thing1");
 | 
							public static final Other THING1 = new Other(1, "Thing1");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		public static final Other THING2 = new Other(2, "Thing2");
 | 
							public static final Other THING2 = new Other(2, "Thing2");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright 2002-2012 the original author or authors.
 | 
					 * Copyright 2002-2013 the original author or authors.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
					 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 * you may not use this file except in compliance with the License.
 | 
					 * you may not use this file except in compliance with the License.
 | 
				
			||||||
| 
						 | 
					@ -34,7 +34,6 @@ public class StopWatchTests extends TestCase {
 | 
				
			||||||
		String name1 = "Task 1";
 | 
							String name1 = "Task 1";
 | 
				
			||||||
		String name2 = "Task 2";
 | 
							String name2 = "Task 2";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		long fudgeFactor = 5L;
 | 
					 | 
				
			||||||
		assertFalse(sw.isRunning());
 | 
							assertFalse(sw.isRunning());
 | 
				
			||||||
		sw.start(name1);
 | 
							sw.start(name1);
 | 
				
			||||||
		Thread.sleep(int1);
 | 
							Thread.sleep(int1);
 | 
				
			||||||
| 
						 | 
					@ -44,6 +43,7 @@ public class StopWatchTests extends TestCase {
 | 
				
			||||||
		// TODO are timings off in JUnit? Why do these assertions sometimes fail
 | 
							// TODO are timings off in JUnit? Why do these assertions sometimes fail
 | 
				
			||||||
		// under both Ant and Eclipse?
 | 
							// under both Ant and Eclipse?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//long fudgeFactor = 5L;
 | 
				
			||||||
		//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() >= int1);
 | 
							//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() >= int1);
 | 
				
			||||||
		//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() <= int1 + fudgeFactor);
 | 
							//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() <= int1 + fudgeFactor);
 | 
				
			||||||
		sw.start(name2);
 | 
							sw.start(name2);
 | 
				
			||||||
| 
						 | 
					@ -72,7 +72,6 @@ public class StopWatchTests extends TestCase {
 | 
				
			||||||
		String name1 = "Task 1";
 | 
							String name1 = "Task 1";
 | 
				
			||||||
		String name2 = "Task 2";
 | 
							String name2 = "Task 2";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		long fudgeFactor = 5L;
 | 
					 | 
				
			||||||
		assertFalse(sw.isRunning());
 | 
							assertFalse(sw.isRunning());
 | 
				
			||||||
		sw.start(name1);
 | 
							sw.start(name1);
 | 
				
			||||||
		Thread.sleep(int1);
 | 
							Thread.sleep(int1);
 | 
				
			||||||
| 
						 | 
					@ -82,6 +81,7 @@ public class StopWatchTests extends TestCase {
 | 
				
			||||||
		// TODO are timings off in JUnit? Why do these assertions sometimes fail
 | 
							// TODO are timings off in JUnit? Why do these assertions sometimes fail
 | 
				
			||||||
		// under both Ant and Eclipse?
 | 
							// under both Ant and Eclipse?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//long fudgeFactor = 5L;
 | 
				
			||||||
		//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() >= int1);
 | 
							//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() >= int1);
 | 
				
			||||||
		//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() <= int1 + fudgeFactor);
 | 
							//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() <= int1 + fudgeFactor);
 | 
				
			||||||
		sw.start(name2);
 | 
							sw.start(name2);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright 2002-2012 the original author or authors.
 | 
					 * Copyright 2002-2013 the original author or authors.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
					 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 * you may not use this file except in compliance with the License.
 | 
					 * you may not use this file except in compliance with the License.
 | 
				
			||||||
| 
						 | 
					@ -17,6 +17,7 @@
 | 
				
			||||||
package org.springframework.expression.spel;
 | 
					package org.springframework.expression.spel;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import static org.junit.Assert.assertEquals;
 | 
					import static org.junit.Assert.assertEquals;
 | 
				
			||||||
 | 
					import static org.junit.Assert.assertNotNull;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.util.HashMap;
 | 
					import java.util.HashMap;
 | 
				
			||||||
import java.util.Map;
 | 
					import java.util.Map;
 | 
				
			||||||
| 
						 | 
					@ -83,9 +84,10 @@ public class MapAccessTests extends ExpressionTestCase {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ExpressionParser parser = new SpelExpressionParser();
 | 
							ExpressionParser parser = new SpelExpressionParser();
 | 
				
			||||||
		Expression exp = parser.parseExpression("testBean.properties['key2']");
 | 
							Expression exp = parser.parseExpression("testBean.properties['key2']");
 | 
				
			||||||
		String key= (String)exp.getValue(bean);
 | 
							String key = (String) exp.getValue(bean);
 | 
				
			||||||
 | 
							assertNotNull(key);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public static class TestBean
 | 
						public static class TestBean
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright 2002-2012 the original author or authors.
 | 
					 * Copyright 2002-2013 the original author or authors.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
					 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 * you may not use this file except in compliance with the License.
 | 
					 * you may not use this file except in compliance with the License.
 | 
				
			||||||
| 
						 | 
					@ -18,6 +18,7 @@ package org.springframework.expression.spel;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import static org.junit.Assert.assertEquals;
 | 
					import static org.junit.Assert.assertEquals;
 | 
				
			||||||
import static org.junit.Assert.assertFalse;
 | 
					import static org.junit.Assert.assertFalse;
 | 
				
			||||||
 | 
					import static org.junit.Assert.assertNotNull;
 | 
				
			||||||
import static org.junit.Assert.assertNull;
 | 
					import static org.junit.Assert.assertNull;
 | 
				
			||||||
import static org.junit.Assert.assertTrue;
 | 
					import static org.junit.Assert.assertTrue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -213,9 +214,11 @@ public class SpelDocumentationTests extends ExpressionTestCase {
 | 
				
			||||||
		societyContext.setRootObject(new IEEE());
 | 
							societyContext.setRootObject(new IEEE());
 | 
				
			||||||
		// Officer's Dictionary
 | 
							// Officer's Dictionary
 | 
				
			||||||
		Inventor pupin = parser.parseExpression("officers['president']").getValue(societyContext, Inventor.class);
 | 
							Inventor pupin = parser.parseExpression("officers['president']").getValue(societyContext, Inventor.class);
 | 
				
			||||||
 | 
							assertNotNull(pupin);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// evaluates to "Idvor"
 | 
							// evaluates to "Idvor"
 | 
				
			||||||
		String city = parser.parseExpression("officers['president'].PlaceOfBirth.city").getValue(societyContext, String.class);
 | 
							String city = parser.parseExpression("officers['president'].PlaceOfBirth.city").getValue(societyContext, String.class);
 | 
				
			||||||
 | 
							assertNotNull(city);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// setting values
 | 
							// setting values
 | 
				
			||||||
		Inventor i = parser.parseExpression("officers['advisors'][0]").getValue(societyContext,Inventor.class);
 | 
							Inventor i = parser.parseExpression("officers['advisors'][0]").getValue(societyContext,Inventor.class);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,6 +19,7 @@ package org.springframework.expression.spel;
 | 
				
			||||||
import static org.hamcrest.Matchers.is;
 | 
					import static org.hamcrest.Matchers.is;
 | 
				
			||||||
import static org.junit.Assert.assertEquals;
 | 
					import static org.junit.Assert.assertEquals;
 | 
				
			||||||
import static org.junit.Assert.assertFalse;
 | 
					import static org.junit.Assert.assertFalse;
 | 
				
			||||||
 | 
					import static org.junit.Assert.assertNotNull;
 | 
				
			||||||
import static org.junit.Assert.assertThat;
 | 
					import static org.junit.Assert.assertThat;
 | 
				
			||||||
import static org.junit.Assert.assertTrue;
 | 
					import static org.junit.Assert.assertTrue;
 | 
				
			||||||
import static org.junit.Assert.fail;
 | 
					import static org.junit.Assert.fail;
 | 
				
			||||||
| 
						 | 
					@ -1680,6 +1681,7 @@ public class SpelReproTests extends ExpressionTestCase {
 | 
				
			||||||
		ExpressionParser parser = new SpelExpressionParser();
 | 
							ExpressionParser parser = new SpelExpressionParser();
 | 
				
			||||||
		StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
 | 
							StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
 | 
				
			||||||
		Class<?> valueType = parser.parseExpression("simpleProperty").getValueType(evaluationContext);
 | 
							Class<?> valueType = parser.parseExpression("simpleProperty").getValueType(evaluationContext);
 | 
				
			||||||
 | 
							assertNotNull(valueType);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
| 
						 | 
					@ -1687,6 +1689,7 @@ public class SpelReproTests extends ExpressionTestCase {
 | 
				
			||||||
		ExpressionParser parser = new SpelExpressionParser();
 | 
							ExpressionParser parser = new SpelExpressionParser();
 | 
				
			||||||
		StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
 | 
							StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
 | 
				
			||||||
		Object value = parser.parseExpression("simpleProperty").getValue(evaluationContext);
 | 
							Object value = parser.parseExpression("simpleProperty").getValue(evaluationContext);
 | 
				
			||||||
 | 
							assertNotNull(value);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
| 
						 | 
					@ -1694,6 +1697,7 @@ public class SpelReproTests extends ExpressionTestCase {
 | 
				
			||||||
		ExpressionParser parser = new SpelExpressionParser();
 | 
							ExpressionParser parser = new SpelExpressionParser();
 | 
				
			||||||
		StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
 | 
							StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
 | 
				
			||||||
		Class<?> valueType = parser.parseExpression("primitiveProperty").getValueType(evaluationContext);
 | 
							Class<?> valueType = parser.parseExpression("primitiveProperty").getValueType(evaluationContext);
 | 
				
			||||||
 | 
							assertNotNull(valueType);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
| 
						 | 
					@ -1701,6 +1705,7 @@ public class SpelReproTests extends ExpressionTestCase {
 | 
				
			||||||
		ExpressionParser parser = new SpelExpressionParser();
 | 
							ExpressionParser parser = new SpelExpressionParser();
 | 
				
			||||||
		StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
 | 
							StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
 | 
				
			||||||
		Object value = parser.parseExpression("primitiveProperty").getValue(evaluationContext);
 | 
							Object value = parser.parseExpression("primitiveProperty").getValue(evaluationContext);
 | 
				
			||||||
 | 
							assertNotNull(value);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright 2002-2012 the original author or authors.
 | 
					 * Copyright 2002-2013 the original author or authors.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
					 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 * you may not use this file except in compliance with the License.
 | 
					 * you may not use this file except in compliance with the License.
 | 
				
			||||||
| 
						 | 
					@ -67,7 +67,6 @@ public class SQLStateExceptionTranslatorTests extends TestCase {
 | 
				
			||||||
	 * Bug 729170
 | 
						 * Bug 729170
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public void testMalformedSqlStateCodes() {
 | 
						public void testMalformedSqlStateCodes() {
 | 
				
			||||||
		String sql = "SELECT FOO FROM BAR";
 | 
					 | 
				
			||||||
		SQLException sex = new SQLException("Message", null, 1);
 | 
							SQLException sex = new SQLException("Message", null, 1);
 | 
				
			||||||
		testMalformedSqlStateCode(sex);
 | 
							testMalformedSqlStateCode(sex);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright 2002-2012 the original author or authors.
 | 
					 * Copyright 2002-2013 the original author or authors.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
					 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 * you may not use this file except in compliance with the License.
 | 
					 * you may not use this file except in compliance with the License.
 | 
				
			||||||
| 
						 | 
					@ -207,7 +207,7 @@ public class JmsTemplate102Tests extends TestCase {
 | 
				
			||||||
		template.execute(new SessionCallback() {
 | 
							template.execute(new SessionCallback() {
 | 
				
			||||||
			@Override
 | 
								@Override
 | 
				
			||||||
			public Object doInJms(Session session) throws JMSException {
 | 
								public Object doInJms(Session session) throws JMSException {
 | 
				
			||||||
				boolean b = session.getTransacted();
 | 
									session.getTransacted();
 | 
				
			||||||
				return null;
 | 
									return null;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
| 
						 | 
					@ -249,8 +249,8 @@ public class JmsTemplate102Tests extends TestCase {
 | 
				
			||||||
		template.execute(new ProducerCallback() {
 | 
							template.execute(new ProducerCallback() {
 | 
				
			||||||
			@Override
 | 
								@Override
 | 
				
			||||||
			public Object doInJms(Session session, MessageProducer producer) throws JMSException {
 | 
								public Object doInJms(Session session, MessageProducer producer) throws JMSException {
 | 
				
			||||||
				boolean b = session.getTransacted();
 | 
									session.getTransacted();
 | 
				
			||||||
				int i = producer.getPriority();
 | 
									producer.getPriority();
 | 
				
			||||||
				return null;
 | 
									return null;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright 2002-2012 the original author or authors.
 | 
					 * Copyright 2002-2013 the original author or authors.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
					 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 * you may not use this file except in compliance with the License.
 | 
					 * you may not use this file except in compliance with the License.
 | 
				
			||||||
| 
						 | 
					@ -190,8 +190,8 @@ public class JmsTemplateTests extends TestCase {
 | 
				
			||||||
		template.execute(new ProducerCallback() {
 | 
							template.execute(new ProducerCallback() {
 | 
				
			||||||
			@Override
 | 
								@Override
 | 
				
			||||||
			public Object doInJms(Session session, MessageProducer producer) throws JMSException {
 | 
								public Object doInJms(Session session, MessageProducer producer) throws JMSException {
 | 
				
			||||||
				boolean b = session.getTransacted();
 | 
									session.getTransacted();
 | 
				
			||||||
				int i = producer.getPriority();
 | 
									producer.getPriority();
 | 
				
			||||||
				return null;
 | 
									return null;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
| 
						 | 
					@ -234,8 +234,8 @@ public class JmsTemplateTests extends TestCase {
 | 
				
			||||||
		template.execute(new ProducerCallback() {
 | 
							template.execute(new ProducerCallback() {
 | 
				
			||||||
			@Override
 | 
								@Override
 | 
				
			||||||
			public Object doInJms(Session session, MessageProducer producer) throws JMSException {
 | 
								public Object doInJms(Session session, MessageProducer producer) throws JMSException {
 | 
				
			||||||
				boolean b = session.getTransacted();
 | 
									session.getTransacted();
 | 
				
			||||||
				int i = producer.getPriority();
 | 
									producer.getPriority();
 | 
				
			||||||
				return null;
 | 
									return null;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
| 
						 | 
					@ -264,7 +264,7 @@ public class JmsTemplateTests extends TestCase {
 | 
				
			||||||
		template.execute(new SessionCallback() {
 | 
							template.execute(new SessionCallback() {
 | 
				
			||||||
			@Override
 | 
								@Override
 | 
				
			||||||
			public Object doInJms(Session session) throws JMSException {
 | 
								public Object doInJms(Session session) throws JMSException {
 | 
				
			||||||
				boolean b = session.getTransacted();
 | 
									session.getTransacted();
 | 
				
			||||||
				return null;
 | 
									return null;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
| 
						 | 
					@ -303,14 +303,14 @@ public class JmsTemplateTests extends TestCase {
 | 
				
			||||||
			template.execute(new SessionCallback() {
 | 
								template.execute(new SessionCallback() {
 | 
				
			||||||
				@Override
 | 
									@Override
 | 
				
			||||||
				public Object doInJms(Session session) throws JMSException {
 | 
									public Object doInJms(Session session) throws JMSException {
 | 
				
			||||||
					boolean b = session.getTransacted();
 | 
										session.getTransacted();
 | 
				
			||||||
					return null;
 | 
										return null;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
			template.execute(new SessionCallback() {
 | 
								template.execute(new SessionCallback() {
 | 
				
			||||||
				@Override
 | 
									@Override
 | 
				
			||||||
				public Object doInJms(Session session) throws JMSException {
 | 
									public Object doInJms(Session session) throws JMSException {
 | 
				
			||||||
					boolean b = session.getTransacted();
 | 
										session.getTransacted();
 | 
				
			||||||
					return null;
 | 
										return null;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
| 
						 | 
					@ -321,7 +321,7 @@ public class JmsTemplateTests extends TestCase {
 | 
				
			||||||
			TransactionAwareConnectionFactoryProxy tacf = new TransactionAwareConnectionFactoryProxy(scf);
 | 
								TransactionAwareConnectionFactoryProxy tacf = new TransactionAwareConnectionFactoryProxy(scf);
 | 
				
			||||||
			Connection tac = tacf.createConnection();
 | 
								Connection tac = tacf.createConnection();
 | 
				
			||||||
			Session tas = tac.createSession(false, Session.AUTO_ACKNOWLEDGE);
 | 
								Session tas = tac.createSession(false, Session.AUTO_ACKNOWLEDGE);
 | 
				
			||||||
			boolean b = tas.getTransacted();
 | 
								tas.getTransacted();
 | 
				
			||||||
			tas.close();
 | 
								tas.close();
 | 
				
			||||||
			tac.close();
 | 
								tac.close();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright 2002-2012 the original author or authors.
 | 
					 * Copyright 2002-2013 the original author or authors.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
					 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 * you may not use this file except in compliance with the License.
 | 
					 * you may not use this file except in compliance with the License.
 | 
				
			||||||
| 
						 | 
					@ -48,6 +48,7 @@ public class ApplicationManagedEntityManagerIntegrationTests extends AbstractEnt
 | 
				
			||||||
		assertTrue(Proxy.isProxyClass(em.getClass()));
 | 
							assertTrue(Proxy.isProxyClass(em.getClass()));
 | 
				
			||||||
		Query q = em.createQuery("select p from Person as p");
 | 
							Query q = em.createQuery("select p from Person as p");
 | 
				
			||||||
		List<Person> people = q.getResultList();
 | 
							List<Person> people = q.getResultList();
 | 
				
			||||||
 | 
							assertNotNull(people);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		assertTrue("Should be open to start with", em.isOpen());
 | 
							assertTrue("Should be open to start with", em.isOpen());
 | 
				
			||||||
		em.close();
 | 
							em.close();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -539,7 +539,7 @@ public abstract class AbstractTransactionAspectTests extends TestCase {
 | 
				
			||||||
		Method m = setNameMethod;
 | 
							Method m = setNameMethod;
 | 
				
			||||||
		MapTransactionAttributeSource tas = new MapTransactionAttributeSource();
 | 
							MapTransactionAttributeSource tas = new MapTransactionAttributeSource();
 | 
				
			||||||
		tas.register(m, txatt);
 | 
							tas.register(m, txatt);
 | 
				
			||||||
		Method m2 = getNameMethod;
 | 
							// Method m2 = getNameMethod;
 | 
				
			||||||
		// No attributes for m2
 | 
							// No attributes for m2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		MockControl ptmControl = MockControl.createControl(PlatformTransactionManager.class);
 | 
							MockControl ptmControl = MockControl.createControl(PlatformTransactionManager.class);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -163,6 +163,7 @@ public class BeanFactoryTransactionTests extends TestCase {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void testGetBeansOfTypeWithAbstract() {
 | 
						public void testGetBeansOfTypeWithAbstract() {
 | 
				
			||||||
		Map beansOfType = factory.getBeansOfType(ITestBean.class, true, true);
 | 
							Map beansOfType = factory.getBeansOfType(ITestBean.class, true, true);
 | 
				
			||||||
 | 
							assertNotNull(beansOfType);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
| 
						 | 
					@ -172,7 +173,7 @@ public class BeanFactoryTransactionTests extends TestCase {
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
 | 
								DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
 | 
				
			||||||
			new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource("noTransactionAttributeSource.xml", getClass()));
 | 
								new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource("noTransactionAttributeSource.xml", getClass()));
 | 
				
			||||||
			ITestBean testBean = (ITestBean) bf.getBean("noTransactionAttributeSource");
 | 
								bf.getBean("noTransactionAttributeSource");
 | 
				
			||||||
			fail("Should require TransactionAttributeSource to be set");
 | 
								fail("Should require TransactionAttributeSource to be set");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		catch (FatalBeanException ex) {
 | 
							catch (FatalBeanException ex) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright 2002-2012 the original author or authors.
 | 
					 * Copyright 2002-2013 the original author or authors.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
					 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 * you may not use this file except in compliance with the License.
 | 
					 * you may not use this file except in compliance with the License.
 | 
				
			||||||
| 
						 | 
					@ -81,7 +81,7 @@ public class StreamingSimpleHttpRequestFactoryTests extends AbstractHttpRequestF
 | 
				
			||||||
			ClientHttpRequest request = factory.createRequest(new URI(baseUrl + "/methods/post"), HttpMethod.POST);
 | 
								ClientHttpRequest request = factory.createRequest(new URI(baseUrl + "/methods/post"), HttpMethod.POST);
 | 
				
			||||||
			final int BUF_SIZE = 4096;
 | 
								final int BUF_SIZE = 4096;
 | 
				
			||||||
			final int ITERATIONS = Integer.MAX_VALUE / BUF_SIZE;
 | 
								final int ITERATIONS = Integer.MAX_VALUE / BUF_SIZE;
 | 
				
			||||||
			final int contentLength = ITERATIONS * BUF_SIZE;
 | 
					//			final int contentLength = ITERATIONS * BUF_SIZE;
 | 
				
			||||||
//			request.getHeaders().setContentLength(contentLength);
 | 
					//			request.getHeaders().setContentLength(contentLength);
 | 
				
			||||||
			OutputStream body = request.getBody();
 | 
								OutputStream body = request.getBody();
 | 
				
			||||||
			for (int i = 0; i < ITERATIONS; i++) {
 | 
								for (int i = 0; i < ITERATIONS; i++) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -63,7 +63,7 @@ public class ResponseStatusExceptionResolverTests {
 | 
				
			||||||
			exceptionResolver.setMessageSource(messageSource);
 | 
								exceptionResolver.setMessageSource(messageSource);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			StatusCodeAndReasonMessageException ex = new StatusCodeAndReasonMessageException();
 | 
								StatusCodeAndReasonMessageException ex = new StatusCodeAndReasonMessageException();
 | 
				
			||||||
			ModelAndView mav = exceptionResolver.resolveException(request, response, null, ex);
 | 
								exceptionResolver.resolveException(request, response, null, ex);
 | 
				
			||||||
			assertEquals("Invalid status reason", "Gone reason message", response.getErrorMessage());
 | 
								assertEquals("Invalid status reason", "Gone reason message", response.getErrorMessage());
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		finally {
 | 
							finally {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -453,7 +453,7 @@ public class MultiActionControllerTests extends TestCase {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		MockHttpServletRequest request = new MockHttpServletRequest("GET", "/handleIllegalStateException.html");
 | 
							MockHttpServletRequest request = new MockHttpServletRequest("GET", "/handleIllegalStateException.html");
 | 
				
			||||||
		MockHttpServletResponse response = new MockHttpServletResponse();
 | 
							MockHttpServletResponse response = new MockHttpServletResponse();
 | 
				
			||||||
		ModelAndView mav = mac.handleRequest(request, response);
 | 
							mac.handleRequest(request, response);
 | 
				
			||||||
		assertEquals(HttpServletResponse.SC_NOT_FOUND, response.getStatus());
 | 
							assertEquals(HttpServletResponse.SC_NOT_FOUND, response.getStatus());
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -524,7 +524,6 @@ public class MultiActionControllerTests extends TestCase {
 | 
				
			||||||
			this.invoked.put("commandNoSession", Boolean.TRUE);
 | 
								this.invoked.put("commandNoSession", Boolean.TRUE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			String pname = request.getParameter("name");
 | 
								String pname = request.getParameter("name");
 | 
				
			||||||
			String page = request.getParameter("age");
 | 
					 | 
				
			||||||
			// ALLOW FOR NULL
 | 
								// ALLOW FOR NULL
 | 
				
			||||||
			if (pname == null) {
 | 
								if (pname == null) {
 | 
				
			||||||
				assertTrue("name null", command.getName() == null);
 | 
									assertTrue("name null", command.getName() == null);
 | 
				
			||||||
| 
						 | 
					@ -532,6 +531,8 @@ public class MultiActionControllerTests extends TestCase {
 | 
				
			||||||
			else {
 | 
								else {
 | 
				
			||||||
				assertTrue("name param set", pname.equals(command.getName()));
 | 
									assertTrue("name param set", pname.equals(command.getName()));
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								//String page = request.getParameter("age");
 | 
				
			||||||
			// if (page == null)
 | 
								// if (page == null)
 | 
				
			||||||
			// assertTrue("age default", command.getAge() == 0);
 | 
								// assertTrue("age default", command.getAge() == 0);
 | 
				
			||||||
			// else
 | 
								// else
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright 2002-2012 the original author or authors.
 | 
					 * Copyright 2002-2013 the original author or authors.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
					 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 * you may not use this file except in compliance with the License.
 | 
					 * you may not use this file except in compliance with the License.
 | 
				
			||||||
| 
						 | 
					@ -72,14 +72,14 @@ public class ResourceBundleViewResolverTests extends TestCase {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void testParentsAreAbstract() throws Exception {
 | 
						public void testParentsAreAbstract() throws Exception {
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			View v = rb.resolveViewName("debug.Parent", Locale.ENGLISH);
 | 
								rb.resolveViewName("debug.Parent", Locale.ENGLISH);
 | 
				
			||||||
			fail("Should have thrown BeanIsAbstractException");
 | 
								fail("Should have thrown BeanIsAbstractException");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		catch (BeanIsAbstractException ex) {
 | 
							catch (BeanIsAbstractException ex) {
 | 
				
			||||||
			// expected
 | 
								// expected
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			View v = rb.resolveViewName("testParent", Locale.ENGLISH);
 | 
								rb.resolveViewName("testParent", Locale.ENGLISH);
 | 
				
			||||||
			fail("Should have thrown BeanIsAbstractException");
 | 
								fail("Should have thrown BeanIsAbstractException");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		catch (BeanIsAbstractException ex) {
 | 
							catch (BeanIsAbstractException ex) {
 | 
				
			||||||
| 
						 | 
					@ -152,7 +152,7 @@ public class ResourceBundleViewResolverTests extends TestCase {
 | 
				
			||||||
	public void testNoSuchBasename() throws Exception {
 | 
						public void testNoSuchBasename() throws Exception {
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			rb.setBasename("weoriwoierqupowiuer");
 | 
								rb.setBasename("weoriwoierqupowiuer");
 | 
				
			||||||
			View v = rb.resolveViewName("debugView", Locale.ENGLISH);
 | 
								rb.resolveViewName("debugView", Locale.ENGLISH);
 | 
				
			||||||
			fail("No such basename: all requests should fail with exception");
 | 
								fail("No such basename: all requests should fail with exception");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		catch (MissingResourceException ex) {
 | 
							catch (MissingResourceException ex) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright 2002-2012 the original author or authors.
 | 
					 * Copyright 2002-2013 the original author or authors.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
					 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 * you may not use this file except in compliance with the License.
 | 
					 * you may not use this file except in compliance with the License.
 | 
				
			||||||
| 
						 | 
					@ -86,6 +86,7 @@ public class ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests {
 | 
				
			||||||
	public void testPrototype() {
 | 
						public void testPrototype() {
 | 
				
			||||||
		ApplicationContext context = createContext(ScopedProxyMode.NO);
 | 
							ApplicationContext context = createContext(ScopedProxyMode.NO);
 | 
				
			||||||
		ScopedTestBean bean = (ScopedTestBean) context.getBean("prototype");
 | 
							ScopedTestBean bean = (ScopedTestBean) context.getBean("prototype");
 | 
				
			||||||
 | 
							assertNotNull(bean);
 | 
				
			||||||
		assertTrue(context.isPrototype("prototype"));
 | 
							assertTrue(context.isPrototype("prototype"));
 | 
				
			||||||
		assertFalse(context.isSingleton("prototype"));
 | 
							assertFalse(context.isSingleton("prototype"));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue