// Path: test-automation-framework/org.wso2.carbon.automation.engine/src/main/java/org/wso2/carbon/automation/engine/exceptions/AutomationFrameworkException.java
// public class AutomationFrameworkException extends Exception {
//     public AutomationFrameworkException(String message) {
//         super(message);
//     }
// 
//     public AutomationFrameworkException(String message, Throwable e) {
//         super(message, e);
//     }
// 
//     public AutomationFrameworkException(Throwable e) {
//         super(e);
//     }
// }


import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jmeter.JMeter;
import org.apache.jmeter.engine.StandardJMeterEngine;
import org.apache.jmeter.util.ShutdownClient;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.wso2.carbon.automation.engine.exceptions.AutomationFrameworkException;
import org.xml.sax.SAXException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import java.io.*;
import java.lang.Thread.UncaughtExceptionHandler;
import java.nio.charset.Charset;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Pattern;
/*
 * Copyright (c) 2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


package org.wso2.carbon.automation.extensions.jmeter;



public class JMeterTestManager {

    private static final Pattern PAT_ERROR = Pattern.compile(".*\\s+ERROR\\s+.*");
    private static final Log log = LogFactory.getLog(JMeterTestManager.class);

    private String jmeterLogLevel = "INFO";

    private File testFile = null;
    private File jmeterHome = null;
    private File jmeterLogFile = null;

    private DateFormat fmt = new SimpleDateFormat("yyMMdd-HH-mm-ss");

    private File jmeterProps = null;

    public void runTest(JMeterTest jMeterTest)
// Path: test-automation-framework/org.wso2.carbon.automation.engine/src/main/java/org/wso2/carbon/automation/engine/exceptions/AutomationFrameworkException.java
// public class AutomationFrameworkException extends Exception {
//     public AutomationFrameworkException(String message) {
//         super(message);
//     }
// 
//     public AutomationFrameworkException(String message, Throwable e) {
//         super(message, e);
//     }
// 
//     public AutomationFrameworkException(Throwable e) {
//         super(e);
//     }
// }


// Path: test-automation-framework/org.wso2.carbon.automation.extensions/src/main/java/org/wso2/carbon/automation/extensions/jmeter/JMeterTestManager.java
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jmeter.JMeter;
import org.apache.jmeter.engine.StandardJMeterEngine;
import org.apache.jmeter.util.ShutdownClient;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.wso2.carbon.automation.engine.exceptions.AutomationFrameworkException;
import org.xml.sax.SAXException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import java.io.*;
import java.lang.Thread.UncaughtExceptionHandler;
import java.nio.charset.Charset;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Pattern;

/*
 * Copyright (c) 2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


package org.wso2.carbon.automation.extensions.jmeter;



public class JMeterTestManager {

    private static final Pattern PAT_ERROR = Pattern.compile(".*\\s+ERROR\\s+.*");
    private static final Log log = LogFactory.getLog(JMeterTestManager.class);

    private String jmeterLogLevel = "INFO";

    private File testFile = null;
    private File jmeterHome = null;
    private File jmeterLogFile = null;

    private DateFormat fmt = new SimpleDateFormat("yyMMdd-HH-mm-ss");

    private File jmeterProps = null;

    public void runTest(JMeterTest jMeterTest)
            throws AutomationFrameworkException {