package eu.dnetlib.data.hadoop.utils;

import static org.junit.Assert.assertNotNull;

import java.io.IOException;
import java.util.Map.Entry;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.mapreduce.CopyTable;
import org.apache.hadoop.mapreduce.Job;
import org.junit.Test;

public class CopyTableTest {

	@Test
	public void testCopyTable() throws IOException {

		Job job =
				CopyTable.createSubmittableJob(new Configuration(), new String[] { "--peer.adr=server1,server2,server3:2181:/hbase",
					"--families=myOldCf:myNewCf,cf2,cf3", "tableName" });
		assertNotNull(job);

		Configuration conf = job.getConfiguration();

		for (Entry<String, String> e : conf) {
			System.out.println(String.format("<PROPERTY key=\"%s\" value=\"%s\"/>", e.getKey(), e.getValue()));
		}

	}
}
