mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-12 17:07:55 -04:00
integration tests: boot using MinosoftBoot
This commit is contained in:
parent
56f26dbae4
commit
cae786d741
@ -13,19 +13,17 @@
|
||||
|
||||
package de.bixilon.minosoft
|
||||
|
||||
import de.bixilon.kutil.latch.SimpleLatch
|
||||
import de.bixilon.kutil.concurrent.worker.task.TaskWorker
|
||||
import de.bixilon.kutil.reflection.ReflectionUtil.forceSet
|
||||
import de.bixilon.minosoft.assets.IntegratedAssets
|
||||
import de.bixilon.minosoft.assets.meta.MinosoftMeta
|
||||
import de.bixilon.minosoft.assets.properties.version.AssetsVersionProperties
|
||||
import de.bixilon.minosoft.data.registries.fallback.FallbackRegistries
|
||||
import de.bixilon.minosoft.data.registries.fallback.tags.FallbackTags
|
||||
import de.bixilon.minosoft.datafixer.DataFixer
|
||||
import de.bixilon.minosoft.protocol.versions.VersionLoader
|
||||
import de.bixilon.minosoft.main.BootTasks
|
||||
import de.bixilon.minosoft.main.MinosoftBoot
|
||||
import de.bixilon.minosoft.terminal.RunConfiguration
|
||||
import de.bixilon.minosoft.test.IT
|
||||
import de.bixilon.minosoft.test.ITUtil
|
||||
import de.bixilon.minosoft.util.KUtil
|
||||
import de.bixilon.minosoft.util.KUtil.minusAssign
|
||||
import de.bixilon.minosoft.util.logging.Log
|
||||
import de.bixilon.minosoft.util.logging.LogLevels
|
||||
import de.bixilon.minosoft.util.logging.LogMessageType
|
||||
@ -56,11 +54,19 @@ internal object MinosoftSIT {
|
||||
KUtil.initPlayClasses()
|
||||
disableGC()
|
||||
Log.log(LogMessageType.OTHER, LogLevels.INFO) { "Setting up integration tests...." }
|
||||
initAssetsManager()
|
||||
DataFixer.load()
|
||||
loadVersionsJson()
|
||||
loadAssetsProperties()
|
||||
loadDefaultRegistries()
|
||||
|
||||
IntegratedAssets.DEFAULT.load()
|
||||
|
||||
val worker = TaskWorker()
|
||||
MinosoftBoot.register(worker)
|
||||
worker.minusAssign(BootTasks.PROFILES)
|
||||
worker.minusAssign(BootTasks.LAN_SERVERS)
|
||||
worker.minusAssign(BootTasks.MODS)
|
||||
worker.minusAssign(BootTasks.CLI)
|
||||
worker.work(MinosoftBoot.LATCH)
|
||||
MinosoftBoot.LATCH.dec()
|
||||
MinosoftBoot.LATCH.await()
|
||||
|
||||
loadPixlyzerData()
|
||||
Log.log(LogMessageType.OTHER, LogLevels.INFO) { "Integration tests setup successfully!" }
|
||||
}
|
||||
@ -78,25 +84,6 @@ internal object MinosoftSIT {
|
||||
}.start()
|
||||
}
|
||||
|
||||
fun initAssetsManager() {
|
||||
IntegratedAssets.DEFAULT.load()
|
||||
IntegratedAssets.OVERRIDE.load()
|
||||
}
|
||||
|
||||
fun loadVersionsJson() {
|
||||
VersionLoader.load(SimpleLatch(0))
|
||||
}
|
||||
|
||||
fun loadAssetsProperties() {
|
||||
AssetsVersionProperties.load(SimpleLatch(0))
|
||||
}
|
||||
|
||||
fun loadDefaultRegistries() {
|
||||
FallbackTags.load()
|
||||
FallbackRegistries.load()
|
||||
MinosoftMeta.load()
|
||||
}
|
||||
|
||||
fun loadPixlyzerData() {
|
||||
val (version, registries) = ITUtil.loadPixlyzerData(IT.TEST_VERSION_NAME)
|
||||
IT.VERSION = version
|
||||
|
@ -1,3 +1,16 @@
|
||||
/*
|
||||
* Minosoft
|
||||
* Copyright (C) 2020-2023 Moritz Zwerger
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
||||
*/
|
||||
|
||||
package de.bixilon.minosoft.util.yggdrasil
|
||||
|
||||
import org.testng.Assert.*
|
||||
@ -6,13 +19,6 @@ import org.testng.annotations.Test
|
||||
@Test(groups = ["signature", "yggdrasil"])
|
||||
class YggdrasilUtilTest {
|
||||
|
||||
|
||||
@Test(groups = ["signature", "yggdrasil"], priority = -1)
|
||||
fun load() {
|
||||
YggdrasilUtil.load()
|
||||
}
|
||||
|
||||
|
||||
fun `simple skin from mineskin_org`() {
|
||||
val texture = "ewogICJ0aW1lc3RhbXAiIDogMTY5MDQwNDM4NjczNywKICAicHJvZmlsZUlkIiA6ICI3ZGY4NmY1MWFjZmI0MjQzYTkzNDQ1OTAyZDEzYTc0MSIsCiAgInByb2ZpbGVOYW1lIiA6ICJNclJpcHRpZGUiLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjAxNzk1YmZhNmY3YzdkY2E0ZTI2ZWZiMzg2NGFmN2Y2MzhkZTliY2I4MjVjY2QzMjZiN2ZlZGVhZmVlZGZlNSIKICAgIH0KICB9Cn0="
|
||||
val signature = "MZrr6ClYhJoSAM67/zzdD3QhASIKcq5xAXVYJx50QY6QTNFH85h9hAD93fi17ncRzpGvHaktRCk8Jlc7RLhJunidrYZbApJ0ooYRiVMcKu6PY2GvI2/hHkfpMmmnhWUXmmIpcziWQCZAc5xx+5Seud+vvOp5+bvAM10Re1wsU+6lK8lIdSYej4Fy8LZqoX7NkCQjFeH4EVRFghhiZHZQZtBX1qqCiVe6IVqmYtCNYX7dER5VCjK9kye/WzRv41mV8U7PCyavhE0LdgDKK/uGkyAn62CZa0dvwNQ+adpPF+5uMh5UxCvs1E25cVGkOk2jWcUcQOIEDWRD4Jn2073LEYAiVKGKNzI92C7bWiaihIQg5P3Wo1lXS3PPfZ3fKvkgYf+Vju/y6zPcxkfbGngm8m39EaypGy71UJ7vj01w038NAUxEYIS0vZFB2lWDNFxwVAHN1uh831FzyyxBPQb5UaUfecbPq5RXeoquyd5Omy8oRWDvpaAIPsttvKFebxZox0sMBPn3GQWtmq8dNIAvmi2SPLROHl1VstmG9yfbPAza7Iq8Ape2siidl64M/hpFcYXBWssGMzPYjXVp+924XKx6bzImxnc8on8qOoyQFOxftEHjpkLNDvrxYSiqoK3TDNZToiTh6qClqxMkOkJZgOfOQjD41hbyzu7gWBxfIf4="
|
||||
|
@ -29,6 +29,8 @@ import de.bixilon.kutil.collections.CollectionUtil.toSynchronizedSet
|
||||
import de.bixilon.kutil.concurrent.pool.DefaultThreadPool
|
||||
import de.bixilon.kutil.concurrent.pool.runnable.ForcePooledRunnable
|
||||
import de.bixilon.kutil.concurrent.schedule.TaskScheduler
|
||||
import de.bixilon.kutil.concurrent.worker.task.TaskWorker
|
||||
import de.bixilon.kutil.concurrent.worker.task.WorkerTask
|
||||
import de.bixilon.kutil.primitive.BooleanUtil.decide
|
||||
import de.bixilon.kutil.primitive.DoubleUtil
|
||||
import de.bixilon.kutil.primitive.DoubleUtil.matches
|
||||
@ -355,4 +357,9 @@ object KUtil {
|
||||
stream.close()
|
||||
println("Packet dumped to $path")
|
||||
}
|
||||
|
||||
@Deprecated("kutil 1.25")
|
||||
fun TaskWorker.minusAssign(identifier: Any) {
|
||||
this::class.java.getDeclaredField("tasks").apply { isAccessible = true }.get(this).unsafeCast<MutableMap<Any, WorkerTask>>().remove(identifier)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user