merge develop
[jalview.git] / test / jalview / ws / sifts / SiftsClientTest.java
index 7f8adc9..b50baff 100644 (file)
@@ -32,11 +32,13 @@ import jalview.datamodel.SequenceI;
 import jalview.gui.JvOptionPane;
 import jalview.io.DataSourceType;
 import jalview.structure.StructureMapping;
+import jalview.structure.StructureMappingClient.StructureMappingException;
 import jalview.xml.binding.sifts.Entry.Entity;
 
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -282,6 +284,7 @@ public class SiftsClientTest
               "A", testSeq, null);
       Assert.assertEquals(testSeq.getStart(), 1);
       Assert.assertEquals(testSeq.getEnd(), 147);
+<<<<<<< HEAD
       // Can't do Assert.assertEquals(actualMapping, expectedMapping);
       // because this fails in our version of TestNG
       Assert.assertEquals(actualMapping.size(), expectedMapping.size());
@@ -295,6 +298,18 @@ public class SiftsClientTest
                 pair.getValue());
       }
 
+=======
+      // Assert.assertEquals(actualMapping, expectedMapping);
+      Assert.assertEquals(actualMapping.size(), expectedMapping.size());
+      // Test key set
+      Assert.assertEquals(actualMapping.keySet(), expectedMapping.keySet());
+      // Test entry set
+      for (int key : expectedMapping.keySet())
+      {
+        Assert.assertTrue(Arrays.equals(expectedMapping.get(key),
+                actualMapping.get(key)));
+      }
+>>>>>>> f80180a53bf16dc72ecdd4ace0f70c83cb0d274a
     } catch (Exception e)
     {
       e.printStackTrace();
@@ -332,18 +347,18 @@ public class SiftsClientTest
 
   @Test(
 groups = { "Network" },
-    expectedExceptions = SiftsException.class)
+    expectedExceptions = StructureMappingException.class)
   private void populateAtomPositionsNullTest1()
-          throws IllegalArgumentException, SiftsException
+          throws IllegalArgumentException, StructureMappingException
   {
     siftsClient.populateAtomPositions(null, null);
   }
 
   @Test(
 groups = { "Network" },
-    expectedExceptions = SiftsException.class)
+    expectedExceptions = StructureMappingException.class)
   private void populateAtomPositionsNullTest2()
-          throws IllegalArgumentException, SiftsException
+          throws IllegalArgumentException, StructureMappingException
   {
     siftsClient.populateAtomPositions("A", null);
   }
@@ -392,10 +407,11 @@ groups = { "Network" },
   }
 
   @Test(groups = { "Network" })
-  public void getSiftsStructureMappingTest() throws SiftsException
+  public void getSiftsStructureMappingTest()
+          throws StructureMappingException, Exception
   {
     Assert.assertTrue(SiftsSettings.isMapWithSifts());
-    StructureMapping strucMapping = siftsClient.getSiftsStructureMapping(
+    StructureMapping strucMapping = siftsClient.getStructureMapping(
             testSeq, testPDBId, "A");
     String expectedMappingOutput = "\nSequence ⟷ Structure mapping details\n"
             + "Method: SIFTS\n\n"
@@ -414,6 +430,7 @@ groups = { "Network" },
     Assert.assertEquals(strucMapping.getMappingDetailsOutput(),
             expectedMappingOutput);
 
+<<<<<<< HEAD
     // Can't do Assert.assertEquals(strucMapping.getMapping(), expectedMapping);
     // because this fails in our version of TestNG
     Assert.assertEquals(strucMapping.getMapping().size(),
@@ -427,6 +444,19 @@ groups = { "Network" },
               .containsKey(pair.getKey()));
       Assert.assertEquals(strucMapping.getMapping().get(pair.getKey()),
               pair.getValue());
+=======
+    // Assert.assertEquals(strucMapping.getMapping(), expectedMapping);
+    Assert.assertEquals(strucMapping.getMapping().size(),
+            expectedMapping.size());
+    // Test key set
+    Assert.assertEquals(strucMapping.getMapping().keySet(),
+            expectedMapping.keySet());
+    // Test entry set
+    for (int key : expectedMapping.keySet())
+    {
+      Assert.assertTrue(Arrays.equals(expectedMapping.get(key),
+              strucMapping.getMapping().get(key)));
+>>>>>>> f80180a53bf16dc72ecdd4ace0f70c83cb0d274a
     }
   }