Libraries written in Kotlin are factored out into a separate project
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/kotlin" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/junit-4.9.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module" module-name="stdlib" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,10 @@
|
||||
import kotlin.modules.*
|
||||
|
||||
fun project() {
|
||||
module("kunit") {
|
||||
// TODO how to refer to the dir of the module?
|
||||
classpath += "kunit/lib/junit-4.9.jar"
|
||||
|
||||
addSourceFiles("src/main/kotlin")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package org.jetbrains.kotlin.junit
|
||||
|
||||
import junit.framework.TestCase
|
||||
|
||||
/**
|
||||
* Useful base class for test cases using the old JUnit 3 naming convention of functions
|
||||
* starting with "test*" as being a test case
|
||||
*/
|
||||
abstract class TestSupport() : TestCase() {
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package org.jetbrains.kotlin.test.junit
|
||||
|
||||
import kotlin.test.Asserter
|
||||
import org.junit.Assert
|
||||
|
||||
class JUnitAsserter : Asserter {
|
||||
override fun assertEquals(message : String, expected : Any?, actual : Any?) {
|
||||
Assert.assertEquals(message, expected, actual)
|
||||
}
|
||||
|
||||
override fun assertNotNull(message : String, actual : Any?) {
|
||||
Assert.assertNotNull(message, actual)
|
||||
}
|
||||
|
||||
override fun assertNull(message : String, actual : Any?) {
|
||||
Assert.assertNull(message, actual)
|
||||
}
|
||||
|
||||
override fun assertTrue(message : String, actual : Boolean) {
|
||||
Assert.assertTrue(message, actual)
|
||||
}
|
||||
|
||||
override fun fail(message : String) {
|
||||
Assert.fail(message)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user