org.evosuite.testcase.TestVisitor Maven / Gradle / Ivy
The newest version!
/**
* Copyright (C) 2010-2018 Gordon Fraser, Andrea Arcuri and EvoSuite
* contributors
*
* This file is part of EvoSuite.
*
* EvoSuite is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3.0 of the License, or
* (at your option) any later version.
*
* EvoSuite is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with EvoSuite. If not, see .
*/
/**
*
*/
package org.evosuite.testcase;
import org.evosuite.testcase.statements.*;
/**
*
* TestVisitor interface.
*
*
* @author fraser
*/
public abstract class TestVisitor {
/**
*
* visitTestCase
*
*
* @param test
* a {@link org.evosuite.testcase.TestCase} object.
*/
public abstract void visitTestCase(TestCase test);
/**
*
* visitPrimitiveStatement
*
*
* @param statement
* a {@link org.evosuite.testcase.statements.PrimitiveStatement} object.
*/
public abstract void visitPrimitiveStatement(PrimitiveStatement> statement);
/**
*
* visitFieldStatement
*
*
* @param statement
* a {@link org.evosuite.testcase.statements.FieldStatement} object.
*/
public abstract void visitFieldStatement(FieldStatement statement);
/**
*
* visitMethodStatement
*
*
* @param statement
* a {@link org.evosuite.testcase.statements.MethodStatement} object.
*/
public abstract void visitMethodStatement(MethodStatement statement);
/**
*
* visitConstructorStatement
*
*
* @param statement
* a {@link org.evosuite.testcase.statements.ConstructorStatement} object.
*/
public abstract void visitConstructorStatement(ConstructorStatement statement);
/**
*
* visitArrayStatement
*
*
* @param statement
* a {@link org.evosuite.testcase.statements.ArrayStatement} object.
*/
public abstract void visitArrayStatement(ArrayStatement statement);
/**
*
* visitAssignmentStatement
*
*
* @param statement
* a {@link org.evosuite.testcase.statements.AssignmentStatement} object.
*/
public abstract void visitAssignmentStatement(AssignmentStatement statement);
/**
*
* visitNullStatement
*
*
* @param statement
* a {@link org.evosuite.testcase.statements.NullStatement} object.
*/
public abstract void visitNullStatement(NullStatement statement);
/**
*
* visitPrimitiveExpression
*
*
* @param primitiveExpression
* a {@link org.evosuite.testcase.statements.PrimitiveExpression} object.
*/
public abstract void visitPrimitiveExpression(PrimitiveExpression primitiveExpression);
public abstract void visitFunctionalMockStatement(FunctionalMockStatement functionalMockStatement);
/**
*
* visitStatement
*
*
* @param statement
* a {@link org.evosuite.testcase.statements.Statement} object.
*/
public void visitStatement(Statement statement) {
if (statement instanceof PrimitiveStatement>)
visitPrimitiveStatement((PrimitiveStatement>) statement);
else if (statement instanceof FieldStatement)
visitFieldStatement((FieldStatement) statement);
else if (statement instanceof ConstructorStatement)
visitConstructorStatement((ConstructorStatement) statement);
else if (statement instanceof MethodStatement)
visitMethodStatement((MethodStatement) statement);
else if (statement instanceof AssignmentStatement)
visitAssignmentStatement((AssignmentStatement) statement);
else if (statement instanceof ArrayStatement)
visitArrayStatement((ArrayStatement) statement);
else if (statement instanceof NullStatement)
visitNullStatement((NullStatement) statement);
else if (statement instanceof PrimitiveExpression)
visitPrimitiveExpression((PrimitiveExpression) statement);
else if (statement instanceof FunctionalMockStatement)
visitFunctionalMockStatement((FunctionalMockStatement) statement);
else
throw new RuntimeException("Unknown statement type: " + statement);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy