All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lordofthejars.nosqlunit.hbase.EmbeddedHBase Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package com.lordofthejars.nosqlunit.hbase;

import org.junit.rules.ExternalResource;

public class EmbeddedHBase extends ExternalResource {

	private EmbeddedHBase() {
		super();
	}
	
	protected EmbeddedHBaseLifecycleManager embeddedHBaseLifecycleManager;
	
	public static class EmbeddedHBaseRuleBuilder {

		private EmbeddedHBaseLifecycleManager embeddedHBaseLifecycleManager;

		private EmbeddedHBaseRuleBuilder() {
			this.embeddedHBaseLifecycleManager = new EmbeddedHBaseLifecycleManager();
		}

		public static EmbeddedHBaseRuleBuilder newEmbeddedHBaseRule() {
			return new EmbeddedHBaseRuleBuilder();
		}

		public EmbeddedHBaseRuleBuilder dirPermissions(String permission) {
			this.embeddedHBaseLifecycleManager.setFilePermissions(permission);
			return this;
		}

		public EmbeddedHBase build() {
			
			EmbeddedHBase embeddedHBase = new EmbeddedHBase();
			embeddedHBase.embeddedHBaseLifecycleManager = this.embeddedHBaseLifecycleManager;
			return embeddedHBase;
		}

	}

	@Override
	protected void before() throws Throwable {
		this.embeddedHBaseLifecycleManager.startEngine();
	}

	@Override
	protected void after() {
		this.embeddedHBaseLifecycleManager.stopEngine();
	}
	
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy