wrapperinterview.java.svn-base

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

SVN-BASE
99
字号
/* * $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 com.sun.tdk.sampletck.interview;import com.sun.interview.FinalQuestion;import com.sun.interview.Interview;import com.sun.interview.NullQuestion;import com.sun.interview.Question;import com.sun.interview.IntQuestion;import java.util.Map;/** * Sub-interview to gather information about the AdvancedTestSuite specific capabilities * of an implementation. */public class WrapperInterview extends Interview {    public WrapperInterview(AdvancedTestSuiteInterview parent) {	super(parent, "wrapper");	setResourceBundle("wrapper");	setFirstQuestion(qLink);        mainInterview = parent;        init();    }    private void init() {                try {	    setHelpSet("help/sample");	} catch (Interview.HelpNotFoundFault f) {        } catch (Interview.BadHelpFault f) {}    }    private NullQuestion qLink = new NullQuestion(this, "welcome") {          public Question getNext() {                  return qServerPort;          }    };   /**   * get the serverPort for the distributed tests    *    * This is an example of showing how to pass the info.    * from the interview to the tests. Please also   * see the decodeArg() used in the StockTest.java   */    private IntQuestion qServerPort = new IntQuestion(this, "serverPort", 1, 65535) {       public void export(Map map) {           map.put("serverPort", Integer.toString(getValue()));       }           public Question getNext() {           if (isValid()) {               return  qEnd;	   } else {	       return null;	   }       }   };    private FinalQuestion qEnd = new FinalQuestion(this);    private AdvancedTestSuiteInterview mainInterview;    }

⌨️ 快捷键说明

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