package com.voodoodyne.gstrap.gae.test;

import com.voodoodyne.gstrap.test.util.TestInfoContextAdapter;
import org.junit.jupiter.api.extension.AfterEachCallback;
import org.junit.jupiter.api.extension.BeforeEachCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.ExtensionContext.Namespace;

/**
 */
public class GAEExtension implements BeforeEachCallback, AfterEachCallback {

	private static final Namespace NAMESPACE = Namespace.create(GAEExtension.class);

	@Override
	public void beforeEach(final ExtensionContext context) throws Exception {
		final GAEHelper helper = new GAEHelper();

		context.getStore(NAMESPACE).put(GAEHelper.class, helper);

		helper.setUp(new TestInfoContextAdapter(context));
	}

	@Override
	public void afterEach(final ExtensionContext context) throws Exception {
		final GAEHelper helper = context.getStore(NAMESPACE).get(GAEHelper.class, GAEHelper.class);
		helper.tearDown();
	}
}

@@ -337,16 +337,79 @@
 mespace;
+%0Aimport org.junit.jupiter.api.extension.ExtensionContext.Store;
 %0A%0A/**%0A *
@@ -576,167 +576,687 @@
 ;%0A%0A%09
-@Override%0A%09public void beforeEach(final ExtensionContext context) throws Exception %7B%0A%09%09final GAEHelper helper = new GAEHelper();%0A%0A%09%09context.getStore(NAMESPACE)
+/** Key in the store for the queue xml path. If not set, the maven default is used. */%0A%09private static final String QUEUE_XML_PATH = %22queueXmlPath%22;%0A%0A%09/** Optionally override the queue xml path for the GAEHelper */%0A%09public static void setQueueXmlPath(final ExtensionContext context, final String path) %7B%0A%09%09context.getStore(NAMESPACE).put(QUEUE_XML_PATH, path);%0A%09%7D%0A%0A%09@Override%0A%09public void beforeEach(final ExtensionContext context) throws Exception %7B%0A%09%09final Store store = context.getStore(NAMESPACE);%0A%09%09final String queueXmlPath = store.get(QUEUE_XML_PATH, String.class);%0A%0A%09%09final GAEHelper helper = queueXmlPath == null ? new GAEHelper() : new GAEHelper(queueXmlPath);%0A%0A%09%09store
 .put

Allow queue xml path to be set by prior extensions