X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fviewmodel%2Fstyles%2FViewStyleTest.java;h=200cfbbda338ac880454d4643c234df02edd2855;hb=a818865e1c7ea11c5a02d5bd90d4860125aa0350;hp=32d048f31e48aa74f626513e164f4b90daa04906;hpb=be7d3d5e0d85c7c8dcfdf35a6240da9c438ef9bb;p=jalview.git diff --git a/test/jalview/viewmodel/styles/ViewStyleTest.java b/test/jalview/viewmodel/styles/ViewStyleTest.java index 32d048f..200cfbb 100644 --- a/test/jalview/viewmodel/styles/ViewStyleTest.java +++ b/test/jalview/viewmodel/styles/ViewStyleTest.java @@ -1,16 +1,35 @@ +/* + * 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.viewmodel.styles; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.testng.AssertJUnit.assertEquals; +import static org.testng.AssertJUnit.assertFalse; +import static org.testng.AssertJUnit.assertTrue; import java.awt.Color; import java.lang.reflect.Field; import java.util.Random; -import org.junit.Assert; -import org.junit.Test; - +import org.testng.AssertJUnit; +import org.testng.annotations.Test; public class ViewStyleTest { @@ -30,7 +49,7 @@ public class ViewStyleTest * @throws IllegalAccessException * @throws IllegalArgumentException */ - @Test + @Test(groups = { "Functional" }) public void testCopyConstructor() throws IllegalArgumentException, IllegalAccessException { @@ -39,12 +58,16 @@ public class ViewStyleTest for (Field field : fields) { field.setAccessible(true); - changeValue(vs1, field); + if (!copyConstructorIgnores(field.getName())) + { + changeValue(vs1, field); + } } ViewStyle vs2 = new ViewStyle(vs1); - for (Field field1 : fields) { + for (Field field1 : fields) + { final Object value1 = field1.get(vs1); final Object value2 = field1.get(vs2); String msg = "Mismatch in " + field1.getName() + "(" + value1 + "/" @@ -55,6 +78,21 @@ public class ViewStyleTest } /** + * Add any field names in here that we expect to be ignored by the copy + * constructor + * + * @param name + * @return + */ + private boolean copyConstructorIgnores(String name) + { + /* + * currently none! + */ + return false; + } + + /** * Change the value of one field in a ViewStyle object * * @param vs @@ -119,8 +157,8 @@ public class ViewStyleTest } else { - Assert.fail("Unhandled field type (add to test): " + field.getName() - + ":" + type); + AssertJUnit.fail("Unhandled field type (add to test): " + + field.getName() + ":" + type); } } @@ -147,7 +185,7 @@ public class ViewStyleTest * @throws IllegalAccessException * @throws IllegalArgumentException */ - @Test + @Test(groups = { "Functional" }) public void testEquals() throws IllegalArgumentException, IllegalAccessException {