Package bdd.steps

Source Code of bdd.steps.CustomInstantiationStrategy

package bdd.steps;

import org.givwenzen.annotations.InstantiationState;
import org.givwenzen.annotations.InstantiationStateCreator;
import org.givwenzen.annotations.InstantiationStrategy;

import java.lang.reflect.InvocationTargetException;
import java.util.Date;

public class CustomInstantiationStrategy implements InstantiationStrategy {

   public InstantiationState instantiate(Class<?> markedClass, Object parameter) throws InvocationTargetException,
      InstantiationException, IllegalAccessException {
      InstantiationStateCreator creator = new InstantiationStateCreator();
      if (markedClass.equals(CustomInstantiationSteps.class)) {
         return creator.didInstantiate(new CustomInstantiationSteps(new Date()));
      }
      return creator.didNotInstantiate();
   }

}
TOP

Related Classes of bdd.steps.CustomInstantiationStrategy

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.