sparqlGraphLibrary/src/test/java/com/ge/research/semtk/belmont/test/NodeGroupTest_IT.java
private void inflateAndValidate(NodeGroup ng, ImportSpec importSpec, String [] expectErrors, NodeGroupItemStr [] expectItems, String [] expectWarnings) throws Exception {
		ArrayList<String> modelErrMsgs = new ArrayList<String>();
		ArrayList<NodeGroupItemStr> invalidItems = new  ArrayList<NodeGroupItemStr>();
		ArrayList<String> warnings = new ArrayList<String>();

		ng.inflateAndValidate(oInfo, importSpec, modelErrMsgs, invalidItems, warnings);
		
		assertEquals("wrong number of error messages\n" + String.join(",", modelErrMsgs) + "\n", expectErrors.length, modelErrMsgs.size());
		assertEquals("wrong number of invalid items", expectItems.length, invalidItems.size());
		assertEquals("wrong number of warnings\n" + String.join(",", warnings)+ "\n", expectWarnings.length, warnings.size());
		
		for (String expectErr : expectErrors) {
			boolean found = false;
			for (String modelErr : modelErrMsgs) {
				if (modelErr.contains(expectErr)) {
					found = true;
				}
			}
			assertTrue("Expected error was not generated: " + expectErr, found);
		}
		
		for (NodeGroupItemStr expectItem : expectItems) {
			boolean found = false;
			for (NodeGroupItemStr modelItem : invalidItems) {
				if (modelItem.getStr().equals(expectItem.getStr())) {
					found = true;
				}
			}
			assertTrue("Expected error item was not generated: " + expectItem.getStr(), found);
		}
		
		for (String expectWarn : expectWarnings) {
			boolean found = false;
			for (String w : warnings) {
				if (w.contains(expectWarn)) {
					found = true;
				}
			}
			assertTrue("Expected warning was not generated: " + expectWarn, found);
		}
		
	}
/*
	 * Helper to run inflate and Validate and check expected results
	 */
Helper to run inflate and Validate and check expected results
Helper to run inflate and Validate and check expected results
private void inflateAndValidate(NodeGroup ng, ImportSpec importSpec, String [] expectErrors, NodeGroupItemStr [] expectItems, String [] expectWarnings) throws Exception {
		ArrayList<String> modelErrMsgs = new ArrayList<String>();
		ArrayList<NodeGroupItemStr> invalidItems = new  ArrayList<NodeGroupItemStr>();
		ArrayList<String> warnings = new ArrayList<String>();
		ng.inflateAndValidate(oInfo, importSpec, modelErrMsgs, invalidItems, warnings);
		assertEquals("wrong number of error messages\n" + String.join(",", modelErrMsgs) + "\n", expectErrors.length, modelErrMsgs.size());
		assertEquals("wrong number of invalid items", expectItems.length, invalidItems.size());
		assertEquals("wrong number of warnings\n" + String.join(",", warnings)+ "\n", expectWarnings.length, warnings.size());
		for (String expectErr : expectErrors) {
			boolean found = false;
			for (String modelErr : modelErrMsgs) {
				if (modelErr.contains(expectErr)) {
					found = true;
				}
			}
			assertTrue("Expected error was not generated: " + expectErr, found);
		}
		for (NodeGroupItemStr expectItem : expectItems) {
			boolean found = false;
			for (NodeGroupItemStr modelItem : invalidItems) {
				if (modelItem.getStr().equals(expectItem.getStr())) {
					found = true;
				}
			}
			assertTrue("Expected error item was not generated: " + expectItem.getStr(), found);
		}
		for (String expectWarn : expectWarnings) {
			boolean found = false;
			for (String w : warnings) {
				if (w.contains(expectWarn)) {
					found = true;
				}
			}
			assertTrue("Expected warning was not generated: " + expectWarn, found);
		}
	}
private void inflateAndValidate ( NodeGroup ng , ImportSpec importSpec , String [ ] expectErrors , NodeGroupItemStr [ ] expectItems , String [ ] expectWarnings ) throws Exception { ArrayList < String > modelErrMsgs = new ArrayList < String > ( ) ; ArrayList < NodeGroupItemStr > invalidItems = new ArrayList < NodeGroupItemStr > ( ) ; ArrayList < String > warnings = new ArrayList < String > ( ) ; ng . inflateAndValidate ( oInfo , importSpec , modelErrMsgs , invalidItems , warnings ) ; assertEquals ( "wrong number of error messages\n" + String . join ( "," , modelErrMsgs ) + "\n" , expectErrors . length , modelErrMsgs . size ( ) ) ; assertEquals ( "wrong number of invalid items" , expectItems . length , invalidItems . size ( ) ) ; assertEquals ( "wrong number of warnings\n" + String . join ( "," , warnings ) + "\n" , expectWarnings . length , warnings . size ( ) ) ; for ( String expectErr : expectErrors ) { boolean found = false ; for ( String modelErr : modelErrMsgs ) { if ( modelErr . contains ( expectErr ) ) { found = true ; } } assertTrue ( "Expected error was not generated: " + expectErr , found ) ; } for ( NodeGroupItemStr expectItem : expectItems ) { boolean found = false ; for ( NodeGroupItemStr modelItem : invalidItems ) { if ( modelItem . getStr ( ) . equals ( expectItem . getStr ( ) ) ) { found = true ; } } assertTrue ( "Expected error item was not generated: " + expectItem . getStr ( ) , found ) ; } for ( String expectWarn : expectWarnings ) { boolean found = false ; for ( String w : warnings ) { if ( w . contains ( expectWarn ) ) { found = true ; } } assertTrue ( "Expected warning was not generated: " + expectWarn , found ) ; } }
Helper to run inflate and Validate and check expected results
Helper to run inflate and Validate and check expected results