1 /*
   2  * $Id$
   3  *
   4  * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
   5  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   6  *
   7  * This code is free software; you can redistribute it and/or modify it
   8  * under the terms of the GNU General Public License version 2 only, as
   9  * published by the Free Software Foundation.  Oracle designates this
  10  * particular file as subject to the "Classpath" exception as provided
  11  * by Oracle in the LICENSE file that accompanied this code.
  12  *
  13  * This code is distributed in the hope that it will be useful, but WITHOUT
  14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16  * version 2 for more details (a copy is included in the LICENSE file that
  17  * accompanied this code).
  18  *
  19  * You should have received a copy of the GNU General Public License version
  20  * 2 along with this work; if not, write to the Free Software Foundation,
  21  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  22  *
  23  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  24  * or visit www.oracle.com if you need additional information or have any
  25  * questions.
  26  */
  27 
  28 package com.sun.javatest.junit;
  29 
  30 import com.sun.interview.Question;
  31 import com.sun.javatest.Parameters;
  32 import com.sun.javatest.TestEnvironment;
  33 import com.sun.javatest.interview.BasicInterviewParameters;
  34 import java.util.HashMap;
  35 
  36 /**
  37  * A basic interview for JUnit test suite.  Doesn't require input from the user.
  38  */
  39 public class JUnitBaseInterview extends BasicInterviewParameters implements Parameters.EnvParameters {
  40 
  41     /** Creates a new instance of JUnitBaseInterview */
  42     public JUnitBaseInterview() throws Fault {
  43         super("junit");
  44     }
  45 
  46     protected Question getEnvFirstQuestion() {
  47         return getEnvSuccessorQuestion();
  48     }
  49 
  50     public EnvParameters getEnvParameters() {
  51         return this;
  52     }
  53 
  54     public TestEnvironment getEnv() {
  55         try {
  56             return new TestEnvironment("junitenv", new HashMap<String, String>(), "junit");
  57         }
  58         catch (TestEnvironment.Fault f) {
  59            f.printStackTrace();
  60            throw new RuntimeException();
  61         }
  62     }
  63 }