From 639715a37f34db96f6149ef25efd395398ecfbeb Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Wed, 6 Apr 2016 14:56:37 +0100 Subject: [PATCH] JAL-1960 updated test to capture new behaviour improvement --- src/jalview/gui/StructureChooser.java | 2 +- test/jalview/gui/StructureChooserTest.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index f38f267..5709ac9 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -341,7 +341,7 @@ public class StructureChooser extends GStructureChooser implements { Objects.requireNonNull(seqName); return seqName.replaceAll("\\[\\d*\\]", "") - .replaceAll("[^\\dA-Za-z ]", "").replaceAll("\\s+", "+"); + .replaceAll("[^\\dA-Za-z|]", "").replaceAll("\\s+", "+"); } diff --git a/test/jalview/gui/StructureChooserTest.java b/test/jalview/gui/StructureChooserTest.java index 1b00c4a..28b9b83 100644 --- a/test/jalview/gui/StructureChooserTest.java +++ b/test/jalview/gui/StructureChooserTest.java @@ -70,10 +70,16 @@ public class StructureChooserTest public void buildQueryTest() { String query = StructureChooser.buildQuery(seq); - System.out.println(">>>>>>>>>> query : " + query); + assertEquals("pdb_id:1tim", query); + System.out.println("seq >>>> " + seq); + seq.getAllPDBEntries().clear(); + query = StructureChooser.buildQuery(seq); assertEquals( - "4kqy OR text:1tim OR text:XYZ_1 OR text:XYZ_2 OR text:XYZ_3 OR text:XYZ_4", + "text:XYZ_1 OR text:XYZ_2 OR text:XYZ_3 OR text:XYZ_4 OR text:4kqy", query); + seq.setDBRefs(null); + query = StructureChooser.buildQuery(seq); + assertEquals("text:4kqy", query); } @Test(groups = { "Functional" }) -- 1.7.10.2