package org.powertac.factoredcustomer;

import org.apache.commons.configuration.CompositeConfiguration;
import org.apache.commons.configuration.XMLConfiguration;
import org.powertac.common.config.Configurator;
import org.powertac.common.interfaces.ServerConfiguration;

import java.net.URL;
import java.util.Collection;
import java.util.List;


class DummyConfig implements ServerConfiguration
{
  private Configurator configurator;

  DummyConfig ()
  {
    super();
  }

  void initialize ()
  {
    configurator = new Configurator();
    CompositeConfiguration config = new CompositeConfiguration();

    String[] names = {"test-properties.xml", "BrooksideHomes.xml",
        "FrostyStorage.xml", "MedicalCenter.xml", "WindmillCoOp.xml"};

    try {
      for (String name : names) {
        ClassLoader classLoader = getClass().getClassLoader();
        URL url = classLoader.getResource("config/" + name);
        XMLConfiguration xconfig = new XMLConfiguration(url);
        config.addConfiguration(xconfig);
      }
      configurator.setConfiguration(config);
    }
    catch (Exception e) {
      System.out.println("Error loading configuration: " + e.toString());
    }
  }

  @Override
  public void configureMe (Object target)
  {
    configurator.configureSingleton(target);
  }

  @Override
  public Collection<?> configureInstances (Class<?> target)
  {
    return configurator.configureInstances(target);
  }

  @Override
  public void publishConfiguration (Object target)
  {
    // TODO Auto-generated method stub

  }

  @Override
  public void saveBootstrapState (Object thing)
  {
    // TODO Auto-generated method stub

  }

  @Override
  public Collection<?> configureNamedInstances (List<?> instances)
  {
    // Auto-generated method stub
    return null;
  }
}

@@ -72,16 +72,17 @@
 guration
+2
 .Composi
@@ -102,66 +102,8 @@
 on;%0A
-import org.apache.commons.configuration.XMLConfiguration;%0A
 impo
@@ -210,29 +210,8 @@
 n;%0A%0A
-import java.net.URL;%0A
 impo
@@ -714,225 +714,70 @@
     
-ClassLoader classLoader = getClass().getClassLoader();%0A        URL url = classLoader.getResource(%22config/%22 + name);%0A        XMLConfiguration xconfig = new XMLConfiguration(url);%0A        config.addConfiguration(xconfig
+config.addConfiguration(Configurator.readXML(%22config/%22 + name)
 );%0A 

Upgrade dependencies