/*
Use @BeforeClass event in order to scan the test class for annotation we might be interesting.
Event fired Before the Class execution.
504220
public void executeBeforeClass(@Observes BeforeClass event, TestClass testClass){
		testClass = event.getTestClass();
		Field[] fields = testClass.getJavaClass().getDeclaredFields();
		for (Field field : fields) {
			if (field.isAnnotationPresent(GetDeployableContainer.class)){
				if (field.getType().isAssignableFrom(ContainerManagerTool.class)){
					isGetDeployableContainerAnnoPresent = true;
					deployableContainerFields.add(field);
				}
			}
		}
	}
488323
def before(self, context):
        ""
        run.before_each.execute(context)
        self._invoke(self._before, context)
3232
def before(complete = true, index = 0, &block)
        unless @before_run
          while callback = machine.callbacks[:before][index]
            index += 1
            
            if callback.type == :around
              # Around callback: need to handle recursively.  Execution only gets
              # paused if:
              # * The block fails and the callback doesn't run on failures OR
              # * The block succeeds, but after callbacks are disabled (in which
              #   case a continuation is stored for later execution)
              return if catch(:cancel) do
                callback.call(object, context, self) do
                  before(complete, index, &block)
                  
                  pause if @success && !complete
                  throw :cancel, true unless @success
                end
              end
            else
              # Normal before callback
              callback.call(object, context, self)
            end
          end
          
          @before_run = true
        end
        
        action = {:success => true}.merge(block_given? ? yield : {})
        @result, @success = action[:result], action[:success]
      end
500666
private static void checkPreconditions(final Class<?> jodaClass,
			final String pattern) {
		if (jodaClass == null) {
			throw new NullPointerException("jodaClass should not be null");
		} else if (pattern == null) {
			throw new NullPointerException("pattern should not be null");
		}
	}
875304
private void initSequential(final Boolean sequential) {

        // Try to retrieve the Sequential annotation at class level within class hierarchy
        final Sequential seq = ClassUtility.getLastClassAnnotation(this.getClass(), Sequential.class);

        // First try to get the annotation value (if present
        // Secondly by provided runtType argument
        // Thirdly (default case) use FALSE value
        setSequential(seq == null ? sequential == null ? DEFAULT_SEQUENTIAL_VALUE : sequential : seq.value());

    }
242774
function runBeforeDetach (args, methodMeta) {
    // skip if no beforeDetach methods
    if (!defined(methodMeta.beforeDetach)) {
        return
    }
    // run all functions
    _.each(methodMeta.beforeDetach, method => {
        // call method
        (method)(args, methodMeta.signature, 'beforeDetach')
        // log errors
        .catch(err => {
            // require log client
            if (!defined(methodMeta.logClient)) {
                return
            }
            // log error
            methodMeta.logClient.error(err, args.session)
        })
    })
}
1180017
private void ensurePreparedForInjection() {
		if (!prepared) {
			try {
				Class<ReflectiveInterceptor> clazz = ReflectiveInterceptor.class;
				method_jlcgdfs = clazz.getDeclaredMethod("jlClassGetDeclaredFields", Class.class);
				method_jlcgdf = clazz.getDeclaredMethod("jlClassGetDeclaredField", Class.class, String.class);
				method_jlcgf = clazz.getDeclaredMethod("jlClassGetField", Class.class, String.class);
				method_jlcgdms = clazz.getDeclaredMethod("jlClassGetDeclaredMethods", Class.class);
				method_jlcgdm = clazz.getDeclaredMethod("jlClassGetDeclaredMethod", Class.class, String.class,
						EMPTY_CLASS_ARRAY_CLAZZ);
				method_jlcgm = clazz.getDeclaredMethod("jlClassGetMethod", Class.class, String.class,
						EMPTY_CLASS_ARRAY_CLAZZ);
				method_jlcgdc = clazz.getDeclaredMethod("jlClassGetDeclaredConstructor", Class.class,
						EMPTY_CLASS_ARRAY_CLAZZ);
				method_jlcgc = clazz.getDeclaredMethod("jlClassGetConstructor", Class.class, EMPTY_CLASS_ARRAY_CLAZZ);
				method_jlcgmods = clazz.getDeclaredMethod("jlClassGetModifiers", Class.class);
				method_jlcgms = clazz.getDeclaredMethod("jlClassGetMethods", Class.class);

				method_jlcgdcs = clazz.getDeclaredMethod("jlClassGetDeclaredConstructors", Class.class);
				method_jlrfg = clazz.getDeclaredMethod("jlrFieldGet", Field.class, Object.class);
				method_jlrfgl = clazz.getDeclaredMethod("jlrFieldGetLong", Field.class, Object.class);
				method_jlrmi = clazz.getDeclaredMethod("jlrMethodInvoke", Method.class, Object.class, Object[].class);
				method_jloObjectStream_hasInitializerMethod = clazz.getDeclaredMethod("jlosHasStaticInitializer",
						Class.class);
			}
			catch (NoSuchMethodException nsme) {
				// cant happen, a-hahaha
				throw new Impossible(nsme);
			}
			prepared = true;
		}
	}
922430
public function beforeRender(Event $event)
    {
        parent::beforeRender($event);

        $this->set('detect', $this->detect);
    }
1188908
public function beforeSend()
    {
        $this->client->beforeSend($this);

        $event = new RequestEvent();
        $event->request = $this;
        $this->trigger(self::EVENT_BEFORE_SEND, $event);
    }
294176
protected void _before(SarlCapacityUses uses, IExtraLanguageGeneratorContext context) {
		// Rename the function in order to produce the good features at the calls.
		for (final JvmTypeReference capacity : uses.getCapacities()) {
			final JvmType type = capacity.getType();
			if (type instanceof JvmDeclaredType) {
				computeCapacityFunctionMarkers((JvmDeclaredType) type);
			}
		}
	}
663501
private function parseBefore($method, &$args)
    {
        $this->doAspect($method, 'before', function($aspectClassName, $methodName) use($method, &$args){
            $joinPoint = new JoinPoint('before', $method, $args, $this->object, $this);
            call_user_func([new $aspectClassName, $methodName], $joinPoint);
        });
    }
478069
public function beforeSpec(Spec $spec)
    {
        self::$testCase->setUp();
        self::$result->startTest(self::$test);

        /** @var Closure $closure */
        $closure = self::$testCase->getProperty($spec, 'closure');

        // This will not be set for incomplete specs.
        if (!$closure) {
            return;
        }
        $suite = self::$testCase->getProperty($spec, 'suite');
        $newSuite = new ProxySuite($spec->getTitle(), $closure, $suite);
        $reflection = new \ReflectionClass($suite);
        foreach ($reflection->getProperties() as $property) {
            $v = self::$testCase->getProperty($suite, $property->getName());
            self::$testCase->setProperty($newSuite, $property->getName(), $v);
        }
        /** @noinspection PhpUndefinedMethodInspection */
        $closure = $closure->bindTo($newSuite);
        self::$testCase->setProperty($spec, 'closure', $closure);
    }
1230471
@Override
    public void before(final Method method, final Object[] params, final Object arg2) throws Throwable {
        AuditManager.getInstance().audit(method.getClass(), method, params);
    }
1202435
public void startup(@Observes(precedence = -100) final BeforeSuite event) {
        if (extensionEnabled()) {
            debug("Catching BeforeSuite event {0}", event.toString());
            executeInClassScope(new Callable<Void>() {
                @Override
                public Void call() {
                    generateDeploymentEvent.fire(new GenerateDeployment(new TestClass(deploymentClass)));
                    suiteDeploymentScenario = classDeploymentScenario.get();
                    return null;
                }
            });
            deployDeployments = true;
            extendedSuiteContext.get().activate();
            suiteDeploymentScenarioInstanceProducer.set(suiteDeploymentScenario);
        }
    }
1062258
@Override
    public void scan(ClassSource_Aggregate classSource, Set<String> specificClassNames) throws AnnotationTargets_Exception {
        try {
            createScanner(classSource).scan(specificClassNames);
            // 'createScanner' throws class source exception

        } finally {
            haveScannedDirectClasses = true;
            haveScannedReferencedClasses = true;
        }
    }
1094437
public function _before(TestInterface $test) {
        $this->context = $test;
        $this->initStepsList();

        parent::_before($test);
    }
915668
def pre_process(classes_hash, opts)
      Process::IgnoredClasses.new(classes_hash).process_all!
      Process::GlobalMembers.new(classes_hash, opts).process_all!
      Process::Accessors.new(classes_hash).process_all!
      Process::Ext4Events.new(classes_hash, opts).process_all!
      Process::Enums.new(classes_hash).process_all!
      Process::Overrides.new(classes_hash, opts).process_all!

      classes_hash.values
    end