Updated package for java samples
This commit is contained in:
parent
825d794801
commit
9116aa5bd0
|
@ -1,4 +1,4 @@
|
|||
// Interoperability/AnnotateThrows.kt
|
||||
// interoperability/AnnotateThrows.kt
|
||||
package interop
|
||||
import java.io.IOException
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Interoperability/AnnotatedJava.kt
|
||||
// interoperability/AnnotatedJava.kt
|
||||
package interop
|
||||
import Interoperability.AnnotatedJTool
|
||||
import interoperability.AnnotatedJTool
|
||||
import atomictest.eq
|
||||
|
||||
object KotlinCode2 {
|
||||
|
@ -14,10 +14,10 @@ object KotlinCode2 {
|
|||
fun main() {
|
||||
with(KotlinCode2) {
|
||||
::a.returnType eq
|
||||
"Interoperability.JTool"
|
||||
"interoperability.JTool"
|
||||
::c.returnType eq
|
||||
"Interoperability.JTool?"
|
||||
"interoperability.JTool?"
|
||||
::d.returnType eq
|
||||
"Interoperability.JTool?"
|
||||
"interoperability.JTool?"
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
// Interoperability/BigFibonacci.kt
|
||||
// interoperability/BigFibonacci.kt
|
||||
package interop
|
||||
import atomictest.eq
|
||||
import java.math.BigInteger
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Interoperability/BigInt.kt
|
||||
// interoperability/BigInt.kt
|
||||
package biginteger
|
||||
import java.math.BigInteger
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Interoperability/ChangeName.kt
|
||||
// interoperability/ChangeName.kt
|
||||
@file:JvmName("Utils")
|
||||
package interop
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Interoperability/CollectionStructure.kt
|
||||
// interoperability/CollectionStructure.kt
|
||||
package collectionstructure
|
||||
|
||||
interface Collection<E>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Interoperability/ExtensionsToJavaClass.kt
|
||||
// interoperability/ExtensionsToJavaClass.kt
|
||||
package interop
|
||||
import Interoperability.Chameleon
|
||||
import interoperability.Chameleon
|
||||
import atomictest.eq
|
||||
|
||||
fun Chameleon.adjustToTemperature(
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Interoperability/HiddenArrayList.kt
|
||||
// interoperability/HiddenArrayList.kt
|
||||
import atomictest.eq
|
||||
|
||||
fun main() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Interoperability/AnnotatedJTool.java
|
||||
package Interoperability;
|
||||
// interoperability/AnnotatedJTool.java
|
||||
package interoperability;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Interoperability/CallTopLevelFunction.java
|
||||
package Interoperability;
|
||||
// interoperability/CallTopLevelFunction.java
|
||||
package interoperability;
|
||||
import interop.TopLevelFunctionKt;
|
||||
import static atomictest.AtomicTestKt.eq;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Interoperability/CallTopLevelFunction2.java
|
||||
package Interoperability;
|
||||
// interoperability/CallTopLevelFunction2.java
|
||||
package interoperability;
|
||||
import static interop.TopLevelFunctionKt.hi;
|
||||
import static atomictest.AtomicTestKt.eq;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Interoperability/CatchChecked.java
|
||||
package Interoperability;
|
||||
// interoperability/CatchChecked.java
|
||||
package interoperability;
|
||||
import interop.AnnotateThrowsKt;
|
||||
import java.io.IOException;
|
||||
import static atomictest.AtomicTestKt.eq;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Interoperability/Chameleon.java
|
||||
package Interoperability;
|
||||
// interoperability/Chameleon.java
|
||||
package interoperability;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Chameleon
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Interoperability/JTool.java
|
||||
package Interoperability;
|
||||
// interoperability/JTool.java
|
||||
package interoperability;
|
||||
|
||||
public class JTool {
|
||||
public static JTool get(String s) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Interoperability/JavaChecked.java
|
||||
package Interoperability;
|
||||
// interoperability/JavaChecked.java
|
||||
package interoperability;
|
||||
import java.io.*;
|
||||
import java.nio.file.*;
|
||||
import static atomictest.AtomicTestKt.eq;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// Interoperability/JavaWrapper.java
|
||||
package Interoperability;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
// interoperability/JavaWrapper.java
|
||||
package interoperability;
|
||||
import java.util.*;
|
||||
|
||||
public class JavaWrapper {
|
||||
public static void main(String[] args) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Interoperability/MakeSalad.java
|
||||
package Interoperability;
|
||||
// interoperability/MakeSalad.java
|
||||
package interoperability;
|
||||
import interop.Utils;
|
||||
import static atomictest.AtomicTestKt.eq;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Interoperability/UseDataClass.java
|
||||
package Interoperability;
|
||||
// interoperability/UseDataClass.java
|
||||
package interoperability;
|
||||
import java.util.HashMap;
|
||||
import static atomictest.AtomicTestKt.eq;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Interoperability/UsingKotlinClass.java
|
||||
package Interoperability;
|
||||
// interoperability/UsingKotlinClass.java
|
||||
package interoperability;
|
||||
import interop.Basic;
|
||||
import static atomictest.AtomicTestKt.eq;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Interoperability/JavaList.kt
|
||||
// interoperability/JavaList.kt
|
||||
import atomictest.eq
|
||||
|
||||
fun main() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Interoperability/KotlinChecked.kt
|
||||
// interoperability/KotlinChecked.kt
|
||||
import atomictest.eq
|
||||
import java.io.File
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Interoperability/KotlinClass.kt
|
||||
// interoperability/KotlinClass.kt
|
||||
package interop
|
||||
|
||||
class Basic {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Interoperability/KotlinDataClass.kt
|
||||
package Interoperability
|
||||
// interoperability/KotlinDataClass.kt
|
||||
package interoperability
|
||||
|
||||
data class Muppet(
|
||||
var name: String,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Interoperability/KotlinWrapper.kt
|
||||
// interoperability/KotlinWrapper.kt
|
||||
package interop
|
||||
|
||||
fun main() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Interoperability/NPEOnPlatformType.kt
|
||||
import Interoperability.JTool
|
||||
// interoperability/NPEOnPlatformType.kt
|
||||
import interoperability.JTool
|
||||
import atomictest.*
|
||||
|
||||
fun main() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Interoperability/PlatformTypes.kt
|
||||
// interoperability/PlatformTypes.kt
|
||||
package interop
|
||||
import Interoperability.JTool
|
||||
import interoperability.JTool
|
||||
import atomictest.eq
|
||||
|
||||
object KotlinCode {
|
||||
|
@ -15,10 +15,10 @@ fun main() {
|
|||
b.method() eq "Success"
|
||||
c.method() eq "Success" // [5]
|
||||
::a.returnType eq
|
||||
"Interoperability.JTool?"
|
||||
"interoperability.JTool?"
|
||||
::b.returnType eq
|
||||
"Interoperability.JTool"
|
||||
"interoperability.JTool"
|
||||
::c.returnType eq
|
||||
"Interoperability.JTool!" // [6]
|
||||
"interoperability.JTool!" // [6]
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
// Interoperability/Random.kt
|
||||
// interoperability/Random.kt
|
||||
import atomictest.eq
|
||||
import java.util.Random
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Interoperability/ReadOnlyByDefault.kt
|
||||
// interoperability/ReadOnlyByDefault.kt
|
||||
package interop
|
||||
|
||||
data class Animal(val name: String)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Interoperability/ReadOnlyCollections.kt
|
||||
// interoperability/ReadOnlyCollections.kt
|
||||
import atomictest.eq
|
||||
|
||||
fun main() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Interoperability/TopLevelFunction.kt
|
||||
// interoperability/TopLevelFunction.kt
|
||||
package interop
|
||||
|
||||
fun hi() = "Hello!"
|
|
@ -1,5 +1,5 @@
|
|||
// Interoperability/UseBeanClass.kt
|
||||
import Interoperability.Chameleon
|
||||
// interoperability/UseBeanClass.kt
|
||||
import interoperability.Chameleon
|
||||
import atomictest.eq
|
||||
|
||||
fun main() {
|
||||
|
|
|
@ -2,7 +2,7 @@ type: theory
|
|||
files:
|
||||
- name: src/Random.kt
|
||||
visible: true
|
||||
- name: src/Interoperability/Chameleon.java
|
||||
- name: src/interoperability/Chameleon.java
|
||||
visible: true
|
||||
- name: src/UseBeanClass.kt
|
||||
visible: true
|
||||
|
@ -10,41 +10,41 @@ files:
|
|||
visible: true
|
||||
- name: src/KotlinClass.kt
|
||||
visible: true
|
||||
- name: src/Interoperability/UsingKotlinClass.java
|
||||
- name: src/interoperability/UsingKotlinClass.java
|
||||
visible: true
|
||||
- name: src/KotlinDataClass.kt
|
||||
visible: true
|
||||
- name: src/Interoperability/UseDataClass.java
|
||||
- name: src/interoperability/UseDataClass.java
|
||||
visible: true
|
||||
- name: src/TopLevelFunction.kt
|
||||
visible: true
|
||||
- name: src/Interoperability/CallTopLevelFunction.java
|
||||
- name: src/interoperability/CallTopLevelFunction.java
|
||||
visible: true
|
||||
- name: src/Interoperability/CallTopLevelFunction2.java
|
||||
- name: src/interoperability/CallTopLevelFunction2.java
|
||||
visible: true
|
||||
- name: src/ChangeName.kt
|
||||
visible: true
|
||||
- name: src/Interoperability/MakeSalad.java
|
||||
- name: src/interoperability/MakeSalad.java
|
||||
visible: true
|
||||
- name: src/BigInt.kt
|
||||
visible: true
|
||||
- name: src/BigFibonacci.kt
|
||||
visible: true
|
||||
- name: src/Interoperability/JavaChecked.java
|
||||
- name: src/interoperability/JavaChecked.java
|
||||
visible: true
|
||||
- name: src/KotlinChecked.kt
|
||||
visible: true
|
||||
- name: src/AnnotateThrows.kt
|
||||
visible: true
|
||||
- name: src/Interoperability/CatchChecked.java
|
||||
- name: src/interoperability/CatchChecked.java
|
||||
visible: true
|
||||
- name: src/Interoperability/JTool.java
|
||||
- name: src/interoperability/JTool.java
|
||||
visible: true
|
||||
- name: src/PlatformTypes.kt
|
||||
visible: true
|
||||
- name: src/NPEOnPlatformType.kt
|
||||
visible: true
|
||||
- name: src/Interoperability/AnnotatedJTool.java
|
||||
- name: src/interoperability/AnnotatedJTool.java
|
||||
visible: true
|
||||
- name: src/AnnotatedJava.kt
|
||||
visible: true
|
||||
|
@ -58,7 +58,7 @@ files:
|
|||
visible: true
|
||||
- name: src/ReadOnlyCollections.kt
|
||||
visible: true
|
||||
- name: src/Interoperability/JavaWrapper.java
|
||||
- name: src/interoperability/JavaWrapper.java
|
||||
visible: true
|
||||
- name: src/KotlinWrapper.kt
|
||||
visible: true
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
id: 1710366
|
||||
update_date: Thu, 19 Nov 2020 14:21:35 UTC
|
||||
update_date: Thu, 19 Nov 2020 15:16:02 UTC
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
id: 440663
|
||||
update_date: Thu, 19 Nov 2020 14:21:33 UTC
|
||||
update_date: Thu, 19 Nov 2020 15:16:00 UTC
|
||||
unit: 430860
|
||||
|
|
|
@ -2573,42 +2573,42 @@ public class TestAllExamples extends AbstractTestExamples {
|
|||
|
||||
@Test
|
||||
public void testUsingKotlinClass() {
|
||||
testExample("Appendices/Java Interoperability/Examples/src/Interoperability/UsingKotlinClass.java", Interoperability.UsingKotlinClass::main);
|
||||
testExample("Appendices/Java Interoperability/Examples/src/interoperability/UsingKotlinClass.java", interoperability.UsingKotlinClass::main);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMakeSalad() {
|
||||
testExample("Appendices/Java Interoperability/Examples/src/Interoperability/MakeSalad.java", Interoperability.MakeSalad::main);
|
||||
testExample("Appendices/Java Interoperability/Examples/src/interoperability/MakeSalad.java", interoperability.MakeSalad::main);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testJavaWrapper() {
|
||||
testExample("Appendices/Java Interoperability/Examples/src/Interoperability/JavaWrapper.java", Interoperability.JavaWrapper::main);
|
||||
testExample("Appendices/Java Interoperability/Examples/src/interoperability/JavaWrapper.java", interoperability.JavaWrapper::main);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCallTopLevelFunction() {
|
||||
testExample("Appendices/Java Interoperability/Examples/src/Interoperability/CallTopLevelFunction.java", Interoperability.CallTopLevelFunction::main);
|
||||
testExample("Appendices/Java Interoperability/Examples/src/interoperability/CallTopLevelFunction.java", interoperability.CallTopLevelFunction::main);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCatchChecked() {
|
||||
testExample("Appendices/Java Interoperability/Examples/src/Interoperability/CatchChecked.java", Interoperability.CatchChecked::main);
|
||||
testExample("Appendices/Java Interoperability/Examples/src/interoperability/CatchChecked.java", interoperability.CatchChecked::main);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testJavaChecked() {
|
||||
testExample("Appendices/Java Interoperability/Examples/src/Interoperability/JavaChecked.java", Interoperability.JavaChecked::main);
|
||||
testExample("Appendices/Java Interoperability/Examples/src/interoperability/JavaChecked.java", interoperability.JavaChecked::main);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCallTopLevelFunction2() {
|
||||
testExample("Appendices/Java Interoperability/Examples/src/Interoperability/CallTopLevelFunction2.java", Interoperability.CallTopLevelFunction2::main);
|
||||
testExample("Appendices/Java Interoperability/Examples/src/interoperability/CallTopLevelFunction2.java", interoperability.CallTopLevelFunction2::main);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUseDataClass() {
|
||||
testExample("Appendices/Java Interoperability/Examples/src/Interoperability/UseDataClass.java", Interoperability.UseDataClass::main);
|
||||
testExample("Appendices/Java Interoperability/Examples/src/interoperability/UseDataClass.java", interoperability.UseDataClass::main);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue