PythonTransformationAsURIValidator extends PythonTransformationTokenVistor { public boolean validate(String transformationCode) { List<PythonTransformationToken> tokens = PythonTransformationAsURITokenizer.tokenize(transformationCode); return validate(tokens); }  boolean validate(String transformationCode); boolean validate(List<PythonTransformationToken> tokens);  }
@Test public void emptyStringTest() { String transformationCode = ""; PythonTransformationAsURIValidator validator = new PythonTransformationAsURIValidator(); assertFalse(validator.validate(transformationCode)); }
@Test public void nullStringTest() { String transformationCode = null; PythonTransformationAsURIValidator validator = new PythonTransformationAsURIValidator(); assertFalse(validator.validate(transformationCode)); }
@Test public void basicColumnTest() { String transformationCode = "return getValue(\"value\")"; PythonTransformationAsURIValidator validator = new PythonTransformationAsURIValidator(); assertTrue(validator.validate(transformationCode)); }
@Test public void basicColumnWithSpacesTest() { String transformationCode = "return getValue( \"value\" )"; PythonTransformationAsURIValidator validator = new PythonTransformationAsURIValidator(); assertTrue(validator.validate(transformationCode)); }
@Test public void basicStringTest() { String transformationCode = "return \"http: PythonTransformationAsURIValidator validator = new PythonTransformationAsURIValidator(); assertTrue(validator.validate(transformationCode)); }
@Test public void basicVariableTest() { String transformationCode = "something = \"garbage\"\nreturn something + getValue(\"value\")"; PythonTransformationAsURIValidator validator = new PythonTransformationAsURIValidator(); assertFalse(validator.validate(transformationCode)); }