/*
* Copyright (C) 2011-2014 CodingCrayons s.r.o.
* All rights reserved.
* Contact: CodingCrayons s.r.o. (info@codingcrayons.com)
*
* This file is part of AspectFaces.
*
* AspectFaces 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.
*
* Foobar 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 Foobar. If not, see <http://www.gnu.org/licenses/>.
*/
package com.codingcrayons.aspectfaces;
import java.net.URL;
import com.codingcrayons.aspectfaces.configuration.Configuration;
import com.codingcrayons.aspectfaces.configuration.ConfigurationStorage;
import com.codingcrayons.aspectfaces.plugins.j2ee.configuration.ServerConfiguration;
import org.testng.annotations.Test;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.fail;
public class AFWeaverTest {
@Test
public void testAddConfigurationByUrl() {
try {
String name = "config";
Configuration configuration = new ServerConfiguration(name, null);
AFWeaver.addConfiguration(configuration, new URL("127.0.0.1"), true, true);
assertNotNull(ConfigurationStorage.getInstance().getConfiguration(name));
} catch (java.net.MalformedURLException e) {
//skip an exception for testing
} catch (Exception e) {
fail("An unexpected exception: " + e.getMessage());
}
}
}