/** * Test method for {@link org.openrdf.rio.ParserConfig#isPreserveBNodeIDs()}. */ @Test public final void testIsPreserveBNodeIDs() { ParserConfig testConfig = new ParserConfig(); assertFalse(testConfig.isPreserveBNodeIDs()); testConfig.set(BasicParserSettings.PRESERVE_BNODE_IDS, true); assertTrue(testConfig.isPreserveBNodeIDs()); }
public void setStopAtFirstError(final boolean stopAtFirstError) { config = new ParserConfig(config.verifyData(), stopAtFirstError, config.isPreserveBNodeIDs(), config.datatypeHandling()); }
public void setVerifyData(final boolean verifyData) { config = new ParserConfig(verifyData, config.stopAtFirstError(), config.isPreserveBNodeIDs(), config.datatypeHandling()); }
public void setDatatypeHandling(final DatatypeHandling datatypeHandling) { config = new ParserConfig(config.verifyData(), config.stopAtFirstError(), config.isPreserveBNodeIDs(), datatypeHandling); }
/** * Test that the explicit constructor sets all of the basic settings using * the default values. */ @Test public final void testParserConfigSameAsDefaults() { ParserConfig testConfig = new ParserConfig(true, true, false, DatatypeHandling.VERIFY); // check that the basic settings are explicitly set assertTrue(testConfig.isSet(BasicParserSettings.PRESERVE_BNODE_IDS)); // check that the basic settings all return their expected default values assertFalse(testConfig.get(BasicParserSettings.PRESERVE_BNODE_IDS)); assertFalse(testConfig.isPreserveBNodeIDs()); }
/** * Test that the explicit constructor sets all of the basic settings using * non-default values. */ @Test public final void testParserConfigNonDefaults() { ParserConfig testConfig = new ParserConfig(false, false, true, DatatypeHandling.IGNORE); // check that the basic settings are explicitly set assertTrue(testConfig.isSet(BasicParserSettings.PRESERVE_BNODE_IDS)); // check that the basic settings all return their set values assertTrue(testConfig.get(BasicParserSettings.PRESERVE_BNODE_IDS)); assertTrue(testConfig.isPreserveBNodeIDs()); }
/** * Test the default constructor does not set any settings, but still returns * the default values for basic settings. */ @Test public final void testParserConfig() { ParserConfig testConfig = new ParserConfig(); // check that the basic settings are not set assertFalse(testConfig.isSet(BasicParserSettings.PRESERVE_BNODE_IDS)); // check that the basic settings all return their expected default values assertFalse(testConfig.get(BasicParserSettings.PRESERVE_BNODE_IDS)); assertFalse(testConfig.isPreserveBNodeIDs()); // then set to check that changes occur testConfig.set(BasicParserSettings.PRESERVE_BNODE_IDS, true); // check that the basic settings are now explicitly set assertTrue(testConfig.isSet(BasicParserSettings.PRESERVE_BNODE_IDS)); // check that the basic settings all return their set values assertTrue(testConfig.get(BasicParserSettings.PRESERVE_BNODE_IDS)); assertTrue(testConfig.isPreserveBNodeIDs()); // reset the values testConfig.set(BasicParserSettings.PRESERVE_BNODE_IDS, null); // check again that the basic settings all return their expected default // values assertFalse(testConfig.get(BasicParserSettings.PRESERVE_BNODE_IDS)); assertFalse(testConfig.isPreserveBNodeIDs()); }