All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.unidal.eunit.handler.IdHandler Maven / Gradle / Ivy

package org.unidal.eunit.handler;

import org.unidal.eunit.annotation.Id;
import org.unidal.eunit.model.entity.EunitParameter;
import org.unidal.eunit.testfwk.spi.IAnnotationHandler;
import org.unidal.eunit.testfwk.spi.IClassContext;
import org.unidal.eunit.testfwk.spi.IClassContext.IEunitContext;
import org.unidal.eunit.testfwk.spi.Parameter;

public enum IdHandler implements IAnnotationHandler {
   INSTANCE;

   @Override
   public Class getTargetAnnotation() {
      return Id.class;
   }

   @Override
   public void handle(IClassContext context, Id meta, Parameter parameter) {
      IEunitContext ctx = context.forEunit();
      EunitParameter eunitParameter = ctx.peek();

      eunitParameter.setId(meta.value());
   }

   @Override
   public boolean isAfter() {
      return false;
   }

   @Override
   public String toString() {
      return String.format("%s.%s", getClass().getSimpleName(), name());
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy