/**
 * 
 */
package com.github.podd.restlet.integrationtest;

import org.openrdf.OpenRDFException;
import org.restlet.Request;
import org.restlet.Response;
import org.restlet.Restlet;
import org.restlet.data.Status;
import org.restlet.resource.ResourceException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.github.podd.restlet.ApplicationUtils;
import com.github.podd.restlet.PoddWebServiceApplication;

/**
 * Resets an application using ApplicationUtils.setupApplication.
 * 
 * @author Peter Ansell p_ansell@yahoo.com
 * 
 */
public class TestResetResourceImpl extends Restlet
{
    
    private final Logger log = LoggerFactory.getLogger(this.getClass());
    private PoddWebServiceApplication application;
    
    /**
     */
    public TestResetResourceImpl()
    {
        super();
    }
    
    public TestResetResourceImpl(final PoddWebServiceApplication nextApplication)
    {
        this.application = nextApplication;
    }
    
    @Override
    public void handle(final Request request, final Response response)
    {
        super.handle(request, response);
        
        this.log.info("========== Reset called ==========");
        try
        {
            ApplicationUtils.setupApplication(this.application, this.application.getContext());
        }
        catch(final OpenRDFException e)
        {
            this.log.error("Could not reset application", e);
            throw new ResourceException(Status.SERVER_ERROR_INTERNAL, "Could not reset application", e);
        }
        this.log.info("========== Reset complete ==========");
        
        response.setStatus(Status.SUCCESS_NO_CONTENT);
    }
    
}

@@ -84,32 +84,79 @@
 enRDFException;%0A
+import org.openrdf.model.impl.LinkedHashModel;%0A
 import org.restl
@@ -1225,32 +1225,197 @@
   try%0A        %7B%0A
+            // Reset the aliases configuration to that it will be regenerated each time%0A            this.application.setAliasesConfiguration(new LinkedHashModel());%0A
             Appl

Reset the aliases configuration to an empty model so it will be regenerated each time