JAL-1960 updated test to capture new behaviour improvement
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 6 Apr 2016 13:56:37 +0000 (14:56 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 6 Apr 2016 13:56:37 +0000 (14:56 +0100)
src/jalview/gui/StructureChooser.java
test/jalview/gui/StructureChooserTest.java

index f38f267..5709ac9 100644 (file)
@@ -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+", "+");
   }
 
 
index 1b00c4a..28b9b83 100644 (file)
@@ -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" })