import org.codehaus.plexus.registry.Registry;
import org.codehaus.plexus.registry.RegistryException;
import org.codehaus.plexus.registry.RegistryListener;
-import org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry;
import org.codehaus.plexus.util.StringUtils;
import java.io.File;
}
else if ( registry.getSection( KEY + ".base" ) != null )
{
+ this.configuration = null;
+
throw new IndeterminateConfigurationException(
"Configuration can not be saved when it is loaded from two sources" );
}
try
{
- ( (CommonsConfigurationRegistry) registry ).initialize();
+ ( (Initializable) registry ).initialize();
}
catch ( InitializationException e )
{
ArchivaConfiguration archivaConfiguration =
(ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" );
- Configuration configuration = new Configuration();
- configuration.setWebapp( new WebappConfiguration() );
- configuration.getWebapp().setUi( new UserInterfaceOptions() );
+ Configuration configuration = archivaConfiguration.getConfiguration();
+ assertTrue( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
+
configuration.getWebapp().getUi().setAppletFindEnabled( false );
try
}
catch ( IndeterminateConfigurationException e )
{
- assertTrue( true );
+ // check it was reverted
+ configuration = archivaConfiguration.getConfiguration();
+ assertTrue( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
}
}