作業部屋の使い方を試しています。
(empty log message)
| @@ -0,0 +1,49 @@ | ||
| 1 | + | |
| 2 | +package utility.test1; | |
| 3 | + | |
| 4 | +import webScraping.utility.SearchDataRW; | |
| 5 | +import java.io.File; | |
| 6 | +import java.lang.reflect.InvocationTargetException; | |
| 7 | +import java.lang.reflect.Method; | |
| 8 | +import java.util.logging.Level; | |
| 9 | +import java.util.logging.Logger; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * | |
| 13 | + * @author kgto | |
| 14 | + */ | |
| 15 | + | |
| 16 | +public class SearchDataRWT01 { | |
| 17 | + SearchDataRW sio = new SearchDataRW(); | |
| 18 | + | |
| 19 | + File file = new File("SearchDataRWT01.xml"); | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * @param args the command line arguments | |
| 23 | + */ | |
| 24 | + public static void main(String[] args) { | |
| 25 | + SearchDataRWT01 test01 = new SearchDataRWT01(); | |
| 26 | + test01.save01(); | |
| 27 | + } | |
| 28 | + | |
| 29 | + void SearchDataRWT01() { | |
| 30 | + } | |
| 31 | + | |
| 32 | + void save01() { | |
| 33 | + try { | |
| 34 | + String str = "abc\ndef\nghi\n1111"; | |
| 35 | + | |
| 36 | + //sio.saveMsg404(str); | |
| 37 | + // リフレクション | |
| 38 | + Method method = SearchDataRW.class.getDeclaredMethod("saveMsg404", String.class); | |
| 39 | + method.setAccessible(true); | |
| 40 | + method.invoke(sio, str); | |
| 41 | + | |
| 42 | + sio.write(file); | |
| 43 | + | |
| 44 | + } catch (NoSuchMethodException | SecurityException | |
| 45 | + | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { | |
| 46 | + Logger.getLogger(SearchDataRWT01.class.getName()).log(Level.SEVERE, null, ex); | |
| 47 | + } | |
| 48 | + } | |
| 49 | +} |
| @@ -0,0 +1,114 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (C) 2014 kgto. | |
| 3 | + * | |
| 4 | + * This library is free software; you can redistribute it and/or | |
| 5 | + * modify it under the terms of the GNU Lesser General Public | |
| 6 | + * License as published by the Free Software Foundation; either | |
| 7 | + * version 2.1 of the License, or (at your option) any later version. | |
| 8 | + * | |
| 9 | + * This library is distributed in the hope that it will be useful, | |
| 10 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | + * Lesser General Public License for more details. | |
| 13 | + * | |
| 14 | + * You should have received a copy of the GNU Lesser General Public | |
| 15 | + * License along with this library; if not, write to the Free Software | |
| 16 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | |
| 17 | + * MA 02110-1301 USA | |
| 18 | + */ | |
| 19 | +package core.test1; | |
| 20 | + | |
| 21 | +import webScraping.core.DebugProcess; | |
| 22 | +import javax.swing.text.MutableAttributeSet; | |
| 23 | +import javax.swing.text.html.HTML; | |
| 24 | +import org.junit.AfterClass; | |
| 25 | +import org.junit.BeforeClass; | |
| 26 | +import org.junit.Test; | |
| 27 | +import static org.junit.Assert.*; | |
| 28 | + | |
| 29 | +import org.junit.AfterClass; | |
| 30 | +import org.junit.BeforeClass; | |
| 31 | +import org.junit.Test; | |
| 32 | +import static org.junit.Assert.*; | |
| 33 | + | |
| 34 | +/** | |
| 35 | + * | |
| 36 | + * @author kgto | |
| 37 | + */ | |
| 38 | + | |
| 39 | + | |
| 40 | +public class DebugProcessTest { | |
| 41 | + | |
| 42 | + public DebugProcessTest() { | |
| 43 | + } | |
| 44 | + | |
| 45 | + @BeforeClass | |
| 46 | + public static void setUpClass() { | |
| 47 | + } | |
| 48 | + | |
| 49 | + @AfterClass | |
| 50 | + public static void tearDownClass() { | |
| 51 | + } | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * Test of debuglog_set method, of class DebugProcess. | |
| 55 | + */ | |
| 56 | + @Test | |
| 57 | + public void testDebuglog_set() { | |
| 58 | + System.out.println("debuglog_set"); | |
| 59 | + DebugProcess.debuglog_set(); | |
| 60 | + // TODO review the generated test code and remove the default call to fail. | |
| 61 | + fail("The test case is a prototype."); | |
| 62 | + } | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * Test of debuglog_unset method, of class DebugProcess. | |
| 66 | + */ | |
| 67 | + @Test | |
| 68 | + public void testDebuglog_unset() { | |
| 69 | + System.out.println("debuglog_unset"); | |
| 70 | + DebugProcess.debuglog_unset(); | |
| 71 | + // TODO review the generated test code and remove the default call to fail. | |
| 72 | + fail("The test case is a prototype."); | |
| 73 | + } | |
| 74 | + | |
| 75 | + /** | |
| 76 | + * Test of htmlinfo method, of class DebugProcess. | |
| 77 | + */ | |
| 78 | + @Test | |
| 79 | + public void testHtmlinfo_4args() { | |
| 80 | + System.out.println("htmlinfo"); | |
| 81 | + HTML.Tag tag = null; | |
| 82 | + MutableAttributeSet attr = null; | |
| 83 | + String methodname = ""; | |
| 84 | + int count = 0; | |
| 85 | + DebugProcess.htmlinfo(tag, attr, methodname, count); | |
| 86 | + // TODO review the generated test code and remove the default call to fail. | |
| 87 | + fail("The test case is a prototype."); | |
| 88 | + } | |
| 89 | + | |
| 90 | + /** | |
| 91 | + * Test of htmlinfo method, of class DebugProcess. | |
| 92 | + */ | |
| 93 | + @Test | |
| 94 | + public void testHtmlinfo_String() { | |
| 95 | + System.out.println("htmlinfo"); | |
| 96 | + String str = ""; | |
| 97 | + DebugProcess.htmlinfo(str); | |
| 98 | + // TODO review the generated test code and remove the default call to fail. | |
| 99 | + fail("The test case is a prototype."); | |
| 100 | + } | |
| 101 | + | |
| 102 | + /** | |
| 103 | + * Test of htmlinfo method, of class DebugProcess. | |
| 104 | + */ | |
| 105 | + @Test | |
| 106 | + public void testHtmlinfo_charArr() { | |
| 107 | + System.out.println("htmlinfo"); | |
| 108 | + char[] data = null; | |
| 109 | + DebugProcess.htmlinfo(data); | |
| 110 | + // TODO review the generated test code and remove the default call to fail. | |
| 111 | + fail("The test case is a prototype."); | |
| 112 | + } | |
| 113 | + | |
| 114 | +} |
| @@ -450,7 +450,7 @@ | ||
| 450 | 450 | } |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | - public void saveMsg404(String msg) { | |
| 453 | + void saveMsg404(String msg) { | |
| 454 | 454 | checkdoc(); |
| 455 | 455 | removeElement("msg404"); // 既にElementが存在してた場合、一度削除 |
| 456 | 456 |