sparqlGraphLibrary/src/test/java/com/ge/research/semtk/query/rdb/test/HiveConnectorTest_IT.java
@Test
	public void testMissingUser() {
		
		// null user
		boolean thrown = false;
		try {
			new HiveConnector("nonexistenthost", 152, "nonexistentdatabase", null, "pw"); // null user
		} catch (Exception e) {
			thrown = true;
			assert(e.getMessage().indexOf("user") != -1);	// confirm useful error message
		}
		assertTrue(thrown);	
		
		// empty user
		thrown = false;
		try {
			new HiveConnector("nonexistenthost", 152, "nonexistentdatabase", " ", "pw"); // empty user
		} catch (Exception e) {
			thrown = true;
			assert(e.getMessage().indexOf("user") != -1);	// confirm useful error message
		}
		assertTrue(thrown);	
	}
/**
	 * Test that we get a meaningful message when the user is null or empty
	 */
Test that we get a meaningful message when the user is null or empty
Test that we get a meaningful message when the user is null or empty
@Test
	public void testMissingUser() {
		boolean thrown = false;
		try {
			new HiveConnector("nonexistenthost", 152, "nonexistentdatabase", null, "pw"); 
		} catch (Exception e) {
			thrown = true;
			assert(e.getMessage().indexOf("user") != -1);	
		}
		assertTrue(thrown);	
		thrown = false;
		try {
			new HiveConnector("nonexistenthost", 152, "nonexistentdatabase", " ", "pw"); 
		} catch (Exception e) {
			thrown = true;
			assert(e.getMessage().indexOf("user") != -1);	
		}
		assertTrue(thrown);	
	}
@ Test public void testMissingUser ( ) { boolean thrown = false ; try { new HiveConnector ( "nonexistenthost" , 152 , "nonexistentdatabase" , null , "pw" ) ; } catch ( Exception e ) { thrown = true ; assert ( e . getMessage ( ) . indexOf ( "user" ) != - 1 ) ; } assertTrue ( thrown ) ; thrown = false ; try { new HiveConnector ( "nonexistenthost" , 152 , "nonexistentdatabase" , " " , "pw" ) ; } catch ( Exception e ) { thrown = true ; assert ( e . getMessage ( ) . indexOf ( "user" ) != - 1 ) ; } assertTrue ( thrown ) ; }
Test that we get a meaningful message when the user is null or empty
Test that we get a meaningful message when the user is null or empty
// null user // null user // confirm useful error message // empty user // empty user // confirm useful error message