mstover1    2002/08/09 10:20:58

  Modified:    src_1/org/apache/jmeter/assertions Assertion.java
               src_1/org/apache/jmeter/assertions/gui AssertionGui.java
               src_1/org/apache/jmeter/resources messages.properties
               src_1/org/apache/jmeter/save SaveService.java
               src_1/org/apache/jmeter/save/old/handlers
                        AssertionHandler.java JMeterHandler.java
               src_1/org/apache/jmeter/visualizers MailerVisualizer.java
  Added:       src_1/org/apache/jmeter/assertions DurationAssertion.java
                        ResponseAssertion.java
               src_1/org/apache/jmeter/assertions/gui
                        DurationAssertionGui.java
               src_1/org/apache/jmeter/resources messages_de.properties
  Log:
  New Response Time Assertion (Wolfram Rittmeyer)
  New German translations (Jochen Stiepel)
  
  Revision  Changes    Path
  1.8       +14 -258   jakarta-jmeter/src_1/org/apache/jmeter/assertions/Assertion.java
  
  Index: Assertion.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src_1/org/apache/jmeter/assertions/Assertion.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Assertion.java    14 Jun 2002 00:12:33 -0000      1.7
  +++ Assertion.java    9 Aug 2002 17:20:57 -0000       1.8
  @@ -54,274 +54,30 @@
    */
   package org.apache.jmeter.assertions;
   
  -import java.util.*;
  -import java.io.Serializable;
   import org.apache.jmeter.samplers.SampleResult;
  -import org.apache.jmeter.config.ConfigElement;
  -import org.apache.jmeter.testelement.AbstractTestElement;
   
  -import org.apache.oro.text.regex.*;
   
  -/************************************************************
  - *  Title: Jakarta-JMeter Description: Copyright: Copyright (c) 2001 Company:
  - *  Apache
  - *
  - *@author     Michael Stover
  - *@created    $Date$
  - *@version    1.0
  - ***********************************************************/
  -
  -public class Assertion extends AbstractTestElement implements Serializable
  -{
  -
  -     public final static String TEST_FIELD = "Assertion.test_field";
  -     public final static String TEST_TYPE = "Assertion.test_type";
  -     public final static String TEST_STRINGS = "Asserion.test_strings";
  -     public final static String SAMPLE_LABEL = "Assertion.sample_label";
  -     public final static String RESPONSE_DATA = "Assertion.response_data";
  -
  -
  -     private String notMessage = "";
  -     private String failMessage = "to contain: ";
  -     public final static int MATCH = 1 << 0;
  -     public final static int CONTAINS = 1 << 1;
  -     public final static int NOT = 1 << 2;
  -     private transient static Perl5Compiler compiler = new Perl5Compiler();
  -     private transient static Perl5Matcher matcher = new Perl5Matcher();
  -
  -     /************************************************************
  -      *  !ToDo (Constructor description)
  -      ***********************************************************/
  -     public Assertion()
  -     {
  -             setProperty(TEST_STRINGS,new ArrayList());
  -     }
  -
  -     /************************************************************
  -      *  !ToDo (Constructor description)
  -      *
  -      *@param  field   !ToDo (Parameter description)
  -      *@param  type    !ToDo (Parameter description)
  -      *@param  string  !ToDo (Parameter description)
  -      ***********************************************************/
  -     public Assertion(String field, int type, String string)
  -     {
  -             this();
  -             setTestField(field);
  -             setTestType(type);
  -             getTestStrings().add(string);
  -     }
  -
  -     /************************************************************
  -      *  !ToDo (Method description)
  -      *
  -      *@param  testField  !ToDo (Parameter description)
  -      ***********************************************************/
  -     public void setTestField(String testField)
  -     {
  -             setProperty(TEST_FIELD,testField);
  -     }
  -
  -     /************************************************************
  -      *  !ToDo (Method description)
  -      *
  -      *@param  testType  !ToDo (Parameter description)
  -      ***********************************************************/
  -     public void setTestType(int testType)
  -     {
  -             setProperty(TEST_TYPE,new Integer(testType));
  -             if ((testType & NOT) > 0)
  -             {
  -                     notMessage = "not ";
  -             }
  -             else
  -             {
  -                     notMessage = "";
  -             }
  -             if ((testType & CONTAINS) > 0)
  -             {
  -                     failMessage = "to contain: ";
  -             }
  -             else
  -             {
  -                     failMessage = "to match: ";
  -             }
  -     }
  -
  -     /************************************************************
  -      *  !ToDo (Method description)
  -      *
  -      *@param  testString  !ToDo (Parameter description)
  -      ***********************************************************/
  -     public void addTestString(String testString)
  -     {
  -             getTestStrings().add(testString);
  -     }
  -     
  -     public void setTestString(String testString,int index)
  -     {
  -             getTestStrings().set(index,testString);
  -     }
  -
  -     public void removeTestString(String testString)
  -     {
  -             getTestStrings().remove(testString);
  -     }
  -     
  -     public void removeTestString(int index)
  -     {
  -             getTestStrings().remove(index);
  -     }
  -
  -     public void clearTestStrings()
  -     {
  -             getTestStrings().clear();
  -     }
  -
  -     /************************************************************
  -      *  !ToDoo (Method description)
  +/**
  + * <p>An Assertion checks a SampleResult wether it fulfills the necessary
  + * conditions to be called a successful Sample. The resulting
  + * success-status can be obtained from a corresponding AssertionResult.</p>
         *
  -      *@param  response  !ToDo (Parameter description)
  -      *@return           !ToDo (Return description)
  -      ***********************************************************/
  -     public AssertionResult getResult(SampleResult response)
  -     {
  -             AssertionResult result;
  -             if (!response.isSuccessful())
  -             {
  -                     result = new AssertionResult();
  -                     result.setError(true);
  -                     result.setFailureMessage(new 
String((byte[])response.getResponseData()));
  -                     return result;
  -             }
  -             result = evaluateResponse(response);
  -             return result;
  -     }
  -
  -
  -     /************************************************************
  -      *  !ToDoo (Method description)
  + * <p>E.g.: If A web-response doesn't contain a needed expression it would be
  + * considered a failure.</p>
         *
  -      *@return    !ToDo (Return description)
  -      ***********************************************************/
  -     public String getTestField()
  + * @version $Revision$, $Date$
  + */
  +public interface Assertion
        {
  -             return (String)getProperty(TEST_FIELD);
  -     }
   
        /************************************************************
  -      *  !ToDoo (Method description)
  +      *  Returns the AssertionResult-object encapsulating information
  +      *  about the success or failure of the assertion.
         *
  -      *@return    !ToDo (Return description)
  -      ***********************************************************/
  -     public int getTestType()
  -     {
  -             Object type = getProperty(TEST_TYPE);
  -             if(type == null)
  -             {
  -                     return CONTAINS;
  -             }
  -             else if(type instanceof Integer)
  -             {
  -                     return ((Integer)type).intValue();
  -             }
  -             else
  -             {
  -                     return Integer.parseInt((String)type);
  -             }
  -     }
  -
  -     /************************************************************
  -      *  !ToDoo (Method description)
  +      *@param  response The SampleResult containing informations about the Sample 
(duration, success...).
         *
  -      *@return    !ToDo (Return description)
  +      *@return The AssertionResult containing the information about success or 
failure.
         ***********************************************************/
  -     public List getTestStrings()
  -     {
  -             return (List)getProperty(TEST_STRINGS);
  -     }
  +     public AssertionResult getResult(SampleResult response);
   
  -     public boolean isContainsType()
  -     {
  -             return (getTestType() & CONTAINS) > 0;
  -     }
  -
  -     public boolean isMatchType()
  -     {
  -             return (getTestType() & MATCH) > 0;
  -     }
  -
  -     public boolean isNotType()
  -     {
  -             return (getTestType() & NOT) > 0;
  -     }
  -
  -     public void setToContainsType()
  -     {
  -             setTestType((getTestType() | CONTAINS) & (MATCH ^ (CONTAINS | MATCH | 
NOT)));
  -             failMessage = "to contain: ";
  -     }
  -
  -     public void setToMatchType()
  -     {
  -             setTestType((getTestType() | MATCH) & (CONTAINS ^ (CONTAINS | MATCH | 
NOT)));
  -             failMessage = "to match: ";
  -     }
  -
  -     public void setToNotType()
  -     {
  -             setTestType((getTestType() | NOT));
  -     }
  -
  -     public void unsetNotType()
  -     {
  -             setTestType(getTestType() & (NOT ^ (CONTAINS | MATCH | NOT)));
  -     }
  -
  -     private AssertionResult evaluateResponse(SampleResult response)
  -     {
  -             boolean pass = true;
  -             boolean not = (NOT & getTestType()) > 0;
  -             AssertionResult result = new AssertionResult();
  -             try
  -             {
  -                     Iterator iter = getTestStrings().iterator();
  -                     while (iter.hasNext())
  -                     {
  -                             String pattern = (String)iter.next();
  -                             if ((CONTAINS & getTestType()) > 0)
  -                             {
  -                                     pass = pass && (not ? !matcher.contains(new 
String(response.getResponseData()),
  -                                                     compiler.compile(pattern)) :
  -                                                     matcher.contains(new 
String(response.getResponseData()),
  -                                                     compiler.compile(pattern)));
  -                             }
  -                             else
  -                             {
  -                                     pass = pass && (not ? !matcher.matches(new 
String(response.getResponseData()),
  -                                                     compiler.compile(pattern)) :
  -                                                     matcher.matches(new 
String(response.getResponseData()),
  -                                                     compiler.compile(pattern)));
  -                             }
  -                             if (!pass)
  -                             {
  -                                     result.setFailure(true);
  -                                     result.setFailureMessage("Test Failed, 
expected " + notMessage + failMessage + pattern);
  -                                     break;
  -                             }
  -                     }
  -                     if(pass)
  -                     {
  -                             result.setFailure(false);
  -                     }
  -                     result.setError(false);
  -             }
  -             catch(MalformedPatternException e)
  -             {
  -                     result.setError(true);
  -                     result.setFailure(false);
  -                     result.setFailureMessage("Bad test configuration"+e);
  -             }
  -             return result;
  -     }
   }
  
  
  
  1.1                  
jakarta-jmeter/src_1/org/apache/jmeter/assertions/DurationAssertion.java
  
  Index: DurationAssertion.java
  ===================================================================
  /*
   * ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001 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" and
   * "Apache JMeter" must not be used to endorse or promote products
   * derived from this software without prior written permission. For
   * written permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache",
   * "Apache JMeter", 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.jmeter.assertions;
  
  import java.io.Serializable;
  import java.text.MessageFormat;
  import org.apache.jmeter.util.JMeterUtils;
  import org.apache.jmeter.testelement.AbstractTestElement;
  import org.apache.jmeter.samplers.SampleResult;
  
  /**
   * Checks if an Sample is sampled within a specified time-frame. If the
   * duration is larger than the timeframe the Assertion is considered
   * a failure.
   *
   Copyright: Copyright (c) 2001
   * Company: Apache
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Wolfram Rittmeyer</a>
   *
   * @version $Revision: 1.1 $, $Date: 2002/08/09 17:20:57 $
   */
  public class DurationAssertion extends AbstractTestElement implements Serializable, 
Assertion {
  
        /** Key for storing assertion-informations in the jmx-file. */
        private static final String DURATION_KEY = "DurationAssertion.duration";
  
        /**
         * Returns the result of the Assertion. Here it checks wether the
         * Sample took to long to be considered successful. If so an AssertionResult
         * containing a FailureMessage will be returned. Otherwise the returned
         * AssertionResult will reflect the success of the Sample.
         */
        public AssertionResult getResult(SampleResult response) {
                AssertionResult result = new AssertionResult();
                result.setFailure(false);
  
                // has the Sample lasted to long?
                if (((response.getTime() > getAllowedDuration()) && 
(getAllowedDuration() > 0))) {
                        result.setFailure(true);
                        Object[] arguments = { new Long(response.getTime()), new 
Long(getAllowedDuration())};
                        String message = 
MessageFormat.format(JMeterUtils.getResString("duration_assertion_failure"), 
arguments);
                        result.setFailureMessage(message);
                }
                return result;
        }
  
        /**
         * Returns the duration to be asserted. A duration of 0 indicates this 
assertion is to 
         * be ignored.
         */
        public long getAllowedDuration() {
                return getPropertyAsLong(DURATION_KEY);
        }
  
        /**
         * Set the duration that shall be asserted.
         *
         * @param duration A period of time in milliseconds. Is not allowed to be 
negative. Use Double.MAX_VALUE to indicate illegal or empty inputs. This will result 
to not checking the assertion.
         *
         * @throws IllegalArgumentException If <code>duration</code> is negative.
         */
        public void setAllowedDuration(long duration) throws IllegalArgumentException {
                if (duration < 0L) {
                        throw new 
IllegalArgumentException(JMeterUtils.getResString("argument_must_not_be_negative"));
                }
                if (duration == Long.MAX_VALUE) {
                        setProperty(DURATION_KEY, new Long(0));
                }
                else {
                        setProperty(DURATION_KEY, new Long(duration));
                }
        }
  
  
  
  }
  
  
  1.1                  
jakarta-jmeter/src_1/org/apache/jmeter/assertions/ResponseAssertion.java
  
  Index: ResponseAssertion.java
  ===================================================================
  /*
   * ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001 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" and
   * "Apache JMeter" must not be used to endorse or promote products
   * derived from this software without prior written permission. For
   * written permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache",
   * "Apache JMeter", 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.jmeter.assertions;
  
  import java.util.*;
  import java.io.Serializable;
  import org.apache.jmeter.samplers.SampleResult;
  import org.apache.jmeter.config.ConfigElement;
  import org.apache.jmeter.testelement.AbstractTestElement;
  
  import org.apache.oro.text.regex.*;
  
  /************************************************************
   *  Title: Jakarta-JMeter Description: Copyright: Copyright (c) 2001 Company:
   *  Apache
   *
   *@author     Michael Stover
   *@created    $Date: 2002/08/09 17:20:57 $
   *@version    1.0
   ***********************************************************/
  
  public class ResponseAssertion extends AbstractTestElement implements Serializable, 
Assertion
  {
  
        public final static String TEST_FIELD = "Assertion.test_field";
        public final static String TEST_TYPE = "Assertion.test_type";
        public final static String TEST_STRINGS = "Asserion.test_strings";
        public final static String SAMPLE_LABEL = "Assertion.sample_label";
        public final static String RESPONSE_DATA = "Assertion.response_data";
  
  
        private String notMessage = "";
        private String failMessage = "to contain: ";
        public final static int MATCH = 1 << 0;
        public final static int CONTAINS = 1 << 1;
        public final static int NOT = 1 << 2;
        private transient static Perl5Compiler compiler = new Perl5Compiler();
        private transient static Perl5Matcher matcher = new Perl5Matcher();
  
        /************************************************************
         *  !ToDo (Constructor description)
         ***********************************************************/
        public ResponseAssertion()
        {
                setProperty(TEST_STRINGS,new ArrayList());
        }
  
        /************************************************************
         *  !ToDo (Constructor description)
         *
         *@param  field   !ToDo (Parameter description)
         *@param  type    !ToDo (Parameter description)
         *@param  string  !ToDo (Parameter description)
         ***********************************************************/
        public ResponseAssertion(String field, int type, String string)
        {
                this();
                setTestField(field);
                setTestType(type);
                getTestStrings().add(string);
        }
  
        /************************************************************
         *  !ToDo (Method description)
         *
         *@param  testField  !ToDo (Parameter description)
         ***********************************************************/
        public void setTestField(String testField)
        {
                setProperty(TEST_FIELD,testField);
        }
  
        /************************************************************
         *  !ToDo (Method description)
         *
         *@param  testType  !ToDo (Parameter description)
         ***********************************************************/
        public void setTestType(int testType)
        {
                setProperty(TEST_TYPE,new Integer(testType));
                if ((testType & NOT) > 0)
                {
                        notMessage = "not ";
                }
                else
                {
                        notMessage = "";
                }
                if ((testType & CONTAINS) > 0)
                {
                        failMessage = "to contain: ";
                }
                else
                {
                        failMessage = "to match: ";
                }
        }
  
        /************************************************************
         *  !ToDo (Method description)
         *
         *@param  testString  !ToDo (Parameter description)
         ***********************************************************/
        public void addTestString(String testString)
        {
                getTestStrings().add(testString);
        }
  
        public void setTestString(String testString,int index)
        {
                getTestStrings().set(index,testString);
        }
  
        public void removeTestString(String testString)
        {
                getTestStrings().remove(testString);
        }
  
        public void removeTestString(int index)
        {
                getTestStrings().remove(index);
        }
  
        public void clearTestStrings()
        {
                getTestStrings().clear();
        }
  
        /************************************************************
         *  !ToDoo (Method description)
         *
         *@param  response  !ToDo (Parameter description)
         *@return           !ToDo (Return description)
         ***********************************************************/
        public AssertionResult getResult(SampleResult response)
        {
                AssertionResult result;
                if (!response.isSuccessful())
                {
                        result = new AssertionResult();
                        result.setError(true);
                        result.setFailureMessage(new 
String((byte[])response.getResponseData()));
                        return result;
                }
                result = evaluateResponse(response);
                return result;
        }
  
  
        /************************************************************
         *  !ToDoo (Method description)
         *
         *@return    !ToDo (Return description)
         ***********************************************************/
        public String getTestField()
        {
                return (String)getProperty(TEST_FIELD);
        }
  
        /************************************************************
         *  !ToDoo (Method description)
         *
         *@return    !ToDo (Return description)
         ***********************************************************/
        public int getTestType()
        {
                Object type = getProperty(TEST_TYPE);
                if(type == null)
                {
                        return CONTAINS;
                }
                else if(type instanceof Integer)
                {
                        return ((Integer)type).intValue();
                }
                else
                {
                        return Integer.parseInt((String)type);
                }
        }
  
        /************************************************************
         *  !ToDoo (Method description)
         *
         *@return    !ToDo (Return description)
         ***********************************************************/
        public List getTestStrings()
        {
                return (List)getProperty(TEST_STRINGS);
        }
  
        public boolean isContainsType()
        {
                return (getTestType() & CONTAINS) > 0;
        }
  
        public boolean isMatchType()
        {
                return (getTestType() & MATCH) > 0;
        }
  
        public boolean isNotType()
        {
                return (getTestType() & NOT) > 0;
        }
  
        public void setToContainsType()
        {
                setTestType((getTestType() | CONTAINS) & (MATCH ^ (CONTAINS | MATCH | 
NOT)));
                failMessage = "to contain: ";
        }
  
        public void setToMatchType()
        {
                setTestType((getTestType() | MATCH) & (CONTAINS ^ (CONTAINS | MATCH | 
NOT)));
                failMessage = "to match: ";
        }
  
        public void setToNotType()
        {
                setTestType((getTestType() | NOT));
        }
  
        public void unsetNotType()
        {
                setTestType(getTestType() & (NOT ^ (CONTAINS | MATCH | NOT)));
        }
  
        private AssertionResult evaluateResponse(SampleResult response)
        {
                boolean pass = true;
                boolean not = (NOT & getTestType()) > 0;
                AssertionResult result = new AssertionResult();
                try
                {
                        Iterator iter = getTestStrings().iterator();
                        while (iter.hasNext())
                        {
                                String pattern = (String)iter.next();
                                if ((CONTAINS & getTestType()) > 0)
                                {
                                        pass = pass && (not ? !matcher.contains(new 
String(response.getResponseData()),
                                                        compiler.compile(pattern)) :
                                                        matcher.contains(new 
String(response.getResponseData()),
                                                        compiler.compile(pattern)));
                                }
                                else
                                {
                                        pass = pass && (not ? !matcher.matches(new 
String(response.getResponseData()),
                                                        compiler.compile(pattern)) :
                                                        matcher.matches(new 
String(response.getResponseData()),
                                                        compiler.compile(pattern)));
                                }
                                if (!pass)
                                {
                                        result.setFailure(true);
                                        result.setFailureMessage("Test Failed, 
expected " + notMessage + failMessage + pattern);
                                        break;
                                }
                        }
                        if(pass)
                        {
                                result.setFailure(false);
                        }
                        result.setError(false);
                }
                catch(MalformedPatternException e)
                {
                        result.setError(true);
                        result.setFailure(false);
                        result.setFailureMessage("Bad test configuration"+e);
                }
                return result;
        }
  }
  
  
  
  1.9       +13 -12    
jakarta-jmeter/src_1/org/apache/jmeter/assertions/gui/AssertionGui.java
  
  Index: AssertionGui.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src_1/org/apache/jmeter/assertions/gui/AssertionGui.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AssertionGui.java 18 Jun 2002 01:01:13 -0000      1.8
  +++ AssertionGui.java 9 Aug 2002 17:20:57 -0000       1.9
  @@ -81,6 +81,7 @@
   import javax.swing.border.EmptyBorder;
   import javax.swing.table.TableCellRenderer;
   import org.apache.jmeter.assertions.Assertion;
  +import org.apache.jmeter.assertions.ResponseAssertion;
   import org.apache.jmeter.gui.util.PowerTableModel;
   import org.apache.jmeter.gui.util.TextAreaCellRenderer;
   import org.apache.jmeter.gui.util.TextAreaTableCellEditor;
  @@ -122,7 +123,7 @@
   
        public TestElement createTestElement()
        {
  -             Assertion el = new Assertion();
  +             ResponseAssertion el = new ResponseAssertion();
                String[] testStrings = tableModel.getData().getColumn(COL_NAME);
                for(int i = 0;i < testStrings.length;i++)
                {
  @@ -131,11 +132,11 @@
                configureTestElement(el);
                if(labelButton.isSelected())
                {
  -                     el.setTestField(Assertion.SAMPLE_LABEL);
  +                     el.setTestField(ResponseAssertion.SAMPLE_LABEL);
                }
                else
                {
  -                     el.setTestField(Assertion.RESPONSE_DATA);
  +                     el.setTestField(ResponseAssertion.RESPONSE_DATA);
                }
                if(containsBox.isSelected())
                {
  @@ -162,7 +163,7 @@
        public void configure(TestElement el)
        {
                super.configure(el);
  -             Assertion model = (Assertion)el;
  +             ResponseAssertion model = (ResponseAssertion)el;
                if(model.isContainsType())
                {
                        containsBox.setSelected(true);
  @@ -184,7 +185,7 @@
                        notBox.setSelected(false);
                }
   
  -             if(Assertion.RESPONSE_DATA.equals(model.getTestField()))
  +             if(ResponseAssertion.RESPONSE_DATA.equals(model.getTestField()))
                {
                        responseStringButton.setSelected(true);
                        labelButton.setSelected(false);
  
  
  
  1.1                  
jakarta-jmeter/src_1/org/apache/jmeter/assertions/gui/DurationAssertionGui.java
  
  Index: DurationAssertionGui.java
  ===================================================================
  /*
   * ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001 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" and
   * "Apache JMeter" must not be used to endorse or promote products
   * derived from this software without prior written permission. For
   * written permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache",
   * "Apache JMeter", 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.jmeter.assertions.gui;
  
  import java.awt.FlowLayout;
  import java.awt.BorderLayout;
  import java.awt.Color;
  import java.awt.Component;
  import java.awt.Font;
  import java.awt.GridBagConstraints;
  import java.awt.GridBagLayout;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import java.awt.event.FocusEvent;
  import java.awt.event.FocusListener;
  import java.util.Iterator;
  
  import javax.swing.BorderFactory;
  import javax.swing.Box;
  import javax.swing.ButtonGroup;
  import javax.swing.DefaultListCellRenderer;
  import javax.swing.JButton;
  import javax.swing.JCheckBox;
  import javax.swing.JLabel;
  import javax.swing.JList;
  import javax.swing.JPanel;
  import javax.swing.JRadioButton;
  import javax.swing.JScrollPane;
  import javax.swing.JTextField;
  import javax.swing.JTable;
  import javax.swing.border.Border;
  import javax.swing.border.EmptyBorder;
  import javax.swing.table.TableCellRenderer;
  import org.apache.jmeter.assertions.DurationAssertion;
  import org.apache.jmeter.assertions.ResponseAssertion;
  import org.apache.jmeter.gui.util.PowerTableModel;
  import org.apache.jmeter.gui.util.TextAreaCellRenderer;
  import org.apache.jmeter.gui.util.TextAreaTableCellEditor;
  import org.apache.jmeter.gui.util.VerticalLayout;
  import org.apache.jmeter.testelement.TestElement;
  import org.apache.jmeter.util.JMeterUtils;
  
  
  /****************************************
   * Title: Jakarta-JMeter Description: Copyright: Copyright (c) 2001 Company:
   * Apache
   *
   *@author    Michael Stover
   *@created   $Date: 2002/08/09 17:20:57 $
   *@version   1.0
   ***************************************/
  
  public class DurationAssertionGui extends AbstractAssertionGui implements 
FocusListener
  {
  
        private JTextField duration;
  
        /****************************************
         * !ToDo (Constructor description)
         ***************************************/
        public DurationAssertionGui()
        {
                init();
        }
  
        /**
         * Returns the label to be shown within the JTree-Component.
         */
        public String getStaticLabel()
        {
                return JMeterUtils.getResString("duration_assertion_title");
        }
  
        public String getDurationAttributesTitle()
        {
                return JMeterUtils.getResString("duration_assertion_duration_test");
        }
  
        public TestElement createTestElement()
        {
                //ResponseAssertion el = new ResponseAssertion();
                DurationAssertion el = new DurationAssertion();
                configureTestElement(el);
                String durationString = duration.getText();
                long assertionDuration = 0;
                try {
                        assertionDuration = Long.parseLong(durationString);
                }
                catch (NumberFormatException e) {
                        System.out.println("exception");
                        assertionDuration = Long.MAX_VALUE;
                }
                el.setAllowedDuration(assertionDuration);
                return el;
        }
  
        /****************************************
         * !ToDo (Method description)
         ***************************************/
        public void configure(TestElement el)
        {
                super.configure(el);
                DurationAssertion assertion = (DurationAssertion)el;
                duration.setText(String.valueOf(assertion.getAllowedDuration()));
        }
  
        private void init()
        {
                this.setLayout(new VerticalLayout(5, VerticalLayout.LEFT, 
VerticalLayout.TOP));
  
                // MAIN PANEL
                JPanel mainPanel = new JPanel();
                Border margin = new EmptyBorder(10, 10, 5, 10);
                mainPanel.setBorder(margin);
                mainPanel.setLayout(new VerticalLayout(5, VerticalLayout.LEFT));
  
                // TITLE
                JLabel panelTitleLabel = new JLabel(getStaticLabel());
                Font curFont = panelTitleLabel.getFont();
                int curFontSize = curFont.getSize();
                curFontSize += 4;
                panelTitleLabel.setFont(new Font(curFont.getFontName(), 
curFont.getStyle(), curFontSize));
                mainPanel.add(panelTitleLabel);
  
                // NAME
                mainPanel.add(getNamePanel());
  
                // USER_INPUT
                JPanel durationPanel = new JPanel();
                
durationPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
 getDurationAttributesTitle()));
                FlowLayout layout = new FlowLayout();
                durationPanel.setLayout(layout);
  
                durationPanel.add(new 
JLabel(JMeterUtils.getResString("duration_assertion_label")));
                duration = new JTextField(5);
                durationPanel.add(duration);
  
                mainPanel.add(durationPanel);
                this.add(mainPanel);
  
        }
  
        /****************************************
         * Description of the Method
         *
         *@param e  Description of Parameter
         ***************************************/
        public void focusLost(FocusEvent e)
        {
        }
  
        /****************************************
         * Description of the Method
         *
         *@param e  Description of Parameter
         ***************************************/
        public void focusGained(FocusEvent e) {
        }
  
  }
  
  
  
  1.31      +6 -1      
jakarta-jmeter/src_1/org/apache/jmeter/resources/messages.properties
  
  Index: messages.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src_1/org/apache/jmeter/resources/messages.properties,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- messages.properties       8 Aug 2002 15:53:29 -0000       1.30
  +++ messages.properties       9 Aug 2002 17:20:57 -0000       1.31
  @@ -116,7 +116,12 @@
   server=Server Name or IP:
   file_to_retrieve=File to Retrieve From Server:
   ftp_sample_title=FTP Request Defaults
  -assertion_title=Assertion
  +argument_must_not_be_negative=The Argument must not be negative!
  +duration_assertion_failure=The operation lasted to long: It took {0} milliseconds, 
but should not have lasted longer than {1} milliseconds.
  +duration_assertion_title=Duration Assertion
  +duration_assertion_duration_test=Duration to Assert
  +duration_assertion_label=Duration in milliseconds:
  +assertion_title=Response Assertion
   assertion_visualizer_title=Assertion Results
   assertion_resp_field=Response Field to Test
   assertion_text_resp=Text Response
  
  
  
  1.1                  
jakarta-jmeter/src_1/org/apache/jmeter/resources/messages_de.properties
  
  Index: messages_de.properties
  ===================================================================
  file=Datei
  run=Start
  save=Speichern als
  save_all=Speichern Test Plan
  load=Laden
  open=�ffnen
  edit=Bearbeiten
  exit=Beenden
  start=Start
  stop=Stop
  new=Neu
  clear=L�schen
  clear_all=Alle L�schen
  report=Report
  analyze=Analysiere Daten Datei...
  option=Optionen
  appearance=Aussehen
  menu_timer=Timer
  menu_assertions=�berpr�fung
  menu_listener=Lauscher
  menu_logic_controller=Logik Kontroller
  menu_generative_controller=Sampler
  menu_config_element=Konfigurations Element
  menu_response_based_modifiers=Antwort Basierter Modifizierer
  menu_modifiers=Modifizierer
  sslManager=SSL Manager
  pkcs12_desc=PKCS 12 Key (*.p12)
  ssl_error_title=Key Store Problem
  ssl_pass_prompt=Please type your password
  ssl_pass_title=KeyStore Password
  ssl_alias_prompt=Please type your preferred alias
  ssl_alias_select=Select your alias for the test
  ssl_alias_title=Client Alias
  help=Hilfe
  about=�ber Apache JMeter
  remote_start=Remote Start
  remote_stop=Remote Stop
  root=Root
  test_plan=Test Plan
  workbench=WorkBench
  add=Hinzuf�gen
  remove=Entfernen
  delete=L�schen
  threadgroup=Thread Gruppe
  controller=Controller
  config_element=Config Element
  protocol=Protocol:
  domain=Domain
  port=Port:
  path=Path:
  follow_redirects=Folge Redirects
  use_keepalive=Benutze KeepAlive
  method=Method:
  default_parameters=Standart Parameters
  name=Name:
  value=Wert
  metadata=MetaData
  secure=Sicher
  expiration=Expiration
  username=Benutzername
  password=Passwort
  number_of_threads=Anzahl von Threads:
  infinite=Forever
  iterator_num=Wiederholanzahl:
  add_value=Wert addieren
  paramtable=Sende Parameter mit dem Request:
  upload=Datei hochladen
  field_name=Feldername
  looping_control=Wiederholungs Controlle
  browse=Browse...
  constant_timer_memo=Add a constant delay between sampling
  gaussian_timer_memo=Adds a random delay with a gaussian distribution
  uniform_timer_memo=Adds a random delay with a uniform distribution
  modification_controller_title=Modifikation Manager
  mimetype=Mimetype
  patterns_to_include=Muster zum einschliessen
  patterns_to_exclude=Muster zum ausschliessen
  add_pattern=Addiere Muster:
  ramp_up=Ramp-Up Period (in seconds):
  constant_timer_title=Konstanter Timer
  constant_timer_delay=Thread Delay (in milliseconds):
  gaussian_timer_title=Gaussian Random Timer
  gaussian_timer_delay=Constant Delay Offset (in milliseconds):
  gaussian_timer_range=Deviation (in milliseconds):
  uniform_timer_title=Uniform Random Timer
  uniform_timer_delay=Constant Delay Offset (in milliseconds):
  uniform_timer_range=Random Delay Maximum (in milliseconds):
  thread_delay_properties=Thread Delay Properties
  thread_group_title=Thread Gruppe
  loop_controller_title=Wiederhollungs Kontroller
  modification_manager_title=Modifikations Manager
  interleave_control_title=Interleave Controller
  random_control_title=Random Controller
  logic_controller_title=Simple Controller
  once_only_controller_title=Once Only Controller
  modification_controller_title=Modification Controller
  workbench_title=WorkBench
  root_title=Root
  menu_edit=Edit
  graph_full_results_title=GraphFull Results
  graph_results_title=Graph Results
  graph_results_data=Data
  graph_results_average=Average
  graph_results_deviation=Deviation
  graph_results_no_samples=No of Samples
  graph_results_ms=ms
  graph_results_latest_sample=Latest Sample
  graph_choose_graphs=Graphs to Display
  spline_visualizer_title=Spline Visualizer
  spline_visualizer_maximum=Maximum
  spline_visualizer_minimum=Minimum
  spline_visualizer_average=Average
  spline_visualizer_incoming=Incoming
  spline_visualizer_waitingmessage=Waiting for samples
  ftp_testing_title=FTP Request
  server=Server Name or IP:
  file_to_retrieve=File to Retrieve From Server:
  ftp_sample_title=FTP Request Defaults
  argument_must_not_be_negative=The Argument must not be negative!
  duration_assertion_failure=The operation lasted to long: It took {0} milliseconds, 
but should not have lasted longer than {1} milliseconds.
  duration_assertion_title=Duration Assertion
  duration_assertion_duration_test=Duration to Assert
  duration_assertion_label=Duration in milliseconds:
  assertion_title=Response Assertion
  assertion_visualizer_title=Assertion Results
  assertion_resp_field=Response Field to Test
  assertion_text_resp=Text Response
  assertion_url_samp=URL Sampled
  assertion_pattern_match_rules=Pattern Matching Rules
  assertion_contains=Contains
  assertion_matches=Matches
  assertion_not=Not
  assertion_patterns_to_test=Patterns to Test
  assertion_textarea_label=Assertions:
  login_config=Login Configuration
  database_testing_title=JDBC Request
  database_driver_class=Driver Class:
  database_url=JDBC URL:
  database_url_jdbc_props=Database URL and JDBC Driver
  database_login_title=JDBC Database Login Defaults
  database_conn_pool_props=Database Connection Pool
  database_conn_pool_title=JDBC Database Connection Pool Defaults
  database_conn_pool_size=Number of Connections in Pool:
  database_conn_pool_max_usage=Max Usage For Each Connection:
  database_sql_query_title=JDBC SQL Query Defaults
  database_sql_query_string=SQL Query String:
  file_visualizer_title=File Reporter
  file_visualizer_output_file=Write All Data to a File
  file_visualizer_browse=Browse...
  file_visualizer_append=Append to Existing Data File
  file_visualizer_verbose=Verbose Output
  file_visualizer_auto_flush=Automatically Flush After Each Data Sample
  file_visualizer_submit_data=Include Submitted Data
  file_visualizer_open=Open
  file_visualizer_flush=Flush
  file_visualizer_close=Close
  file_visualizer_filename=Enter a new filename, or browse to an existing file.
  file_visualizer_file_options=File Options
  file_visualizer_missing_filename=No output filename specified.
  url_config_post=POST
  url_config_get=GET
  url_config_http=HTTP
  url_config_https=HTTPS
  url_config_title=HTTP Request Defaults
  url_full_config_title=UrlFull Sample
  web_server=Web Server
  web_server_domain=Server Name or IP:
  web_server_port=Port Number:
  web_request=HTTP Request
  web_testing_title=HTTP Request
  web_testing_retrieve_images=Retrieve  All Images and Java Applets (HTML files only)
  send_file=Send a File With the Request:
  send_file_filename_label=Filename:
  send_file_browse=Browse...
  send_file_param_name_label=Parameter Name:
  send_file_mime_label=MIME Type:
  optional_tasks=Optional Tasks
  proxy_title=HTTP Proxy Server
  view_results_title=View Results
  view_results_tree_title=View Results Tree
  view_graph_tree_title=View Graph Tree
  email_results_title=Email Results
  cookie_manager_title=HTTP Cookie Manager
  cookies_stored=Cookies Stored in the Cookie Manager
  header_manager_title=HTTP Header Manager
  headers_stored=Headers Stored in the Header Manager
  auth_manager_title=HTTP Authorization Manager
  auth_base_url=Base URL
  auths_stored=Authorizations Stored in the Authorization Manager
  anchor_modifier_title=HTTP HTML Link Parser
  jndi_config_title=JNDI Configuration
  jndi_url_jndi_props=JNDI Properties
  jndi_lookup_title=JNDI Lookup Configuration
  jndi_lookup_name=Remote Interface
  jndi_method_title=Remote Method Configuration
  jndi_testing_title=JNDI Request
  jndi_method_name=Method Configuration
  jndi_method_home_name=Home Method Name
  jndi_method_home_parms=Home Method Parameters
  jndi_method_remote_name=Remote Method Name
  jndi_method_remote_parms=Remote Method Parameters
  jndi_method_remote_interface_list=Remote Interfaces
  jndi_method_button_reflect=Reflect
  jndi_method_button_invoke=Invoke
  insert_parent=Insert Parent
  copy=Copy
  cut=Cut
  paste_insert=Paste As Insert
  paste=Paste
  url=URL
  success?=Success?
  html_parameter_mask=HTML Parameter Mask
  id_prefix=ID Prefix
  lower_bound=Lower Bound
  upper_bound=Upper Bound
  increment=Increment
  id_suffix=ID Suffix
  url_multipart_config_title=HTTP Multipart Request Defaults
  view_results_in_table=View Results in Table
  http_response_code=HTTP response code
  aggregate_report=Aggregate Report
  login_config_element=Login Config Element
  menu_non_test_elements=Non-Test Elements
  file_already_in_use=That file is already in use
  busy_testing=Ich bin mit dem Testen besch�ftigt, bitte stoppen sie den Test bevor 
sie die Einstellungen �ndern.
  http_user_parameter_modifier=HTTP User Parameter Modifier
  user_param_mod_help_note=(Do not change this.  Instead, modify the file of that name 
in JMeter's /bin directory)
  filename=Dateiname
  cancel_exit_to_save=There are test items that have not been saved.  Do you wish to 
save before exiting?
  cancel_new_to_save=There are test items that have not been saved.  Do you wish to 
save before clearing the test plan?
  save?=Speichern?
  insert_before=Devor einf�gen
  insert_after=Danach einf�gen
  add_as_child=Als ein Kind hinzuf�gen
  cancel=Abbrechen
  protocol_java_classname=Classname:
  protocol_java_config_tile=Configure Java Sample
  protocol_java_border=Java class
  protocol_java_test_title=Java Testing
  java_request=Java Request
  java_request_defaults=Java Request Defaults
  second=Sekunde
  graph_results_throughput=Durchsatz
  minute=Minute
  http_url_rewriting_modifier_title=HTTP URL-Rewriting Modifier
  session_argument_name=Session Argument Name
  path_extension_choice=Path Extension (use ";" as separator)
  you_must_enter_a_valid_number=Sie m�ssen ein g�ltige Nummer eingeben
  invalid_data=Invalid data
  error_occurred=Error Occurred
  proxy_cl_error=If specifying a proxy server, host and port must be given
  functional_mode=Funktionaler Test Mode
  functional_mode_explanation=W�hlen Sie den funktionalen Test Mode nur, um die 
empfangenen Dateien \nvom Server bei jedem Request aufzuzeichnen bzw. zu speichern.  
\n\nDiese Funktion beeintr�chtigt die Performance betr�chtlich.
  stopping_test_title=Stoppe den Test
  stopping_test=Fahre alle Test herunter. Bitte warten ...
  soap_sampler_title=Soap/XML-RPC Sampler (Alpha code)
  soap_data_title=Soap/XML-RPC Data
  user_defined_variables=Benutzer definierte Variablen
  regexfunc_param_1=Regul�re Ausdr�cke zum suchen in den Resultsder vorherigen Requests
  regexfunc_param_2=Beispiel f�r Ersetzungs Strings, benuzte Gruppen von den regul�ren 
Ausdr�cken
  regexfunc_param_3=Which match to use.  An integer 1 or greater, RAND to indicate 
JMeter should randomly choose, A float, or ALL indicating all matches should be used
  regexfunc_param_4=Between text.  If ALL is selected, the between text will be used 
to generate the results
  regexfunc_param_5=Default text.  Used instead of the template if the regular 
expression finds no matches
  function_dialog_menu_item=Funktions Helfer Dialog
  function_params=Function Parameters
  cut_paste_function=Copy and paste function string
  choose_function=Choose a function
  function_helper_title=Function Helper
  generate=Generate
  iteration_counter_arg_1=TRUE, for each user to have own counter, FALSE for a global 
counter
  request_data=Request Data
  restart=Restart
  
  
  
  1.10      +15 -3     jakarta-jmeter/src_1/org/apache/jmeter/save/SaveService.java
  
  Index: SaveService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src_1/org/apache/jmeter/save/SaveService.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SaveService.java  6 Aug 2002 19:27:23 -0000       1.9
  +++ SaveService.java  9 Aug 2002 17:20:58 -0000       1.10
  @@ -18,7 +18,7 @@
   import org.apache.avalon.framework.configuration.DefaultConfiguration;
   import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
   import org.apache.avalon.framework.configuration.DefaultConfigurationSerializer;
  -import org.apache.jmeter.assertions.Assertion;
  +import org.apache.jmeter.assertions.ResponseAssertion;
   import org.apache.jmeter.assertions.AssertionResult;
   import org.apache.jmeter.samplers.SampleResult;
   import org.apache.jmeter.testelement.TestElement;
  @@ -297,7 +297,19 @@
        public static TestElement createTestElement(Configuration config) throws 
ConfigurationException,
                        ClassNotFoundException, 
IllegalAccessException,InstantiationException
        {
  -             TestElement element = 
(TestElement)Class.forName((String)config.getAttribute("class")).newInstance();
  +             TestElement element = null;
  +             try
  +             {
  +                     element = 
(TestElement)Class.forName((String)config.getAttribute("class")).newInstance();
  +             }
  +             catch(InstantiationException e)
  +             {
  +                     //Assertion is now an interface, replaced with 
ResponseAssertion
  +                     
if(config.getAttribute("class").equals("org.apache.jmeter.assertions.Assertion"))
  +                     {
  +                             element = new ResponseAssertion();
  +                     }
  +             }
                Configuration[] children = config.getChildren();
                for (int i = 0; i < children.length; i++)
                {
  @@ -401,7 +413,7 @@
                public void testLoadAssertion() throws Exception
                {
                        Configuration config = new 
DefaultConfigurationBuilder().buildFromFile(assertionFile);
  -                     Assertion testEl = 
(Assertion)createTestElement(config.getChild("testelement"));
  +                     ResponseAssertion testEl = 
(ResponseAssertion)createTestElement(config.getChild("testelement"));
                        assertEquals("save this string 
\\d+",testEl.getTestStrings().get(0));
                }
        }
  
  
  
  1.5       +5 -5      
jakarta-jmeter/src_1/org/apache/jmeter/save/old/handlers/AssertionHandler.java
  
  Index: AssertionHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src_1/org/apache/jmeter/save/old/handlers/AssertionHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AssertionHandler.java     7 Aug 2002 18:49:37 -0000       1.4
  +++ AssertionHandler.java     9 Aug 2002 17:20:58 -0000       1.5
  @@ -3,7 +3,7 @@
   import java.io.IOException;
   import java.io.Writer;
   
  -import org.apache.jmeter.assertions.Assertion;
  +import org.apache.jmeter.assertions.ResponseAssertion;
   import org.apache.jmeter.save.old.SaveHandler;
   import org.apache.jmeter.save.old.Saveable;
   import org.apache.jmeter.save.old.xml.TagHandler;
  @@ -22,7 +22,7 @@
   public class AssertionHandler extends TagHandler implements SaveHandler
   {
   
  -     Assertion model;
  +     ResponseAssertion model;
   
        public AssertionHandler() {
        }
  @@ -33,7 +33,7 @@
        }
   
        public void save(Saveable objectToSave, Writer out) throws IOException {
  -             Assertion saved = (Assertion)objectToSave;
  +             ResponseAssertion saved = (ResponseAssertion)objectToSave;
                out.write("<");
                out.write(getPrimaryTagName());
                out.write(" name=\"");
  @@ -59,7 +59,7 @@
        public void setAtts(Attributes atts) throws 
ClassNotFoundException,IllegalAccessException,InstantiationException
        {
                try {
  -                     model = 
(Assertion)Class.forName(atts.getValue("class")).newInstance();
  +                     model = 
(ResponseAssertion)Class.forName(JMeterHandler.getComponentConversion(atts.getValue("class"))).newInstance();
                        model.setName(atts.getValue("name"));
                        model.setTestType(Integer.parseInt(atts.getValue("testType")));
                        
model.setTestField(JMeterHandler.convertProperty(atts.getValue("testField")));
  @@ -74,7 +74,7 @@
                model.addTestString(data);
        }
   
  -     private void writeTestStrings(Assertion saved,Writer out) throws IOException
  +     private void writeTestStrings(ResponseAssertion saved, Writer out) throws 
IOException
        {
                /*Iterator iter = saved.getTestStringList().iterator();
                while (iter.hasNext())
  
  
  
  1.7       +5 -3      
jakarta-jmeter/src_1/org/apache/jmeter/save/old/handlers/JMeterHandler.java
  
  Index: JMeterHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src_1/org/apache/jmeter/save/old/handlers/JMeterHandler.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JMeterHandler.java        7 Aug 2002 18:49:37 -0000       1.6
  +++ JMeterHandler.java        9 Aug 2002 17:20:58 -0000       1.7
  @@ -65,7 +65,7 @@
   import org.apache.jmeter.save.old.SaveHandler;
   import org.apache.jmeter.save.old.Saveable;
   import org.apache.jmeter.testelement.TestElement;
  -import org.apache.jmeter.assertions.Assertion;
  +import org.apache.jmeter.assertions.ResponseAssertion;
   
   
   /**
  @@ -127,8 +127,8 @@
                propertyConversion.put("method",HTTPSampler.METHOD);
                propertyConversion.put("domain",HTTPSampler.DOMAIN);
                propertyConversion.put("path",HTTPSampler.PATH);
  -             propertyConversion.put("sampler.RESPONSE",Assertion.RESPONSE_DATA);
  -             propertyConversion.put("sampler.LABEL",Assertion.SAMPLE_LABEL);
  +             
propertyConversion.put("sampler.RESPONSE",ResponseAssertion.RESPONSE_DATA);
  +             propertyConversion.put("sampler.LABEL",ResponseAssertion.SAMPLE_LABEL);
                
                propertyConversion.put("name",TestElement.NAME);
                
  @@ -137,6 +137,8 @@
                
componentMap.put("org.apache.jmeter.reporters.ResultCollector","org.apache.jmeter.reporters.ResultCollector");
                
componentMap.put("org.apache.jmeter.protocol.http.config.UrlConfig","org.apache.jmeter.config.ConfigTestElement");
                
componentMap.put("org.apache.jmeter.protocol.http.config.MultipartUrlConfig","org.apache.jmeter.config.ConfigTestElement");
  +             componentMap.put("org.apache.jmeter.assertions.Assertion",
  +                             "org.apache.jmeter.assertions.ResponseAssertion");
                
        }
                
  
  
  
  1.7       +24 -17    
jakarta-jmeter/src_1/org/apache/jmeter/visualizers/MailerVisualizer.java
  
  Index: MailerVisualizer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src_1/org/apache/jmeter/visualizers/MailerVisualizer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MailerVisualizer.java     3 Aug 2002 01:50:38 -0000       1.6
  +++ MailerVisualizer.java     9 Aug 2002 17:20:58 -0000       1.7
  @@ -183,19 +183,24 @@
        public synchronized Vector newAddressVector(String theAddressie)
        {
                Vector addressVector = new Vector();
  -             String addressSep = ", ";
  -
  -             StringTokenizer next = new StringTokenizer(theAddressie, addressSep);
  -
  -             while (next.hasMoreTokens())
  -             {
  -                     String theToken = next.nextToken();
  -
  -                     if (theToken.indexOf("@") > 0)
  +             if (theAddressie != null) {
  +                     String addressSep = ", ";
  +     
  +                     StringTokenizer next = new StringTokenizer(theAddressie, 
addressSep);
  +     
  +                     while (next.hasMoreTokens())
                        {
  -                             addressVector.addElement(theToken);
  +                             String theToken = next.nextToken();
  +     
  +                             if (theToken.indexOf("@") > 0)
  +                             {
  +                                     addressVector.addElement(theToken);
  +                             }
                        }
                }
  +             else {
  +                     return new Vector(0);
  +             }
   
                return addressVector;
        }
  @@ -228,11 +233,13 @@
   
                        // Send the mail ...
                        Vector addressVector = newAddressVector(addressie);
  -                     sendMail(from, addressVector, failsubject, "URL Failed: " +
  -                                     sample.getSampleLabel(), smtpHost);
  -                     siteDown = true;
  -                     failureMsgSent = true;
  -                     successCount = 0;
  +                     if (addressVector.size() != 0) {
  +                             sendMail(from, addressVector, failsubject, "URL 
Failed: " +
  +                                             sample.getSampleLabel(), smtpHost);
  +                             siteDown = true;
  +                             failureMsgSent = true;
  +                             successCount = 0;
  +                     }
                }
   
                if (siteDown && (sample.getTime() != -1) & !successMsgSent)
  
  
  

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

Reply via email to