forked from teatrove/teatrove
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- add sortArray and sortList to SortContext for backwards support (marked deprecated) - cleaned up SortContext for consistency and performance - add HTMLContext for HTML-based pagination support for legacy support - updated BeanAnalzyer to attempt to fix bridge method issues - add missing messages in type checker properties
- Loading branch information
Nicholas Hagen
committed
Apr 11, 2012
1 parent
c787619
commit d81feff
Showing
11 changed files
with
849 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
tea/src/test/java/org/teatrove/tea/util/BeanAnalyzerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.teatrove.tea.util; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import java.beans.PropertyDescriptor; | ||
import java.util.Map; | ||
|
||
import org.junit.Test; | ||
import org.teatrove.trove.generics.GenericType; | ||
|
||
public class BeanAnalyzerTest { | ||
|
||
@Test | ||
public void testCovariants() throws Exception { | ||
Map<String, PropertyDescriptor> properties = | ||
BeanAnalyzer.getAllProperties(new GenericType(Int.class)); | ||
PropertyDescriptor value = properties.get("value"); | ||
assertEquals(Integer.class, value.getPropertyType()); | ||
assertEquals(Integer.class, value.getReadMethod().getReturnType()); | ||
} | ||
|
||
@Test | ||
public void testGenerics() throws Exception { | ||
Map<String, PropertyDescriptor> properties = | ||
BeanAnalyzer.getAllProperties(new GenericType(IntGenerics.class)); | ||
PropertyDescriptor value = properties.get("value"); | ||
assertEquals(Integer.class, value.getPropertyType()); | ||
assertEquals(Integer.class, value.getReadMethod().getReturnType()); | ||
assertEquals(Integer.class, value.getWriteMethod().getParameterTypes()[0]); | ||
} | ||
|
||
public static class Base { | ||
public Number getValue() { return null; } | ||
} | ||
|
||
public static class Int extends Base { | ||
public Integer getValue() { return null; } | ||
} | ||
|
||
public static class BaseGenerics<T extends Number> { | ||
public T getValue() { return null; } | ||
public void setValue(T value) { } | ||
} | ||
|
||
public static class IntGenerics extends BaseGenerics<Integer> { | ||
public Integer getValue() { return null; } | ||
public void setValue(Integer value) { } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.