⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 samplesaveconfiguration.java

📁 测试工具
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
		encoding = value;
		fieldNames = value;
		fileName = value;
		hostname = value;
		label = value;
		latency = value;
		message = value;
		printMilliseconds = _printMilliseconds;//is derived from properties only
		requestHeaders = value;
		responseData = value;
		responseDataOnError = value;
		responseHeaders = value;
		samplerData = value;
		saveAssertionResultsFailureMessage = value;
		subresults = value;
		success = value;
		threadCounts = value;
		sampleCount = value;
		threadName = value;
		time = value;
		timestamp = value;
		url = value;
		xml = value;
	}

    private Object readResolve() throws ObjectStreamException{
	   formatter = _formatter;
       return this;
    }

    public Object clone() {
        try {
            SampleSaveConfiguration clone = (SampleSaveConfiguration)super.clone();
            if(this.formatter != null) {
                clone.formatter = (SimpleDateFormat)this.formatter.clone();
            }
            return clone;
        }
        catch(CloneNotSupportedException e) {
            // this should not happen
            return null;
        }
	}
    
    public boolean equals(Object obj) {
        if(this == obj) {
            return true;
        }
        if((obj == null) || (obj.getClass() != this.getClass())) {
            return false;
        }
        // We know we are comparing to another SampleSaveConfiguration
        SampleSaveConfiguration s = (SampleSaveConfiguration)obj;
        boolean primitiveValues = s.time == time &&
            s.latency == latency && 
            s.timestamp == timestamp &&
            s.success == success &&
            s.label == label &&
            s.code == code &&
            s.message == message &&
            s.threadName == threadName &&
            s.dataType == dataType &&
            s.encoding == encoding &&
            s.assertions == assertions &&
            s.subresults == subresults &&
            s.responseData == responseData &&
            s.samplerData == samplerData &&
            s.xml == xml &&
            s.fieldNames == fieldNames &&
            s.responseHeaders == responseHeaders &&
            s.requestHeaders == requestHeaders &&
            s.assertionsResultsToSave == assertionsResultsToSave &&
            s.saveAssertionResultsFailureMessage == saveAssertionResultsFailureMessage &&
            s.printMilliseconds == printMilliseconds &&
            s.responseDataOnError == responseDataOnError &&
            s.url == url &&
            s.bytes == bytes &&
            s.fileName == fileName &&
            s.hostname == hostname &&
            s.sampleCount == sampleCount &&
            s.threadCounts == threadCounts;
        
        boolean stringValues = false;
        if(primitiveValues) {
            stringValues = s.delimiter == delimiter || (delimiter != null && delimiter.equals(s.delimiter));
        }
        boolean complexValues = false;
        if(primitiveValues && stringValues) {
            complexValues = s.formatter == formatter || (formatter != null && formatter.equals(s.formatter));
        }
        
        return primitiveValues && stringValues && complexValues;
    }
    
    public int hashCode() {
        int hash = 7;
        hash = 31 * hash + (time ? 1 : 0);
        hash = 31 * hash + (latency ? 1 : 0);
        hash = 31 * hash + (timestamp ? 1 : 0);
        hash = 31 * hash + (success ? 1 : 0);
        hash = 31 * hash + (label ? 1 : 0);
        hash = 31 * hash + (code ? 1 : 0);
        hash = 31 * hash + (message ? 1 : 0);
        hash = 31 * hash + (threadName ? 1 : 0);
        hash = 31 * hash + (dataType ? 1 : 0);
        hash = 31 * hash + (encoding ? 1 : 0);
        hash = 31 * hash + (assertions ? 1 : 0);
        hash = 31 * hash + (subresults ? 1 : 0);
        hash = 31 * hash + (responseData ? 1 : 0);
        hash = 31 * hash + (samplerData ? 1 : 0);
        hash = 31 * hash + (xml ? 1 : 0);
        hash = 31 * hash + (fieldNames ? 1 : 0);
        hash = 31 * hash + (responseHeaders ? 1 : 0);
        hash = 31 * hash + (requestHeaders ? 1 : 0);
        hash = 31 * hash + assertionsResultsToSave;
        hash = 31 * hash + (saveAssertionResultsFailureMessage ? 1 : 0);
        hash = 31 * hash + (printMilliseconds ? 1 : 0);
        hash = 31 * hash + (responseDataOnError ? 1 : 0);
        hash = 31 * hash + (url ? 1 : 0);
        hash = 31 * hash + (bytes ? 1 : 0);
        hash = 31 * hash + (fileName ? 1 : 0);
        hash = 31 * hash + (hostname ? 1 : 0);
        hash = 31 * hash + (threadCounts ? 1 : 0);
        hash = 31 * hash + (delimiter != null  ? delimiter.hashCode() : 0);
        hash = 31 * hash + (formatter != null  ? formatter.hashCode() : 0);
        hash = 31 * hash + (sampleCount ? 1 : 0);
        
        return hash;
    }

    ///////////////////// Start of standard save/set access methods /////////////////////
    
	public boolean saveResponseHeaders() {
		return responseHeaders;
	}

	public void setResponseHeaders(boolean r) {
		responseHeaders = r;
	}

	public boolean saveRequestHeaders() {
		return requestHeaders;
	}

	public void setRequestHeaders(boolean r) {
		requestHeaders = r;
	}

	public boolean saveAssertions() {
		return assertions;
	}

	public void setAssertions(boolean assertions) {
		this.assertions = assertions;
	}

	public boolean saveCode() {
		return code;
	}

	public void setCode(boolean code) {
		this.code = code;
	}

	public boolean saveDataType() {
		return dataType;
	}

	public void setDataType(boolean dataType) {
		this.dataType = dataType;
	}

	public boolean saveEncoding() {
		return encoding;
	}

	public void setEncoding(boolean encoding) {
		this.encoding = encoding;
	}

	public boolean saveLabel() {
		return label;
	}

	public void setLabel(boolean label) {
		this.label = label;
	}

	public boolean saveLatency() {
		return latency;
	}

	public void setLatency(boolean latency) {
		this.latency = latency;
	}

	public boolean saveMessage() {
		return message;
	}

	public void setMessage(boolean message) {
		this.message = message;
	}

	public boolean saveResponseData(SampleResult res) {
		return responseData || TestPlan.getFunctionalMode() || (responseDataOnError && !res.isSuccessful());
	}
    
    public boolean saveResponseData()
    {
        return responseData;
    }

	public void setResponseData(boolean responseData) {
		this.responseData = responseData;
	}

	public boolean saveSamplerData(SampleResult res) {
		return samplerData || TestPlan.getFunctionalMode() // as per 2.0 branch
				|| (responseDataOnError && !res.isSuccessful());
	}
    
    public boolean saveSamplerData()
    {
        return samplerData;
    }

	public void setSamplerData(boolean samplerData) {
		this.samplerData = samplerData;
	}

	public boolean saveSubresults() {
		return subresults;
	}

	public void setSubresults(boolean subresults) {
		this.subresults = subresults;
	}

	public boolean saveSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public boolean saveThreadName() {
		return threadName;
	}

	public void setThreadName(boolean threadName) {
		this.threadName = threadName;
	}

	public boolean saveTime() {
		return time;
	}

	public void setTime(boolean time) {
		this.time = time;
	}

	public boolean saveTimestamp() {
		return timestamp;
	}

	public void setTimestamp(boolean timestamp) {
		this.timestamp = timestamp;
	}

	public boolean saveAsXml() {
		return xml;
	}

	public void setAsXml(boolean xml) {
		this.xml = xml;
	}

	public boolean saveFieldNames() {
		return fieldNames;
	}

	public void setFieldNames(boolean printFieldNames) {
		this.fieldNames = printFieldNames;
	}

	public boolean saveUrl() {
		return url;
	}

	public void setUrl(boolean save) {
		this.url = save;
	}

	public boolean saveBytes() {
		return bytes;
	}

	public void setBytes(boolean save) {
		this.bytes = save;
	}

	public boolean saveFileName() {
		return fileName;
	}

	public void setFileName(boolean save) {
		this.fileName = save;
	}

	public boolean saveAssertionResultsFailureMessage() {
		return saveAssertionResultsFailureMessage;
	}

	public void setAssertionResultsFailureMessage(boolean b) {
		saveAssertionResultsFailureMessage = b;
	}

    public boolean saveThreadCounts() {
        return threadCounts;
    }

    public void setThreadCounts(boolean save) {
        this.threadCounts = save;
    }

    public boolean saveSampleCount() {
        return sampleCount;
    }

    public void setSampleCount(boolean save) {
        this.sampleCount = save;
    }

	///////////////// End of standard field accessors /////////////////////
	
    /**
     * Only intended for use by OldSaveService (and test cases)
     */
    public void setFormatter(DateFormat fmt){
    	printMilliseconds = (fmt == null); // maintain relationship
    	formatter = fmt;
    }
    
	public boolean printMilliseconds() {
		return printMilliseconds;
	}

	public DateFormat formatter() {
		return formatter;
	}

	public int assertionsResultsToSave() {
		return assertionsResultsToSave;
	}

	public String getDelimiter() {
		return delimiter;
	}

    public String getXmlPi() {
        return JMeterUtils.getJMeterProperties().getProperty(XML_PI, ""); // Defaults to empty;
    }

    // Used by old Save service
	public void setDelimiter(String delim) {
		delimiter=delim;
	}

    // Used by SampleSaveConfigurationConverter.unmarshall()
	public void setDefaultDelimiter() {
		delimiter=_delimiter;
	}

    // Used by SampleSaveConfigurationConverter.unmarshall()
	public void setDefaultTimeStampFormat() {
		printMilliseconds=_printMilliseconds;
		formatter=_formatter;
	}
	
	public boolean saveHostname(){
		return hostname;
	}
	
	public void setHostname(boolean save){
		hostname = save;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -