Minor: normalize '@Test' annotation casing in all tests.

This commit is contained in:
Ilya Gorbunov
2016-11-16 21:26:39 +03:00
parent 50cd620f92
commit 6a70761783
48 changed files with 749 additions and 751 deletions
+5 -5
View File
@@ -8,11 +8,11 @@ import java.io.*
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.atomic.AtomicInteger
import kotlin.concurrent.thread
import org.junit.Test as test
import org.junit.Test
class LazyJVMTest {
@test fun synchronizedLazy() {
@Test fun synchronizedLazy() {
val counter = AtomicInteger(0)
val lazy = lazy {
val value = counter.incrementAndGet()
@@ -26,7 +26,7 @@ class LazyJVMTest {
assertEquals(1, counter.get())
}
@test fun externallySynchronizedLazy() {
@Test fun externallySynchronizedLazy() {
val counter = AtomicInteger(0)
var initialized: Boolean = false
val runs = ConcurrentHashMap<Int, Boolean>()
@@ -51,7 +51,7 @@ class LazyJVMTest {
}
}
@test fun publishOnceLazy() {
@Test fun publishOnceLazy() {
val counter = AtomicInteger(0)
var initialized: Boolean = false
val runs = ConcurrentHashMap<Int, Boolean>()
@@ -75,7 +75,7 @@ class LazyJVMTest {
}
}
@test fun lazyInitializationForcedOnSerialization() {
@Test fun lazyInitializationForcedOnSerialization() {
for(mode in listOf(LazyThreadSafetyMode.SYNCHRONIZED, LazyThreadSafetyMode.PUBLICATION, LazyThreadSafetyMode.NONE)) {
val lazy = lazy(mode) { "initialized" }
assertFalse(lazy.isInitialized())
+4 -4
View File
@@ -2,11 +2,11 @@ package test.utils
import kotlin.*
import kotlin.test.*
import org.junit.Test as test
import org.junit.Test
class LazyTest {
@test fun initializationCalledOnce() {
@Test fun initializationCalledOnce() {
var callCount = 0
val lazyInt = lazy { ++callCount }
@@ -20,7 +20,7 @@ class LazyTest {
assertEquals(1, callCount)
}
@test fun alreadyInitialized() {
@Test fun alreadyInitialized() {
val lazyInt = lazyOf(1)
assertTrue(lazyInt.isInitialized())
@@ -28,7 +28,7 @@ class LazyTest {
}
@test fun lazyToString() {
@Test fun lazyToString() {
var callCount = 0
val lazyInt = lazy { ++callCount }
@@ -1,12 +1,12 @@
@file:kotlin.jvm.JvmVersion
package test.utils
import org.junit.Test as test
import org.junit.Test
import kotlin.test.*
class PreconditionsJVMTest() {
@test fun passingRequire() {
@Test fun passingRequire() {
require(true)
var called = false
@@ -14,21 +14,21 @@ class PreconditionsJVMTest() {
assertFalse(called)
}
@test fun failingRequire() {
@Test fun failingRequire() {
val error = assertFailsWith(IllegalArgumentException::class) {
require(false)
}
assertNotNull(error.message)
}
@test fun failingRequireWithLazyMessage() {
@Test fun failingRequireWithLazyMessage() {
val error = assertFailsWith(IllegalArgumentException::class) {
require(false) { "Hello" }
}
assertEquals("Hello", error.message)
}
@test fun passingCheck() {
@Test fun passingCheck() {
check(true)
var called = false
@@ -36,34 +36,34 @@ class PreconditionsJVMTest() {
assertFalse(called)
}
@test fun failingCheck() {
@Test fun failingCheck() {
val error = assertFailsWith(IllegalStateException::class) {
check(false)
}
assertNotNull(error.message)
}
@test fun failingCheckWithLazyMessage() {
@Test fun failingCheckWithLazyMessage() {
val error = assertFailsWith(IllegalStateException::class) {
check(false) { "Hello" }
}
assertEquals("Hello", error.message)
}
@test fun requireNotNull() {
@Test fun requireNotNull() {
val s1: String? = "S1"
val r1: String = requireNotNull(s1)
assertEquals("S1", r1)
}
@test fun requireNotNullFails() {
@Test fun requireNotNullFails() {
assertFailsWith(IllegalArgumentException::class) {
val s2: String? = null
requireNotNull(s2)
}
}
@test fun requireNotNullWithLazyMessage() {
@Test fun requireNotNullWithLazyMessage() {
val error = assertFailsWith(IllegalArgumentException::class) {
val obj: Any? = null
requireNotNull(obj) { "Message" }
@@ -78,20 +78,20 @@ class PreconditionsJVMTest() {
assertFalse(lazyCalled, "Message is not evaluated if the condition is met")
}
@test fun checkNotNull() {
@Test fun checkNotNull() {
val s1: String? = "S1"
val r1: String = checkNotNull(s1)
assertEquals("S1", r1)
}
@test fun checkNotNullFails() {
@Test fun checkNotNullFails() {
assertFailsWith(IllegalStateException::class) {
val s2: String? = null
checkNotNull(s2)
}
}
@test fun passingAssert() {
@Test fun passingAssert() {
assert(true)
var called = false
assert(true) { called = true; "some message" }
@@ -100,7 +100,7 @@ class PreconditionsJVMTest() {
}
@test fun failingAssert() {
@Test fun failingAssert() {
val error = assertFails {
assert(false)
}
@@ -111,7 +111,7 @@ class PreconditionsJVMTest() {
}
}
@test fun error() {
@Test fun error() {
val error = assertFails {
error("There was a problem")
}
@@ -122,11 +122,11 @@ class PreconditionsJVMTest() {
}
}
@test fun passingAssertWithMessage() {
@Test fun passingAssertWithMessage() {
assert(true) { "Hello" }
}
@test fun failingAssertWithMessage() {
@Test fun failingAssertWithMessage() {
val error = assertFails {
assert(false) { "Hello" }
}
@@ -137,7 +137,7 @@ class PreconditionsJVMTest() {
}
}
@test fun failingAssertWithLazyMessage() {
@Test fun failingAssertWithLazyMessage() {
val error = assertFails {
assert(false) { "Hello" }
}
+2 -2
View File
@@ -18,7 +18,7 @@ package test.utils
import kotlin.*
import kotlin.test.*
import org.junit.Test as test
import org.junit.Test
class TODOTest {
private class PartiallyImplementedClass {
@@ -52,7 +52,7 @@ class TODOTest {
}
@test fun usage() {
@Test fun usage() {
val inst = PartiallyImplementedClass()
assertNotImplemented { inst.prop }