Commons/src/test/java/eu/univento/commons/CommonsTest.java

63 lines
1.6 KiB
Java

/*
* Copyright (c) 2017 univento.eu - All rights reserved
* You are not allowed to use, distribute or modify this code
*/
package eu.univento.commons;
import eu.univento.commons.database.DatabaseManager;
import eu.univento.commons.security.SecurityHandler;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
/**
* @author joethei
* @version 0.1
*/
public class CommonsTest {
/*
@Test
public void testCommons() {
Commons commons = new Commons();
assertNotNull(commons);
assertNotNull(commons.getDatabaseManager());
assertNotNull(commons.getConfigurationHandler());
assertNotNull(commons.getSecurityHandler());
assertNotNull(commons.getLoggingHandler());
assertNotNull(commons.getSlackHandler());
commons.shutdown();
}
@Test
public void testDatabaseManager() {
Commons commons = new Commons();
DatabaseManager db = commons.getDatabaseManager();
assertNotNull(db.getAsyncMongoDB());
assertNotNull(db.getAsyncMySQL());
assertNotNull(db.getMongoDB());
assertNotNull(db.getMySQL());
commons.shutdown();
}
@Test
public void testSecurityHandler() {
Commons commons = new Commons();
SecurityHandler security = commons.getSecurityHandler();
assertFalse(security.isValidServer(""));
assertFalse(security.isValidServer("8.8.8.8"));
assertTrue(security.isValidServer("79.133.48.84"));
commons.shutdown();
}
*/
}