RDFParserHelper { public static void reportError(String msg, RioSetting<Boolean> relevantSetting, ParserConfig parserConfig, ParseErrorListener errListener) throws RDFParseException { reportError(msg, -1, -1, relevantSetting, parserConfig, errListener); } protected  RDFParserHelper(); static final Literal createLiteral(String label, String lang, IRI datatype, ParserConfig parserConfig,
			ParseErrorListener errListener, ValueFactory valueFactory); static final Literal createLiteral(String label, String lang, IRI datatype, ParserConfig parserConfig,
			ParseErrorListener errListener, ValueFactory valueFactory, long lineNo, long columnNo); static void reportError(String msg, RioSetting<Boolean> relevantSetting, ParserConfig parserConfig,
			ParseErrorListener errListener); static void reportError(String msg, long lineNo, long columnNo, RioSetting<Boolean> relevantSetting,
			ParserConfig parserConfig, ParseErrorListener errListener); static void reportError(Exception e, long lineNo, long columnNo, RioSetting<Boolean> relevantSetting,
			ParserConfig parserConfig, ParseErrorListener errListener); static void reportFatalError(String msg, ParseErrorListener errListener); static void reportFatalError(String msg, long lineNo, long columnNo, ParseErrorListener errListener); static void reportFatalError(Exception e, ParseErrorListener errListener); static void reportFatalError(Exception e, long lineNo, long columnNo, ParseErrorListener errListener); static void reportFatalError(String message, Exception e, long lineNo, long columnNo,
			ParseErrorListener errListener);  }
@Test public final void testReportErrorStringFatalActive() throws Exception { parserConfig.set(BasicParserSettings.VERIFY_DATATYPE_VALUES, true); assertTrue(parserConfig.get(BasicParserSettings.VERIFY_DATATYPE_VALUES)); thrown.expect(RDFParseException.class); thrown.expectMessage(TEST_MESSAGE_FOR_FAILURE); try { RDFParserHelper.reportError(TEST_MESSAGE_FOR_FAILURE, BasicParserSettings.VERIFY_DATATYPE_VALUES, parserConfig, errListener); } finally { assertErrorListener(0, 1, 0); } }
@Test public final void testReportErrorStringNonFatalActive() throws Exception { parserConfig.set(BasicParserSettings.VERIFY_DATATYPE_VALUES, true); assertTrue(parserConfig.get(BasicParserSettings.VERIFY_DATATYPE_VALUES)); parserConfig.addNonFatalError(BasicParserSettings.VERIFY_DATATYPE_VALUES); RDFParserHelper.reportError(TEST_MESSAGE_FOR_FAILURE, BasicParserSettings.VERIFY_DATATYPE_VALUES, parserConfig, errListener); assertErrorListener(0, 1, 0); }
@Test public final void testReportErrorStringFatalInactive() throws Exception { assertFalse(parserConfig.get(BasicParserSettings.FAIL_ON_UNKNOWN_DATATYPES)); RDFParserHelper.reportError(TEST_MESSAGE_FOR_FAILURE, BasicParserSettings.FAIL_ON_UNKNOWN_DATATYPES, parserConfig, errListener); assertErrorListener(0, 0, 0); }
@Test public final void testReportErrorStringNonFatalInactive() throws Exception { assertFalse(parserConfig.get(BasicParserSettings.FAIL_ON_UNKNOWN_DATATYPES)); parserConfig.addNonFatalError(BasicParserSettings.FAIL_ON_UNKNOWN_DATATYPES); RDFParserHelper.reportError(TEST_MESSAGE_FOR_FAILURE, BasicParserSettings.FAIL_ON_UNKNOWN_DATATYPES, parserConfig, errListener); assertErrorListener(0, 0, 0); }
@Test public final void testReportErrorStringIntIntFatalActive() throws Exception { parserConfig.set(BasicParserSettings.VERIFY_DATATYPE_VALUES, true); assertTrue(parserConfig.get(BasicParserSettings.VERIFY_DATATYPE_VALUES)); thrown.expect(RDFParseException.class); thrown.expectMessage(TEST_MESSAGE_FOR_FAILURE); try { RDFParserHelper.reportError(TEST_MESSAGE_FOR_FAILURE, 1, 1, BasicParserSettings.VERIFY_DATATYPE_VALUES, parserConfig, errListener); } finally { assertErrorListener(0, 1, 0); } }
@Test public final void testReportErrorStringIntIntNonFatalActive() throws Exception { parserConfig.set(BasicParserSettings.VERIFY_DATATYPE_VALUES, true); assertTrue(parserConfig.get(BasicParserSettings.VERIFY_DATATYPE_VALUES)); parserConfig.addNonFatalError(BasicParserSettings.VERIFY_DATATYPE_VALUES); RDFParserHelper.reportError(TEST_MESSAGE_FOR_FAILURE, 1, 1, BasicParserSettings.VERIFY_DATATYPE_VALUES, parserConfig, errListener); assertErrorListener(0, 1, 0); }
@Test public final void testReportErrorStringIntIntFatalInactive() throws Exception { assertFalse(parserConfig.get(BasicParserSettings.FAIL_ON_UNKNOWN_DATATYPES)); RDFParserHelper.reportError(TEST_MESSAGE_FOR_FAILURE, 1, 1, BasicParserSettings.FAIL_ON_UNKNOWN_DATATYPES, parserConfig, errListener); assertErrorListener(0, 0, 0); }
@Test public final void testReportErrorStringIntIntNonFatalInactive() throws Exception { assertFalse(parserConfig.get(BasicParserSettings.FAIL_ON_UNKNOWN_DATATYPES)); parserConfig.addNonFatalError(BasicParserSettings.FAIL_ON_UNKNOWN_DATATYPES); RDFParserHelper.reportError(TEST_MESSAGE_FOR_FAILURE, 1, 1, BasicParserSettings.FAIL_ON_UNKNOWN_DATATYPES, parserConfig, errListener); assertErrorListener(0, 0, 0); }