thomsoncfg.java

来自「openacs source for CPE wan management」· Java 代码 · 共 69 行

JAVA
69
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package open.acs.test;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileReader;import java.io.IOException;import java.nio.CharBuffer;import java.util.logging.Level;import java.util.logging.Logger;import junit.framework.TestCase;import org.openacs.vendors.Vendor;/** * * @author Administrator */public class thomsoncfg extends TestCase {        public thomsoncfg(String testName) {        super(testName);    }    @Override    protected void setUp() throws Exception {        super.setUp();    }    @Override    protected void tearDown() throws Exception {        super.tearDown();    }    // TODO add test methods here. The name must begin with 'test'. For example:    // public void testHello() {}    public void test1 () {        FileInputStream fin = null;        try {            Vendor v = Vendor.getVendor("00147F", "sss", "BANT-V");            fin = new FileInputStream("c:/tmp/user_780.ini");            byte[] b = new byte[fin.available()];            fin.read(b);            fin.close();            String cfg = new String(b);            String r [] = v.CheckConfig("user.ini", "badname", "badversion", cfg);            Logger.getLogger(thomsoncfg.class.getName()).log(Level.SEVERE, null, r);                    } catch (FileNotFoundException ex) {            Logger.getLogger(thomsoncfg.class.getName()).log(Level.SEVERE, null, ex);        } catch (IOException ex) {            Logger.getLogger(thomsoncfg.class.getName()).log(Level.SEVERE, null, ex);        } finally {            try {                fin.close();            } catch (IOException ex) {                Logger.getLogger(thomsoncfg.class.getName()).log(Level.SEVERE, null, ex);            }        }    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?