At last update to JUnit 4.x
[zxing.git] / core / test / src / com / google / zxing / qrcode / decoder / ModeTestCase.java
index caaf963..ee7ddc8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008 Google Inc.
+ * Copyright 2008 ZXing authors
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package com.google.zxing.qrcode.decoder;
 
-import com.google.zxing.ReaderException;
-import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Test;
 
 /**
- * @author srowen@google.com (Sean Owen)
+ * @author Sean Owen
  */
-public final class ModeTestCase extends TestCase {
+public final class ModeTestCase extends Assert {
 
-  public void testForBits() throws ReaderException {
-    assertEquals(Mode.TERMINATOR, Mode.forBits(0x00));
-    assertEquals(Mode.NUMERIC, Mode.forBits(0x01));
-    assertEquals(Mode.ALPHANUMERIC, Mode.forBits(0x02));
-    assertEquals(Mode.BYTE, Mode.forBits(0x04));
-    assertEquals(Mode.KANJI, Mode.forBits(0x08));
+  @Test
+  public void testForBits() {
+    assertSame(Mode.TERMINATOR, Mode.forBits(0x00));
+    assertSame(Mode.NUMERIC, Mode.forBits(0x01));
+    assertSame(Mode.ALPHANUMERIC, Mode.forBits(0x02));
+    assertSame(Mode.BYTE, Mode.forBits(0x04));
+    assertSame(Mode.KANJI, Mode.forBits(0x08));
     try {
       Mode.forBits(0x10);
       fail("Should have thrown an exception");
-    } catch (ReaderException re) {
+    } catch (IllegalArgumentException iae) {
       // good
     }
   }
 
-  public void testCharacterCount() throws ReaderException {
+  @Test
+  public void testCharacterCount() {
     // Spot check a few values
     assertEquals(10, Mode.NUMERIC.getCharacterCountBits(Version.getVersionForNumber(5)));
     assertEquals(12, Mode.NUMERIC.getCharacterCountBits(Version.getVersionForNumber(26)));