taylor      02/03/23 11:39:42

  Modified:    src/java/org/apache/jetspeed/services/psmlmanager
                        TestMarshalPsml.java
  Log:
  Fixed test to startup Turbine config and services
  
  Revision  Changes    Path
  1.2       +37 -6     
jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/TestMarshalPsml.java
  
  Index: TestMarshalPsml.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/TestMarshalPsml.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestMarshalPsml.java      22 Mar 2002 18:51:56 -0000      1.1
  +++ TestMarshalPsml.java      23 Mar 2002 19:39:42 -0000      1.2
  @@ -20,11 +20,18 @@
   
   import org.apache.jetspeed.om.profile.*;
   
  +import org.apache.turbine.services.TurbineServices;
  +import org.apache.jetspeed.services.idgenerator.*;
  +import org.apache.stratum.configuration.Configuration;
  +import org.apache.stratum.configuration.PropertiesConfiguration;
  +import org.apache.turbine.util.TurbineConfig;
  +import org.apache.turbine.util.StringUtils;
  +
   /**
    * TestMarshalPsml
    *
    * @author <a href="[EMAIL PROTECTED]">David Sean Taylor</a>
  - * @version $Id: TestMarshalPsml.java,v 1.1 2002/03/22 18:51:56 taylor Exp $
  + * @version $Id: TestMarshalPsml.java,v 1.2 2002/03/23 19:39:42 taylor Exp $
    */
   //public class TestMarshalPsml extends ServletTestCase {
   public class TestMarshalPsml extends TestCase {    
  @@ -106,7 +113,7 @@
               }
               catch (Exception e)
               {
  -                String errmsg = "Error in psml mapping creation" + e.toString();
  +                String errmsg = "Error in psml mapping creation: " + e.toString();
                   System.err.println(errmsg);
                   assertNotNull(errmsg, null);
               }
  @@ -246,12 +253,13 @@
   
                   Entry e3 = (Entry)pe.elementAt(2);
                   assertTrue(e3.getParent().equals("HelloCleveland"));    
  -                assertTrue(e3.getId().equals("9999"));    
  +                assertTrue(e3.getId().startsWith("P-"));    
  +                System.out.println(e3.getId());
   
               }
               catch (Exception e)
               {
  -                String errmsg = "Error in psml mapping creation" + e.toString();
  +                String errmsg = "Error in psml mapping creation: " + e.toString();
                   System.err.println(errmsg);
                   assertNotNull(errmsg, null);
               }
  @@ -295,18 +303,41 @@
               }
               catch (Exception e)
               {
  -                String errmsg = "Error in psml mapping creation" + e.toString();
  +                String errmsg = "Error in psml mapping creation: " + e.toString();
                   System.err.println(errmsg);
                   assertNotNull(errmsg, null);
               }
           }
           else
           {
  -            String errmsg = "PSML Mapping not found or not a file or unreadable: ";
  +            String errmsg = "PSML Mapping not found or not a file or unreadable.";
               System.err.println(errmsg);
               assertNotNull(errmsg, null);
           }
      
  +    }
  +
  +  /*
  +    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
  +        {
  +        config = new TurbineConfig( "../webapp", 
"/WEB-INF/conf/TurbineResources.properties");
  +        config.init();
  +        }
  +        catch (Exception e)
  +        {
  +            fail(StringUtils.stackTrace(e));
  +        }
       }
   
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to