package uk.co.automatictester.lightning.tests;

import uk.co.automatictester.lightning.JMeterTransactions;

public abstract class Test {

    protected final String name;
    protected final String description;
    protected final String transactionName;
    protected String expectedResult;
    protected String actualResult;
    protected boolean passed;
    protected boolean failed;
    protected boolean error;

    protected Test(String name, String description, String transactionName) {
        this.name = name;
        this.description = description;
        this.transactionName = transactionName;
        this.expectedResult = "";
        this.actualResult = "";
        this.passed = false;
        this.failed = false;
        this.error = false;
    }

    public abstract void execute(JMeterTransactions originalJMeterTransactions);

    public String getReport() {
        String ls = System.lineSeparator();
        String desc = (!description.isEmpty()) ? ("Test description: " + description + ls) : "";
        String testResult = "";

        if (error) {
            testResult = "ERROR";
        } else if (failed) {
            testResult = "FAIL";
        } else {
            testResult = "Pass";
        }

        return "Test name:        " + name + ls
                + desc
                + "Transaction name: " + transactionName + ls
                + "Expected result:  " + expectedResult + ls
                + "Actual result:    " + actualResult + ls
                + "Test result:      " + testResult + ls + ls;
    }

    public boolean isPassed() {
        return passed;
    }

    public boolean isFailed() {
        return failed;
    }

    public boolean isError() {
        return error;
    }

    public boolean equals(Object obj) {
        if (obj instanceof Test) {
            Test test = (Test) obj;
            return name.equals(test.name) &&
                    description.equals(test.description) &&
                    transactionName.equals(test.transactionName) &&
                    expectedResult.equals(test.expectedResult) &&
                    actualResult.equals(test.actualResult) &&
                    failed == test.failed;
        } else {
            return false;
        }
    }
}

@@ -1736,522 +1736,7 @@
    %7D
-%0A%0A    public boolean equals(Object obj) %7B%0A        if (obj instanceof Test) %7B%0A            Test test = (Test) obj;%0A            return name.equals(test.name) &&%0A                    description.equals(test.description) &&%0A                    transactionName.equals(test.transactionName) &&%0A                    expectedResult.equals(test.expectedResult) &&%0A                    actualResult.equals(test.actualResult) &&%0A                    failed == test.failed;%0A        %7D else %7B%0A            return false;%0A        %7D%0A    %7D
 %0A%7D%0A

Remove equals method from abstract Test class