You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by ms...@apache.org on 2001/07/24 14:54:18 UTC

cvs commit: jakarta-jmeter/src/org/apache/jmeter/util ClassFinder.java

mstover1    01/07/24 05:54:18

  Modified:    src/org/apache/jmeter/engine RemoteJMeterEngineImpl.java
               src/org/apache/jmeter/protocol/http/control
                        HttpTestSample.java
               src/org/apache/jmeter/protocol/http/sampler
                        HTTPSamplerFull.java
               src/org/apache/jmeter/util ClassFinder.java
  Log:
  Removing references to com.hin (changed to org.apache)
  
  Revision  Changes    Path
  1.7       +1 -1      jakarta-jmeter/src/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java
  
  Index: RemoteJMeterEngineImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RemoteJMeterEngineImpl.java	2001/03/17 22:25:44	1.6
  +++ RemoteJMeterEngineImpl.java	2001/07/24 12:54:17	1.7
  @@ -82,7 +82,7 @@
   		backingEngine = new StandardJMeterEngine();
   		try
   		{
  -			Naming.bind("JMeterEngine", this);
  +			Naming.rebind("JMeterEngine", this);
   		}
   		catch(Exception ex)
   		{
  
  
  
  1.17      +3 -5      jakarta-jmeter/src/org/apache/jmeter/protocol/http/control/HttpTestSample.java
  
  Index: HttpTestSample.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/org/apache/jmeter/protocol/http/control/HttpTestSample.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- HttpTestSample.java	2001/07/23 19:17:39	1.16
  +++ HttpTestSample.java	2001/07/24 12:54:17	1.17
  @@ -71,10 +71,8 @@
   
   import org.apache.jmeter.samplers.SampleResult;
   
  -import org.apache.jmeter.protocol.http.sampler.HTTPSampler;
  +import org.apache.jmeter.protocol.http.sampler.*;
   
  -import org.apache.jmeter.protocol.http.sampler.MultipartFormSampler;
  -
   import org.apache.jmeter.control.SamplerController;
   
   import org.apache.jmeter.samplers.*;
  @@ -88,7 +86,7 @@
    *  Apache Foundation
    *
    *@author     Michael Stover
  - *@created    $Date: 2001/07/23 19:17:39 $
  + *@created    $Date: 2001/07/24 12:54:17 $
    *@version    1.0
    */
   
  @@ -456,7 +454,7 @@
   			catClass.debug(
   					"Element class is an instance of " +
   					"UrlConfigFull.class");
  -			entry.setSamplerClass(com.hin.jmeter.protocol.http.sampler.HTTPSamplerFull.class);
  +			entry.setSamplerClass(HTTPSamplerFull.class);
   		}
   		else if (element instanceof UrlConfig)
   		{
  
  
  
  1.2       +2 -2      jakarta-jmeter/src/org/apache/jmeter/protocol/http/sampler/HTTPSamplerFull.java
  
  Index: HTTPSamplerFull.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/org/apache/jmeter/protocol/http/sampler/HTTPSamplerFull.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HTTPSamplerFull.java	2001/07/23 19:17:39	1.1
  +++ HTTPSamplerFull.java	2001/07/24 12:54:17	1.2
  @@ -52,7 +52,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    */
  -package com.hin.jmeter.protocol.http.sampler;
  +package org.apache.jmeter.protocol.http.sampler;
   
   import org.apache.jmeter.protocol.http.sampler.HTTPSampler;
   import org.apache.jmeter.protocol.http.config.*;
  @@ -78,7 +78,7 @@
    *
    * @author	Khor Soon Hin
    * @version	1.0
  - * @created	$Date: 2001/07/23 19:17:39 $
  + * @created	$Date: 2001/07/24 12:54:17 $
    */
   public class HTTPSamplerFull extends HTTPSampler
   {
  
  
  
  1.10      +142 -142  jakarta-jmeter/src/org/apache/jmeter/util/ClassFinder.java
  
  Index: ClassFinder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/org/apache/jmeter/util/ClassFinder.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ClassFinder.java	2001/07/23 19:17:39	1.9
  +++ ClassFinder.java	2001/07/24 12:54:17	1.10
  @@ -81,8 +81,8 @@
   public class ClassFinder
   {
   
  -        private static Category catClass = 
  -          Category.getInstance(ClassFinder.class.getName());
  +		  private static Category catClass =
  +			 Category.getInstance(ClassFinder.class.getName());
   
   	private ClassFinder()
   	{
  @@ -91,8 +91,8 @@
   
   	/**
   	 *  Convenience method for
  -         *  <code>findClassesThatExtend(Class[], boolean)</code>
  -         *  with the option to include inner classes in the search set to false
  +			*  <code>findClassesThatExtend(Class[], boolean)</code>
  +			*  with the option to include inner classes in the search set to false
   	 *
   	 *@param  superClasses                Description of Parameter
   	 *@return                             ArrayList containing discovered classes.
  @@ -102,14 +102,14 @@
   
   	public static List findClassesThatExtend(Class[] superClasses) throws IOException, ClassNotFoundException
   	{
  -          return findClassesThatExtend(superClasses, false);
  -        }
  +			 return findClassesThatExtend(superClasses, false);
  +		  }
   
   	/**
   	 *  Find classes in the provided path(s)/jar(s) that extend the class(es).
   	 *
   	 *@param  superClasses                Description of Parameter
  -         *@param  innerClasses	              indicate whether to include inner classes in the search
  +			*@param  innerClasses	              indicate whether to include inner classes in the search
   	 *@return                             ArrayList containing discovered classes.
   	 *@exception  IOException
   	 *@exception  ClassNotFoundException
  @@ -128,22 +128,22 @@
   		String[] strPathsOrJars = JMeterUtils.split(JMeterUtils.getPropDefault(
   				"search_paths", ".;ApacheJMeter.jar"), ";");
   
  -                if(catClass.isDebugEnabled())
  -                {
  -                  for(int k = 0; k < strPathsOrJars.length; k++)
  -                  {
  -                    catClass.debug("strPathsOrJars : " + strPathsOrJars[k]);
  -                  }
  -                }
  +					 if(catClass.isDebugEnabled())
  +					 {
  +						for(int k = 0; k < strPathsOrJars.length; k++)
  +						{
  +						  catClass.debug("strPathsOrJars : " + strPathsOrJars[k]);
  +						}
  +					 }
   		listPaths = getClasspathMatches(strPathsOrJars);
  -                if(catClass.isDebugEnabled())
  -                {
  -                  Iterator tIter = listPaths.iterator();
  -                  for(;tIter.hasNext();)
  -                  {
  -                    catClass.debug("listPaths : " + tIter.next());
  -                  }
  -                }
  +					 if(catClass.isDebugEnabled())
  +					 {
  +						Iterator tIter = listPaths.iterator();
  +						for(;tIter.hasNext();)
  +						{
  +						  catClass.debug("listPaths : " + tIter.next());
  +						}
  +					 }
   
   		listClasses = new ArrayList();
   
  @@ -159,38 +159,38 @@
   		// first get all the classes
   
   		findClassesInPaths(listPaths, listClasses);
  +
  +					 if(catClass.isDebugEnabled())
  +					 {
  +						Iterator tIter = listClasses.iterator();
  +						for(;tIter.hasNext();)
  +						{
  +						  catClass.debug("listClasses : " + tIter.next());
  +						}
  +					 }
   
  -                if(catClass.isDebugEnabled())
  -                {
  -                  Iterator tIter = listClasses.iterator();
  -                  for(;tIter.hasNext();)
  -                  {
  -                    catClass.debug("listClasses : " + tIter.next());
  -                  }
  -                }
  -
  -                List subClassList = findAllSubclasses(listSuperClasses, listClasses, innerClasses);
  -                return subClassList;
  +					 List subClassList = findAllSubclasses(listSuperClasses, listClasses, innerClasses);
  +					 return subClassList;
   	}
   
   
   
  -        /**
  -         * Convenience method to
  -         * <code>findClassesByInterface(String[], Class[], boolean)</code> with
  -         * option to include inner classes in the search set to false
  -         *
  +		  /**
  +			* Convenience method to
  +			* <code>findClassesByInterface(String[], Class[], boolean)</code> with
  +			* option to include inner classes in the search set to false
  +			*
   	 *@param  interfaces                  Array of interfaces to search for.
   	 *@param  strPathsOrJars              paths and jars to search
   	 *@return                             ArrayList containing discovered classes.
   	 *@exception  IOException
  -         *
  -         */
  -        public static ArrayList findClassesByInterface(String[] strPathsOrJars,
  -          Class[] interfaces) throws IOException, ClassNotFoundException
  -        {
  -          return findClassesByInterface(strPathsOrJars, interfaces, false);
  -        }
  +			*
  +			*/
  +		  public static ArrayList findClassesByInterface(String[] strPathsOrJars,
  +			 Class[] interfaces) throws IOException, ClassNotFoundException
  +		  {
  +			 return findClassesByInterface(strPathsOrJars, interfaces, false);
  +		  }
   
   	/**
   	 *  Find classes in the provided path(s)/jar(s) that implement the
  @@ -198,7 +198,7 @@
   	 *
   	 *@param  interfaces                  Array of interfaces to search for.
   	 *@param  strPathsOrJars              paths and jars to search
  -         *@param  innerClasses                Indicate whether the search includes inner classes
  +			*@param  innerClasses                Indicate whether the search includes inner classes
   	 *@return                             ArrayList containing discovered classes.
   	 *@exception  IOException
   	 *@exception  ClassNotFoundException
  @@ -263,8 +263,8 @@
   
   				foundIt = false;
   
  -                                // only check classes if they are not inner classes
  -                                // or we intend to check for inner classes
  +										  // only check classes if they are not inner classes
  +										  // or we intend to check for inner classes
   				if ((strClassName.indexOf("$") == -1) || innerClasses)
   				{
   					// might throw an exception, assume this is ignorable
  @@ -340,7 +340,7 @@
   
   			strPathsOrJars = fixSlashes(strPathsOrJars);
   
  -                        strPathsOrJars = fixEndingSlashes(strPathsOrJars);
  +								strPathsOrJars = fixEndingSlashes(strPathsOrJars);
   		}
   
   
  @@ -353,7 +353,7 @@
   
   			strPath = fixSlashes(strPath);
   
  -                        strPath = fixEndingSlashes(strPath);
  +								strPath = fixEndingSlashes(strPath);
   			if (strPathsOrJars == null)
   			{
   
  @@ -365,14 +365,14 @@
   
   				for (i = 0; i < strPathsOrJars.length; i++)
   				{
  -                                        if(catClass.isDebugEnabled())
  -                                        {
  -                                          catClass.debug("strPath(lower) : " + strPath.toLowerCase());
  -                                          catClass.debug("strPathsOrJars[" + i + "] : " + strPathsOrJars[i]);
  -                                        }
  +													 if(catClass.isDebugEnabled())
  +													 {
  +														catClass.debug("strPath(lower) : " + strPath.toLowerCase());
  +														catClass.debug("strPathsOrJars[" + i + "] : " + strPathsOrJars[i]);
  +													 }
   					if (strPath.toLowerCase().endsWith(strPathsOrJars[i]))
   					{
  -                                                catClass.debug("match!!!");
  +																catClass.debug("match!!!");
   
   						listPaths.add(strPath);
   
  @@ -448,27 +448,27 @@
   	}
   
   
  -        private static String[] fixEndingSlashes(String[] strings)
  -        {
  -          String[] strNew = new String[strings.length];
  -          for(int i = 0; i < strings.length; i++)
  -          {
  -            strNew[i] = fixEndingSlashes(strings[i]).toLowerCase();
  -          }
  -          return strNew;
  -        }
  -
  -        private static String fixEndingSlashes(String string)
  -        {
  -          if(string.endsWith("/") || string.endsWith("\\"))
  -          {
  -            string = string.substring(0, string.length()-1);
  -            string = fixEndingSlashes(string);
  -          }
  -          return string;
  -        }
  +		  private static String[] fixEndingSlashes(String[] strings)
  +		  {
  +			 String[] strNew = new String[strings.length];
  +			 for(int i = 0; i < strings.length; i++)
  +			 {
  +				strNew[i] = fixEndingSlashes(strings[i]).toLowerCase();
  +			 }
  +			 return strNew;
  +		  }
  +
  +		  private static String fixEndingSlashes(String string)
  +		  {
  +			 if(string.endsWith("/") || string.endsWith("\\"))
  +			 {
  +				string = string.substring(0, string.length()-1);
  +				string = fixEndingSlashes(string);
  +			 }
  +			 return string;
  +		  }
   
  -        private static String[] fixSlashes(String[] strings)
  +		  private static String[] fixSlashes(String[] strings)
   	{
   
   
  @@ -600,7 +600,7 @@
   
   	/**
   	 *  Convenience method for
  -         *  <code>findAllSubclasses(List, List, boolean)</code>
  +			*  <code>findAllSubclasses(List, List, boolean)</code>
   	 *  with the option to include inner classes in the search set to false
   	 *
   	 *@param  listSuperClasses  the base classes to find subclasses for
  @@ -610,8 +610,8 @@
   
   	private static ArrayList findAllSubclasses(List listSuperClasses, List listAllClasses)
   	{
  -          return findAllSubclasses(listSuperClasses, listAllClasses, false);
  -        }
  +			 return findAllSubclasses(listSuperClasses, listAllClasses, false);
  +		  }
   
   	/**
   	 *  Finds all classes that extend the classes in the listSuperClasses
  @@ -619,7 +619,7 @@
   	 *
   	 *@param  listSuperClasses  the base classes to find subclasses for
   	 *@param  listAllClasses    the collection of classes to search in
  -         *@param  innerClasses      indicate whether to include inner classes in the search
  +			*@param  innerClasses      indicate whether to include inner classes in the search
   	 *@return                   ArrayList of the subclasses
   	 */
   
  @@ -645,10 +645,10 @@
   
   			strClassName = (String) iterClasses.next();
   
  -                        // only check classes if they are not inner classes
  -                        // or we intend to check for inner classes
  +								// only check classes if they are not inner classes
  +								// or we intend to check for inner classes
   			if ((strClassName.indexOf("$") == -1) || innerClasses)
  -                        {
  +								{
   				// might throw an exception, assume this is ignorable
   
   				try
  @@ -674,9 +674,9 @@
   	}
   
   	/**
  -	 *  Convenience method for                                          
  +	 *  Convenience method for
   	 *  <code>findAllSubclassesOneClass(Class, List, List, boolean)</code>
  -         *  with option to include inner classes in the search set to false
  +			*  with option to include inner classes in the search set to false
   	 *
   	 *@param  theClass        the parent class
   	 *@param  listAllClasses  the collection of classes to search in
  @@ -685,10 +685,10 @@
   
   	private static void findAllSubclassesOneClass(Class theClass,
   			List listAllClasses, List listSubClasses)
  -        { 
  -          findAllSubclassesOneClass(theClass, listAllClasses,
  -             listSubClasses, false);
  -        }
  +		  {
  +			 findAllSubclassesOneClass(theClass, listAllClasses,
  +				 listSubClasses, false);
  +		  }
   
   	/**
   	 *  Finds all classes that extend the class, searching in the listAllClasses
  @@ -697,7 +697,7 @@
   	 *@param  theClass        the parent class
   	 *@param  listAllClasses  the collection of classes to search in
   	 *@param  listSubClasses  the collection of discovered subclasses
  -         *@param  innerClasses    indicates whether inners classes should be included in the search
  +			*@param  innerClasses    indicates whether inners classes should be included in the search
   	 */
   
   	private static void findAllSubclassesOneClass(Class theClass,
  @@ -727,10 +727,10 @@
   
   			strClassName = (String) iterClasses.next();
   
  -                        // only check classes if they are not inner classes
  -                        // or we intend to check for inner classes
  +								// only check classes if they are not inner classes
  +								// or we intend to check for inner classes
   			if ((strClassName.indexOf("$") == -1) || innerClasses)
  -                        {
  +								{
   				// might throw an exception, assume this is ignorable
   
   				try
  @@ -938,55 +938,55 @@
   
     public static class Test extends TestCase
     {
  -    public Test(String name)
  -    {
  -      super(name);
  -    }
  -
  -    // For a given testPath, get the name of the classes in the path and its
  -    // subpaths. Append the first class name found to the testPath to ensure
  -    // that the file is found.
  -    public void testFindClassesInPaths()
  -    {
  -      String testPath = "/usr/local/jakarta-jmeter-dev/src/org/apache/jmeter/junit";
  -      List listPaths = new ArrayList();
  -      ArrayList listClasses = new ArrayList();
  -      // listPaths will contain the path/jars where all classes will be listed
  -      listPaths.add(testPath);
  -      try
  -      {
  -        findClassesInPaths(listPaths, listClasses);
  -      }
  -      catch(IOException e)
  -      {
  -        fail("IOException thrown");
  -      }
  -      Iterator iter = listClasses.iterator();
  -      if(iter.hasNext())
  -      {
  -        String fullname =  null;
  -        // check if file exist
  -        String fileSeparator = System.getProperty("file.separator");
  -        String filename = (String)iter.next();
  -        filename = filename.replace('.', fileSeparator.charAt(0));
  -        if(testPath.endsWith(fileSeparator))
  -        {
  -          fullname = testPath + filename + ".class";
  -        }
  -        else
  -        {
  -          fullname = testPath + fileSeparator +  filename + ".class";
  -        }
  -        File file = new File(fullname);
  -        assertTrue(fullname + " is not a file", file.isFile());
  -      }
  -      else
  -      { 
  -        // if testPath is empty, fail the test
  -        fail(testPath +
  -          " is empty. Please choose a path which has at least one file");
  -      }
  -    }
  +	 public Test(String name)
  +	 {
  +		super(name);
  +	 }
  +
  +	 // For a given testPath, get the name of the classes in the path and its
  +	 // subpaths. Append the first class name found to the testPath to ensure
  +	 // that the file is found.
  +	 public void testFindClassesInPaths()
  +	 {
  +		String testPath = "/usr/local/jakarta-jmeter-dev/src/org/apache/jmeter/junit";
  +		List listPaths = new ArrayList();
  +		ArrayList listClasses = new ArrayList();
  +		// listPaths will contain the path/jars where all classes will be listed
  +		listPaths.add(testPath);
  +		try
  +		{
  +		  findClassesInPaths(listPaths, listClasses);
  +		}
  +		catch(IOException e)
  +		{
  +		  fail("IOException thrown");
  +		}
  +		Iterator iter = listClasses.iterator();
  +		if(iter.hasNext())
  +		{
  +		  String fullname =  null;
  +		  // check if file exist
  +		  String fileSeparator = System.getProperty("file.separator");
  +		  String filename = (String)iter.next();
  +		  filename = filename.replace('.', fileSeparator.charAt(0));
  +		  if(testPath.endsWith(fileSeparator))
  +		  {
  +			 fullname = testPath + filename + ".class";
  +		  }
  +		  else
  +		  {
  +			 fullname = testPath + fileSeparator +  filename + ".class";
  +		  }
  +		  File file = new File(fullname);
  +		  this.assert(fullname + " is not a file", file.isFile());
  +		}
  +		else
  +		{
  +		  // if testPath is empty, fail the test
  +		  fail(testPath +
  +			 " is empty. Please choose a path which has at least one file");
  +		}
  +	 }
     }
   }
   
  
  
  

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