X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fstructure%2FAtomSpecTest.java;h=39d10ae7d504d32ac78797400f43b0dc3ce71267;hb=8879d902c46cd33cfe201fcbd96e87d33b89259f;hp=ff6e6cbe866b2ecd77dea941a2bb5301d45ff60c;hpb=34567bb79dfa8f163f44c3f3448083fcd145f308;p=jalview.git diff --git a/test/jalview/structure/AtomSpecTest.java b/test/jalview/structure/AtomSpecTest.java index ff6e6cb..39d10ae 100644 --- a/test/jalview/structure/AtomSpecTest.java +++ b/test/jalview/structure/AtomSpecTest.java @@ -1,3 +1,23 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.structure; import static org.testng.Assert.assertEquals; @@ -9,23 +29,23 @@ import org.testng.annotations.Test; public class AtomSpecTest { @Test - public void testFromChimeraAtomSpec_chimera() + public void testFromChimeraAtomSpec() { - AtomSpec as = AtomSpec.fromChimeraAtomspec("#1:12.B", false); + AtomSpec as = AtomSpec.fromChimeraAtomspec("#1:12.B"); assertEquals(as.getModelNumber(), 1); assertEquals(as.getPdbResNum(), 12); assertEquals(as.getChain(), "B"); assertNull(as.getPdbFile()); // no model - default to zero - as = AtomSpec.fromChimeraAtomspec(":13.C", false); + as = AtomSpec.fromChimeraAtomspec(":13.C"); assertEquals(as.getModelNumber(), 0); assertEquals(as.getPdbResNum(), 13); assertEquals(as.getChain(), "C"); assertNull(as.getPdbFile()); // model.submodel - as = AtomSpec.fromChimeraAtomspec("#3.2:15", false); + as = AtomSpec.fromChimeraAtomspec("#3.2:15"); assertEquals(as.getModelNumber(), 3); assertEquals(as.getPdbResNum(), 15); assertEquals(as.getChain(), ""); @@ -34,7 +54,7 @@ public class AtomSpecTest String spec = "3:12.B"; try { - as = AtomSpec.fromChimeraAtomspec(spec, false); + as = AtomSpec.fromChimeraAtomspec(spec); fail("Expected exception for " + spec); } catch (IllegalArgumentException e) { @@ -44,7 +64,7 @@ public class AtomSpecTest spec = "#3:12-14.B"; try { - as = AtomSpec.fromChimeraAtomspec(spec, false); + as = AtomSpec.fromChimeraAtomspec(spec); fail("Expected exception for " + spec); } catch (IllegalArgumentException e) { @@ -54,7 +74,7 @@ public class AtomSpecTest spec = ""; try { - as = AtomSpec.fromChimeraAtomspec(spec, false); + as = AtomSpec.fromChimeraAtomspec(spec); fail("Expected exception for " + spec); } catch (IllegalArgumentException e) { @@ -64,7 +84,7 @@ public class AtomSpecTest spec = null; try { - as = AtomSpec.fromChimeraAtomspec(spec, false); + as = AtomSpec.fromChimeraAtomspec(spec); fail("Expected exception for " + spec); } catch (NullPointerException e) { @@ -73,62 +93,62 @@ public class AtomSpecTest } @Test - public void testFromChimeraAtomSpec_chimeraX() + public void testFromChimeraXAtomSpec() { - AtomSpec as = AtomSpec.fromChimeraAtomspec("#1/B:12", true); + AtomSpec as = AtomSpec.fromChimeraXAtomspec("#1/B:12"); assertEquals(as.getModelNumber(), 1); assertEquals(as.getPdbResNum(), 12); assertEquals(as.getChain(), "B"); assertNull(as.getPdbFile()); - + // no model - default to zero - as = AtomSpec.fromChimeraAtomspec("/C:13", true); + as = AtomSpec.fromChimeraXAtomspec("/C:13"); assertEquals(as.getModelNumber(), 0); assertEquals(as.getPdbResNum(), 13); assertEquals(as.getChain(), "C"); assertNull(as.getPdbFile()); - + // model.submodel - as = AtomSpec.fromChimeraAtomspec("#3.2/:15", true); + as = AtomSpec.fromChimeraXAtomspec("#3.2/:15"); assertEquals(as.getModelNumber(), 3); assertEquals(as.getPdbResNum(), 15); assertEquals(as.getChain(), ""); assertNull(as.getPdbFile()); - + String spec = "3:12.B"; try { - as = AtomSpec.fromChimeraAtomspec(spec, true); + as = AtomSpec.fromChimeraXAtomspec(spec); fail("Expected exception for " + spec); } catch (IllegalArgumentException e) { // ok } - + spec = "#3:12-14.B"; try { - as = AtomSpec.fromChimeraAtomspec(spec, true); + as = AtomSpec.fromChimeraXAtomspec(spec); fail("Expected exception for " + spec); } catch (IllegalArgumentException e) { // ok } - + spec = ""; try { - as = AtomSpec.fromChimeraAtomspec(spec, true); + as = AtomSpec.fromChimeraXAtomspec(spec); fail("Expected exception for " + spec); } catch (IllegalArgumentException e) { // ok } - + spec = null; try { - as = AtomSpec.fromChimeraAtomspec(spec, true); + as = AtomSpec.fromChimeraXAtomspec(spec); fail("Expected exception for " + spec); } catch (NullPointerException e) {