Override @ClassRule retrieval to prevent from running them inside of a container
964359
@Override
    protected List<TestRule> classRules() {
        List<JUnitClassRulesFilter> junitClassRulesFilters =
            new JavaSPILoader().all(Arquillian.class.getClassLoader(), JUnitClassRulesFilter.class);
        List<TestRule> result = super.classRules();

        if (!junitClassRulesFilters.isEmpty()) {
            for (final JUnitClassRulesFilter junitClassRulesFilter : junitClassRulesFilters) {
                result = junitClassRulesFilter.filter(result);
            }
        }
        return result;
    }
926260
function filterValidRule(rule) {
  return (rule.hasOwnProperty('match')&&typeof rule.match === "object")
  && (rule.hasOwnProperty('use') && (
    typeof rule.use === "object"
    || typeof rule.use === "function"
  ))
  && (
    (rule.match.hasOwnProperty('request'))
    || (rule.match.hasOwnProperty('base'))
  )
}
561652
@Override
	public void cacheResult(List<CPRule> cpRules) {
		for (CPRule cpRule : cpRules) {
			if (entityCache.getResult(CPRuleModelImpl.ENTITY_CACHE_ENABLED,
						CPRuleImpl.class, cpRule.getPrimaryKey()) == null) {
				cacheResult(cpRule);
			}
			else {
				cpRule.resetOriginalValues();
			}
		}
	}
349106
@Override
    public void validate(Class<?> clazz) {

        if (log.isDebugEnabled())
            log.debug("Validating " + clazz.getName());

        // Is Entity?
        if (!checkValidClass(clazz)) {

            throw new RuleValidationException(clazz.getName() + " is not a valid jpa entity.");
        }

        // must have a default no-argument constructor
        boolean flag = false;
        try {
            Constructor[] constructors = clazz.getDeclaredConstructors();
            for (Constructor constructor : constructors) {
                if ((Modifier.isPublic(constructor.getModifiers()) || Modifier.isProtected(constructor.getModifiers()))
                    && constructor.getParameterTypes().length == 0) {
                    flag = true;
                    break;
                }
            }
            if (!flag) {
                throw new Exception();
            }
        } catch (Exception e) {
            throw new RuleValidationException(clazz.getName()
                + " must have a default public or protected no-argument constructor.");
        }
    }
240484
@SuppressWarnings("unchecked")
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        super.readExternal(in);
        rule = (RuleImpl) in.readObject();
        subrule = (GroupElement) in.readObject();
        subruleIndex = in.readInt();
        previousTupleSinkNode = (LeftTupleSinkNode) in.readObject();
        nextTupleSinkNode = (LeftTupleSinkNode) in.readObject();

        salienceDeclarations = ( Declaration[]) in.readObject();
        enabledDeclarations = ( Declaration[]) in.readObject();
        consequenceName = (String) in.readObject();

        fireDirect = rule.getActivationListener().equals( "direct" );

        initDeclarations();
    }
515267
private void checkInnerClass(ClassDeclaration jclass)
            throws FatalCompileTimeException
    {
        boolean noFormBeanAnnotation = true;
        if (CompilerUtils.getAnnotation(jclass, FORM_BEAN_TAG_NAME, true) != null) {
            noFormBeanAnnotation = false;
        }
        else {
            //
            // check the methods for validatable property annotations that
            // would be processed elsewhere.
            //
            MethodDeclaration[] methods = CompilerUtils.getClassMethods(jclass, null);
            for (int i = 0; i < methods.length && noFormBeanAnnotation; i++) {
                MethodDeclaration method = methods[i];
                if (CompilerUtils.getAnnotation(method, VALIDATABLE_PROPERTY_TAG_NAME) != null) {
                    noFormBeanAnnotation = false;
                }
            }
        }

        if (noFormBeanAnnotation) {
            _formBeanChecker.check(jclass);
        }
    }
922953
private int checkClass(final ClassReader reader, Pattern suppressAnnotationsPattern) throws ForbiddenApiException {
    final String className = Type.getObjectType(reader.getClassName()).getClassName();
    final ClassScanner scanner = new ClassScanner(this, forbiddenSignatures, suppressAnnotationsPattern); 
    try {
      reader.accept(scanner, ClassReader.SKIP_FRAMES);
    } catch (RelatedClassLoadingException rcle) {
      final Exception cause = rcle.getException();
      final StringBuilder msg = new StringBuilder()
          .append("Check for forbidden API calls failed while scanning class '")
          .append(className)
          .append('\'');
      final String source = scanner.getSourceFile();
      if (source != null) {
        msg.append(" (").append(source).append(')');
      }
      msg.append(": ").append(cause);
      msg.append(" (while looking up details about referenced class '").append(rcle.getClassName()).append("')");
      assert cause != null && (cause instanceof IOException || cause instanceof ClassNotFoundException);
      throw new ForbiddenApiException(msg.toString(), cause);
    }
    final List<ForbiddenViolation> violations = scanner.getSortedViolations();
    final Pattern splitter = Pattern.compile(Pattern.quote(ForbiddenViolation.SEPARATOR));
    for (final ForbiddenViolation v : violations) {
      for (final String line : splitter.split(v.format(className, scanner.getSourceFile()))) {
        logger.error(line);
      }
    }
    return violations.size();
  }
118780
public static synchronized void suppressConstructor(Class<?>... classes) {
		for (Class<?> clazz : classes) {
			Class<?> tempClass = clazz;
			while (tempClass != Object.class) {
				suppressConstructor(tempClass, false);
				tempClass = tempClass.getSuperclass();
			}
		}
	}
977375
private synchronized PipelineInterpreter.State reloadAndSave() {
        // this classloader will hold all generated rule classes
        PipelineClassloader commonClassLoader = allowCodeGeneration ? new PipelineClassloader() : null;

        // read all rules and parse them
        Map<String, Rule> ruleNameMap = Maps.newHashMap();
        ruleService.loadAll().forEach(ruleDao -> {
            Rule rule;
            try {
                rule = pipelineRuleParser.parseRule(ruleDao.id(), ruleDao.source(), false, commonClassLoader);
            } catch (ParseException e) {
                rule = Rule.alwaysFalse("Failed to parse rule: " + ruleDao.id());
            }
            ruleNameMap.put(rule.name(), rule);
        });

        // read all pipelines and parse them
        ImmutableMap.Builder<String, Pipeline> pipelineIdMap = ImmutableMap.builder();
        pipelineService.loadAll().forEach(pipelineDao -> {
            Pipeline pipeline;
            try {
                pipeline = pipelineRuleParser.parsePipeline(pipelineDao.id(), pipelineDao.source());
            } catch (ParseException e) {
                pipeline = Pipeline.empty("Failed to parse pipeline" + pipelineDao.id());
            }
            //noinspection ConstantConditions
            pipelineIdMap.put(pipelineDao.id(), resolvePipeline(pipeline, ruleNameMap));
        });

        final ImmutableMap<String, Pipeline> currentPipelines = pipelineIdMap.build();

        // read all stream connections of those pipelines to allow processing messages through them
        final HashMultimap<String, Pipeline> connections = HashMultimap.create();
        for (PipelineConnections streamConnection : pipelineStreamConnectionsService.loadAll()) {
            streamConnection.pipelineIds().stream()
                    .map(currentPipelines::get)
                    .filter(Objects::nonNull)
                    .forEach(pipeline -> connections.put(streamConnection.streamId(), pipeline));
        }
        ImmutableSetMultimap<String, Pipeline> streamPipelineConnections = ImmutableSetMultimap.copyOf(connections);

        final PipelineInterpreter.State newState = stateFactory.newState(currentPipelines, streamPipelineConnections);
        latestState.set(newState);
        return newState;
    }
230171
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException
    {
        setContextPath((String)in.readObject());
        setVirtualHosts((String[])in.readObject());
        Object o= in.readObject();

        while (o instanceof HttpHandler)
        {
            addHandler((HttpHandler)o);
            o= in.readObject();
        }
        setAttributes((Map)o);
        setRedirectNullPath(in.readBoolean());
        setMaxCachedFileSize(in.readInt());
        setMaxCacheSize(in.readInt());
        setStatsOn(in.readBoolean());
        setPermissions((PermissionCollection)in.readObject());
        setClassLoaderJava2Compliant(in.readBoolean());

        _defaultsDescriptor= (String)in.readObject();
        _war= (String)in.readObject();
        _extract= in.readBoolean();
        _ignorewebjetty= in.readBoolean();
        _distributable= in.readBoolean();
        _configurationClassNames=(String[])in.readObject();
    }
1021718
function (container, cfg) {
                var id = cfg.id;
                if (cfg.loadingIndicator) {
                    this._triggerLoadingIndicator(container, false);
                }
                var mapDom = mapDoms[id];
                if (mapDom) {
                    var parent = mapDom.parentNode;
                    if (parent) {
                        parent.removeChild(mapDom);
                    }
                }
            }
1049182
ClassConstraints extractValidationRules() {
    final ClassConstraints classConstraints = new ClassConstraints();
    Set<Field> allFields = ReflectionUtils.getAllFields(clazz, buildAnnotationsPredicate());
    for (Field field : allFields) {
      if (isNotExcluded(field)) {
        FieldConstraints fieldValidationRules = new AnnotatedField(field,
          relevantAnnotationClasses).extractValidationRules();
        if (fieldValidationRules.size() > 0) {
          classConstraints.put(field.getName(), fieldValidationRules);
        }
      }
    }
    return classConstraints;
  }
626578
public void eInit(XtendTypeDeclaration container, String name, IJvmTypeProvider context) {
		if (this.sarlClass == null) {
			this.container = container;
			this.sarlClass = SarlFactory.eINSTANCE.createSarlClass();
			container.getMembers().add(this.sarlClass);
			if (!Strings.isEmpty(name)) {
				this.sarlClass.setName(name);
			}
		}
	}
664400
public void resolveBeanClass(ItemRule itemRule) throws IllegalRuleException {
        Iterator<Token[]> it = ItemRule.tokenIterator(itemRule);
        if (it != null) {
            while (it.hasNext()) {
                Token[] tokens = it.next();
                if (tokens != null) {
                    for (Token token : tokens) {
                        resolveBeanClass(token);
                    }
                }
            }
        }
    }
975946
protected function setClassesToRun()
    {
        foreach ($this->listOfFiles as $filename => $file) {
            // Exclude non-PHP files
            if (!Utils::isFilePhp($filename)) {
                continue;
            }

            // Exclude non-Controller classes
            if (!Utils::doesFileContain($filename, 'extends Controller')) {
                continue;
            }

            // Set the classes to run
            $this->classesToRun[] = $this->namespace . '\\' . pathinfo($filename, PATHINFO_FILENAME);
        }
    }
1318386
private void processRules(RI ruleInput) {
        switch (ruleToResultHandlerMapping) {
            case SPLIT:
                processEachRuleWithEachResultHandler(ruleInput);
                break;
            case JOIN:
                processAllRulesWithEachResultHandler(ruleInput);
                break;
            default:
                LOGGER.error("Unsupported " + MappingStrategy.class.getSimpleName() + ": " +
                        ruleToResultHandlerMapping);
        }
    }
792787
private void disposeRulesAndResultHandlers() {
        for (final Map.Entry<R, List<RH>> entry : rulesToResultHandlers.entrySet()) {
            // Dispose rule
            final R rule = entry.getKey();
            if (rule instanceof Disposable) {
                ((Disposable) rule).dispose();
            }

            // Dispose result handlers
            final List<RH> resultHandlers = entry.getValue();
            if (resultHandlers != null) {
                for (final RH resultHandler : resultHandlers) {
                    if (resultHandler instanceof Disposable) {
                        ((Disposable) resultHandler).dispose();
                    }
                }
            }
        }

        // Clears all triggers
        rulesToResultHandlers.clear();
    }