New J2K: add test data for #KT-16662, #KT-15991, #KT-12050

This commit is contained in:
Ilya Kirillov
2019-06-05 17:38:29 +03:00
parent c1e24d818b
commit 58611ec417
7 changed files with 105 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
import java.io.Serializable;
class BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
}
class AuditableEntity extends BaseEntity {
private String createdBy;
private String modifiedBy;
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getModifiedBy() {
return modifiedBy;
}
public void setModifiedBy(String modifiedBy) {
this.modifiedBy = modifiedBy;
}
private static final long serialVersionUID = 2L;
}
+18
View File
@@ -0,0 +1,18 @@
import java.io.Serializable
internal open class BaseEntity : Serializable {
var id: Long? = null
companion object {
private const val serialVersionUID = 1L
}
}
internal class AuditableEntity : BaseEntity() {
var createdBy: String? = null
var modifiedBy: String? = null
companion object {
private const val serialVersionUID = 2L
}
}
+7
View File
@@ -0,0 +1,7 @@
public class Numerology {
public long makeLong() { return 5L; }
public void context() {
boolean b = makeLong() == 0;
}
}
+9
View File
@@ -0,0 +1,9 @@
class Numerology {
fun makeLong(): Long {
return 5L
}
fun context() {
val b = makeLong() == 0L
}
}
+9
View File
@@ -0,0 +1,9 @@
public class NullableArray {
public String[] createArrayFailure(int size) {
return new String[size];
}
public String[] createArraySuccess(int size) {
return new String[] {};
}
}
+9
View File
@@ -0,0 +1,9 @@
class NullableArray {
fun createArrayFailure(size: Int): Array<String?> {
return arrayOfNulls(size)
}
fun createArraySuccess(size: Int): Array<String> {
return arrayOf()
}
}
@@ -2676,6 +2676,11 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
runTest("nj2k/testData/newJ2k/issues/kt-14248.java");
}
@TestMetadata("kt-16662.java")
public void testKt_16662() throws Exception {
runTest("nj2k/testData/newJ2k/issues/kt-16662.java");
}
@TestMetadata("kt-17379.java")
public void testKt_17379() throws Exception {
runTest("nj2k/testData/newJ2k/issues/kt-17379.java");
@@ -3078,6 +3083,11 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
runTest("nj2k/testData/newJ2k/literalExpression/hex.java");
}
@TestMetadata("kt-15991.java")
public void testKt_15991() throws Exception {
runTest("nj2k/testData/newJ2k/literalExpression/kt-15991.java");
}
@TestMetadata("long.java")
public void testLong() throws Exception {
runTest("nj2k/testData/newJ2k/literalExpression/long.java");
@@ -3471,6 +3481,11 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
runTest("nj2k/testData/newJ2k/nullability/IndirectOverride.java");
}
@TestMetadata("kt-12050.java")
public void testKt_12050() throws Exception {
runTest("nj2k/testData/newJ2k/nullability/kt-12050.java");
}
@TestMetadata("LocalValReassignment.java")
public void testLocalValReassignment() throws Exception {
runTest("nj2k/testData/newJ2k/nullability/LocalValReassignment.java");