1   package com.powerset.heritrix.writer.test;
2   
3   import java.io.IOException;
4   
5   import org.testng.Assert;
6   import org.testng.annotations.Test;
7   
8   import com.powerset.heritrix.writer.HBaseWriter;
9   
10  // TODO: Auto-generated Javadoc
11  /**
12   * The Class TestHBaseWriter.
13   */
14  public class TestHBaseWriter {
15  	
16  	/** The master. */
17  	String master = "localhost:60000";
18  	
19  	/** The table. */
20  	String table = "test";
21  	
22  	/** The pool maximum active. */
23  	int poolMaximumActive = 10;
24  	
25  	/** The pool maximum wait. */
26  	int poolMaximumWait = 20;
27  
28  	/** The hw. */
29  	HBaseWriter hw;
30  
31  	/**
32  	 * Test that bad table values cannot be used when creating an instance of
33  	 * HbaseWriter.
34  	 * 
35  	 * @throws IOException Signals that an I/O exception has occurred.
36  	 */
37  	@Test()
38  	public void testCreateHBaseWriter() throws IOException {
39  		// Test
40  		try {
41  			hw = new HBaseWriter(master, null);
42  			Assert.assertNull(hw);
43  		} catch (IllegalArgumentException e) {
44  			Assert.assertNotNull(e);
45  		}
46  
47  		try {
48  			hw = new HBaseWriter(master, "");
49  			Assert.assertNull(hw);
50  		} catch (IllegalArgumentException e) {
51  			Assert.assertNotNull(e);
52  		}
53  
54  	}
55  }