sparqlGraphLibrary/src/test/java/com/ge/research/semtk/belmont/runtimeConstraints/test/RuntimeConstraintsTest.java
@Test
	public void failIfBadRuntimeConstraints() throws Exception{
		boolean exceptionThrown = false;
		try{
			this.setup();
			RuntimeConstraintManager rtConstraints = new RuntimeConstraintManager(ng);
			JSONArray invalidRuntimeConstraintJSON = Utility.getJsonArrayFromString("[ { \"SparqlID\" : \"?durationInYears\", \"Operator\" : \"GREATERTHANOREQUALS\", \"Operands\" : [ 300 ] } ]");
			rtConstraints.applyConstraintJson(invalidRuntimeConstraintJSON);
		}catch(Exception e){
			exceptionThrown = true;
			assertTrue(e.getMessage().contains("Cannot find runtime-constrainable item in nodegroup.  sparqlID: ?durationInYears"));
		}
		assertTrue(exceptionThrown);
	}
/**
	 * Confirm that we get a good error message if try to apply runtime constraint with an invalid sparqlId ("durationInYears")
	 */
Confirm that we get a good error message if try to apply runtime constraint with an invalid sparqlId ("durationInYears")
Confirm that we get a good error message if try to apply runtime constraint with an invalid sparqlId ( " durationInYears " )
@Test
	public void failIfBadRuntimeConstraints() throws Exception{
		boolean exceptionThrown = false;
		try{
			this.setup();
			RuntimeConstraintManager rtConstraints = new RuntimeConstraintManager(ng);
			JSONArray invalidRuntimeConstraintJSON = Utility.getJsonArrayFromString("[ { \"SparqlID\" : \"?durationInYears\", \"Operator\" : \"GREATERTHANOREQUALS\", \"Operands\" : [ 300 ] } ]");
			rtConstraints.applyConstraintJson(invalidRuntimeConstraintJSON);
		}catch(Exception e){
			exceptionThrown = true;
			assertTrue(e.getMessage().contains("Cannot find runtime-constrainable item in nodegroup.  sparqlID: ?durationInYears"));
		}
		assertTrue(exceptionThrown);
	}
@ Test public void failIfBadRuntimeConstraints ( ) throws Exception { boolean exceptionThrown = false ; try { this . setup ( ) ; RuntimeConstraintManager rtConstraints = new RuntimeConstraintManager ( ng ) ; JSONArray invalidRuntimeConstraintJSON = Utility . getJsonArrayFromString ( "[ { \"SparqlID\" : \"?durationInYears\", \"Operator\" : \"GREATERTHANOREQUALS\", \"Operands\" : [ 300 ] } ]" ) ; rtConstraints . applyConstraintJson ( invalidRuntimeConstraintJSON ) ; } catch ( Exception e ) { exceptionThrown = true ; assertTrue ( e . getMessage ( ) . contains ( "Cannot find runtime-constrainable item in nodegroup.  sparqlID: ?durationInYears" ) ) ; } assertTrue ( exceptionThrown ) ; }
Confirm that we get a good error message if try to apply runtime constraint with an invalid sparqlId ("durationInYears")
Confirm that we get a good error message if try to apply runtime constraint with an invalid sparqlId ( " durationInYears " )