-
Notifications
You must be signed in to change notification settings - Fork 275
Unit test cleanup #1534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Unit test cleanup #1534
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
af3efea
Renaming java files
707ebf6
Cleaning existing unit tests
d3ff11c
Adding a utility for checking java generic class
c5b06e6
Breaking the old parse_generic_class into two unit tests
2e2e34b
Renaming unit test for generic inner classes to bounded generic inner…
80be2fd
Extending and cleaning test for generic class with generic inner classes
3e6cf35
Extending test for signature/descriptor mismatch
89b99ce
Extending test for generic functions
9db9947
Extending test for generic class
c9a3716
Adding unit test for functions with generics
de97e23
Adding unit test for nested generics
2883bb1
Extending test for generic arrays
d9d9ea1
Cleaning includes, unifying scenario names, adding JIRA references
e908f0c
Updating utility functions to check generic/non-generic java classes
c1e1ba2
Applying new function for accessing elements of arrays
cce7814
Refactoring unit test utility functions to make them easier to use
398c88a
Applying new utility functions for generics
1fa8e2f
Adding unit test for generic fields
f5ec45a
Adding JIRA tickets cont.
e3019f2
Extending test for derived generics
03438bb
Disabling part of unit test due to a bug
51cbfc9
Deleting a utility function for generics
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+401 Bytes
unit/java_bytecode/java_bytecode_parse_generics/AbstractGeneric.class
Binary file not shown.
4 changes: 4 additions & 0 deletions
4
unit/java_bytecode/java_bytecode_parse_generics/AbstractGeneric.java
This file contains hidden or 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,4 @@ | ||
public abstract class AbstractGeneric<T> | ||
{ | ||
|
||
} |
Binary file removed
BIN
-421 Bytes
unit/java_bytecode/java_bytecode_parse_generics/AbstractGenericClass.class
Binary file not shown.
4 changes: 0 additions & 4 deletions
4
unit/java_bytecode/java_bytecode_parse_generics/AbstractGenericClass.java
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
unit/java_bytecode/java_bytecode_parse_generics/BasicInterface.java
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-138 Bytes
unit/java_bytecode/java_bytecode_parse_generics/BasicInterfaceCopy.class
Binary file not shown.
4 changes: 0 additions & 4 deletions
4
unit/java_bytecode/java_bytecode_parse_generics/BasicInterfaceCopy.java
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+725 Bytes
.../java_bytecode/java_bytecode_parse_generics/BoundedGenericInnerClasses$BoundedInner.class
Binary file not shown.
Binary file added
BIN
+755 Bytes
...bytecode/java_bytecode_parse_generics/BoundedGenericInnerClasses$DoubleBoundedInner.class
Binary file not shown.
Binary file added
BIN
+691 Bytes
unit/java_bytecode/java_bytecode_parse_generics/BoundedGenericInnerClasses$Inner.class
Binary file not shown.
Binary file added
BIN
+777 Bytes
...va_bytecode/java_bytecode_parse_generics/BoundedGenericInnerClasses$TwoElementInner.class
Binary file not shown.
Binary file added
BIN
+747 Bytes
unit/java_bytecode/java_bytecode_parse_generics/BoundedGenericInnerClasses.class
Binary file not shown.
25 changes: 25 additions & 0 deletions
25
unit/java_bytecode/java_bytecode_parse_generics/BoundedGenericInnerClasses.java
This file contains hidden or 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,25 @@ | ||
public class BoundedGenericInnerClasses | ||
{ | ||
class Inner<E> | ||
{ | ||
E elem; | ||
} | ||
|
||
class BoundedInner<NUM extends java.lang.Number> | ||
{ | ||
NUM elem; | ||
} | ||
|
||
BoundedInner<Integer> belem; | ||
|
||
class DoubleBoundedInner<T extends java.lang.Number & Interface> | ||
{ | ||
T elem; | ||
} | ||
|
||
class TwoElementInner<K, V> | ||
{ | ||
K k; | ||
V v; | ||
} | ||
} |
Binary file removed
BIN
-309 Bytes
unit/java_bytecode/java_bytecode_parse_generics/DerivedGeneric.class
Binary file not shown.
4 changes: 0 additions & 4 deletions
4
unit/java_bytecode/java_bytecode_parse_generics/DerivedGeneric.java
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+330 Bytes
unit/java_bytecode/java_bytecode_parse_generics/DerivedGenericInst.class
Binary file not shown.
4 changes: 4 additions & 0 deletions
4
unit/java_bytecode/java_bytecode_parse_generics/DerivedGenericInst.java
This file contains hidden or 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,4 @@ | ||
class DerivedGenericInst extends Generic<Interface_Implementation> | ||
{ | ||
|
||
} |
Binary file added
BIN
+408 Bytes
unit/java_bytecode/java_bytecode_parse_generics/DerivedGenericUninst.class
Binary file not shown.
4 changes: 4 additions & 0 deletions
4
unit/java_bytecode/java_bytecode_parse_generics/DerivedGenericUninst.java
This file contains hidden or 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,4 @@ | ||
class DerivedGenericUninst<T> extends Generic<T> | ||
{ | ||
|
||
} |
Binary file not shown.
Binary file added
BIN
+540 Bytes
unit/java_bytecode/java_bytecode_parse_generics/FunctionsWithGenerics$Inner.class
Binary file not shown.
Binary file added
BIN
+1.67 KB
unit/java_bytecode/java_bytecode_parse_generics/FunctionsWithGenerics.class
Binary file not shown.
36 changes: 36 additions & 0 deletions
36
unit/java_bytecode/java_bytecode_parse_generics/FunctionsWithGenerics.java
This file contains hidden or 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,36 @@ | ||
public class FunctionsWithGenerics | ||
{ | ||
|
||
class Inner | ||
{ | ||
public Generic<Integer> x; | ||
} | ||
|
||
public static Generic<Integer> processReturnSame(Generic<Integer> x) | ||
{ | ||
return x; | ||
} | ||
|
||
public static Generic<Integer> processReturnDifferent(Generic<String> s) | ||
{ | ||
Generic<Integer> x = new Generic<Integer>(); | ||
return x; | ||
} | ||
|
||
public static Generic<Integer> processReturnMultipleSame(Generic<Integer> x, Generic<Integer> y) | ||
{ | ||
return x; | ||
} | ||
|
||
public static Generic<Integer> processReturnMultipleDifferent(Generic<String> s, Generic<Boolean> b) | ||
{ | ||
Generic<Integer> x = new Generic<Integer>(); | ||
return x; | ||
} | ||
|
||
public Generic<Integer> returnInnerField(Inner inner) | ||
{ | ||
return inner.x; | ||
} | ||
|
||
} |
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
unit/java_bytecode/java_bytecode_parse_generics/Generic.java
This file contains hidden or 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,12 @@ | ||
class Generic<T> | ||
{ | ||
public T t; | ||
public Generic<Integer> g; | ||
|
||
public static <T> Generic<T> makeGeneric(T value) | ||
{ | ||
Generic<T> newST = new Generic<T>(); | ||
newST.t = value; | ||
return newST; | ||
} | ||
} |
Binary file modified
BIN
+53 Bytes
(110%)
unit/java_bytecode/java_bytecode_parse_generics/GenericArray.class
Binary file not shown.
4 changes: 2 additions & 2 deletions
4
unit/java_bytecode/java_bytecode_parse_generics/GenericArray.java
This file contains hidden or 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
class GenericArray<T> | ||
{ | ||
public T [] t; | ||
public Integer [] Ia; | ||
public int [] ia; | ||
Generic<T>[] t2; | ||
Generic<Integer>[] t3; | ||
} |
Binary file removed
BIN
-500 Bytes
unit/java_bytecode/java_bytecode_parse_generics/GenericClass$InnerClass.class
Binary file not shown.
Binary file not shown.
109 changes: 0 additions & 109 deletions
109
unit/java_bytecode/java_bytecode_parse_generics/GenericClass.java
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+891 Bytes
...nerics/GenericClassWithGenericInnerClasses$GenericInnerClass$DoublyNestedInnerClass.class
Binary file not shown.
Binary file added
BIN
+1.01 KB
...GenericClassWithGenericInnerClasses$GenericInnerClass$DoublyNestedInnerGenericClass.class
Binary file not shown.
Binary file added
BIN
+1.03 KB
.../java_bytecode_parse_generics/GenericClassWithGenericInnerClasses$GenericInnerClass.class
Binary file not shown.
Binary file added
BIN
+661 Bytes
...ytecode/java_bytecode_parse_generics/GenericClassWithGenericInnerClasses$InnerClass.class
Binary file not shown.
Binary file added
BIN
+844 Bytes
...ecode_parse_generics/GenericClassWithGenericInnerClasses$SameGenericParamInnerClass.class
Binary file not shown.
Binary file added
BIN
+857 Bytes
...java_bytecode_parse_generics/GenericClassWithGenericInnerClasses$TwoParamInnerClass.class
Binary file not shown.
Binary file added
BIN
+7.6 KB
unit/java_bytecode/java_bytecode_parse_generics/GenericClassWithGenericInnerClasses.class
Binary file not shown.
147 changes: 147 additions & 0 deletions
147
unit/java_bytecode/java_bytecode_parse_generics/GenericClassWithGenericInnerClasses.java
This file contains hidden or 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,147 @@ | ||
public class GenericClassWithGenericInnerClasses<T> | ||
{ | ||
class InnerClass | ||
{ | ||
} | ||
|
||
class GenericInnerClass<V> | ||
{ | ||
V field; | ||
|
||
class DoublyNestedInnerClass | ||
{ | ||
|
||
} | ||
|
||
class DoublyNestedInnerGenericClass<U> | ||
{ | ||
T field; | ||
} | ||
} | ||
|
||
class SameGenericParamInnerClass<T> | ||
{ | ||
T field; | ||
} | ||
|
||
class TwoParamInnerClass<K, L> | ||
{ | ||
K k; | ||
L l; | ||
} | ||
|
||
InnerClass field; | ||
|
||
GenericInnerClass<Interface_Implementation> field2; | ||
GenericInnerClass<T> field3; | ||
|
||
GenericInnerClass<Interface_Implementation>.DoublyNestedInnerClass field4; | ||
GenericInnerClass<T>.DoublyNestedInnerClass field5; | ||
|
||
GenericInnerClass<Interface_Implementation>.DoublyNestedInnerGenericClass<Interface_Implementation> field6; | ||
GenericInnerClass<T>.DoublyNestedInnerGenericClass<T> field7; | ||
|
||
TwoParamInnerClass<Interface_Implementation,Interface_Implementation> field8; | ||
TwoParamInnerClass<Interface_Implementation,T> field9; | ||
TwoParamInnerClass<T,T> field10; | ||
|
||
void method(InnerClass input) | ||
{ | ||
|
||
} | ||
|
||
void method2(InnerClass input, InnerClass input2) | ||
{ | ||
|
||
} | ||
|
||
|
||
void method3(GenericInnerClass<Interface_Implementation> input) | ||
{ | ||
|
||
} | ||
|
||
void method4(GenericInnerClass<T> input) | ||
{ | ||
|
||
} | ||
|
||
void method5(GenericInnerClass<Interface_Implementation>.DoublyNestedInnerClass input) | ||
{ | ||
|
||
} | ||
|
||
void method6(GenericInnerClass<T>.DoublyNestedInnerClass input) | ||
{ | ||
|
||
} | ||
|
||
void method7(GenericInnerClass<Interface_Implementation>.DoublyNestedInnerGenericClass<Interface_Implementation> input) | ||
{ | ||
|
||
} | ||
|
||
void method8(GenericInnerClass<T>.DoublyNestedInnerGenericClass<T> input) | ||
{ | ||
|
||
} | ||
|
||
void method9(TwoParamInnerClass<Interface_Implementation,Interface_Implementation> input) | ||
{ | ||
|
||
} | ||
|
||
void method10(TwoParamInnerClass<Interface_Implementation,T> input) | ||
{ | ||
|
||
} | ||
|
||
void method11(TwoParamInnerClass<T,T> input) | ||
{ | ||
|
||
} | ||
|
||
InnerClass ret_method1() | ||
{ | ||
return null; | ||
} | ||
|
||
GenericInnerClass<Interface_Implementation> ret_method2() | ||
{ | ||
return null; | ||
} | ||
|
||
GenericInnerClass<T> ret_method3() | ||
{ | ||
return null; | ||
} | ||
|
||
GenericInnerClass<Interface_Implementation>.DoublyNestedInnerClass ret_method4() | ||
{ | ||
return null; | ||
} | ||
GenericInnerClass<T>.DoublyNestedInnerClass ret_method5() | ||
{ | ||
return null; | ||
} | ||
GenericInnerClass<Interface_Implementation>.DoublyNestedInnerGenericClass<Interface_Implementation> ret_method6() | ||
{ | ||
return null; | ||
} | ||
GenericInnerClass<T>.DoublyNestedInnerGenericClass<T> ret_method7() | ||
{ | ||
return null; | ||
} | ||
TwoParamInnerClass<Interface_Implementation,Interface_Implementation> ret_method8() | ||
{ | ||
return null; | ||
} | ||
TwoParamInnerClass<Interface_Implementation,T> ret_method9() | ||
{ | ||
return null; | ||
} | ||
TwoParamInnerClass<T,T> ret_method10() | ||
{ | ||
return null; | ||
} | ||
} |
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it also worth adding a test for something like a field of type
SomeClass<T>[]
?