A somewhat copy past of Jetbrain's code from the kotlin plugin repo to make it humanly possible to test Intellij IDEA kotlin plugins that work on kotlin

Overview

Introduction

This library is a "workaround" the lack of real documentation & library for testing Intellij IDEA plugins in kotlin & with the kotlin stdLib presented.

There is an example under the example folder

Installation

Add the csense maven repo

groovy dsl

repositories {
    maven {
        url 'https://pkgs.dev.azure.com/csense-oss/csense-oss/_packaging/csense-oss/maven/v1'
        name 'csense-oss'
    }
}

kotlin gradle dsl

repositories {
    maven {
        setUrl("https://pkgs.dev.azure.com/csense-oss/csense-oss/_packaging/csense-oss/maven/v1")
        name = "Csense oss"
    }
}

Add the library

groovy dsl

dependencies {
    testImplementation "csense.idea.test:csense-idea-test:0.1.0"
}

kotlin gradle dsl

dependencies {
    testImplementation("csense.idea.test:csense-idea-test:0.1.0")
}

Getting started / steps explained

There are a few things to set up before any tests of sorts can work.

(the Example folder contains a simple example which the following steps will create)

  1. the structure of tests can / are only tested as follows: adding this to gradle
     sourceSets {
   test {
       resources {
           srcDir("testData")
       }
   }
}

Then adding directly under the test folder a folder called "testData" (of cause you can customize this)

  1. Add test fixtures inside here. as an "getting started example" you can use this in a "Example.kt"
fun main(args: Array<String>) {
    val exception = kotlin.KotlinNullPointerException() //this is to validate that we have loaded the standard library
    throw exception //just for the sake of it.
}
  1. add a test in the test/kotlin/ you want as an example you can use ExampleTest.kt
@RunWith(JUnit4::class)
class ExampleTest : KotlinLightCodeInsightFixtureTestCaseLighter() {
    //The folder referenced again
    override fun getTestDataPath(): String = "src/test/testData/"

    @Test
    fun tryExample() {
        myFixture.testHighlighting("Example.kt")
    }

}
  1. Tada, it should "just work" out of the box. (if somehow its utterly broken then perhaps setting idea home system property might solve some issues ( see https://plugins.jetbrains.com/docs/intellij/tests-prerequisites.html#set-the-run-configuration-parameters))

License

Most is copy and paste from https://github.com/JetBrains/intellij-community so that is Apache2 licensed thus it all trademarked Jetbrains. (the original file copyright has been included in each file even after modifying it to preserve the license)

You might also like...
A Kotlin work manager library for Android with progress notifications and Hilt support.

Boot Laces A kotlin work manager library for Android that includes notifications and Hilt support. User Instructions Add the JitPack repository to you

A set of extension properties on Int, Long, Double, and Duration, that makes it easier to work with Kotlin Duration

Kotlin Duration Extensions Gradle Groovy repositories { mavenCentral() } implementation 'com.eygraber:kotlin-duration-extensions:1.0.1' Kotlin rep

Dots indicator that shows the current position on a View Pager. It does all the work for you with a few customisations.
Dots indicator that shows the current position on a View Pager. It does all the work for you with a few customisations.

Dots What is Dots? Dots is a library that helps in implementing a simple yet effective dots indicator for the View Pagers used in your android code. I

Reapp is everything you need to build amazing apps with React: a collection of packages that work together, our UI kit, and a CLI that scaffolds your app and includes a server and build system.
Reapp is everything you need to build amazing apps with React: a collection of packages that work together, our UI kit, and a CLI that scaffolds your app and includes a server and build system.

What is it? Reapp is everything you need to build amazing apps with React: a collection of packages that work together, our UI kit, and a CLI that sca

A repo to experiment with Continuation R, A implementations in Kotlin

A repo to experiment with Continuation R, A implementations in Kotlin

Android app to fetch closed pull request of any public repo

Pullr Android app to fetch closed pull request of any public repo 🌟 Features Co

Plugin-shared-preferences - Pluto plugin to manage your Shared Preferences

Pluto Shared Preferences Plugin Pluto Shared Preferences is a Pluto plugin to in

The KPy gradle plugin allows you to write Kotlin/Native code and use it from python.

The KPy gradle plugin allows you to write Kotlin/Native code and use it from python.

💫 A Gradle Plugin to generate your networking code from Swagger

Swagger Gradle Codegen A Gradle plugin to generate networking code from a Swagger spec file. This plugin wraps swagger-codegen, and exposes a configur

Owner
common sense OSS
common sense OSS
Catppuccin-jetbrains - Vibrant pastel theme for JetBrains IDEs

?? Vibrant pastel theme for JetBrains IDEs Usage Grab the latest jar from the re

Timo Epp 139 Dec 25, 2022
Auto-generate the fastest possible Parcelable implementations for Java and Kotlin

This project is deprecated It will still be maintained, but no new features will be added. Please use Parcelize, as it is the official way of generati

Bradley Campbell 492 Nov 17, 2022
RecyclerView Adapter Library with different models and different layouts as convenient as possible.

RecyclerView Presenter Convenience library to handle different view types with different presenters in a single RecyclerView. How to install repositor

Jan Rabe 86 Dec 26, 2022
Condenses KDoc where possible.

KDocCondenser Template ToDo list Create a new IntelliJ Platform Plugin Template project. Get known with the template documentation. Verify the pluginG

Jacob Wysko 0 Nov 3, 2021
Demo for Jetbrains webinar on "How to share data layer in KMM"

RealmDemo Demo application demostrating how to share data layer in an KMM project using Realm Kotlin SDK and Atlas App Service. Webinar Link : https:/

MongoDB Developer Relations 9 Dec 15, 2022
Provides Kotlin libs and some features for building Kotlin plugins

Kotlin Plugin Provides Kotlin libs and some features for building awesome Kotlin plugins. Can be used instead of CreeperFace's KotlinLib (don't use to

null 3 Dec 24, 2021
A set of highly-opinionated, batteries-included gradle plugins to get you started building delicious multi-module Kotlin projects

Sourdough Gradle What is Sourdough Gradle? Sourdough is a set of highly opinionated gradle plugins that aim to act as the starter for your Kotlin proj

Backbone 0 Oct 3, 2022
A react-like kotlin library to create an inventory ui easily in paper plugins

A react-like kotlin library to create an inventory ui easily in paper plugins

R2turnTrue 6 Aug 23, 2022
A collection of plugins for Aliucord.

Aliucord Plugins collection Plugins for Aliucord Download Download from here AttachmentUtils Adds a context menu to attachments. Gnuify Appends "GNU/"

Xinto 65 Dec 14, 2022
BungeePluginManagerPlus - Dynamically manage your BungeeCord plugins

BungeePluginManagerPlus A plugin for BungeeCord / Waterfall that allows you to m

null 4 Jun 29, 2022