@@ -0,0 +1,3205 @@
+/*%0A * Copyright (c) 2012-2014 The original author or authors%0A * ------------------------------------------------------%0A * All rights reserved. This program and the accompanying materials%0A * are made available under the terms of the Eclipse Public License v1.0%0A * and Apache License v2.0 which accompanies this distribution.%0A *%0A * The Eclipse Public License is available at%0A * http://www.eclipse.org/legal/epl-v10.html%0A *%0A * The Apache License v2.0 is available at%0A * http://www.opensource.org/licenses/apache2.0.php%0A *%0A * You may elect to redistribute this code under either of these licenses.%0A */%0Apackage org.eclipse.moquette.server;%0A%0Aimport org.fusesource.mqtt.client.*;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.util.Iterator;%0Aimport java.util.Map;%0Aimport java.util.Properties;%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport static org.eclipse.moquette.commons.Constants.PERSISTENT_STORE_PROPERTY_NAME;%0Aimport static org.eclipse.moquette.commons.Constants.AUTHENTICATOR_CLASS_NAME;%0Aimport static org.eclipse.moquette.commons.Constants.AUTHORIZATOR_CLASS_NAME;%0Aimport org.eclipse.moquette.spi.impl.security.IAuthenticator;%0Aimport org.eclipse.moquette.spi.impl.security.IAuthorizator;%0A%0Aimport static org.junit.Assert.*;%0A%0A/**%0A *%0A * @author luca %3Cluca.capra@create-net.org%3E %0A */%0Apublic class ConfigurationClassLoaderTest implements IAuthenticator, IAuthorizator %7B%0A    private static final Logger LOG = LoggerFactory.getLogger(ConfigurationClassLoaderTest.class);%0A%0A    Server m_server;%0A    MQTT m_mqtt;%0A    BlockingConnection m_subscriber;%0A    BlockingConnection m_publisher;%0A    %0A    protected void startServer(Properties props) throws IOException %7B%0A        m_server = new Server();        %0A        m_server.startServer(props);%0A    %7D%0A%0A%0A    @After%0A    public void tearDown() throws Exception %7B%0A        m_server.stopServer();%0A        File dbFile = new File(m_server.getProperties().getProperty(PERSISTENT_STORE_PROPERTY_NAME));%0A        if (dbFile.exists()) %7B%0A            dbFile.delete();%0A        %7D%0A    %7D%0A    %0A    @Test%0A    public void loadAuthenticator() throws Exception %7B%0A        Properties props = new Properties(IntegrationUtils.prepareTestPropeties());%0A        props.setProperty(AUTHENTICATOR_CLASS_NAME, %22org.eclipse.moquette.server.ConfigurationClassLoaderTest%22);%0A        startServer(props);%0A        assertTrue(true);%0A        m_server.stopServer();%0A    %7D%0A    %0A    @Test%0A    public void loadAuthorizator() throws Exception %7B%0A        Properties props = new Properties(IntegrationUtils.prepareTestPropeties());%0A        props.setProperty(AUTHORIZATOR_CLASS_NAME, %22org.eclipse.moquette.server.ConfigurationClassLoaderTest%22);%0A        startServer(props);%0A        assertTrue(true);%0A        m_server.stopServer();%0A    %7D%0A%0A    @Override%0A    public boolean checkValid(String username, String password) %7B%0A        return true;%0A    %7D%0A%0A    @Override%0A    public boolean canWrite(String topic, String user, String client) %7B%0A        return true;%0A    %7D%0A%0A    @Override%0A    public boolean canRead(String topic, String user, String client) %7B%0A        return true;%0A    %7D%0A    %0A%7D%0A

add classloader tests