portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jf...@apache.org
Subject cvs commit: jakarta-jetspeed/plugin/src/plugin-resources/default/template-resources/src/test/services/myservice TestMyService.java
Date Thu, 22 Apr 2004 16:07:23 GMT
jford       2004/04/22 09:07:23

  Added:       plugin/src/plugin-resources/default/template-resources/src/test/services/myservice
                        TestMyService.java
  Log:
  Added test for service.  Will need to determine how to enable Turbine
  
  Revision  Changes    Path
  1.1                  jakarta-jetspeed/plugin/src/plugin-resources/default/template-resources/src/test/services/myservice/TestMyService.java
  
  Index: TestMyService.java
  ===================================================================
  /*
   * Copyright 2000-2001,2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package @PACKAGE@.services.myservice;
  
  import junit.awtui.TestRunner;
  import junit.framework.Test;
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  
  import org.apache.turbine.util.StringUtils;
  import org.apache.turbine.util.TurbineConfig;
  
  //Log4j classes
  import org.apache.log4j.Logger;
  import org.apache.log4j.Level;
  import org.apache.log4j.ConsoleAppender;
  import org.apache.log4j.SimpleLayout;
  
  public class TestMyService extends TestCase
  {
      /**
       * Defines the testcase name for JUnit.
       *
       * @param name the testcase's name.
       */
      public TestMyService( String name )
      {
          super( name );
      }
      
      /**
       * Start the tests.
       *
       * @param args the arguments. Not used
       */
      public static void main(String args[])
      {
          TestRunner.main( new String[]
          { TestMyService.class.getName() } );
      }
      
      public void setup()
      {
          System.out.println("Setup: Testing MyService");
      }
      /**
       * Creates the test suite.
       *
       * @return a test suite (<code>TestSuite</code>) that includes all methods
       *         starting with "test"
       */
      public static Test suite()
      {
          // All methods starting with "test" will be executed in the test suite.
          return new TestSuite( TestMyService.class );
      }
      
      public void testMyService() throws Exception
      {
          //this passes
      }
      
      /*
       * Setup Turbine environment
       */
      
      /*
       * Configuration object to run Turbine outside a servlet container
       * ( uses turbine.properties )
       */
      private static TurbineConfig config = null;
      
      /*
       * Sets up TurbineConfig using the system property:
       * <pre>turbine.properties</pre>
       */
      static
      {
          try
          {
              
  //             Done
              ConsoleAppender ca = new ConsoleAppender(new SimpleLayout());
              Logger root = Logger.getRootLogger();
              root.setLevel(Level.INFO);
              root.addAppender(ca);
  
              //config = new TurbineConfig( "webapp", "/WEB-INF/conf/TurbineResources.properties");
              //config.init();
          }
          catch (Exception e)
          {
              fail(StringUtils.stackTrace(e));
          }
      }
  }
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message