From e5759b04c4487a7ac09a0231a8e9f958ce38e93a Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 28 Sep 2016 15:26:08 +0100 Subject: [PATCH] JAL-2235 implicit test to check that exception is raised for non-dataset reference --- test/jalview/datamodel/SequenceTest.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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()); } -- 1.7.10.2