fixes for known 2.0.0 bugs reported since release - see changelog

This commit is contained in:
Keith Donald
2008-05-06 07:05:18 +00:00
parent c9179d9d21
commit 797e203f8f
54 changed files with 840 additions and 397 deletions

View File

@@ -2,7 +2,7 @@ package org.springframework.faces.config;
import junit.framework.TestCase;
import org.springframework.binding.convert.ConversionException;
import org.springframework.binding.convert.ConversionExecutionException;
import org.springframework.binding.convert.ConversionExecutor;
import org.springframework.binding.convert.ConversionService;
import org.springframework.binding.expression.Expression;
@@ -74,21 +74,21 @@ public class FacesFlowBuilderServicesBeanDefinitionParserTests extends TestCase
public static class TestConversionService implements ConversionService {
public Class getClassByAlias(String alias) throws ConversionException {
public Class getClassByAlias(String alias) throws ConversionExecutionException {
throw new UnsupportedOperationException("Auto-generated method stub");
}
public ConversionExecutor getConversionExecutor(Class sourceClass, Class targetClass)
throws ConversionException {
throws ConversionExecutionException {
throw new UnsupportedOperationException("Auto-generated method stub");
}
public ConversionExecutor getConversionExecutorByTargetAlias(Class sourceClass, String targetAlias)
throws ConversionException {
throws ConversionExecutionException {
throw new UnsupportedOperationException("Auto-generated method stub");
}
public ConversionExecutor[] getConversionExecutorsForSource(Class sourceClass) throws ConversionException {
public ConversionExecutor[] getConversionExecutorsForSource(Class sourceClass) throws ConversionExecutionException {
throw new UnsupportedOperationException("Auto-generated method stub");
}

View File

@@ -7,16 +7,25 @@ import java.util.List;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
import junit.framework.TestCase;
import org.springframework.binding.convert.Converter;
import org.springframework.faces.model.SerializableListDataModel;
import junit.framework.TestCase;
public class DataModelConverterTests extends TestCase {
Converter converter = new DataModelConverter();
public void testConvertListToListDataModel() {
public void testConvertListToDataModel() throws Exception {
List sourceList = new ArrayList();
DataModel resultModel = (DataModel) converter.convert(sourceList, DataModel.class, null);
assertNotNull(resultModel);
assertSame(sourceList, resultModel.getWrappedData());
}
public void testConvertListToListDataModel() throws Exception {
List sourceList = new ArrayList();
DataModel resultModel = (DataModel) converter.convert(sourceList, ListDataModel.class, null);
@@ -25,7 +34,7 @@ public class DataModelConverterTests extends TestCase {
assertSame(sourceList, resultModel.getWrappedData());
}
public void testConvertListToSerializableListDataModel() {
public void testConvertListToSerializableListDataModel() throws Exception {
List sourceList = new ArrayList();
DataModel resultModel = (DataModel) converter.convert(sourceList, SerializableListDataModel.class, null);
@@ -35,7 +44,7 @@ public class DataModelConverterTests extends TestCase {
assertTrue(resultModel instanceof Serializable);
}
public void testConvertListToSerializableListDataModelNullSource() {
public void testConvertListToSerializableListDataModelNullSource() throws Exception {
List sourceList = null;
DataModel resultModel = (DataModel) converter.convert(sourceList, SerializableListDataModel.class, null);

View File

@@ -0,0 +1,26 @@
package org.springframework.faces.model.converter;
import java.util.ArrayList;
import java.util.List;
import javax.faces.model.DataModel;
import junit.framework.TestCase;
import org.springframework.binding.convert.ConversionExecutor;
public class FacesConversionServiceTests extends TestCase {
private FacesConversionService service;
protected void setUp() throws Exception {
service = new FacesConversionService();
}
public void testGetAbstractType() {
ConversionExecutor executor = service.getConversionExecutor(List.class, DataModel.class);
ArrayList list = new ArrayList();
list.add("foo");
executor.execute(list);
}
}