Examples of JMeterError


Examples of org.apache.jorphan.util.JMeterError

            Method method = doCreateMethod(_class , argTypes);
            if (method == null){
                final String message = "Can't find method "
                    +_class.getName()+"#"+methodName+typesToString(argTypes);
                log.error(message, new Throwable());
                throw new JMeterError(message);
            }
            return method.invoke(_invokee, _args);
        } catch (Exception e) {
            final String message = "Trouble functing: "
                +_class.getName()
                +"."+methodName+"(...) : "
                +" invokee: "+_invokee
                +" "+e.getMessage();
            log.warn(message, e);
            throw new JMeterError(message,e);
        }
    }
View Full Code Here

Examples of org.apache.jorphan.util.JMeterError

    public void sampleOccurred(SampleEvent e) {
        try {
            listener.sampleOccurred(e);
        } catch (RemoteException err) {
            if (err.getCause() instanceof java.net.ConnectException){
                throw new JMeterError("Could not return sample",err);
            }
            log.error("sampleOccurred", err);
        }
    }
View Full Code Here

Examples of org.apache.jorphan.util.JMeterError

                    if (size > 0) {
                        try {
                            listener.processBatch(l);
                        } catch (RemoteException err) {
                            if (err.getCause() instanceof java.net.ConnectException){
                                throw new JMeterError("Could not return sample",err);
                            }
                            log.error("Failed to return sample", err);
                        }
                    }
                }
View Full Code Here

Examples of org.apache.jorphan.util.JMeterError

                if (obj instanceof SampleEvent) {
                    try {
                        listener.sampleOccurred((SampleEvent) obj);
                    } catch (RemoteException err) {
                        if (err.getCause() instanceof java.net.ConnectException){
                            throw new JMeterError("Could not return sample",err);
                        }
                        log.error("returning sample", err);
                    }
                } else {
                    log.error("Unexpected object type found in data file "+obj.getClass().getName());
View Full Code Here

Examples of org.apache.jorphan.util.JMeterError

        try {
            r = m.invoke(bshInstance, o);
        } catch (IllegalArgumentException e) { // Programming error
            final String message = errorString + m.getName();
            log.error(message);
            throw new JMeterError(message, e);
        } catch (IllegalAccessException e) { // Also programming error
            final String message = errorString + m.getName();
            log.error(message);
            throw new JMeterError(message, e);
        } catch (InvocationTargetException e) { // Can occur at run-time
            // could be caused by the bsh Exceptions:
            // EvalError, ParseException or TargetError
            String message = errorString + m.getName();
            Throwable cause = e.getCause();
View Full Code Here

Examples of org.apache.jorphan.util.JMeterError

            previousResult.addAssertionResult(ass);
            previousResult.setSuccessful(false);
        } catch (ParserConfigurationException e) {// Should not happen
            final String errrorMessage = "ParserConfigurationException while processing ("+getXPathQuery()+")";
            log.error(errrorMessage,e);
            throw new JMeterError(errrorMessage,e);
        } catch (SAXException e) {// Can happen for bad input document
            log.warn("SAXException while processing ("+getXPathQuery()+") "+e.getLocalizedMessage());
            addAssertionFailure(previousResult, e, false); // Should this also fail the sample?
        } catch (TransformerException e) {// Can happen for incorrect XPath expression
            log.warn("TransformerException while processing ("+getXPathQuery()+") "+e.getLocalizedMessage());
View Full Code Here

Examples of org.apache.jorphan.util.JMeterError

                entry = i;
                break;
            }
        }
        if (entry == -1) {
            throw new JMeterError("Impossible state, data key not present in order: "+currentKey.getClass());
        }
        order.set(entry, newKey);
    }
View Full Code Here

Examples of org.apache.jorphan.util.JMeterError

      Document d = parseResponse(previousResult);   
      getValuesForXPath(d,getXPathQuery(),vars, refName);
    }catch(IOException e){// Should not happen
      final String errorMessage = "error on ("+getXPathQuery()+")";
      log.error(errorMessage,e);
      throw new JMeterError(errorMessage,e);
    } catch (ParserConfigurationException e) {// Should not happen
      final String errrorMessage = "error on ("+getXPathQuery()+")";
      log.error(errrorMessage,e);
      throw new JMeterError(errrorMessage,e);
    } catch (SAXException e) {// Can happen for bad input document
      log.warn("error on ("+getXPathQuery()+")"+e.getLocalizedMessage());
    } catch (TransformerException e) {// Can happen for incorrect XPath expression
      log.warn("error on ("+getXPathQuery()+")"+e.getLocalizedMessage());
    } catch (TidyException e) {
View Full Code Here

Examples of org.apache.jorphan.util.JMeterError

          Date stamp = saveConfig.formatter().parse(text);
          timeStamp = stamp.getTime();
        } else { // can this happen?
          final String msg = "Unknown timestamp format";
          log.warn(msg);
          throw new JMeterError(msg);
        }
      }

      if (saveConfig.saveTime()) {
        field = CSV_ELAPSED;
        text = parts[i++];
        elapsed = Long.parseLong(text);
      }

      if (saveConfig.saveSampleCount()) {
        result = new StatisticalSampleResult(timeStamp, elapsed);
      } else {
        result = new SampleResult(timeStamp, elapsed);
      }

      if (saveConfig.saveLabel()) {
        field = LABEL;
        text = parts[i++];
        result.setSampleLabel(text);
      }
      if (saveConfig.saveCode()) {
        field = RESPONSE_CODE;
        text = parts[i++];
        result.setResponseCode(text);
      }

      if (saveConfig.saveMessage()) {
        field = RESPONSE_MESSAGE;
        text = parts[i++];
        result.setResponseMessage(text);
      }

      if (saveConfig.saveThreadName()) {
        field = THREAD_NAME;
        text = parts[i++];
        result.setThreadName(text);
      }

      if (saveConfig.saveDataType()) {
        field = DATA_TYPE;
        text = parts[i++];
        result.setDataType(text);
      }

      if (saveConfig.saveSuccess()) {
        field = SUCCESSFUL;
        text = parts[i++];
        result.setSuccessful(Boolean.valueOf(text).booleanValue());
      }

      if (saveConfig.saveAssertionResultsFailureMessage()) {
        i++;
                // TODO - should this be restored?
      }
           
            if (saveConfig.saveBytes()) {
              field = CSV_BYTES;
                text = parts[i++];
                result.setBytes(Integer.parseInt(text));
            }
       
            if (saveConfig.saveThreadCounts()) {
              field = CSV_THREAD_COUNT1;
                text = parts[i++];
                result.setGroupThreads(Integer.parseInt(text));
               
              field = CSV_THREAD_COUNT2;
                text = parts[i++];
                result.setAllThreads(Integer.parseInt(text));
            }

            if (saveConfig.saveUrl()) {
                i++;
                // TODO: should this be restored?
            }
       
            if (saveConfig.saveFileName()) {
              field = CSV_FILENAME;
                text = parts[i++];
                result.setResultFileName(text);
            }           
            if (saveConfig.saveLatency()) {
              field = CSV_LATENCY;
                text = parts[i++];
                result.setLatency(Long.parseLong(text));
            }

            if (saveConfig.saveEncoding()) {
              field = CSV_ENCODING;
                text = parts[i++];
                result.setEncodingAndType(text);
            }

            if (saveConfig.saveSampleCount()) {
              field = CSV_SAMPLE_COUNT;
                text = parts[i++];
                result.setSampleCount(Integer.parseInt(text));
              field = CSV_ERROR_COUNT;
                text = parts[i++];
                result.setErrorCount(Integer.parseInt(text));
            }

            if (saveConfig.saveHostname()) {
              field = CSV_HOSTNAME;
                hostname = parts[i++];
            }
           
            if (i + saveConfig.getVarCount() < parts.length){
              log.warn("Line: "+lineNumber+". Found "+parts.length+" fields, expected "+i+". Extra fields have been ignored.");
            }

    } catch (NumberFormatException e) {
      log.warn("Error parsing field '" + field + "' at line " + lineNumber + " " + e);
      throw new JMeterError(e);
    } catch (ParseException e) {
      log.warn("Error parsing field '" + field + "' at line " + lineNumber + " " + e);
      throw new JMeterError(e);
    } catch (ArrayIndexOutOfBoundsException e){
      log.warn("Insufficient columns to parse field '" + field + "' at line " + lineNumber);
      throw new JMeterError(e);
    }
    return new SampleEvent(result,"",hostname);
  }
View Full Code Here

Examples of org.apache.jorphan.util.JMeterError

          }
        }
      }
    } catch (IOException e) {
      log.fatalError("Bad saveservice properties file", e);
      throw new JMeterError("JMeter requires the saveservice properties file to continue");
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.