Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/images/tutorials/jvm-test/run-test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/tutorials/jvm-test/test-failed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
660 changes: 330 additions & 330 deletions docs/kr.tree

Large diffs are not rendered by default.

138 changes: 138 additions & 0 deletions docs/snippets/jvm-test-tutorial/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-junit-complete</artifactId>
<version>1.0-SNAPSHOT</version>

<name>kotlin-junit-complete</name>
<url>https://kotlinlang.org/docs/jvm-test-using-junit.htm</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>17</maven.compiler.release>
<jexer.version>1.6.0</jexer.version>
<kotlin.version>%kotlinVersion%</kotlin.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.11.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<!-- Add JUnit Jupiter engine for test runtime -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<!-- Optionally: parameterized tests support -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<!-- Add Kotlin standard library to compile and run Kotlin tests -->
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.gitlab.klamonte</groupId>
<artifactId>jexer</artifactId>
<version>${jexer.version}</version>
</dependency>
</dependencies>

<build>
<pluginManagement><!-- Lock down plugin versions to avoid using Maven defaults (can be moved to a parent pom file) -->
<plugins>
<!-- Clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.4.0</version>
</plugin>
<!-- Default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.2</version>
</plugin>
<!-- Site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.12.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.6.1</version>
</plugin>
<!-- No maven-compiler-plugin needed with Kotlin extensions -->
</plugins>
</pluginManagement>
<plugins>
<!-- Activate Kotlin Maven plugin for main and test sources -->
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<configuration>
<sourceDirs>
<sourceDir>src/main/kotlin</sourceDir>
<!-- Ensure Kotlin code can reference Java code -->
<sourceDir>src/main/java</sourceDir>
</sourceDirs>
</configuration>
</execution>
<execution>
<id>default-test-compile</id>
<phase>test-compile</phase>
<configuration>
<sourceDirs>
<sourceDir>src/test/kotlin</sourceDir>
<sourceDir>src/test/java</sourceDir>
</sourceDirs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
2 changes: 1 addition & 1 deletion docs/topics/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ the ability to write expressive code as well as facilitating creation of DSL.
Yes. Kotlin is 100% interoperable with the Java programming language, and major emphasis has been placed on making sure
that your existing codebase can interact properly with Kotlin. You can easily [call Kotlin code from Java](java-to-kotlin-interop.md) and [Java code
from Kotlin](java-interop.md). This makes adoption much easier and lower-risk. There's also an automated [Java-to-Kotlin converter built
into the IDE](mixing-java-kotlin-intellij.md#converting-an-existing-java-file-to-kotlin-with-j2k) that simplifies migration of existing code.
into the IDE](mixing-java-kotlin-intellij.md#convert-java-files-to-kotlin) that simplifies migration of existing code.

### What can I use Kotlin for?

Expand Down
11 changes: 7 additions & 4 deletions docs/topics/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ Here you'll learn how to develop a console application and create unit tests wit

Here you'll learn how to develop a backend application with Kotlin server-side.

1. **Create your first backend application:**
* **Introduce Kotlin to your Java project:**

* [Create a RESTful web service with Spring Boot](jvm-get-started-spring-boot.md)
* [Create HTTP APIs with Ktor](https://ktor.io/docs/creating-http-apis.html)
* [Configure a Java project to work with Kotlin](mixing-java-kotlin-intellij.md)
* [Add Kotlin tests to your Java Maven project](jvm-test-using-junit.md)

2. **[Learn how to mix Kotlin and Java code in your application](mixing-java-kotlin-intellij.md).**
* **Create a backend app from scratch with Kotlin:**

* [Create a RESTful web service with Spring Boot](jvm-get-started-spring-boot.md)
* [Create HTTP APIs with Ktor](https://ktor.io/docs/creating-http-apis.html)

</tab>

Expand Down
2 changes: 1 addition & 1 deletion docs/topics/jvm/java-to-kotlin-collections-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ fun main() {

* Visit [Kotlin Koans](koans.md) – complete exercises to learn Kotlin syntax. Each exercise is created as a failing unit test and your job is to make it pass.
* Look through other [Kotlin idioms](idioms.md).
* Learn how to convert existing Java code to Kotlin with the [Java to Kotlin converter](mixing-java-kotlin-intellij.md#converting-an-existing-java-file-to-kotlin-with-j2k).
* Learn how to convert existing Java code to Kotlin with the [Java to Kotlin converter](mixing-java-kotlin-intellij.md#convert-java-files-to-kotlin).
* Discover [collections in Kotlin](collections-overview.md).

If you have a favorite idiom, we invite you to share it by sending a pull request.
2 changes: 1 addition & 1 deletion docs/topics/jvm/java-to-kotlin-idioms-strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,6 @@ Learn more about [multiline strings](coding-conventions.md#strings).

* Look through other [Kotlin idioms](idioms.md).
* Learn how to convert existing Java code to Kotlin with
the [Java to Kotlin converter](mixing-java-kotlin-intellij.md#converting-an-existing-java-file-to-kotlin-with-j2k).
the [Java to Kotlin converter](mixing-java-kotlin-intellij.md#convert-java-files-to-kotlin).

If you have a favorite idiom, we invite you to share it by sending a pull request.
2 changes: 1 addition & 1 deletion docs/topics/jvm/java-to-kotlin-nullability-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ This version replaces the `if` expression with the [safe call operator](null-saf
## What's next?

* Browse other [Kotlin idioms](idioms.md).
* Learn how to convert existing Java code to Kotlin with the [Java-to-Kotlin (J2K) converter](mixing-java-kotlin-intellij.md#converting-an-existing-java-file-to-kotlin-with-j2k).
* Learn how to convert existing Java code to Kotlin with the [Java-to-Kotlin (J2K) converter](mixing-java-kotlin-intellij.md#convert-java-files-to-kotlin).
* Check out other migration guides:
* [Strings in Java and Kotlin](java-to-kotlin-idioms-strings.md)
* [Collections in Java and Kotlin](java-to-kotlin-collections-guide.md)
Expand Down
Loading
Loading