1   package com.powerset.heritrix.writer.test;
2   
3   import org.testng.Assert;
4   import org.testng.annotations.BeforeClass;
5   import org.testng.annotations.Test;
6   
7   import com.powerset.heritrix.writer.HBaseWriterPool;
8   
9   // TODO: Auto-generated Javadoc
10  /**
11   * The Class TestHBaseWriterPool.
12   */
13  public class TestHBaseWriterPool {
14  	
15  	/** The master. */
16  	String master = "locahost";
17  	
18  	/** The table. */
19  	String table = "test";
20  	
21  	/** The pool maximum active. */
22  	int poolMaximumActive = 10;
23  	
24  	/** The pool maximum wait. */
25  	int poolMaximumWait = 20;
26  
27  	/** The hwp. */
28  	HBaseWriterPool hwp;
29  
30  	/**
31  	 * Creates the h base writer pool.
32  	 */
33  	@BeforeClass()
34  	public void createHBaseWriterPool() {
35  		hwp = new HBaseWriterPool(master, table, poolMaximumActive,
36  				poolMaximumWait);
37  	}
38  
39  	/**
40  	 * Test h base writer pool integrity.
41  	 */
42  	@Test()
43  	public void testHBaseWriterPoolIntegrity() {
44  		Assert.assertNotNull(hwp);
45  		Assert.assertEquals(hwp.getNumActive(), 0);
46  		Assert.assertEquals(hwp.getNumIdle(), 0);
47  		Assert.assertEquals(hwp.getSerialNo().intValue(), 0);
48  		Assert.assertFalse(hwp.getSettings().isCompressed());
49  		Assert.assertNull(hwp.getSettings().getPrefix());
50  		Assert.assertNull(hwp.getSettings().getSuffix());
51  	}
52  }