-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e494d15
commit 04e07f2
Showing
4 changed files
with
55 additions
and
10 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
18 changes: 18 additions & 0 deletions
18
src/test/java/com/fasterxml/classmate/failing/ArrayTypeResolution51Test.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,18 @@ | ||
package com.fasterxml.classmate.failing; | ||
|
||
import com.fasterxml.classmate.BaseTest; | ||
import com.fasterxml.classmate.ResolvedType; | ||
import com.fasterxml.classmate.TypeResolver; | ||
|
||
public class ArrayTypeResolution51Test extends BaseTest | ||
{ | ||
protected final TypeResolver RESOLVER = new TypeResolver(); | ||
|
||
// [classmate#51]: parent type for Array classes | ||
public void testResolvingRawType() { | ||
ResolvedType rt = RESOLVER.resolve(Long[].class); | ||
ResolvedType parent = rt.getParentClass(); | ||
assertNotNull(parent); | ||
assertEquals(Long.class, parent.getErasedType()); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/test/java/com/fasterxml/classmate/failing/TestTypeResolver53.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,26 @@ | ||
package com.fasterxml.classmate.failing; | ||
|
||
import java.util.Arrays; | ||
import java.util.Comparator; | ||
import java.util.List; | ||
|
||
import com.fasterxml.classmate.BaseTest; | ||
import com.fasterxml.classmate.ResolvedType; | ||
import com.fasterxml.classmate.TypeResolver; | ||
|
||
// for [classmate#53]: Raw Comparator | ||
public class TestTypeResolver53 extends BaseTest | ||
{ | ||
@SuppressWarnings("rawtypes") | ||
static abstract class Comparator53 implements Comparator { } | ||
|
||
protected final TypeResolver RESOLVER = new TypeResolver(); | ||
|
||
// [classmate#53] Problem with Raw types | ||
public void testResolvingRawType() { | ||
ResolvedType rt = RESOLVER.resolve(Comparator53.class); | ||
List<ResolvedType> params = rt.typeParametersFor(Comparator.class); | ||
assertEquals(Arrays.asList(RESOLVER.resolve(Object.class)), | ||
params); | ||
} | ||
} |