Kickstart Kotlin : Jython with Spring Boot

Submitted by Dickens A S on Fri, 03/20/2020 - 07:02

Easily create Kotlin based Jython project from these multiplatform boilerplate Gradle DSL

Run gradle command

  gradle assemble

Run gradle command

  gradle run

Browse http://localhost:8080/index.html

On the screen you will see response from Jython via AJAX

JavaScript libraries are maintained using "webjars"

Spring Boot REST code

Jython
Spring Boot
Web Jars
Embed Python
AJAX

Web Jars

Submitted by Dickens A S on Mon, 03/16/2020 - 10:49

Web Jars is a dependency management technique which reduces the leraning curve of the developer to use single dependency management system to manage the versions of JavaScript libraries or other non-maven-standard libraries which has other then java code

For Example: i you want to add jQuery into your spring boot project, in the past you need to put that in the static folder manually of you need to use tools like bower to download it inside the static folder

but now you don't have to do that, you can use same pom.xml or build.gradle and specify the webjar dependency

Web Jars

Kickstart Kotlin Web Socket with Spring Boot

Submitted by Dickens A S on Mon, 03/16/2020 - 10:39

Easily create Kotlin Web Socket project from these multiplatform boilerplate Gradle DSL

Run gradle command

  gradle assemble

Run gradle command

  gradle run

Browse http://localhost:8080/index.html

On the screen you will see connection status

JavaScript libraries are maintained using "webjars",

Source Code

End Of Article

Web Jars
Spring Boot
Web Socket
SockJS
Stomp
jQuery

Kotlin JUnit5

Submitted by Dickens A S on Sun, 12/15/2019 - 05:10

A simple JUnit 5 project with Gradle 6

package junit5

import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test

class AppTest {
    @Test fun `test greeting`() {
        val classUnderTest = App()
        assertNotNull(classUnderTest.greeting, "app should have a greeting")
    }
}

Note: a fresh gradle project always generates code for JUnit 4, for JUnit 5 you need to change the dependencies accordingly to jupiter package

 

JUnit
JUnit 5
kotlin
gradle