From: Jim Procter Date: Wed, 28 Sep 2016 14:26:08 +0000 (+0100) Subject: JAL-2235 implicit test to check that exception is raised for non-dataset reference X-Git-Tag: Release_2_10_0~20^2~28 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e5759b04c4487a7ac09a0231a8e9f958ce38e93a;p=jalview.git JAL-2235 implicit test to check that exception is raised for non-dataset reference --- diff --git a/test/jalview/datamodel/SequenceTest.java b/test/jalview/datamodel/SequenceTest.java index 8c5073b..cfcb9ec 100644 --- a/test/jalview/datamodel/SequenceTest.java +++ b/test/jalview/datamodel/SequenceTest.java @@ -366,7 +366,16 @@ public class SequenceTest * is there a usecase for this ? setDatasetSequence should throw an error if * this actually occurs. */ - sq.getDatasetSequence().setDatasetSequence(sq); // loop! + try + { + sq.getDatasetSequence().setDatasetSequence(sq); // loop! + Assert.fail("Expected Error to be raised when calling setDatasetSequence with self reference"); + } catch (Error e) + { + // TODO Jalview error/exception class for raising implementation errors + assertTrue(e.getMessage().toLowerCase() + .contains("implementation error")); + } assertNull(sq.getSequenceFeatures()); }