package org.eclipse.scanning.test.event.queues;

import java.net.URI;
import java.net.URISyntaxException;

import org.eclipse.dawnsci.json.MarshallerService;
import org.eclipse.scanning.api.event.queues.IQueueService;
import org.eclipse.scanning.api.event.queues.beans.QueueAtom;
import org.eclipse.scanning.api.event.queues.beans.QueueBean;
import org.eclipse.scanning.event.EventServiceImpl;
import org.eclipse.scanning.event.queues.AtomQueueService;
import org.eclipse.scanning.test.event.queues.mocks.AllBeanQueueProcessCreator;
import org.junit.Before;
import org.junit.BeforeClass;

import uk.ac.diamond.daq.activemq.connector.ActivemqConnectorService;

/**
 * Test of the concrete implementation {@link AtomQueueService} of the {@link IQueueService}.
 * Tests located in {@link AbstractQueueServiceTest}.
 * @author wnm24546
 *
 */
public class AtomQueueServiceDummyTest extends AbstractQueueServiceTest {
	
	@Before
	public void createService() throws Exception {
		//Configure AtomQueueService as necessary before setting the test field
		AtomQueueService localQServ = new AtomQueueService();
		localQServ.setQueueRoot(qRoot);
		localQServ.setURI(uri);
		ActivemqConnectorService.setJsonMarshaller(new MarshallerService());
		localQServ.setEventService(new EventServiceImpl(new ActivemqConnectorService()));
		
		qServ = localQServ;
		
		//Reset the IQueueService generic process creator
		qServ.setJobQueueProcessor(new AllBeanQueueProcessCreator<QueueBean>(true));
		qServ.setActiveQueueProcessor(new AllBeanQueueProcessCreator<QueueAtom>(true));
		
		//All set? Let's go!
		qServ.init();
	}

}

@@ -46,66 +46,8 @@
 s;%0A%0A
-import java.net.URI;%0Aimport java.net.URISyntaxException;%0A%0A
 impo
@@ -380,32 +380,94 @@
 omQueueService;%0A
+import org.eclipse.scanning.event.queues.QueueServicesHolder;%0A
 import org.eclip
@@ -558,38 +558,8 @@
 ore;
-%0Aimport org.junit.BeforeClass;
 %0A%0Aim
@@ -947,193 +947,28 @@
 %09%09//
-Configure AtomQueueService as necessary before setting the test field%0A%09%09AtomQueueService localQServ = new AtomQueueService();%0A%09%09localQServ.setQueueRoot(qRoot);%0A%09%09localQServ.setURI(uri);
+Set up IEventService
 %0A%09%09A
@@ -1037,26 +1037,35 @@
 e());%0A%09%09
-localQServ
+QueueServicesHolder
 .setEven
@@ -1137,26 +1137,110 @@
 %09%0A%09%09
-qServ = localQServ
+//Create QueueService with 2 argument constructor for tests%0A%09%09qServ = new AtomQueueService(qRoot, uri)
 ;%0A%09%09

Change EventService setting to use the QueueServiceHolder and instantiate with a new two argument test constructor.