JAL-1270 JUnit to TestNG refactoring
[jalview.git] / test / jalview / viewmodel / styles / ViewStyleTest.java
index 32d048f..32003c2 100644 (file)
@@ -1,16 +1,14 @@
 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 org.testng.annotations.Test;
+import org.testng.AssertJUnit;
 import java.awt.Color;
 import java.lang.reflect.Field;
 import java.util.Random;
 
-import org.junit.Assert;
-import org.junit.Test;
-
 
 public class ViewStyleTest
 {
@@ -39,7 +37,10 @@ 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);
@@ -55,6 +56,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,7 +135,7 @@ public class ViewStyleTest
     }
     else
     {
-      Assert.fail("Unhandled field type (add to test): " + field.getName()
+      AssertJUnit.fail("Unhandled field type (add to test): " + field.getName()
               + ":" + type);
     }
   }