mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-17 16:15:20 +01:00
Unignored 2 BungeeSystem tests
- Caught a PoolInitializationException in MySQL to throw EnableException properly.
This commit is contained in:
parent
217867ab52
commit
3d65e8c745
@ -11,7 +11,6 @@ import com.djrapitops.plan.system.settings.config.PlanConfig;
|
||||
import com.djrapitops.plan.system.settings.paths.ProxySettings;
|
||||
import com.djrapitops.plan.system.settings.paths.WebserverSettings;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
@ -32,11 +31,11 @@ public class BungeeSystemTest {
|
||||
|
||||
@ClassRule
|
||||
public static TemporaryFolder temporaryFolder = new TemporaryFolder();
|
||||
@ClassRule
|
||||
public static ComponentMocker component = new BungeeComponentMocker(temporaryFolder);
|
||||
|
||||
private final int TEST_PORT_NUMBER = RandomData.randomInt(9005, 9500);
|
||||
|
||||
@Rule
|
||||
public ComponentMocker component = new BungeeComponentMocker(temporaryFolder);
|
||||
@Rule
|
||||
public ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@ -58,7 +57,6 @@ public class BungeeSystemTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("First test causes config settings to be wrong")
|
||||
public void bungeeDoesNotEnableWithDefaultIP() throws Exception {
|
||||
thrown.expect(EnableException.class);
|
||||
thrown.expectMessage("IP setting still 0.0.0.0 - Configure AlternativeIP/IP that connects to the Proxy server.");
|
||||
@ -79,10 +77,9 @@ public class BungeeSystemTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("MySQL Driver unavailable for some reason.")
|
||||
public void testEnableNoMySQL() throws EnableException {
|
||||
thrown.expect(EnableException.class);
|
||||
thrown.expectMessage("Database failed to initialize");
|
||||
thrown.expectMessage("Failed to initialize pool: Communications link failure");
|
||||
|
||||
PlanSystem bungeeSystem = component.getPlanSystem();
|
||||
try {
|
||||
|
@ -32,6 +32,7 @@ import com.djrapitops.plugin.logging.error.ErrorHandler;
|
||||
import com.djrapitops.plugin.task.RunnableFactory;
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import com.zaxxer.hikari.pool.HikariPool;
|
||||
import dagger.Lazy;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@ -108,7 +109,7 @@ public class MySQLDB extends SQLDB {
|
||||
this.dataSource = new HikariDataSource(hikariConfig);
|
||||
|
||||
getConnection();
|
||||
} catch (SQLException e) {
|
||||
} catch (HikariPool.PoolInitializationException | SQLException e) {
|
||||
throw new DBInitException("Failed to set-up HikariCP Datasource: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ public class BungeeBukkitConnectionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("Causes next BungeeSystem test to fail")
|
||||
@Ignore("InfoRequestFactory not available via getters")
|
||||
public void testRequest() throws Exception {
|
||||
enable();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user