Editions on the emulator: Play isolation, 400 to 402 to 410 migration, Play recovery options
Adds PlayEditionTest: the Play edition never answers the room update routes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package tv.orbit.classic
|
||||
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.rules.TemporaryFolder
|
||||
import java.net.InetAddress
|
||||
|
||||
/** The Play edition (Paul, 10 November 2026): it never shares itself with another room, even if a copy were handed to it. */
|
||||
class PlayEditionTest {
|
||||
@get:Rule val folder = TemporaryFolder()
|
||||
|
||||
@Test fun anotherRoomAskingForAnUpdateGetsNothing() {
|
||||
assertEquals("play", Edition.NAME)
|
||||
PhoneLink.initForTest(object : PhoneStore {
|
||||
override fun all() = emptyMap<String, String>(); override fun get(id: String): String? = null
|
||||
override fun put(id: String, value: String) {}; override fun remove(id: String) {} })
|
||||
PhoneLink.bindTo = InetAddress.getLoopbackAddress(); PhoneLink.port = 18_098; PhoneLink.allowed = { it.isLoopbackAddress }
|
||||
val apk = folder.newFile("orbit.apk").apply { writeBytes(ByteArray(1_000) { 7 }) }
|
||||
fun status(path: String) = (java.net.URL("http://127.0.0.1:18098$path").openConnection() as java.net.HttpURLConnection).responseCode
|
||||
try {
|
||||
PhoneLink.shared = SharedBuild(402, "0.127.0-play", apk); PhoneLink.listening = true
|
||||
assertEquals(404, status("/room/version")); assertEquals(404, status("/room/orbit.apk"))
|
||||
assertFalse(Edition.serveUpdate("/room/version", "GET", java.io.ByteArrayOutputStream(), PhoneLink.shared) { _, _ -> fail("answered") })
|
||||
} finally { PhoneLink.listening = false; PhoneLink.stop(); PhoneLink.allowed = EmbyServer::isHomeAddress; PhoneLink.bindTo = null; PhoneLink.port = PhoneLink.PORT; PhoneLink.shared = null }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user