OSDN Git Service

ユニットテスト修正
authorOlyutorskii <olyutorskii@users.osdn.me>
Sat, 18 Jun 2016 02:06:18 +0000 (11:06 +0900)
committerOlyutorskii <olyutorskii@users.osdn.me>
Sat, 18 Jun 2016 02:06:18 +0000 (11:06 +0900)
src/test/java/jp/sfjp/jindolf/config/CmdOptionTest.java
src/test/java/jp/sfjp/jindolf/config/OptionInfoTest.java
src/test/java/jp/sfjp/jindolf/data/AvatarTest.java
src/test/java/jp/sfjp/jindolf/net/HttpUtilsTest.java
src/test/java/jp/sfjp/jindolf/util/StringUtilsTest.java

index 6a87a14..b8adca2 100644 (file)
@@ -6,14 +6,15 @@
 
 package jp.sfjp.jindolf.config;
 
-import java.util.List;
 import java.util.Arrays;
 import java.util.LinkedList;
+import java.util.List;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
+
 import static org.junit.Assert.*;
 
 /**
@@ -53,7 +54,7 @@ public class CmdOptionTest {
 
         List<CmdOption> list = Arrays.asList(values);
 
-        List<CmdOption> testList = new LinkedList<CmdOption>();
+        List<CmdOption> testList = new LinkedList<>();
         testList.add(CmdOption.OPT_HELP);
         testList.add(CmdOption.OPT_VERSION);
         testList.add(CmdOption.OPT_BOLDMETAL);
index 0fbff02..991cb45 100644 (file)
@@ -12,6 +12,7 @@ import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
+
 import static org.junit.Assert.*;
 
 /**
@@ -61,7 +62,7 @@ public class OptionInfoTest {
         assertNotNull(result);
 
         try{
-            result = OptionInfo.parseOptions("X");
+            OptionInfo.parseOptions("X");
             fail();
         }catch(IllegalArgumentException e){
             assertEquals("未定義の起動オプション[X]が指定されました。",
@@ -69,7 +70,7 @@ public class OptionInfoTest {
         }
 
         try{
-            result = OptionInfo.parseOptions("");
+            OptionInfo.parseOptions("");
             fail();
         }catch(IllegalArgumentException e){
             assertEquals("未定義の起動オプション[]が指定されました。",
@@ -146,7 +147,7 @@ public class OptionInfoTest {
         OptionInfo result;
 
         try{
-            result = OptionInfo.parseOptions("-antialias");
+            OptionInfo.parseOptions("-antialias");
             fail();
         }catch(IllegalArgumentException e){
             String expMsg =
@@ -155,7 +156,7 @@ public class OptionInfoTest {
         }
 
         try{
-            result = OptionInfo.parseOptions("-fractional");
+            OptionInfo.parseOptions("-fractional");
             fail();
         }catch(IllegalArgumentException e){
             String expMsg =
@@ -198,7 +199,7 @@ public class OptionInfoTest {
         }
 
         try{
-            result = OptionInfo.parseOptions("-antialias", "X");
+            OptionInfo.parseOptions("-antialias", "X");
             fail();
         }catch(IllegalArgumentException e){
             String expMsg =
@@ -209,7 +210,7 @@ public class OptionInfoTest {
         }
 
         try{
-            result = OptionInfo.parseOptions("-fractional", "X");
+            OptionInfo.parseOptions("-fractional", "X");
             fail();
         }catch(IllegalArgumentException e){
             String expMsg =
@@ -236,7 +237,7 @@ public class OptionInfoTest {
         OptionInfo result;
 
         try{
-            result = OptionInfo.parseOptions("-initfont");
+            OptionInfo.parseOptions("-initfont");
             fail();
         }catch(IllegalArgumentException e){
             String expMsg =
@@ -245,7 +246,7 @@ public class OptionInfoTest {
         }
 
         try{
-            result = OptionInfo.parseOptions("-confdir");
+            OptionInfo.parseOptions("-confdir");
             fail();
         }catch(IllegalArgumentException e){
             String expMsg =
@@ -334,7 +335,7 @@ public class OptionInfoTest {
         assertNull(result.initialFrameYpos());
 
         try{
-            result = OptionInfo.parseOptions("-geometry");
+            OptionInfo.parseOptions("-geometry");
             fail();
         }catch(IllegalArgumentException e){
             String expMsg =
@@ -343,7 +344,7 @@ public class OptionInfoTest {
         }
 
         try{
-            result = OptionInfo.parseOptions("-geometry", "Q");
+            OptionInfo.parseOptions("-geometry", "Q");
             fail();
         }catch(IllegalArgumentException e){
             String expMsg =
index 4d65e74..e852a6b 100644 (file)
@@ -14,6 +14,7 @@ import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
+
 import static org.junit.Assert.*;
 
 /**
index b4f97a2..aba3523 100644 (file)
@@ -14,6 +14,7 @@ import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
+
 import static org.junit.Assert.*;
 
 /**
index 2e0f70f..c8b70fe 100644 (file)
@@ -13,6 +13,7 @@ import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
+
 import static org.junit.Assert.*;
 
 /**
@@ -63,13 +64,13 @@ public class StringUtilsTest {
         assertEquals(456, result);
 
         try{
-            result = StringUtils.parseInt(null, matcher, 1);
+            StringUtils.parseInt(null, matcher, 1);
             fail();
         }catch(NullPointerException e){
         }
 
         try{
-            result = StringUtils.parseInt(input, null, 1);
+            StringUtils.parseInt(input, null, 1);
             fail();
         }catch(NullPointerException e){
         }
@@ -87,7 +88,7 @@ public class StringUtilsTest {
         int result;
 
         try{
-            result = StringUtils.parseInt(null);
+            StringUtils.parseInt(null);
             fail();
         }catch(NullPointerException e){
         }
@@ -120,7 +121,7 @@ public class StringUtilsTest {
         int result;
 
         try{
-            result = StringUtils.parseInt(null, 1, 3);
+            StringUtils.parseInt(null, 1, 3);
             fail();
         }catch(NullPointerException e){
         }
@@ -141,13 +142,13 @@ public class StringUtilsTest {
         assertEquals(0, result);
 
         try{
-            result = StringUtils.parseInt("1234567", 2, 999);
+            StringUtils.parseInt("1234567", 2, 999);
             fail();
         }catch(StringIndexOutOfBoundsException e){
         }
 
         try{
-            result = StringUtils.parseInt("1234567", -1, 5);
+            StringUtils.parseInt("1234567", -1, 5);
             fail();
         }catch(StringIndexOutOfBoundsException e){
         }
@@ -165,7 +166,7 @@ public class StringUtilsTest {
         CharSequence result;
 
         try{
-            result = StringUtils.suppressString(null);
+            StringUtils.suppressString(null);
             fail();
         }catch(NullPointerException e){
         }