From: <tho...@us...> - 2011-01-16 19:26:16
|
Revision: 4111 http://bigdata.svn.sourceforge.net/bigdata/?rev=4111&view=rev Author: thompsonbry Date: 2011-01-16 19:26:10 +0000 (Sun, 16 Jan 2011) Log Message: ----------- Fixed unit test broken by the change to RWStore#getData() (it used to wrap things as an IllegalArgumentException, which had the wrong semantics when the underlying cause was an interrupt in the caller's thread resulting in a ClosedByInterruptException). Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java 2011-01-16 18:59:43 UTC (rev 4110) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java 2011-01-16 19:26:10 UTC (rev 4111) @@ -41,7 +41,6 @@ import com.bigdata.btree.ITuple; import com.bigdata.btree.ITupleIterator; import com.bigdata.btree.IndexMetadata; -import com.bigdata.config.LongValidator; import com.bigdata.journal.AbstractInterruptsTestCase; import com.bigdata.journal.AbstractJournalTestCase; import com.bigdata.journal.AbstractMRMWTestCase; @@ -58,7 +57,7 @@ import com.bigdata.journal.Journal.Options; import com.bigdata.rawstore.AbstractRawStoreTestCase; import com.bigdata.rawstore.IRawStore; -import com.bigdata.service.AbstractTransactionService; +import com.bigdata.util.InnerCause; /** * Test suite for {@link BufferMode#DiskRW} journals. @@ -1029,14 +1028,24 @@ assertEquals(0L, bs.getPhysicalAddress(faddr)); - try { - rdBuf = bs.read(faddr); // should fail with illegal argument - throw new RuntimeException("Fail"); - } catch (Exception ise) { - assertTrue("Expected "+IllegalArgumentException.class.getName()+" reading from " + (faddr >> 32) + " instead got: " - + ise, ise instanceof IllegalArgumentException - ); - } + try { + // should fail with PhysicalAddressResolutionException + rdBuf = bs.read(faddr); + fail("Expecting: " + + PhysicalAddressResolutionException.class); + } catch (Throwable t) { + if (InnerCause.isInnerCause(t, + PhysicalAddressResolutionException.class)) { + if (log.isInfoEnabled()) { + log.info("Ignoring expected exception: " + t); + } + } else { + fail("Expected: " + + PhysicalAddressResolutionException.class + .getName() + " reading from " + + (faddr >> 32) + ", instead got: " + t, t); + } + } } finally { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2011-04-19 18:44:07
|
Revision: 4420 http://bigdata.svn.sourceforge.net/bigdata/?rev=4420&view=rev Author: thompsonbry Date: 2011-04-19 18:44:01 +0000 (Tue, 19 Apr 2011) Log Message: ----------- Fixed some unit tests in TestRWJournal where the journal was not being destroyed by a finally {} clause. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java 2011-04-19 17:47:31 UTC (rev 4419) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java 2011-04-19 18:44:01 UTC (rev 4420) @@ -689,7 +689,7 @@ */ public void test_reallocation() throws IOException { final Properties properties = getProperties(); - File tmpfile = File.createTempFile("TestRW", "rw"); + File tmpfile = File.createTempFile("TestRW", ".rw"); properties.setProperty(Options.FILE, tmpfile.getAbsolutePath()); properties.remove(Options.CREATE_TEMP_FILE); Journal store = new Journal(properties); @@ -1226,12 +1226,12 @@ public void test_metaAlloc() { Journal store = (Journal) getStore(); + try { RWStrategy bs = (RWStrategy) store.getBufferStrategy(); RWStore rw = bs.getRWStore(); long realAddr = 0; - try { for (int i = 0; i < 100000; i++) { int allocAddr = rw.metaAlloc(); @@ -1379,12 +1379,12 @@ public void test_stressAlloc() { Journal store = (Journal) getStore(); + try { final RWStrategy bs = (RWStrategy) store.getBufferStrategy(); final RWStore rw = bs.getRWStore(); // long realAddr = 0; - try { // allocBatch(store, 1, 32, 650, 100000000); allocBatch(store, 1, 32, 650, 50000); store.commit(); @@ -1410,6 +1410,7 @@ // Sequential logic final Journal store = (Journal) getStore(); + try { final RWStrategy bs = (RWStrategy) store.getBufferStrategy(); final RWStore rw = bs.getRWStore(); @@ -1434,6 +1435,10 @@ rw.deactivateTx(); store.commit(); + } finally { + store.destroy(); + } + } /** @@ -1447,6 +1452,7 @@ // Sequential logic final Journal store = (Journal) getStore(); + try { final RWStrategy bs = (RWStrategy) store.getBufferStrategy(); final RWStore rw = bs.getRWStore(); @@ -1492,8 +1498,10 @@ assertEquals(bb, rdBuf); } - store.commit(); + } finally { + store.destroy(); + } } /** @@ -1503,12 +1511,12 @@ public void test_pureAlloc() { Journal store = (Journal) getStore(); + try { RWStrategy bs = (RWStrategy) store.getBufferStrategy(); RWStore rw = bs.getRWStore(); long realAddr = 0; - try { // allocBatch(store, 1, 32, 650, 100000000); pureAllocBatch(store, 1, 32, rw.m_maxFixedAlloc - 4, 300000); // cover // wider This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2011-04-20 12:40:18
|
Revision: 4426 http://bigdata.svn.sourceforge.net/bigdata/?rev=4426&view=rev Author: thompsonbry Date: 2011-04-20 12:40:12 +0000 (Wed, 20 Apr 2011) Log Message: ----------- Commented out a NOP test. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java 2011-04-20 12:30:47 UTC (rev 4425) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/rwstore/TestRWJournal.java 2011-04-20 12:40:12 UTC (rev 4426) @@ -520,14 +520,14 @@ } - /** - * Test write of a record and then update of a slice of that record. - * <p> - * Note: Since the record was written but not flushed it will be found - * in the write cache by update(). - */ - public void test_write_plus_update() { - } +// /** +// * Test write of a record and then update of a slice of that record. +// * <p> +// * Note: Since the record was written but not flushed it will be found +// * in the write cache by update(). +// */ +// public void test_write_plus_update() { +// } /** * Ensures the allocation of unique addresses by mapping allocated @@ -613,9 +613,9 @@ * Not so much a test as a code coverage exercise. * * The output from showAllocReserve confirms the relative merits of - * optimising for space vs density. The DirectFixedAllocators will + * optimizing for space vs density. The DirectFixedAllocators will * allocate from DirectBuffers, where locality of reference is less - * important than efficient management of the memory, which is optimised + * important than efficient management of the memory, which is optimized * by allocations in smaller amounts that match the demands at a finer * granularity. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |