Package com.softwaremill.common.arquillian

Source Code of com.softwaremill.common.arquillian.BetterArquillian

package com.softwaremill.common.arquillian;

import org.jboss.arquillian.testng.Arquillian;
import org.testng.IHookCallBack;
import org.testng.ITestResult;

public abstract class BetterArquillian extends Arquillian {
    protected void beforeMethodWithDependencies() { }
    protected void afterMethodWithDependencies() { }

    @Override
    public void run(final IHookCallBack callback, ITestResult testResult) {
        super.run(new IHookCallBack() {
            @Override
            public void runTestMethod(ITestResult testResult) {
                beforeMethodWithDependencies();
                try {
                    callback.runTestMethod(testResult);
                } finally {
                    afterMethodWithDependencies();
                }
            }

            @Override
            public Object[] getParameters() {
                return callback.getParameters();
            }
        }, testResult);
    }
}
TOP

Related Classes of com.softwaremill.common.arquillian.BetterArquillian

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.