OSDN Git Service

refactor: refactor directories
authorhizumiaoba <56146205+hizumiaoba@users.noreply.github.com>
Wed, 9 Mar 2022 01:02:25 +0000 (10:02 +0900)
committerhizumiaoba <56146205+hizumiaoba@users.noreply.github.com>
Wed, 9 Mar 2022 01:02:25 +0000 (10:02 +0900)
16 files changed:
generated/database.json
src/com/ranfa/languages/List_en_US.properties
src/com/ranfa/languages/List_ja_JP.properties
src/com/ranfa/lib/ManualUpdateThreadImpl.java
src/com/ranfa/lib/database/Album.java [moved from src/com/ranfa/lib/Album.java with 91% similarity]
src/com/ranfa/lib/database/AlbumCycleDefinitionProperty.java [moved from src/com/ranfa/lib/AlbumCycleDefinitionProperty.java with 94% similarity]
src/com/ranfa/lib/database/AlbumTypeEstimate.java [moved from src/com/ranfa/lib/AlbumTypeEstimate.java with 98% similarity]
src/com/ranfa/lib/database/EstimateAlbumTypeCycle.java [moved from src/com/ranfa/lib/EstimateAlbumTypeCycle.java with 99% similarity]
src/com/ranfa/lib/database/Scraping.java [moved from src/com/ranfa/lib/Scraping.java with 98% similarity]
src/com/ranfa/lib/database/Song.java [moved from src/com/ranfa/lib/Song.java with 97% similarity]
src/com/ranfa/lib/database/SongJSONProperty.java [moved from src/com/ranfa/lib/SongJSONProperty.java with 86% similarity]
src/com/ranfa/lib/songinfo/FetchFromAPI.java
src/com/ranfa/main/Messages.java
src/test/FileIOTest.java
src/test/LanguageTest.java
src/test/WebFetchingTest.java

index 2d675aa..620ca13 100644 (file)
   }, {
     "attribute" : "全タイプ",
     "name" : "EVERLASTING",
-    "difficulty" : "MASTER+",
+    "difficulty" : "MASTER+",
     "level" : 30,
     "notes" : 939,
-    "albumType" : "Not-implemented"
+    "albumType" : "ALBUM A"
   }, {
     "attribute" : "全タイプ",
     "name" : "秋風に手を振って",
   }, {
     "attribute" : "パッション",
     "name" : "トロピカルガール",
-    "difficulty" : "MASTER+",
-    "level" : 29,
-    "notes" : 988,
-    "albumType" : "Not-implemented"
-  }, {
-    "attribute" : "パッション",
-    "name" : "スパイスパラダイス",
-    "difficulty" : "WITCH",
-    "level" : 27,
-    "notes" : 566,
-    "albumType" : "Not-Implemented"
-  }, {
-    "attribute" : "パッション",
-    "name" : "トロピカルガール",
-    "difficulty" : "DEBUT",
-    "level" : 8,
-    "notes" : 104,
-    "albumType" : "Not-Implemented"
-  }, {
-    "attribute" : "パッション",
-    "name" : "トロピカルガール",
-    "difficulty" : "REGULAR",
-    "level" : 14,
-    "notes" : 203,
-    "albumType" : "Not-Implemented"
-  }, {
-    "attribute" : "パッション",
-    "name" : "トロピカルガール",
-    "difficulty" : "PRO",
-    "level" : 18,
-    "notes" : 408,
-    "albumType" : "Not-Implemented"
-  }, {
-    "attribute" : "パッション",
-    "name" : "トロピカルガール",
-    "difficulty" : "MASTER",
-    "level" : 26,
-    "notes" : 694,
-    "albumType" : "Not-Implemented"
-  }, {
-    "attribute" : "パッション",
-    "name" : "トロピカルガール",
-    "difficulty" : "MASTER+",
+    "difficulty" : "ⓁMASTER+",
     "level" : 29,
     "notes" : 988,
-    "albumType" : "Not-implemented"
+    "albumType" : "ALBUM C"
   }, {
     "attribute" : "クール",
     "name" : "あこがれステッチ",
     "level" : 30,
     "notes" : 997,
     "albumType" : "Not-implemented"
+  }, {
+    "attribute" : "パッション",
+    "name" : "トロピカルガール",
+    "difficulty" : "MASTER+",
+    "level" : 29,
+    "notes" : 988,
+    "albumType" : "ALBUM C"
+  }, {
+    "attribute" : "パッション",
+    "name" : "青空リレーション",
+    "difficulty" : "MASTER+",
+    "level" : 28,
+    "notes" : 919,
+    "albumType" : "ALBUM C"
+  }, {
+    "attribute" : "クール",
+    "name" : "#HE4DSHOT",
+    "difficulty" : "LIGHT",
+    "level" : 8,
+    "notes" : 184,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "クール",
+    "name" : "#HE4DSHOT",
+    "difficulty" : "TRICK",
+    "level" : 17,
+    "notes" : 381,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "パッション",
+    "name" : "Twin☆くるっ★テール",
+    "difficulty" : "LIGHT",
+    "level" : 7,
+    "notes" : 157,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "パッション",
+    "name" : "Twin☆くるっ★テール",
+    "difficulty" : "TRICK",
+    "level" : 16,
+    "notes" : 359,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "クール",
+    "name" : "ストリート・ランウェイ",
+    "difficulty" : "DEBUT",
+    "level" : 7,
+    "notes" : 115,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "クール",
+    "name" : "ストリート・ランウェイ",
+    "difficulty" : "REGULAR",
+    "level" : 13,
+    "notes" : 236,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "クール",
+    "name" : "ストリート・ランウェイ",
+    "difficulty" : "PRO",
+    "level" : 18,
+    "notes" : 465,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "クール",
+    "name" : "ストリート・ランウェイ",
+    "difficulty" : "MASTER",
+    "level" : 27,
+    "notes" : 802,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "クール",
+    "name" : "ストリート・ランウェイ",
+    "difficulty" : "MASTER+",
+    "level" : 30,
+    "notes" : 999,
+    "albumType" : "Not-implemented"
+  }, {
+    "attribute" : "全タイプ",
+    "name" : "EVERLASTING",
+    "difficulty" : "MASTER+",
+    "level" : 30,
+    "notes" : 941,
+    "albumType" : "ALBUM A"
+  }, {
+    "attribute" : "キュート",
+    "name" : "cherry*merry*cherry",
+    "difficulty" : "MASTER+",
+    "level" : 28,
+    "notes" : 914,
+    "albumType" : "ALBUM A"
   } ]
 }
\ No newline at end of file
index e054db1..fbe62dc 100644 (file)
@@ -28,4 +28,17 @@ MSGNarrowDownProcedure:How to select songs\r\n1.Select difficulty, attribute, an
 MSGCurrentAlbumType:\nCurrent MASTER+ ALBUM type(based on simulation):
 MSGManualUpdate:<html><body>Manual<br>Update</body></html>
 MSGManualUpdateNotCompleteYet:Manual Update has not been finished yet. Please wait a moment.
-MSGConfigurations:Config
\ No newline at end of file
+MSGConfigurations:Config
+MSGAPIWaitAPIFetch:Getting informations from API. Please wait.
+MSGInfoPlayedSongs:The songs you played
+MSGInfoWait:Please wait...
+MSGInfoSongName:Song Name
+MSGInfoLyricsBy:Lyrics By
+MSGInfoSongAttribute:Song Attribute
+MSGInfoComposedBy:Composed By
+MSGInfoSongDifficulty:Difficulty
+MSGInfoArrangedBy:Arranged By
+MSGInfoSongLevel:Song Level
+MSGInfoMember:Member
+MSGInfoSongNotes:Notes
+MSGInfoOpenBrowser:More Information
\ No newline at end of file
index 3bc65e3..0c9a0c8 100644 (file)
@@ -28,4 +28,17 @@ MSGNarrowDownProcedure:\u697d\u66f2\u9078\u629e\u306e\u624b\u9806\r\n\uff11\uff0
 MSGCurrentAlbumType:\n\u73fe\u5728\u306eMASTER+\u30a2\u30eb\u30d0\u30e0\u5468\u671f\uff08\u63a8\u5b9a\uff09\uff1a
 MSGManualUpdate:<html><body>\u624b\u52d5\u66f4\u65b0</body></html>
 MSGManualUpdateNotCompleteYet:\u624b\u52d5\u66f4\u65b0\u304c\u5b8c\u4e86\u3057\u3066\u3044\u307e\u305b\u3093\u3002\u3082\u3046\u3057\u3070\u3089\u304f\u304a\u5f85\u3061\u304f\u3060\u3055\u3044\u3002
-MSGConfigurations:\u8a2d\u5b9a
\ No newline at end of file
+MSGConfigurations:\u8a2d\u5b9a
+MSGAPIWaitAPIFetch:\u697D\u66F2\u60C5\u5831\u0041\u0050\u0049\u3088\u308A\u53D6\u5F97\u4E2D\u3067\u3059\u3002\n\u3057\u3070\u3089\u304F\u304A\u5F85\u3061\u304F\u3060\u3055\u3044\u3002
+MSGInfoPlayedSongs:\u4ECA\u56DE\u30D7\u30EC\u30A4\u3057\u305F\u697D\u66F2
+MSGInfoWait:\u3057\u3070\u3089\u304F\u304A\u5F85\u3061\u304F\u3060\u3055\u3044\u2026
+MSGInfoSongName:\u66F2\u540D
+MSGInfoLyricsBy:\u4F5C\u8A5E\u8005
+MSGInfoSongAttribute:\u66F2\u30BF\u30A4\u30D7
+MSGInfoComposedBy:\u4F5C\u66F2\u8005
+MSGInfoSongDifficulty:\u96E3\u6613\u5EA6
+MSGInfoArrangedBy:\u7DE8\u66F2\u8005
+MSGInfoSongLevel:\u30EC\u30D9\u30EB
+MSGInfoMember:\u767B\u5834\u30E1\u30F3\u30D0\u30FC
+MSGInfoSongNotes:\u30CE\u30FC\u30C8\u6570
+MSGInfoOpenBrowser:\u66F4\u306B\u8A73\u3057\u3044\u60C5\u5831\u3092\u898B\u308B
\ No newline at end of file
index 0b495b0..2b526d4 100644 (file)
@@ -10,6 +10,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.ranfa.lib.concurrent.CountedThreadFactory;
+import com.ranfa.lib.database.Scraping;
+import com.ranfa.lib.database.Song;
 
 public class ManualUpdateThreadImpl implements Runnable {
 
similarity index 91%
rename from src/com/ranfa/lib/Album.java
rename to src/com/ranfa/lib/database/Album.java
index 637c308..301865b 100644 (file)
@@ -1,4 +1,4 @@
-package com.ranfa.lib;
+package com.ranfa.lib.database;
 
 public class Album {
 
similarity index 98%
rename from src/com/ranfa/lib/AlbumTypeEstimate.java
rename to src/com/ranfa/lib/database/AlbumTypeEstimate.java
index 429c5db..6a3a778 100644 (file)
@@ -1,4 +1,4 @@
-package com.ranfa.lib;
+package com.ranfa.lib.database;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -1,4 +1,4 @@
-package com.ranfa.lib;
+package com.ranfa.lib.database;
 
 import java.io.IOException;
 import java.nio.file.Files;
similarity index 98%
rename from src/com/ranfa/lib/Scraping.java
rename to src/com/ranfa/lib/database/Scraping.java
index b122918..8d459bb 100644 (file)
@@ -1,4 +1,4 @@
-package com.ranfa.lib;
+package com.ranfa.lib.database;
 
 import java.io.File;
 import java.io.IOException;
@@ -22,8 +22,8 @@ import org.slf4j.LoggerFactory;
 import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.ObjectWriter;
-import com.ranfa.lib.AlbumTypeEstimate.MASTERPLUS_TYPE;
 import com.ranfa.lib.concurrent.CountedThreadFactory;
+import com.ranfa.lib.database.AlbumTypeEstimate.MASTERPLUS_TYPE;
 import com.ranfa.main.Messages;
 
 public class Scraping {
similarity index 97%
rename from src/com/ranfa/lib/Song.java
rename to src/com/ranfa/lib/database/Song.java
index 655ea55..af4148c 100644 (file)
@@ -1,4 +1,4 @@
-package com.ranfa.lib;
+package com.ranfa.lib.database;
 
 public class Song {
 
similarity index 86%
rename from src/com/ranfa/lib/SongJSONProperty.java
rename to src/com/ranfa/lib/database/SongJSONProperty.java
index 5ee3eca..82729b6 100644 (file)
@@ -1,4 +1,4 @@
-package com.ranfa.lib;
+package com.ranfa.lib.database;
 
 import java.util.List;
 
index 26eeb82..84c4b24 100644 (file)
@@ -47,7 +47,6 @@ public class FetchFromAPI {
                List<JsonNode> listFutures = new ArrayList<>();
                final AtomicInteger n = new AtomicInteger(0);
                for(String songname : Arrays.asList(songnames)) {
-                       DelesteRandomSelector.progressTool.setValue(n.incrementAndGet());
                        DelesteRandomSelector.labelInfoProgressSongName.setText("<html><body>Processing : " + songname + "</body></html>");
                        Map<String, Object> data = fetchList(songname);
                        if(data.getOrDefault("error", "false").equals("true")) {
@@ -60,10 +59,13 @@ public class FetchFromAPI {
                                        .addParameter(Music_Params.ID   , String.valueOf(taxId))
                                        .build();
                        logger.info("fetch data : {}", taxId);
+                       
                        try {
                                listFutures.add(impl.get());
                        } catch (NoSuchURIException | IOException | InterruptedException e) {
                                logger.error("Exception while processing json.", e);
+                       } finally {
+                               DelesteRandomSelector.progressTool.setValue(n.incrementAndGet());
                        }
                }
                DelesteRandomSelector.labelInfoProgressSongName.setText("");
@@ -140,18 +142,15 @@ public class FetchFromAPI {
                                LinkedHashMap<String, String> result = new LinkedHashMap<>();
                                result.put("songname", node.get("name").asText());
                                result.put("link", node.get("link").asText());
-                               String lyric = "",
-                                               composer = "",
-                                               arrange = "";
                                TypeReference<List<Map<String, Object>>> typeRef = new TypeReference<List<Map<String,Object>>>() {};
                                ObjectMapper mapper = new ObjectMapper();
                                List<Map<String, Object>> lyricList = mapper.readValue(node.get("lyrics").traverse(), typeRef),
                                                composerList = mapper.readValue(node.get("composer").traverse(), typeRef),
                                                arrangeList = mapper.readValue(node.get("arrange").traverse(), typeRef);
-                               List<CompletableFuture<String>> nameArraySupplyFutures = List.of(
-                                               CompletableFuture.supplyAsync(() -> getArrayedNames(lyricList), localDispatcher),
-                                               CompletableFuture.supplyAsync(() -> getArrayedNames(composerList), localDispatcher),
-                                               CompletableFuture.supplyAsync(() -> getArrayedNames(arrangeList), localDispatcher)
+                               List<CompletableFuture<Void>> nameArraySupplyFutures = List.of(
+                                               CompletableFuture.supplyAsync(() -> getArrayedNames(lyricList), localDispatcher).thenAcceptAsync(str -> result.put("lyric", str), localDispatcher),
+                                               CompletableFuture.supplyAsync(() -> getArrayedNames(composerList), localDispatcher).thenAcceptAsync(str -> result.put("composer", str), localDispatcher),
+                                               CompletableFuture.supplyAsync(() -> getArrayedNames(arrangeList), localDispatcher).thenAcceptAsync(str -> result.put("arrange", str), localDispatcher)
                                );
                                StringBuilder memberBuilder = new StringBuilder();
                                for(Member tmpMember : mapper.readValue(node.get("member").traverse(), new TypeReference<List<Member>>() {})) {
@@ -161,12 +160,6 @@ public class FetchFromAPI {
                                memberBuilder.deleteCharAt(memberBuilder.length() - 1);
                                result.put("member", memberBuilder.toString());
                                CompletableFuture.allOf(nameArraySupplyFutures.toArray(new CompletableFuture[] {})).join();
-                               lyric = nameArraySupplyFutures.get(0).join();
-                               composer = nameArraySupplyFutures.get(1).join();
-                               arrange = nameArraySupplyFutures.get(2).join();
-                               result.put("lyric", lyric);
-                               result.put("composer", composer);
-                               result.put("arrange", arrange);
                                resultList.add(result);
                        }
                } catch(IOException | InterruptedException e) {
index 08ac302..7599272 100644 (file)
@@ -40,8 +40,20 @@ public enum Messages {
        MSGCurrentAlbumType,
        MSGManualUpdate,
        MSGManualUpdateNotCompleteYet,
-       MSGConfigurations;
-
+       MSGConfigurations,
+       MSGAPIWaitAPIFetch,
+       MSGInfoPlayedSongs,
+       MSGInfoWait,
+       MSGInfoSongName,
+       MSGInfoLyricsBy,
+       MSGInfoSongAttribute,
+       MSGInfoComposedBy,
+       MSGInfoSongDifficulty,
+       MSGInfoArrangedBy,
+       MSGInfoSongLevel,
+       MSGInfoMember,
+       MSGInfoSongNotes,
+       MSGInfoOpenBrowser;
 
        @Override
        public String toString() {
index 5a22b42..b340c1a 100644 (file)
@@ -5,8 +5,8 @@ import static org.junit.Assert.assertTrue;
 import java.util.ArrayList;
 import org.junit.Test;
 
-import com.ranfa.lib.Scraping;
-import com.ranfa.lib.Song;
+import com.ranfa.lib.database.Scraping;
+import com.ranfa.lib.database.Song;
 
 public class FileIOTest {
 
index 6a2c6eb..345f6bd 100644 (file)
@@ -24,35 +24,48 @@ public class LanguageTest {
                // asserts
                assertEquals("開始!", Messages.MSGCalcStart.toString());
                assertEquals("楽曲データベースが見つかりませんでした。自動的に作成されます…\n注意:初回起動ではなく、かつ、Jarファイルと同じ階層に\"database.json\"というファイルが存在するにも関わらず\nこのポップアップが出た場合、開発者までご一報ください。\nGithub URL: https://github.com/hizumiaoba/DelesteRandomSelector/issues", Messages.MSGDatabaseNotExist.toString());
-               assertEquals(Messages.MSGAlbumTypeBeingCalculated.toString(), "計算中...");
-               assertEquals(Messages.MSGNarrowingDownSongs.toString(), "<html><body>楽曲<br>絞り込み</body></html>");
-               assertEquals(Messages.MSGTitle.toString(), "デレステ課題曲セレクター");
-               assertEquals(Messages.MSGSelectDifficulty.toString(), "難易度選択");
-               assertEquals(Messages.MSGNonSelected.toString(), "指定なし");
-               assertEquals(Messages.MSGSongLevel.toString(), "楽曲Lv");
-               assertTrue(Messages.MSGBelowSpecificLevel.toString().equals("指定Lv以下"));
-               assertTrue(Messages.MSGOverSpecificLevel.toString().equals("指定Lv以上"));
-               assertTrue(Messages.MSGLevelCheckboxInfo.toString().equals("<html><body>以下以上両方にチェックをつけることで指定レベルのみ絞り込むことができます</body></html>"));
-               assertTrue(Messages.MSGUpdatingDatabase.toString().equals("<html><body>データベース<br>更新中…</body></html>"));
-               assertTrue(Messages.MSGCompleteNarrowDown.toString().equals("絞り込み完了!「開始」をクリックすることで選曲できます!"));
-               assertTrue(Messages.MSGNumberOfSongs.toString().equals("曲目:"));
-               assertTrue(Messages.MSGThisPhrase.toString().equals("この"));
-               assertTrue(Messages.MSGPlayPhrase.toString().equals("曲をプレイしましょう!!!"));
-               assertTrue(Messages.MSGTwitterIntegration.toString().equals("Twitter連携"));
-               assertTrue(Messages.MSGUsingThisAppPhrase.toString().equals("デレステ課題曲セレクターで\n"));
-               assertTrue(Messages.MSGNotPlayYet.toString().equals("ちひろ「まだプレイを始めていないみたいですね」"));
-               assertTrue(Messages.MSGTwitterPlayOtherwisePhrase.toString().equals("…その他数曲\nをプレイしました!\n"));
-               assertTrue(Messages.MSGTwitterPlayOnlyPhrase.toString().equals("をプレイしました!"));
-               assertTrue(Messages.MSGTwitterIntegrationConfirm.toString().equals("Twitterへ以下の内容を投稿します。よろしいですか?\n\n"));
-               assertTrue(Messages.MSGStringLength.toString().equals("\n\n文字数:"));
-               assertTrue(Messages.MSGCompletePost.toString().equals("投稿が完了しました。"));
-               assertTrue(Messages.MSGTerminate.toString().equals("終了"));
-               assertTrue(Messages.MSGInternalYpdateNotDoneYet.toString().equals("内部更新処理が完了していません。少し待ってからやり直してください。"));
-               assertTrue(Messages.MSGNarrowDownProcedure.toString().equals("楽曲選択の手順\r\n1.難易度、属性、レベルを選択する\r\n2.「楽曲取り込み」ボタンを押す!\r\n3.「開始」ボタンを押す!\r\n4.選択された楽曲がここに表示されます!\r\n現在設定されている楽曲選択の最大数:"));
-               assertTrue(Messages.MSGCurrentAlbumType.toString().equals("\n現在のMASTER+アルバム周期(推定):"));
-               assertTrue(Messages.MSGManualUpdate.toString().equals("<html><body>手動更新</body></html>"));
-               assertTrue(Messages.MSGManualUpdateNotCompleteYet.toString().equals("手動更新が完了していません。もうしばらくお待ちください。"));
+               assertEquals("計算中...", Messages.MSGAlbumTypeBeingCalculated.toString());
+               assertEquals("<html><body>楽曲<br>絞り込み</body></html>", Messages.MSGNarrowingDownSongs.toString());
+               assertEquals("デレステ課題曲セレクター", Messages.MSGTitle.toString());
+               assertEquals("難易度選択", Messages.MSGSelectDifficulty.toString());
+               assertEquals("指定なし", Messages.MSGNonSelected.toString());
+               assertEquals("楽曲Lv", Messages.MSGSongLevel.toString());
+               assertEquals("指定Lv以下", Messages.MSGBelowSpecificLevel.toString());
+               assertEquals("指定Lv以上", Messages.MSGOverSpecificLevel.toString());
+               assertEquals("<html><body>以下以上両方にチェックをつけることで指定レベルのみ絞り込むことができます</body></html>", Messages.MSGLevelCheckboxInfo.toString());
+               assertEquals("<html><body>データベース<br>更新中…</body></html>", Messages.MSGUpdatingDatabase.toString());
+               assertEquals("絞り込み完了!「開始」をクリックすることで選曲できます!", Messages.MSGCompleteNarrowDown.toString());
+               assertEquals("曲目:", Messages.MSGNumberOfSongs.toString());
+               assertEquals("この", Messages.MSGThisPhrase.toString());
+               assertEquals("曲をプレイしましょう!!!", Messages.MSGPlayPhrase.toString());
+               assertEquals("Twitter連携", Messages.MSGTwitterIntegration.toString());
+               assertEquals("デレステ課題曲セレクターで\n", Messages.MSGUsingThisAppPhrase.toString());
+               assertEquals("ちひろ「まだプレイを始めていないみたいですね」", Messages.MSGNotPlayYet.toString());
+               assertEquals("…その他数曲\nをプレイしました!\n", Messages.MSGTwitterPlayOtherwisePhrase.toString());
+               assertEquals("をプレイしました!", Messages.MSGTwitterPlayOnlyPhrase.toString());
+               assertEquals("Twitterへ以下の内容を投稿します。よろしいですか?\n\n", Messages.MSGTwitterIntegrationConfirm.toString());
+               assertEquals("\n\n文字数:", Messages.MSGStringLength.toString());
+               assertEquals("投稿が完了しました。", Messages.MSGCompletePost.toString());
+               assertEquals("終了", Messages.MSGTerminate.toString());
+               assertEquals("内部更新処理が完了していません。少し待ってからやり直してください。", Messages.MSGInternalYpdateNotDoneYet.toString());
+               assertEquals("楽曲選択の手順\r\n1.難易度、属性、レベルを選択する\r\n2.「楽曲取り込み」ボタンを押す!\r\n3.「開始」ボタンを押す!\r\n4.選択された楽曲がここに表示されます!\r\n現在設定されている楽曲選択の最大数:", Messages.MSGNarrowDownProcedure.toString());
+               assertEquals("\n現在のMASTER+アルバム周期(推定):", Messages.MSGCurrentAlbumType.toString());
+               assertEquals("<html><body>手動更新</body></html>", Messages.MSGManualUpdate.toString());
+               assertEquals("手動更新が完了していません。もうしばらくお待ちください。", Messages.MSGManualUpdateNotCompleteYet.toString());
                assertEquals("設定", Messages.MSGConfigurations.toString());
+               assertEquals("楽曲情報APIより取得中です。\nしばらくお待ちください。", Messages.MSGAPIWaitAPIFetch.toString());
+               assertEquals("今回プレイした楽曲", Messages.MSGInfoPlayedSongs.toString());
+               assertEquals("しばらくお待ちください…", Messages.MSGInfoWait.toString());
+               assertEquals("曲名", Messages.MSGInfoSongName.toString());
+               assertEquals("作詞者", Messages.MSGInfoLyricsBy.toString());
+               assertEquals("曲タイプ", Messages.MSGInfoSongAttribute.toString());
+               assertEquals("作曲者", Messages.MSGInfoComposedBy.toString());
+               assertEquals("難易度", Messages.MSGInfoSongDifficulty.toString());
+               assertEquals("編曲者", Messages.MSGInfoArrangedBy.toString());
+               assertEquals("レベル", Messages.MSGInfoSongLevel.toString());
+               assertEquals("登場メンバー", Messages.MSGInfoMember.toString());
+               assertEquals("ノート数", Messages.MSGInfoSongNotes.toString());
+               assertEquals("更に詳しい情報を見る", Messages.MSGInfoOpenBrowser.toString());
        }
 
        @Test
@@ -61,37 +74,50 @@ public class LanguageTest {
                Locale.setDefault(this.us);
 
                // asserts
-               assertTrue(Messages.MSGCalcStart.toString().equals("Start!"));
-               assertTrue(Messages.MSGDatabaseNotExist.toString().equals("Music database does not exist.\nIt will be automatically created.\nATTENTION:There is the JSON file named \"database.json\" in the same directory which executable is contained and you see this pop up,\nPlease contact the Developer.\nGithub URL: https://github.com/hizumiaoba/DelesteRandomSelector/issues"));
-               assertTrue(Messages.MSGAlbumTypeBeingCalculated.toString().equals("Simulating..."));
-               assertTrue(Messages.MSGNarrowingDownSongs.toString().equals("<html><body>Narrow down<br>songs</body></html>"));
-               assertTrue(Messages.MSGTitle.toString().equals("DelesteRandomSelector"));
-               assertTrue(Messages.MSGSelectDifficulty.toString().equals("Difficulty"));
-               assertTrue(Messages.MSGNonSelected.toString().equals("Non-Select"));
-               assertTrue(Messages.MSGSongLevel.toString().equals("Level"));
-               assertTrue(Messages.MSGBelowSpecificLevel.toString().equals("Below Lv"));
-               assertTrue(Messages.MSGOverSpecificLevel.toString().equals("Above Lv"));
-               assertTrue(Messages.MSGLevelCheckboxInfo.toString().equals("<html><body>Only specified level songs will be selected if you mark both checkbox.</body></html>"));
-               assertTrue(Messages.MSGUpdatingDatabase.toString().equals("<html><body>Updating<br>database</body></html>"));
-               assertTrue(Messages.MSGCompleteNarrowDown.toString().equals("Narrowing down complete! Click \"Start!\" to play!"));
-               assertTrue(Messages.MSGNumberOfSongs.toString().equals("tracks:"));
-               assertTrue(Messages.MSGThisPhrase.toString().equals("Let's play these"));
-               assertTrue(Messages.MSGPlayPhrase.toString().equals("songs!"));
-               assertTrue(Messages.MSGTwitterIntegration.toString().equals("<html><body>Post to Twitter</body></html>"));
-               assertTrue(Messages.MSGUsingThisAppPhrase.toString().equals("I played\n"));
-               assertTrue(Messages.MSGNotPlayYet.toString().equals("It seems that you don't start playing yet?"));
-               assertTrue(Messages.MSGTwitterPlayOtherwisePhrase.toString().equals("...and some songs!\n"));
-               assertTrue(Messages.MSGTwitterPlayOnlyPhrase.toString().equals("songs!"));
-               assertTrue(Messages.MSGTwitterIntegrationConfirm.toString().equals("Are you sure you want to post this?\n\n"));
-               assertTrue(Messages.MSGStringLength.toString().equals("\n\nNumber of Characters"));
-               assertTrue(Messages.MSGCompletePost.toString().equals("Complete to post."));
-               assertTrue(Messages.MSGTerminate.toString().equals("End"));
-               assertTrue(Messages.MSGInternalYpdateNotDoneYet.toString().equals("Internal update in progress. Please wait a moment."));
-               assertTrue(Messages.MSGNarrowDownProcedure.toString().equals("How to select songs\r\n1.Select difficulty, attribute, and level.\r\n2.Click [Narrow down songs] button.\r\n3.Click [start!] button.\r\n4.Selected songs will be shown here!\r\nThe maximum number of selected songs:"));
-               assertTrue(Messages.MSGCurrentAlbumType.toString().equals("\nCurrent MASTER+ ALBUM type(based on simulation):"));
-               assertTrue(Messages.MSGManualUpdate.toString().equals("<html><body>Manual<br>Update</body></html>"));
-               assertTrue(Messages.MSGManualUpdateNotCompleteYet.toString().equals("Manual Update has not been finished yet. Please wait a moment."));
+               assertEquals("Start!", Messages.MSGCalcStart.toString());
+               assertEquals("Music database does not exist.\nIt will be automatically created.\nATTENTION:There is the JSON file named \"database.json\" in the same directory which executable is contained and you see this pop up,\nPlease contact the Developer.\nGithub URL: https://github.com/hizumiaoba/DelesteRandomSelector/issues", Messages.MSGDatabaseNotExist.toString());
+               assertEquals("Simulating...", Messages.MSGAlbumTypeBeingCalculated.toString());
+               assertEquals("<html><body>Narrow down<br>songs</body></html>", Messages.MSGNarrowingDownSongs.toString());
+               assertEquals("DelesteRandomSelector", Messages.MSGTitle.toString());
+               assertEquals("Difficulty", Messages.MSGSelectDifficulty.toString());
+               assertEquals("Non-Select", Messages.MSGNonSelected.toString());
+               assertEquals("Level", Messages.MSGSongLevel.toString());
+               assertEquals("Below Lv", Messages.MSGBelowSpecificLevel.toString());
+               assertEquals("Above Lv", Messages.MSGOverSpecificLevel.toString());
+               assertEquals("<html><body>Only specified level songs will be selected if you mark both checkbox.</body></html>", Messages.MSGLevelCheckboxInfo.toString());
+               assertEquals("<html><body>Updating<br>database</body></html>", Messages.MSGUpdatingDatabase.toString());
+               assertEquals("Narrowing down complete! Click \"Start!\" to play!", Messages.MSGCompleteNarrowDown.toString());
+               assertEquals("tracks:", Messages.MSGNumberOfSongs.toString());
+               assertEquals("Let's play these", Messages.MSGThisPhrase.toString());
+               assertEquals("songs!", Messages.MSGPlayPhrase.toString());
+               assertEquals("<html><body>Post to Twitter</body></html>", Messages.MSGTwitterIntegration.toString());
+               assertEquals("I played\n", Messages.MSGUsingThisAppPhrase.toString());
+               assertEquals("It seems that you don't start playing yet?", Messages.MSGNotPlayYet.toString());
+               assertEquals("...and some songs!\n", Messages.MSGTwitterPlayOtherwisePhrase.toString());
+               assertEquals("songs!", Messages.MSGTwitterPlayOnlyPhrase.toString());
+               assertEquals("Are you sure you want to post this?\n\n", Messages.MSGTwitterIntegrationConfirm.toString());
+               assertEquals("\n\nNumber of Characters", Messages.MSGStringLength.toString());
+               assertEquals("Complete to post.", Messages.MSGCompletePost.toString());
+               assertEquals("End", Messages.MSGTerminate.toString());
+               assertEquals("Internal update in progress. Please wait a moment.", Messages.MSGInternalYpdateNotDoneYet.toString());
+               assertEquals("How to select songs\r\n1.Select difficulty, attribute, and level.\r\n2.Click [Narrow down songs] button.\r\n3.Click [start!] button.\r\n4.Selected songs will be shown here!\r\nThe maximum number of selected songs:", Messages.MSGNarrowDownProcedure.toString());
+               assertEquals("\nCurrent MASTER+ ALBUM type(based on simulation):", Messages.MSGCurrentAlbumType.toString());
+               assertEquals("<html><body>Manual<br>Update</body></html>", Messages.MSGManualUpdate.toString());
+               assertEquals("Manual Update has not been finished yet. Please wait a moment.", Messages.MSGManualUpdateNotCompleteYet.toString());
                assertEquals("Config", Messages.MSGConfigurations.toString());
+               assertEquals("Getting informations from API. Please wait.", Messages.MSGAPIWaitAPIFetch.toString());
+               assertEquals("The songs you played", Messages.MSGInfoPlayedSongs.toString());
+               assertEquals("Please wait...", Messages.MSGInfoWait.toString());
+               assertEquals("Song Name", Messages.MSGInfoSongName.toString());
+               assertEquals("Lyrics By", Messages.MSGInfoLyricsBy.toString());
+               assertEquals("Song Attribute", Messages.MSGInfoSongAttribute.toString());
+               assertEquals("Composed By", Messages.MSGInfoComposedBy.toString());
+               assertEquals("Difficulty", Messages.MSGInfoSongDifficulty.toString());
+               assertEquals("Arranged By", Messages.MSGInfoArrangedBy.toString());
+               assertEquals("Song Level", Messages.MSGInfoSongLevel.toString());
+               assertEquals("Member", Messages.MSGInfoMember.toString());
+               assertEquals("Notes", Messages.MSGInfoSongNotes.toString());
+               assertEquals("More Information", Messages.MSGInfoOpenBrowser.toString());
        }
 
        @After
index f4930e6..9a246df 100644 (file)
@@ -6,9 +6,9 @@ import java.util.ArrayList;
 
 import org.junit.Test;
 
-import com.ranfa.lib.EstimateAlbumTypeCycle;
-import com.ranfa.lib.Scraping;
-import com.ranfa.lib.Song;
+import com.ranfa.lib.database.EstimateAlbumTypeCycle;
+import com.ranfa.lib.database.Scraping;
+import com.ranfa.lib.database.Song;
 
 public class WebFetchingTest {