Skip to content

Commit 061d119

Browse files
patryk-kucharzKevinGilmore
authored andcommitted
Bael 1704 (eugenp#4973)
* BAEL-1704: Non-Trivial Work in Kotlin vs Java * BAEL-1704: Non-Trivial Work in Kotlin vs Java Renaming one test class * BAEL-1704: Kotlin vs Java * BAEL-1704: Kotlin vs Java The files moved to the guest branch.
1 parent 86aaf6f commit 061d119

13 files changed

Lines changed: 214 additions & 1 deletion

guest/core-kotlin/.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/bin/
2+
3+
#ignore gradle
4+
.gradle/
5+
6+
7+
#ignore build and generated files
8+
build/
9+
node/
10+
out/
11+
12+
#ignore installed node modules and package lock file
13+
node_modules/
14+
package-lock.json

guest/core-kotlin/pom.xml

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<artifactId>core-kotlin</artifactId>
6+
<version>1.0-SNAPSHOT</version>
7+
<groupId>com.stackify</groupId>
8+
<packaging>jar</packaging>
9+
10+
<repositories>
11+
<repository>
12+
<id>jcenter</id>
13+
<url>http://jcenter.bintray.com</url>
14+
</repository>
15+
</repositories>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.junit.platform</groupId>
20+
<artifactId>junit-platform-runner</artifactId>
21+
<version>${junit.platform.version}</version>
22+
<scope>test</scope>
23+
</dependency>
24+
<dependency>
25+
<groupId>org.jetbrains.kotlin</groupId>
26+
<artifactId>kotlin-stdlib</artifactId>
27+
<version>${kotlin-stdlib.version}</version>
28+
</dependency>
29+
<dependency>
30+
<groupId>org.jetbrains.kotlin</groupId>
31+
<artifactId>kotlin-stdlib-jdk8</artifactId>
32+
<version>${kotlin-stdlib.version}</version>
33+
</dependency>
34+
<dependency>
35+
<groupId>org.jetbrains.kotlin</groupId>
36+
<artifactId>kotlin-test-junit</artifactId>
37+
<version>${kotlin-test-junit.version}</version>
38+
<scope>test</scope>
39+
</dependency>
40+
<dependency>
41+
<groupId>org.jetbrains.kotlin</groupId>
42+
<artifactId>kotlin-reflect</artifactId>
43+
<version>${kotlin-reflect.version}</version>
44+
</dependency>
45+
<dependency>
46+
<groupId>org.jetbrains.spek</groupId>
47+
<artifactId>spek-api</artifactId>
48+
<version>1.1.5</version>
49+
<scope>test</scope>
50+
</dependency>
51+
<dependency>
52+
<groupId>org.jetbrains.spek</groupId>
53+
<artifactId>spek-subject-extension</artifactId>
54+
<version>1.1.5</version>
55+
<scope>test</scope>
56+
</dependency>
57+
<dependency>
58+
<groupId>org.jetbrains.spek</groupId>
59+
<artifactId>spek-junit-platform-engine</artifactId>
60+
<version>1.1.5</version>
61+
<scope>test</scope>
62+
</dependency>
63+
<dependency>
64+
<groupId>com.nhaarman</groupId>
65+
<artifactId>mockito-kotlin</artifactId>
66+
<version>${mockito-kotlin.version}</version>
67+
<scope>test</scope>
68+
</dependency>
69+
<dependency>
70+
<groupId>org.assertj</groupId>
71+
<artifactId>assertj-core</artifactId>
72+
<version>${assertj.version}</version>
73+
<scope>test</scope>
74+
</dependency>
75+
<dependency>
76+
<groupId>org.apache.maven.plugins</groupId>
77+
<artifactId>maven-compiler-plugin</artifactId>
78+
<version>${maven-compiler-plugin.version}</version>
79+
</dependency>
80+
<dependency>
81+
<groupId>org.apache.maven.plugins</groupId>
82+
<artifactId>maven-failsafe-plugin</artifactId>
83+
<version>${maven-failsafe-plugin.version}</version>
84+
<scope>test</scope>
85+
</dependency>
86+
<dependency>
87+
<groupId>org.jetbrains.kotlin</groupId>
88+
<artifactId>kotlin-maven-plugin</artifactId>
89+
<version>${kotlin-maven-plugin.version}</version>
90+
<scope>provided</scope>
91+
</dependency>
92+
</dependencies>
93+
94+
<build>
95+
<plugins>
96+
<plugin>
97+
<groupId>org.jetbrains.kotlin</groupId>
98+
<artifactId>kotlin-maven-plugin</artifactId>
99+
<version>${kotlin-maven-plugin.version}</version>
100+
<executions>
101+
<execution>
102+
<id>compile</id>
103+
<goals>
104+
<goal>compile</goal>
105+
</goals>
106+
<configuration>
107+
<sourceDirs>
108+
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
109+
</sourceDirs>
110+
</configuration>
111+
</execution>
112+
<execution>
113+
<id>test-compile</id>
114+
<goals>
115+
<goal>test-compile</goal>
116+
</goals>
117+
<configuration>
118+
<sourceDirs>
119+
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
120+
</sourceDirs>
121+
</configuration>
122+
</execution>
123+
</executions>
124+
</plugin>
125+
<plugin>
126+
<groupId>org.apache.maven.plugins</groupId>
127+
<artifactId>maven-compiler-plugin</artifactId>
128+
<version>${maven-compiler-plugin.version}</version>
129+
<configuration>
130+
<source>${java.version}</source>
131+
<target>${java.version}</target>
132+
</configuration>
133+
<executions>
134+
<!-- Replacing default-compile as it is treated specially
135+
by maven -->
136+
<execution>
137+
<id>default-compile</id>
138+
<phase>none</phase>
139+
</execution>
140+
<!-- Replacing default-testCompile as it is treated specially
141+
by maven -->
142+
<execution>
143+
<id>default-testCompile</id>
144+
<phase>none</phase>
145+
</execution>
146+
<execution>
147+
<id>java-compile</id>
148+
<phase>compile</phase>
149+
<goals>
150+
<goal>compile</goal>
151+
</goals>
152+
</execution>
153+
</executions>
154+
</plugin>
155+
<plugin>
156+
<artifactId>maven-failsafe-plugin</artifactId>
157+
<version>${maven-failsafe-plugin.version}</version>
158+
<dependencies>
159+
<dependency>
160+
<groupId>org.junit.platform</groupId>
161+
<artifactId>junit-platform-surefire-provider</artifactId>
162+
<version>${junit.platform.version}</version>
163+
</dependency>
164+
</dependencies>
165+
<executions>
166+
<execution>
167+
<id>junit5</id>
168+
<goals>
169+
<goal>integration-test</goal>
170+
<goal>verify</goal>
171+
</goals>
172+
<configuration>
173+
<includes>
174+
<include>**/*Test5.java</include>
175+
</includes>
176+
</configuration>
177+
</execution>
178+
</executions>
179+
</plugin>
180+
</plugins>
181+
</build>
182+
183+
<properties>
184+
<maven-failsafe-plugin.version>2.22.0</maven-failsafe-plugin.version>
185+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
186+
<kotlin-maven-plugin.version>1.2.60</kotlin-maven-plugin.version>
187+
<kotlin-test-junit.version>1.2.51</kotlin-test-junit.version>
188+
<kotlin-stdlib.version>1.2.51</kotlin-stdlib.version>
189+
<kotlin-reflect.version>1.2.51</kotlin-reflect.version>
190+
<kotlinx.version>0.22.5</kotlinx.version>
191+
<mockito-kotlin.version>1.5.0</mockito-kotlin.version>
192+
<commons-math3.version>3.6.1</commons-math3.version>
193+
<junit.platform.version>1.0.0</junit.platform.version>
194+
<junit.vintage.version>5.2.0</junit.vintage.version>
195+
<assertj.version>3.10.0</assertj.version>
196+
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
197+
</properties>
198+
199+
</project>

core-kotlin/src/test/kotlin/com/baeldung/kotlinvsjava/CompanionObjectTest.kt renamed to guest/core-kotlin/src/test/kotlin/com/baeldung/kotlinvsjava/CompanionObjectTest.kt

File renamed without changes.

core-kotlin/src/test/kotlin/com/baeldung/kotlinvsjava/ConstructorTest.kt renamed to guest/core-kotlin/src/test/kotlin/com/baeldung/kotlinvsjava/ConstructorTest.kt

File renamed without changes.

core-kotlin/src/test/kotlin/com/baeldung/kotlinvsjava/DataClassTest.kt renamed to guest/core-kotlin/src/test/kotlin/com/baeldung/kotlinvsjava/DataClassTest.kt

File renamed without changes.

core-kotlin/src/test/kotlin/com/baeldung/kotlinvsjava/DelegationTest.kt renamed to guest/core-kotlin/src/test/kotlin/com/baeldung/kotlinvsjava/DelegationTest.kt

File renamed without changes.

core-kotlin/src/test/kotlin/com/baeldung/kotlinvsjava/ExceptionsTest.kt renamed to guest/core-kotlin/src/test/kotlin/com/baeldung/kotlinvsjava/ExceptionsTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ExceptionsTest {
2424
fun givenANullString_whenUsingElvisOperator_thenExceptionIsThrown() {
2525
val sampleString: String? = null
2626

27-
val length: Int = sampleString?.length ?: throw IllegalArgumentException("String must not be null")
27+
sampleString?.length ?: throw IllegalArgumentException("String must not be null")
2828
}
2929

3030
private fun funThrowingException(): Nothing {

core-kotlin/src/test/kotlin/com/baeldung/kotlinvsjava/ExtensionFunctionsTest.kt renamed to guest/core-kotlin/src/test/kotlin/com/baeldung/kotlinvsjava/ExtensionFunctionsTest.kt

File renamed without changes.

core-kotlin/src/test/kotlin/com/baeldung/kotlinvsjava/FunctionsTest.kt renamed to guest/core-kotlin/src/test/kotlin/com/baeldung/kotlinvsjava/FunctionsTest.kt

File renamed without changes.

core-kotlin/src/test/kotlin/com/baeldung/kotlinvsjava/IsOperatorTest.kt renamed to guest/core-kotlin/src/test/kotlin/com/baeldung/kotlinvsjava/IsOperatorTest.kt

File renamed without changes.

0 commit comments

Comments
 (0)