// Path: rjb-blog-multitenancy-extras/src/test/java/com/rjb/blog/multitenancy/test/config/TestContextConfig.java
// public class TestTenantResolver implements TenantResolver {
// 
// 	private String tenantId;
// 
// 	@Override
// 	public String getTenantId() {
// 		return this.tenantId;
// 	}
// 
// 	/**
// 	 * We support manual set for tests.
// 	 * 
// 	 * @param tenantId
// 	 */
// 	public void setTenantId(String tenantId) {
// 		this.tenantId = tenantId;
// 	}
// }
// 
// Path: rjb-blog-multitenancy-starter/src/test/java/com/rjb/blog/multitenancy/test/config/TestEnvironment.java
// public interface TestEnvironment {
// 
// 	void initialize() throws Exception;
// 
// 	void destroy() throws Exception;
// 
// }
// 
// Path: rjb-blog-multitenancy-starter/src/main/java/com/rjb/blog/multitenancy/util/StringUtil.java
// public class StringUtil {
// 
// 	public static boolean isEmpty(String s) {
// 		return s == null || s.isEmpty();
// 	}
// 
// 	public static String[] split(String s, String quote) {
// 		return split(s, quote, true);
// 	}
// 
// 	public static String[] split(String s, String quote, boolean trim) {
// 		String[] returnVal = s.split(Pattern.quote(quote));
// 		if (!trim)
// 			return returnVal;
// 		for (int i = 0; i < returnVal.length; i++) {
// 			returnVal[i] = returnVal[i].trim();
// 		}
// 		return returnVal;
// 	}
// }


import java.io.InputStream;
import java.util.Properties;
import javax.inject.Inject;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.rules.TestName;
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.transaction.BeforeTransaction;
import org.springframework.transaction.annotation.Transactional;
import com.rjb.blog.multitenancy.test.config.TestContextConfig.TestTenantResolver;
import com.rjb.blog.multitenancy.test.config.TestEnvironment;
import com.rjb.blog.multitenancy.util.StringUtil;

package com.rjb.blog.multitenancy.test;





/**
 * 
 * A base class for tests that:
 * <ul>
 * <li>Run in a transaction w/ default rollback.</li>
 * <li>Run with {@link SpringJUnit4ClassRunner}.</li>
 * <li>Provide an optional {@link TestEnvironment} class name in the
 * {@value #TEST_PROPERTIES_CLASSPATH_FILE} file under the key
 * {@value #TEST_ENVIRONMENT_CLASSNAME}. The environment is initialized
 * {@link BeforeClass @BeforeClass} (i.e. before Spring context initialization)
 * and destroyed {@link AfterClass @AfterClass}.</li>
 * </ul>
 *
 */
@Transactional
@RunWith(SpringJUnit4ClassRunner.class)
public class AbstractTest {

	public static final String TEST_PROPERTIES_CLASSPATH_FILE = "/env.properties";

	public static final String TEST_ENVIRONMENT_CLASSNAME = "test.environment.className";

	protected static TestEnvironment testEnvironment;

	@Inject
	protected TestTenantResolver tenantResolver;

	@Rule
	public TestName testName = new TestName();

	@BeforeClass

// Path: rjb-blog-multitenancy-extras/src/test/java/com/rjb/blog/multitenancy/test/config/TestContextConfig.java
// public class TestTenantResolver implements TenantResolver {
// 
// 	private String tenantId;
// 
// 	@Override
// 	public String getTenantId() {
// 		return this.tenantId;
// 	}
// 
// 	/**
// 	 * We support manual set for tests.
// 	 * 
// 	 * @param tenantId
// 	 */
// 	public void setTenantId(String tenantId) {
// 		this.tenantId = tenantId;
// 	}
// }
// 
// Path: rjb-blog-multitenancy-starter/src/test/java/com/rjb/blog/multitenancy/test/config/TestEnvironment.java
// public interface TestEnvironment {
// 
// 	void initialize() throws Exception;
// 
// 	void destroy() throws Exception;
// 
// }
// 
// Path: rjb-blog-multitenancy-starter/src/main/java/com/rjb/blog/multitenancy/util/StringUtil.java
// public class StringUtil {
// 
// 	public static boolean isEmpty(String s) {
// 		return s == null || s.isEmpty();
// 	}
// 
// 	public static String[] split(String s, String quote) {
// 		return split(s, quote, true);
// 	}
// 
// 	public static String[] split(String s, String quote, boolean trim) {
// 		String[] returnVal = s.split(Pattern.quote(quote));
// 		if (!trim)
// 			return returnVal;
// 		for (int i = 0; i < returnVal.length; i++) {
// 			returnVal[i] = returnVal[i].trim();
// 		}
// 		return returnVal;
// 	}
// }


// Path: rjb-blog-multitenancy-extras/src/test/java/com/rjb/blog/multitenancy/test/AbstractTest.java
import java.io.InputStream;
import java.util.Properties;
import javax.inject.Inject;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.rules.TestName;
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.transaction.BeforeTransaction;
import org.springframework.transaction.annotation.Transactional;
import com.rjb.blog.multitenancy.test.config.TestContextConfig.TestTenantResolver;
import com.rjb.blog.multitenancy.test.config.TestEnvironment;
import com.rjb.blog.multitenancy.util.StringUtil;

package com.rjb.blog.multitenancy.test;





/**
 * 
 * A base class for tests that:
 * <ul>
 * <li>Run in a transaction w/ default rollback.</li>
 * <li>Run with {@link SpringJUnit4ClassRunner}.</li>
 * <li>Provide an optional {@link TestEnvironment} class name in the
 * {@value #TEST_PROPERTIES_CLASSPATH_FILE} file under the key
 * {@value #TEST_ENVIRONMENT_CLASSNAME}. The environment is initialized
 * {@link BeforeClass @BeforeClass} (i.e. before Spring context initialization)
 * and destroyed {@link AfterClass @AfterClass}.</li>
 * </ul>
 *
 */
@Transactional
@RunWith(SpringJUnit4ClassRunner.class)
public class AbstractTest {

	public static final String TEST_PROPERTIES_CLASSPATH_FILE = "/env.properties";

	public static final String TEST_ENVIRONMENT_CLASSNAME = "test.environment.className";

	protected static TestEnvironment testEnvironment;

	@Inject
	protected TestTenantResolver tenantResolver;

	@Rule
	public TestName testName = new TestName();

	@BeforeClass

	public static void beforeClass() {
