directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmach...@apache.org
Subject svn commit: rev 6138 - incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest
Date Sun, 11 Jan 2004 02:47:51 GMT
Author: jmachols
Date: Sat Jan 10 18:47:50 2004
New Revision: 6138

Added:
   incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/TestCaseAddUI.java
   incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/TestCaseListUI.java
Modified:
   incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/LdapTestCase.java
   incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/LdapTestSession.java
   incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/LdapTester.java
   incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/TestConfiguration.java
Log:
Add TestCase information in the configuration 

Modified: incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/LdapTestCase.java
==============================================================================
--- incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/LdapTestCase.java
(original)
+++ incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/LdapTestCase.java
Sat Jan 10 18:47:50 2004
@@ -67,13 +67,24 @@
  */
 public class LdapTestCase
 {
+    public static final int ADD = 0 ;
+    public static final int DELETE = 1 ;
+    public static final int MODIFY = 2 ;
+    public static final int MODIFYDN = 3 ;
+    public static final int BIND = 4 ;
+    public static final int SEARCH = 5 ;
+    
+    private String m_testCaseName ;
+    
+    private String m_testCaseDescription ;
+    
     /**
      * Ldap Operation to run, can be bind, add, modify, delete, 
      * modifydn or search
      * 
      * @TODO  This just be setup as an enumeration, not a string
      */
-    private String m_operation ;
+    private int m_operation ;
     
     /**
      * The command line aruguments to send with the operation
@@ -81,7 +92,7 @@
     private String m_args ;
         
     /**
-     * Get the command line arguments for the operation
+     * Get the command line arguments for the operation.  
      * @return arguments, just as they would appear from a command line
      */
     public String getArgs()
@@ -95,7 +106,7 @@
      * 
      * @return LDAP Operation to perform
      */
-    public String getOperation()
+    public int getOperation()
     {
         return m_operation;
     }
@@ -104,9 +115,9 @@
      * Set the command line arguments for the operation
      * @param a_string arguments, just as they would appear from a command line
      */
-    public void setArgs(String a_string)
+    public void setArgs( String a_string )
     {
-        m_args = a_string;
+        m_args = a_string ;
     }
 
     /**
@@ -115,9 +126,48 @@
      * 
      * @param a_string LDAP Operation to perform
      */
-    public void setOperation(String a_string)
+    public void setOperation( int a_int )
+    {
+        m_operation = a_int ; 
+    }
+
+    /**
+     * Get the session description
+     * 
+     * @return Session description
+     */
+    public String getTestCaseDescription()
+    {
+        return m_testCaseDescription;
+    }
+
+    /**
+     * Get the session name
+     * 
+     * @return Session name
+     */
+    public String getTestCaseName()
+    {
+        return m_testCaseName;
+    }
+
+    /**
+    * Set the testCase description 
+    * 
+    * @param a_string testCase description 
+    */
+    public void setTestCaseDescription( String a_string )
     {
-        m_operation = a_string;
+        m_testCaseDescription = a_string;
     }
 
+    /**
+     * Set the testCase name
+     * 
+     * @param a_string testCase name
+     */
+    public void setTestCaseName( String a_string )
+    {
+        m_testCaseName = a_string;
+    }
 }

Modified: incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/LdapTestSession.java
==============================================================================
--- incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/LdapTestSession.java
(original)
+++ incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/LdapTestSession.java
Sat Jan 10 18:47:50 2004
@@ -84,7 +84,9 @@
     
      
     /**
-     * @return
+     * Get the DN of the user name to bind to the server 
+     * 
+     * @return DN of the bind user
      */
     public String getBindDn()
     {
@@ -92,7 +94,9 @@
     }
 
     /**
-     * @return
+     * Get the password of the bind user
+     *  
+     * @return password of the bind user
      */
     public String getBindPassword()
     {
@@ -100,7 +104,9 @@
     }
 
     /**
-     * @return
+     * Get the hostname of the server for the session
+     * 
+     * @return hostname of the server
      */
     public String getHost()
     {
@@ -108,7 +114,9 @@
     }
 
     /**
-     * @return
+     * Get the port to connect to on the ldap server
+     * 
+     * @return port the LDAP client should connect to on the server
      */
     public int getPort()
     {
@@ -116,7 +124,9 @@
     }
 
     /**
-     * @return
+     * True if the session should bind annonymously 
+     * 
+     * @return  True if the session should bind annonymously
      */
     public boolean isAnnonBind()
     {
@@ -124,7 +134,9 @@
     }
 
     /**
-     * @return
+     * Get the session description 
+     * 
+     * @return Session description 
      */
     public String getSessionDescription()
     {
@@ -132,7 +144,9 @@
     }
 
     /**
-     * @return
+     * Get the session description
+     * 
+     * @return Session description
      */
     public String getSessionName()
     {
@@ -140,7 +154,9 @@
     }
 
     /**
-     * @param a_string
+     * Set the DN of the user name to bind to the server
+     * 
+     * @param a_string DN of the user name to bind to the server
      */
     public void setBindDn(String a_string)
     {
@@ -148,7 +164,9 @@
     }
 
     /**
-     * @param a_string
+     * Set the password of the bind user
+     * 
+     * @param a_string password of the bind user
      */
     public void setBindPassword(String a_string)
     {
@@ -156,7 +174,9 @@
     }
 
     /**
-     * @param a_string
+     * Set the hostname of the server for the session
+     * 
+     * @param a_string hostname of the server for the session
      */
     public void setHost(String a_string)
     {
@@ -164,7 +184,9 @@
     }
 
     /**
-     * @param a_i
+     * Set the port to connect to on the ldap server
+     * 
+     * @param a_i port to connect to on the ldap server
      */
     public void setPort(int a_i)
     {
@@ -172,7 +194,9 @@
     }
 
     /**
-     * @param a_b
+     * True if the session should bind annonymously 
+     * 
+     * @param a_b True if the session should bind annonymously 
      */
     public void setAnnonBind(boolean a_b)
     {
@@ -180,7 +204,9 @@
     }
 
     /**
-     * @param a_string
+     * Set the session description 
+     * 
+     * @param a_string session description 
      */
     public void setSessionDescription(String a_string)
     {
@@ -188,7 +214,9 @@
     }
 
     /**
-     * @param a_string
+     * Set the session name
+     * 
+     * @param a_string session name
      */
     public void setSessionName(String a_string)
     {

Modified: incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/LdapTester.java
==============================================================================
--- incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/LdapTester.java
(original)
+++ incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/LdapTester.java
Sat Jan 10 18:47:50 2004
@@ -132,13 +132,18 @@
         menu = new JMenu("Window");
         menu.setMnemonic(KeyEvent.VK_W);
         menu.getAccessibleContext().setAccessibleDescription(
-                "CHange Session and Test Cases");
+                "Change Session and Test Cases");
         menuBar.add(menu);
         
         menuItem = new JMenuItem("Sessions",
                                  KeyEvent.VK_S);
         menuItem.addActionListener( new SessionWindowListener() ) ;
         menu.add(menuItem);
+        
+        menuItem = new JMenuItem("Test Cases",
+                                        KeyEvent.VK_S);
+               menuItem.addActionListener( new TestCaseWindowListener() ) ;
+               menu.add(menuItem);
 
         return menuBar;
     }
@@ -147,8 +152,15 @@
     {
         public void actionPerformed(ActionEvent e)
         {           
-            SessionListUI l_sessionWindow = new SessionListUI( m_config ) ;
-            
+            SessionListUI l_sessionWindow = new SessionListUI( m_config ) ;           
+        }
+    }
+
+    class TestCaseWindowListener implements ActionListener 
+    {
+        public void actionPerformed(ActionEvent e)
+        {           
+            TestCaseListUI l_testCaseWindow = new TestCaseListUI( m_config ) ;          

         }
     }
     

Added: incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/TestCaseAddUI.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/TestCaseAddUI.java
Sat Jan 10 18:47:50 2004
@@ -0,0 +1,77 @@
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2000 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.ldap.clients.ldaptest ;
+
+import javax.swing.DefaultListModel;
+import javax.swing.JPanel;
+
+
+
+/**
+
+ * 
+ * @author <a href="mailto:jmachols@apache.org">Jeff Machols</a>
+ * @author $Author: jmachols $
+ * @version $Revision: 1.1 $
+ */
+public class TestCaseAddUI extends JPanel
+{
+   
+    public TestCaseAddUI( TestConfiguration a_config, DefaultListModel a_list,
+        int a_index )
+    {        
+    }
+}

Added: incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/TestCaseListUI.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/TestCaseListUI.java
Sat Jan 10 18:47:50 2004
@@ -0,0 +1,221 @@
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2000 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.ldap.clients.ldaptest ;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.DefaultListModel;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.ListSelectionModel;
+
+/**
+ * Test Case Management window.  This will list all the current tests cases
+ *  and allow the user to add new, modify or delete tests
+ * 
+ * @author <a href="mailto:jmachols@apache.org">Jeff Machols</a>
+ * @author $Author: jmachols $
+ * @version $Revision: 1.1 $
+ */
+public class TestCaseListUI extends JPanel
+{                      
+    private JList list;
+    private DefaultListModel listModel;
+
+    private static final String addString = " Add  ";
+    private static final String deleteString = "Delete";
+    private static final String modifyString = "Modify";
+    private static final String cancelString = "Cancel";
+ 
+    public TestCaseListUI( TestConfiguration a_config ) 
+    {
+        super(new BorderLayout());
+        //Make sure we have nice window decorations.
+        JFrame.setDefaultLookAndFeelDecorated(true);
+
+        //Create and set up the window.
+        JFrame frame = new JFrame("Test Case Management");
+        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+                
+        String l_listEntry ;    
+        listModel = new DefaultListModel();
+        for (int l_index = 0 ; l_index < a_config.getTestCaseCount() ; l_index ++ ) 
+        {
+            l_listEntry = new String() ;
+            l_listEntry = a_config.getTestCase(l_index ).getTestCaseName() 
+                + " - " 
+                + a_config.getTestCase( l_index ).getTestCaseDescription() ;
+            listModel.addElement( l_listEntry ) ;
+        }
+
+        //Create the list and put it in a scroll pane.
+        list = new JList(listModel);
+        list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        list.setSelectedIndex(0);
+        list.setVisibleRowCount(10);
+        list.setPreferredSize( new Dimension ( 400 , 600 ) ) ;
+        JScrollPane listScrollPane = new JScrollPane(list);       
+        
+        JButton addButton = new JButton(addString);
+        addButton.setActionCommand(addString);
+        addButton.addActionListener( new AddListener( a_config ) );
+
+        JButton deleteButton = new JButton(deleteString);
+        deleteButton.setActionCommand(deleteString);
+        deleteButton.addActionListener(new DeleteListener( a_config ) );
+        
+        JButton modifyButton = new JButton(modifyString);
+        modifyButton.setActionCommand(modifyString);
+        modifyButton.addActionListener(new ModifyListener( a_config ) );
+                        
+        //Create a panel that uses BoxLayout.
+        JPanel buttonPane = new JPanel();
+        buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.Y_AXIS));
+        buttonPane.add(deleteButton);
+        buttonPane.add(Box.createVerticalStrut(8) ) ;
+        buttonPane.add(addButton);
+        buttonPane.add(Box.createVerticalStrut(8) ) ;
+        buttonPane.add(modifyButton);        
+        buttonPane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
+        
+        add(buttonPane, BorderLayout.EAST);
+        add(listScrollPane, BorderLayout.CENTER);
+        
+        //newContentPane.setOpaque(true); //content panes must be opaque
+        frame.setContentPane(this);
+
+        //Display the window.
+        frame.pack();
+        frame.setVisible(true);
+    }
+
+    class DeleteListener implements ActionListener 
+    {
+        TestConfiguration l_config ;
+        public DeleteListener ( TestConfiguration a_config )
+        {
+            l_config = a_config ; 
+        }
+        
+        public void actionPerformed(ActionEvent e) 
+        {
+            int l_index = list.getSelectedIndex();  
+            String l_string = (String) list.getSelectedValue() ;
+            l_string = l_string.substring(0, l_string.indexOf( '-') ).trim() ;
+            
+            //------------------------------------------------------------
+            // Verify we are still in sync with the list, sanity check
+            //------------------------------------------------------------
+            LdapTestCase l_testCase = l_config.getTestCase( l_index ) ;
+            if ( ! l_testCase.getTestCaseName().equalsIgnoreCase( l_string ) )
+            {
+                /**
+                 * @TODO This needs to be a popup
+                 */
+                System.out.println( "Mismatch, reload config" ) ;
+                System.out.println ("List: /" + l_string + "/" ) ;
+                System.out.println ("Sess: /" + l_testCase.getTestCaseName() 
+                    + "/" ) ;
+            }
+            else
+            {
+                l_config.removeTestCase( l_index ) ;
+                listModel.remove( l_index ) ;
+            }            
+        }
+    }
+
+    class AddListener implements ActionListener  
+    {
+        TestConfiguration l_config ;
+        public AddListener ( TestConfiguration a_config )
+        {
+            l_config = a_config ; 
+        }
+        
+        public void actionPerformed(ActionEvent e) 
+        {
+            TestCaseAddUI l_addUI = new TestCaseAddUI( 
+                l_config, listModel, -1 ) ;           
+        }
+    }
+    
+    class ModifyListener implements ActionListener  
+    {
+        TestConfiguration l_config ;
+        public ModifyListener ( TestConfiguration a_config )
+        {
+            l_config = a_config ; 
+        }
+        
+        public void actionPerformed(ActionEvent e) 
+        {
+            TestCaseAddUI l_addUI = new TestCaseAddUI( l_config,
+                listModel, list.getSelectedIndex() ) ;               
+        }
+    }
+    
+
+}

Modified: incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/TestConfiguration.java
==============================================================================
--- incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/TestConfiguration.java
(original)
+++ incubator/directory/ldap/trunk/clients/src/java/org/apache/ldap/clients/ldaptest/TestConfiguration.java
Sat Jan 10 18:47:50 2004
@@ -89,23 +89,24 @@
     private LdapTestSession getSessionConfig( Node node )
     {
         LdapTestSession l_session = new LdapTestSession() ;
-        for(Node child = node.getFirstChild() ; child != null; child = child.getNextSibling())
+        for(Node child = node.getFirstChild() ; child != null; 
+            child = child.getNextSibling())
         {            
-            if ( child.getNodeName().equalsIgnoreCase( "host") )
+            if( child.getNodeName().equalsIgnoreCase( "host" ) )
             {               
                 l_session.setHost( child.getFirstChild().getNodeValue() ) ;
             }
-            else if ( child.getNodeName().equalsIgnoreCase( "port") )
+            else if( child.getNodeName().equalsIgnoreCase( "port" ) )
             {
                 l_session.setPort(
                     Integer.parseInt(child.getFirstChild().getNodeValue() ) ) ;
             }
-            else if ( child.getNodeName().equalsIgnoreCase( "name") )
+            else if( child.getNodeName().equalsIgnoreCase( "name" ) )
             {
                 l_session.setSessionName( 
                     child.getFirstChild().getNodeValue() ) ;
             }
-            else if ( child.getNodeName().equalsIgnoreCase( "descr") )
+            else if( child.getNodeName().equalsIgnoreCase( "descr" ) )
             {
                 l_session.setSessionDescription( 
                     child.getFirstChild().getNodeValue() ) ;
@@ -114,6 +115,35 @@
         return l_session ;
     }
     
+    private LdapTestCase getTestCaseConfig( Node node )
+    {
+        LdapTestCase l_testCase = new LdapTestCase() ;
+        for( Node child = node.getFirstChild() ; child != null ; 
+            child = child.getNextSibling())
+        {            
+            if( child.getNodeName().equalsIgnoreCase( "entry" ) )
+            {               
+                l_testCase.setArgs( child.getFirstChild().getNodeValue() ) ;
+            }
+            else if( child.getNodeName().equalsIgnoreCase( "operation" ) )
+            {
+                l_testCase.setOperation(
+                    Integer.parseInt(child.getFirstChild().getNodeValue() ) ) ;
+            }
+            else if ( child.getNodeName().equalsIgnoreCase( "name" ) )
+            {
+                l_testCase.setTestCaseName( 
+                    child.getFirstChild().getNodeValue() ) ;
+            }
+            else if ( child.getNodeName().equalsIgnoreCase( "descr" ) )
+            {
+                l_testCase.setTestCaseDescription( 
+                    child.getFirstChild().getNodeValue() ) ;
+            }           
+        }
+        return l_testCase ;
+    }
+    
     public void readConfig ( String a_fileName )
         throws FileNotFoundException
     {
@@ -132,23 +162,27 @@
 
         Document document = parser.getDocument() ;
         Node child ; 
-        for(child = document.getFirstChild() ; child != null; child = child.getNextSibling())
+        for( child = document.getFirstChild() ; child != null ;
+            child = child.getNextSibling())
         {
-
-           if ( ( child.getNodeName().equalsIgnoreCase( "LdapTester") ) 
+           if( ( child.getNodeName().equalsIgnoreCase( "LdapTester") ) 
                && (child.hasChildNodes() ) ) 
            {
                break ;              
-           }
-                  
+           }                  
         }
         
-        for(child = child.getFirstChild() ; child != null; child = child.getNextSibling())
+        for( child = child.getFirstChild() ; child != null ; 
+            child = child.getNextSibling())
         {
-          if ( child.getNodeName().equalsIgnoreCase( "session") ) 
-          {
-              m_sessions.add ( getSessionConfig( child ) ) ;             
-          }   
+            if( child.getNodeName().equalsIgnoreCase( "session") ) 
+            {
+                m_sessions.add ( getSessionConfig( child ) ) ;             
+            }   
+            else if( child.getNodeName().equalsIgnoreCase( "testcase" ) )
+            {
+                m_testCases.add( getTestCaseConfig( child ) ) ;
+            }
         }
     }
     

Mime
View raw message