From: <tho...@us...> - 2013-11-10 15:01:56
|
Revision: 7522 http://bigdata.svn.sourceforge.net/bigdata/?rev=7522&view=rev Author: thompsonbry Date: 2013-11-10 15:01:49 +0000 (Sun, 10 Nov 2013) Log Message: ----------- Bug fix to test case. It was failing to ensure that the default file did not exist before running the zero-argument BigdataSail constructor. This was failing the test on AWS using EBS. Added Options.DEFAULT_FILE to BigdataSail to make this default value visible. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/TestBootstrapBigdataSail.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java 2013-11-09 14:42:27 UTC (rev 7521) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java 2013-11-10 15:01:49 UTC (rev 7522) @@ -377,6 +377,15 @@ public static final String DESCRIBE_STATEMENT_LIMIT = BigdataSail.class .getPackage().getName() + ".describeIterationStatementLimit"; + /** + * The name of the default value used for the + * {@link Journal.Options#FILE} property by the + * {@link BigdataSail#BigdataSail()} convenience constructor. + * + * @see BigdataSail#BigdataSail() + */ + public static final String DEFAULT_FILE = "bigdata" + JNL; + } /** @@ -557,9 +566,9 @@ */ private static Properties getDefaultProperties() { - Properties properties = new Properties(); + final Properties properties = new Properties(); - properties.setProperty(Options.FILE, "bigdata" + Options.JNL); + properties.setProperty(Options.FILE, Options.DEFAULT_FILE); return properties; Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/TestBootstrapBigdataSail.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/TestBootstrapBigdataSail.java 2013-11-09 14:42:27 UTC (rev 7521) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/test/com/bigdata/rdf/sail/TestBootstrapBigdataSail.java 2013-11-10 15:01:49 UTC (rev 7522) @@ -29,6 +29,7 @@ import info.aduna.iteration.CloseableIteration; import java.io.File; +import java.io.IOException; import java.util.Properties; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; @@ -76,7 +77,7 @@ /** * @param arg0 */ - public TestBootstrapBigdataSail(String arg0) { + public TestBootstrapBigdataSail(final String arg0) { super(arg0); } @@ -84,13 +85,32 @@ * Test create and shutdown of the default store. * * @throws SailException + * @throws IOException */ - public void test_ctor_1() throws SailException { + public void test_ctor_1() throws SailException, IOException { + final File file = new File(BigdataSail.Options.DEFAULT_FILE); + + /* + * If the default file exists, then delete it before creating the SAIL. + */ + if (file.exists()) { + + if (!file.delete()) { + + throw new IOException("Unable to remove default file:" + file); + + } + + } + final BigdataSail sail = new BigdataSail(); try { + if (!file.exists()) + fail("Expected file does not exist: " + file); + sail.initialize(); sail.shutDown(); @@ -111,15 +131,15 @@ public void test_ctor_2() throws SailException { final File file = new File(getName() + Options.JNL); - - if(file.exists()) { - - if(!file.delete()) { - + + if (file.exists()) { + + if (!file.delete()) { + fail("Could not delete file before test: " + file); } - + } final Properties properties = new Properties(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |