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. |