sampletestsuite.java.svn-base

来自「cqME :java framework for TCK test.」· SVN-BASE 代码 · 共 90 行

SVN-BASE
90
字号
/* * $Id$ * * Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version * 2 only, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License version 2 for more details (a copy is * included at /legal/license.txt). * * You should have received a copy of the GNU General Public License * version 2 along with this work; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa * Clara, CA 95054 or visit www.sun.com if you need additional * information or have any questions. * */package sample.suite;import java.io.File;import java.util.Map;import com.sun.javatest.InterviewParameters;import com.sun.javatest.util.I18NResourceBundle;import com.sun.tck.j2me.interview.BasicTckInterview;import com.sun.tck.j2me.javatest.J2meBaseTestSuite;/** * Sample test suite. */public class SampleTestSuite extends J2meBaseTestSuite {    public SampleTestSuite(File root, Map tsInfo, ClassLoader cl) throws Fault {        super(root, tsInfo, cl);    }        public InterviewParameters createInterview() throws Fault {        try {                        // ME Framework 1.1.1:            // Subclass the BasicTckInterview, to workaround a problem            // with the undefined help set (More Info) in it.            return new ParamsInterview(this);                        // For ME Framework 1.1.2+:            // There is no need for the workaround, and the BasicTckInterview            // can be created directly, without subclassing.            //            // NOTE: subclassing might be needed to customize the interview.            //            // return new BasicTckInterview(            //         this, "sample.suite.SampleInterview");        } catch (com.sun.interview.Interview.Fault fault) {            fault.printStackTrace();            throw new com.sun.javatest.TestSuite.Fault(i18n,                     "ts.errorInitInterview", fault.getMessage());        }    }    // This class is part of workaround for ME Framework 1.1.1, see above.    private final static class ParamsInterview extends BasicTckInterview {        public ParamsInterview(J2meBaseTestSuite ts) throws Fault {            super(ts, "sample.suite.SampleInterview");            setResourceBundle("i18n");            setHelpSet("help/sampleInterview");            setKeywordsEnabled(false);        }        public boolean isDistrMode() {            return false;        }    }        protected boolean shouldEnableDistrTests() {        return false;    }    private static final I18NResourceBundle i18n =        I18NResourceBundle.getBundleForClass(SampleTestSuite.class);}

⌨️ 快捷键说明

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