projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
🔥 Remove session manager from freenet request
[Sone.git]
/
src
/
test
/
kotlin
/
net
/
pterodactylus
/
sone
/
main
/
SonePluginTest.kt
diff --git
a/src/test/kotlin/net/pterodactylus/sone/main/SonePluginTest.kt
b/src/test/kotlin/net/pterodactylus/sone/main/SonePluginTest.kt
index
b846522
..
d1e2cec
100644
(file)
--- a/
src/test/kotlin/net/pterodactylus/sone/main/SonePluginTest.kt
+++ b/
src/test/kotlin/net/pterodactylus/sone/main/SonePluginTest.kt
@@
-15,6
+15,7
@@
import net.pterodactylus.sone.web.*
import net.pterodactylus.sone.web.notification.*
import org.hamcrest.MatcherAssert.*
import org.hamcrest.Matchers.*
import net.pterodactylus.sone.web.notification.*
import org.hamcrest.MatcherAssert.*
import org.hamcrest.Matchers.*
+import org.junit.experimental.categories.*
import org.mockito.Mockito.*
import java.io.*
import java.util.concurrent.atomic.*
import org.mockito.Mockito.*
import java.io.*
import java.util.concurrent.atomic.*
@@
-24,6
+25,7
@@
import kotlin.test.*
* Unit test for [SonePlugin].
*/
@Dirty
* Unit test for [SonePlugin].
*/
@Dirty
+@Category(NotParallel::class)
class SonePluginTest {
private var sonePlugin = SonePlugin { injector }
class SonePluginTest {
private var sonePlugin = SonePlugin { injector }
@@
-100,9
+102,15
@@
class SonePluginTest {
assertThat(getInjected(NotificationHandler::class.java), notNullValue())
}
assertThat(getInjected(NotificationHandler::class.java), notNullValue())
}
+ @Test
+ fun `ticker shutdown is being requested`() {
+ sonePlugin.runPlugin(pluginRespirator)
+ assertThat(getInjected(TickerShutdown::class.java), notNullValue())
+ }
+
private class FirstStartListener(private val firstStartReceived: AtomicBoolean) {
@Subscribe
private class FirstStartListener(private val firstStartReceived: AtomicBoolean) {
@Subscribe
- fun firstStart(firstStart: FirstStart) {
+ fun firstStart(
@Suppress("UNUSED_PARAMETER")
firstStart: FirstStart) {
firstStartReceived.set(true)
}
}
firstStartReceived.set(true)
}
}
@@
-133,7
+141,7
@@
class SonePluginTest {
private class ConfigNotReadListener(private val configNotReadReceiver: AtomicBoolean) {
@Subscribe
private class ConfigNotReadListener(private val configNotReadReceiver: AtomicBoolean) {
@Subscribe
- fun configNotRead(configNotRead: ConfigNotRead) {
+ fun configNotRead(
@Suppress("UNUSED_PARAMETER")
configNotRead: ConfigNotRead) {
configNotReadReceiver.set(true)
}
}
configNotReadReceiver.set(true)
}
}
@@
-177,7
+185,7
@@
class SonePluginTest {
private class StartupListener(private val startupReceived: () -> Unit) {
@Subscribe
private class StartupListener(private val startupReceived: () -> Unit) {
@Subscribe
- fun startup(startup: Startup) {
+ fun startup(
@Suppress("UNUSED_PARAMETER")
startup: Startup) {
startupReceived()
}
}
startupReceived()
}
}
@@
-194,7
+202,7
@@
class SonePluginTest {
private class ShutdownListener(private val shutdownReceived: () -> Unit) {
@Subscribe
private class ShutdownListener(private val shutdownReceived: () -> Unit) {
@Subscribe
- fun shutdown(shutdown: Shutdown) {
+ fun shutdown(
@Suppress("UNUSED_PARAMETER")
shutdown: Shutdown) {
shutdownReceived()
}
}
shutdownReceived()
}
}