Merge branch '3.2.x' into master

* 3.2.x:
  Exclude spring-build-src from maven publish
  Move spring-build-junit into spring-core
  Relocate MergePlugin package
  Develop a gradle plugin to add test dependencies
  Expose Gradle buildSrc for IDE support
  Fix [deprecation] compiler warnings
  Upgrade to xmlunit version 1.3
  Improve 'build' folder ignores
  Fix regression in static setter method support
  Fix SpEL JavaBean compliance for setters

Conflicts:
	spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java
This commit is contained in:
Chris Beams
2013-01-02 10:36:57 +01:00
184 changed files with 1893 additions and 1282 deletions

View File

@@ -20,7 +20,6 @@ import java.beans.PropertyEditorSupport;
import java.util.StringTokenizer;
import junit.framework.TestCase;
import junit.framework.Assert;
import org.springframework.beans.BeansException;
import org.springframework.beans.PropertyBatchUpdateException;
@@ -79,7 +78,7 @@ public abstract class AbstractBeanFactoryTests extends TestCase {
*/
public void testLifecycleCallbacks() {
LifecycleBean lb = (LifecycleBean) getBeanFactory().getBean("lifecycle");
Assert.assertEquals("lifecycle", lb.getBeanName());
assertEquals("lifecycle", lb.getBeanName());
// The dummy business method will throw an exception if the
// necessary callbacks weren't invoked in the right order.
lb.businessMethod();
@@ -327,4 +326,4 @@ public abstract class AbstractBeanFactoryTests extends TestCase {
}
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,8 +16,6 @@
package org.springframework.beans.factory;
import junit.framework.Assert;
import org.springframework.beans.TestBean;
/**
@@ -44,24 +42,24 @@ public abstract class AbstractListableBeanFactoryTests extends AbstractBeanFacto
protected final void assertCount(int count) {
String[] defnames = getListableBeanFactory().getBeanDefinitionNames();
Assert.assertTrue("We should have " + count + " beans, not " + defnames.length, defnames.length == count);
assertTrue("We should have " + count + " beans, not " + defnames.length, defnames.length == count);
}
public void assertTestBeanCount(int count) {
String[] defNames = getListableBeanFactory().getBeanNamesForType(TestBean.class, true, false);
Assert.assertTrue("We should have " + count + " beans for class org.springframework.beans.TestBean, not " +
assertTrue("We should have " + count + " beans for class org.springframework.beans.TestBean, not " +
defNames.length, defNames.length == count);
int countIncludingFactoryBeans = count + 2;
String[] names = getListableBeanFactory().getBeanNamesForType(TestBean.class, true, true);
Assert.assertTrue("We should have " + countIncludingFactoryBeans +
assertTrue("We should have " + countIncludingFactoryBeans +
" beans for class org.springframework.beans.TestBean, not " + names.length,
names.length == countIncludingFactoryBeans);
}
public void testGetDefinitionsForNoSuchClass() {
String[] defnames = getListableBeanFactory().getBeanNamesForType(String.class);
Assert.assertTrue("No string definitions", defnames.length == 0);
assertTrue("No string definitions", defnames.length == 0);
}
/**
@@ -69,18 +67,18 @@ public abstract class AbstractListableBeanFactoryTests extends AbstractBeanFacto
* what type factories may return, and it may even change over time.)
*/
public void testGetCountForFactoryClass() {
Assert.assertTrue("Should have 2 factories, not " +
assertTrue("Should have 2 factories, not " +
getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length,
getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length == 2);
Assert.assertTrue("Should have 2 factories, not " +
assertTrue("Should have 2 factories, not " +
getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length,
getListableBeanFactory().getBeanNamesForType(FactoryBean.class).length == 2);
}
public void testContainsBeanDefinition() {
Assert.assertTrue(getListableBeanFactory().containsBeanDefinition("rod"));
Assert.assertTrue(getListableBeanFactory().containsBeanDefinition("roderick"));
assertTrue(getListableBeanFactory().containsBeanDefinition("rod"));
assertTrue(getListableBeanFactory().containsBeanDefinition("roderick"));
}
}
}

View File

@@ -20,6 +20,7 @@ import java.beans.PropertyEditorSupport;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
import junit.framework.TestCase;
@@ -28,7 +29,6 @@ import org.springframework.beans.ITestBean;
import org.springframework.beans.TestBean;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.beans.propertyeditors.StringArrayPropertyEditor;
import org.springframework.core.CollectionFactory;
import org.springframework.mock.web.portlet.MockPortletRequest;
import org.springframework.validation.BindingResult;
@@ -166,7 +166,7 @@ public class PortletRequestDataBinderTests extends TestCase {
public void testBindingSet() {
TestBean bean = new TestBean();
Set set = CollectionFactory.createLinkedSetIfPossible(2);
Set set = new LinkedHashSet<>(2);
set.add(new TestBean("test1"));
set.add(new TestBean("test2"));
bean.setSomeSet(set);

View File

@@ -19,8 +19,8 @@ package org.springframework.web.portlet.bind;
import junit.framework.TestCase;
import org.junit.Test;
import org.springframework.build.junit.Assume;
import org.springframework.build.junit.TestGroup;
import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup;
import org.springframework.mock.web.portlet.MockPortletRequest;
import org.springframework.util.StopWatch;

View File

@@ -52,6 +52,7 @@ import org.springframework.web.portlet.handler.PortletSessionRequiredException;
/**
* @author Mark Fisher
*/
@Deprecated
public class CommandControllerTests extends TestCase {
private static final String ERRORS_KEY = "errors";