package eu.stratuslab.marketplace.server.resources;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertThat;

import java.util.Map;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.restlet.Request;
import org.restlet.Response;
import org.restlet.data.Form;
import org.restlet.data.MediaType;
import org.restlet.data.Status;
import org.restlet.resource.ClientResource;
import org.restlet.resource.ServerResource;
import org.restlet.Client;
import org.restlet.data.Protocol;
import org.restlet.data.Method;
import org.restlet.representation.StringRepresentation;
import org.restlet.data.MediaType;


import eu.stratuslab.marketplace.server.resources.AboutResource;
import eu.stratuslab.marketplace.server.MarketPlaceApplication;

import eu.stratuslab.marketplace.server.util.ResourceTestBase;

import org.restlet.Component;
import org.restlet.Context;
import org.restlet.data.Protocol;
import org.restlet.Application;

public class AboutResourceTest extends ResourceTestBase {
	
	Application application;
	/*
	@Before
	public void setUp() throws Exception {
		// Create a new Component.
        Component component = new Component();
		application = new MarketPlaceApplication("memory");
		component.getDefaultHost().attach("/", application);
		component.getClients().add(Protocol.CLAP);
		application.setContext(component.getDefaultHost().getContext());
		application.createInboundRoot();
	}
	
	@After
	public void tearDown() throws Exception {
		application.stop();
	}*/
	
	@Test
	public void getAbout() throws Exception {
		Request request = createGetRequest("test", "test");
		Response response = executeRequest(request);

		assertThat(response.getStatus(), is(Status.SUCCESS_OK));
	}
	
	private Request createGetRequest(String key, String value)
	throws Exception {
		Map<String, Object> attributes = createAttributes(key, value);
		Request request = createGetRequest(attributes);
		return request;
	}
	
	private Response executeRequest(Request request) {
		//ServerResource about = new AboutResource();
		//about.setApplication(application);
		return executeRequest(request, new AboutResource());
	}
		
}

@@ -1171,475 +1171,8 @@
 n;%0A%09
-/*%0A%09@Before%0A%09public void setUp() throws Exception %7B%0A%09%09// Create a new Component.%0A        Component component = new Component();%0A%09%09application = new MarketPlaceApplication(%22memory%22);%0A%09%09component.getDefaultHost().attach(%22/%22, application);%0A%09%09component.getClients().add(Protocol.CLAP);%0A%09%09application.setContext(component.getDefaultHost().getContext());%0A%09%09application.createInboundRoot();%0A%09%7D%0A%09%0A%09@After%0A%09public void tearDown() throws Exception %7B%0A%09%09application.stop();%0A%09%7D*/%0A
 %09%0A%09@
@@ -1659,95 +1659,8 @@
 ) %7B%0A
-%09%09//ServerResource about = new AboutResource();%0A%09%09//about.setApplication(application);%0A
 %09%09re

Clean up test