Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bsorrentino committed May 21, 2018
1 parent 950bf6c commit 77899f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void functionalInterfaceTest() {
TSType t = TSType.from(Action2.class);
Assert.assertThat(t.isFunctionalInterface() , equalTo(false));
t.setFunctionalInterface(true);
Assert.assertThat(t.isFunctionalInterface() , equalTo(true));
Assert.assertThat(t.isFunctionalInterface() , equalTo(false));
}

}
Expand Down
18 changes: 9 additions & 9 deletions core/src/test/java/org/bsc/java2typescript/ProcessorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void testWildcardType() throws Exception {
final Method m = type.getValue().getMethod("merge", BiConsumer.class );
final String result = converter.getMethodParametersAndReturnDecl( m,
type,
declaredTypeMap( TSType.from(String.class), TSType.from(Sample2.class), TSType.from(BiConsumer.class, "BiConsumer", false)),
declaredTypeMap( TSType.from(String.class), TSType.from(Sample2.class), TSType.from(BiConsumer.class).setExport(false).setAlias("BiConsumer")),
true) ;

Assert.assertThat( result, IsNull.notNullValue());
Expand All @@ -48,7 +48,7 @@ public void testWildcardType() throws Exception {
final Method m = type.getValue().getMethod("concatMap", Function.class );
final String result = converter.getMethodParametersAndReturnDecl( m,
type,
declaredTypeMap( TSType.from(String.class), TSType.from(Sample2.class), TSType.from(Function.class, "Func", false)),
declaredTypeMap( TSType.from(String.class), TSType.from(Sample2.class), TSType.from(Function.class).setExport(false).setAlias("Func")),
true) ;

Assert.assertThat( result, IsNull.notNullValue());
Expand All @@ -66,7 +66,7 @@ public void testFunctionalInterface() throws Exception {
final Type pType = m.getGenericParameterTypes()[0];
final String result = TypescriptConverter.convertJavaToTS(pType, m,
type,
declaredTypeMap( TSType.from(String.class), TSType.from(java.util.function.Function.class, "Func", false)),
declaredTypeMap( TSType.from(String.class), TSType.from(java.util.function.Function.class).setAlias("Func").setExport(false)),
true,
Optional.empty());
Assert.assertThat( result, IsNull.notNullValue());
Expand All @@ -78,7 +78,7 @@ public void testFunctionalInterface() throws Exception {
final Method m = type.getValue().getMethod("transform", java.util.function.Function.class );
final String result = converter.getMethodParametersAndReturnDecl( m,
type,
declaredTypeMap( TSType.from(String.class), TSType.from(java.util.function.Function.class, "Func", false)),
declaredTypeMap( TSType.from(String.class), TSType.from(java.util.function.Function.class).setAlias("Func").setExport(false)),
true) ;

Assert.assertThat( result, IsNull.notNullValue());
Expand All @@ -88,7 +88,7 @@ public void testFunctionalInterface() throws Exception {
final Method m = type.getValue().getMethod("creator", java.util.concurrent.Callable.class );
final String result = converter.getMethodParametersAndReturnDecl( m,
type,
declaredTypeMap( TSType.from(String.class), TSType.from(java.util.concurrent.Callable.class, "Supplier", false)),
declaredTypeMap( TSType.from(String.class), TSType.from(java.util.concurrent.Callable.class).setExport(false).setAlias("Supplier")),
true) ;

Assert.assertThat( result, IsNull.notNullValue());
Expand Down Expand Up @@ -120,7 +120,7 @@ public void testAlias() throws Exception {
final Type rType = m.getGenericReturnType();
final String result = TypescriptConverter.convertJavaToTS(rType, m,
TSType.from(type),
declaredTypeMap( TSType.from(String.class), TSType.from(java.util.List.class, "List", true) ),
declaredTypeMap( TSType.from(String.class), TSType.from(java.util.List.class).setExport(false).setAlias("List") ),
true,
Optional.empty());
Assert.assertThat( result, IsNull.notNullValue());
Expand All @@ -131,7 +131,7 @@ public void testAlias() throws Exception {

final String result = converter.getMethodParametersAndReturnDecl( m,
TSType.from(type),
declaredTypeMap( TSType.from(String.class), TSType.from(java.util.List.class, "List", true) ),
declaredTypeMap( TSType.from(String.class), TSType.from(java.util.List.class).setExport(false).setAlias("List") ),
true) ;

Assert.assertThat( result, IsNull.notNullValue());
Expand Down Expand Up @@ -201,7 +201,7 @@ public void testSample1() throws Exception {
final Type rType = m.getGenericReturnType();
final String result = TypescriptConverter.convertJavaToTS(rType, m,
TSType.from(type),
declaredTypeMap( TSType.from(java.util.function.BiPredicate.class, "BiPredicate",false) ),
declaredTypeMap( TSType.from(java.util.function.BiPredicate.class).setExport(false).setAlias("BiPredicate") ),
true,
Optional.of(addTypeVar));
Assert.assertThat( result, IsNull.notNullValue());
Expand Down Expand Up @@ -288,7 +288,7 @@ public void testSample1() throws Exception {
final Type pType = m.getParameters()[0].getParameterizedType();
final String rresult = TypescriptConverter.convertJavaToTS(pType, m,
TSType.from(type),
declaredTypeMap( TSType.from(Sample2.class), TSType.from(Consumer.class, "Consumer", false)),
declaredTypeMap( TSType.from(Sample2.class), TSType.from(Consumer.class).setExport(false).setAlias("Consumer")),
true,
Optional.empty());
Assert.assertThat( rresult, IsNull.notNullValue());
Expand Down

0 comments on commit 77899f4

Please sign in to comment.