mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-01-03 22:30:31 +03:00
[FIX] StartLaunchServerTest теперь нормально работает.
This commit is contained in:
parent
34e941ddfd
commit
68c06de23e
2 changed files with 12 additions and 3 deletions
|
@ -23,6 +23,7 @@ public NettyServerSocketHandler(LaunchServer server) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
|
if (nettyServer == null) return;
|
||||||
nettyServer.close();
|
nettyServer.close();
|
||||||
nettyServer.service.channels.close();
|
nettyServer.service.channels.close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package pro.gravit.launchserver;
|
package pro.gravit.launchserver;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.AfterAll;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.io.TempDir;
|
import org.junit.jupiter.api.io.TempDir;
|
||||||
|
@ -28,7 +29,7 @@ public class StartLaunchServerTest {
|
||||||
public static LaunchServer launchServer;
|
public static LaunchServer launchServer;
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void prepare() throws Exception {
|
public static void prepare() throws Throwable {
|
||||||
LaunchServerModulesManager modulesManager = new LaunchServerModulesManager(modulesDir, configDir, null);
|
LaunchServerModulesManager modulesManager = new LaunchServerModulesManager(modulesDir, configDir, null);
|
||||||
LaunchServerConfig config = LaunchServerConfig.getDefault(LaunchServer.LaunchServerEnv.TEST);
|
LaunchServerConfig config = LaunchServerConfig.getDefault(LaunchServer.LaunchServerEnv.TEST);
|
||||||
Launcher.gsonManager = new LaunchServerGsonManager(modulesManager);
|
Launcher.gsonManager = new LaunchServerGsonManager(modulesManager);
|
||||||
|
@ -48,12 +49,14 @@ public static void prepare() throws Exception {
|
||||||
.setLaunchServerConfigManager(new LaunchServer.LaunchServerConfigManager() {
|
.setLaunchServerConfigManager(new LaunchServer.LaunchServerConfigManager() {
|
||||||
@Override
|
@Override
|
||||||
public LaunchServerConfig readConfig() {
|
public LaunchServerConfig readConfig() {
|
||||||
return null;
|
return LaunchServerConfig.getDefault(LaunchServer.LaunchServerEnv.TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LaunchServerRuntimeConfig readRuntimeConfig() {
|
public LaunchServerRuntimeConfig readRuntimeConfig() {
|
||||||
return null;
|
LaunchServerRuntimeConfig r = new LaunchServerRuntimeConfig();
|
||||||
|
r.reset();
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -71,6 +74,11 @@ public void writeRuntimeConfig(LaunchServerRuntimeConfig config) {
|
||||||
launchServer = builder.build();
|
launchServer = builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterAll
|
||||||
|
public static void complete() throws Throwable {
|
||||||
|
launchServer.close();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void start() {
|
public void start() {
|
||||||
launchServer.run();
|
launchServer.run();
|
||||||
|
|
Loading…
Reference in a new issue