Editions on the emulator: Play isolation, 400 to 402 to 410 migration, Play recovery options
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 4m6s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 3m24s
release-gate / verify (push) Successful in 9m39s

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:
2026-11-10 12:41:59 +00:00
co-authored by Claude Opus 5.5
parent 951700fb73
commit b42dbda7ac
2 changed files with 112 additions and 0 deletions
@@ -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 }
}
}