皇家方舟

          從文件中取測試數據進行單元測試

          ?public void testPopSortFromFile() throws IOException
          ?{
          ??@SuppressWarnings("unused")
          ??String line = "";
          ??FileReader myFileReader = new FileReader("com/liyingcheng/testFiles/TestPopSort.txt");//相對路徑
          ??BufferedReader myBufferedReader=new BufferedReader(myFileReader);
          ??while((line = myBufferedReader.readLine())!=null)
          ??{
          ???if(line.startsWith("#"))
          ???{
          ????continue;
          ???}
          ???
          ???String[] tokens = line.split(",");
          ???
          ???int[] actual = {Integer.parseInt(tokens[0]),Integer.parseInt(tokens[1]),Integer.parseInt(tokens[2])};
          ???int[] expected = {Integer.parseInt(tokens[3]),Integer.parseInt(tokens[4]),Integer.parseInt(tokens[5])};
          ???testSinglePopSort(expected,actual);
          ??}
          ?}


          posted on 2006-09-20 14:40 阿輝 閱讀(282) 評論(0)  編輯  收藏 所屬分類: junit

          My Links

          Blog Stats

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 军事| 通江县| 娄底市| 辉县市| 承德市| 北安市| 广东省| 道真| 桦川县| 同江市| 肥城市| 开化县| 铜鼓县| 铁岭市| 容城县| 栾城县| 大理市| 湘阴县| 浦东新区| 福建省| 白沙| 赤峰市| 手游| 松原市| 滦平县| 乐东| 六盘水市| 永兴县| 孝义市| 安新县| 肇庆市| 枞阳县| 宜宾市| 独山县| 西丰县| 龙陵县| 河北省| 句容市| 襄城县| 远安县| 新兴县|