Package com.buschmais.jqassistant.core.report.schema.v1

Examples of com.buschmais.jqassistant.core.report.schema.v1.ObjectFactory


                            for (ColumnType column : rowType.getColumn()) {
                                String name = column.getName();
                                String value = column.getValue();
                                // if a language element element is found use it
                                // as a resource for creating an issue
                                ElementType languageElement = column.getElement();
                                if (languageElement != null) {
                                    LanguageResourceResolver resourceResolver = languageResourceResolvers.get(languageElement.getLanguage());
                                    if (resourceResolver != null) {
                                        String element = languageElement.getValue();
                                        resource = resourceResolver.resolve(element, value);
                                    }
                                }
                                SourceType source = column.getSource();
                                lineNumber = source.getLine();
View Full Code Here


    @Override
    public void analyse(Project project, SensorContext sensorContext) {
        File reportFile = getReportFile();
        if (reportFile != null) {
            JqassistantReport report = readReport(reportFile);
            evaluateReport(project, sensorContext, report);
        }
    }
View Full Code Here

                String id = ruleType.getId();
                ActiveRule activeRule = rules.get(id);
                if (activeRule == null) {
                    LOGGER.warn("Cannot resolve activeRule for id '{}'.", id);
                } else {
                    ResultType result = ruleType.getResult();
                    boolean hasRows = result != null && result.getRows().getCount() > 0;
                    if (ruleType instanceof ConceptType && createEmptyConceptIssue && !hasRows) {
                        createIssue(project, null, "The concept did not return a result.", activeRule, sensorContext);
                    } else if (ruleType instanceof ConstraintType && hasRows) {
                        for (RowType rowType : result.getRows().getRow()) {
                            StringBuilder message = new StringBuilder();
                            Resource<?> resource = null;
                            Integer lineNumber = null;
                            for (ColumnType column : rowType.getColumn()) {
                                String name = column.getName();
View Full Code Here

                                    if (resourceResolver != null) {
                                        String element = languageElement.getValue();
                                        resource = resourceResolver.resolve(element, value);
                                    }
                                }
                                SourceType source = column.getSource();
                                lineNumber = source.getLine();
                                if (message.length() > 0) {
                                    message.append(", ");
                                }
                                message.append(name);
                                message.append('=');
View Full Code Here

  public void test21() {
    ActionBuilder actionNameBuilder = new DefaultActionBuilder();
    ProfileService profileService = new ProfileServiceImpl();
    actionNameBuilder.setProfileService(profileService);

    ObjectFactory of = new ObjectFactory();
    final DummyContainer mockContainer = new DummyContainer();
    Configuration configuration = new DefaultConfiguration() {
      @Override
      public Container getContainer() {
        return mockContainer;
View Full Code Here

            this.name = name;
            this.type = type;
        }

        public Object create(Context context) throws Exception {
            ObjectFactory objFactory = context.getContainer().getInstance(ObjectFactory.class);
            try {
                return objFactory.buildBean(name, null, true);
            } catch (ClassNotFoundException ex) {
                throw new ConfigurationException("Unable to load bean "+type.getName()+" ("+name+")");
            }
        }
View Full Code Here

    protected void tearDown() throws Exception {
        super.tearDown();
    }

    protected ValidationInterceptor create() {
        ObjectFactory objectFactory = container.getInstance(ObjectFactory.class);
        return (ValidationInterceptor) objectFactory.buildInterceptor(
                new InterceptorConfig.Builder("model", ValidationInterceptor.class.getName()).build(), new HashMap<String, String>());
    }
View Full Code Here

     * Releases all instances bound to this dispatcher instance.
     */
    public void cleanup() {

      // clean up ObjectFactory
        ObjectFactory objectFactory = getContainer().getInstance(ObjectFactory.class);
        if (objectFactory == null) {
            if (LOG.isWarnEnabled()) {
          LOG.warn("Object Factory is null, something is seriously wrong, no clean up will be performed");
            }
        }
        if (objectFactory instanceof ObjectFactoryDestroyable) {
            try {
                ((ObjectFactoryDestroyable)objectFactory).destroy();
            }
            catch(Exception e) {
                // catch any exception that may occurred during destroy() and log it
                LOG.error("exception occurred while destroying ObjectFactory [#0]", e, objectFactory.toString());
            }
        }

        // clean up Dispatcher itself for this thread
        instance.set(null);
View Full Code Here

            .addParam("param2", "value 2")
            .addParam("param3", "value 3")
            .addParam("anchor", "fragment")
            .build();

        ObjectFactory factory = container.getInstance(ObjectFactory.class);
        ServletActionRedirectResult result = (ServletActionRedirectResult) factory.buildResult(resultConfig, new HashMap<String, Object>());
        assertNotNull(result);
    }
View Full Code Here

       
        Map<String, PackageConfig> packageConfigs = new HashMap<String, PackageConfig>();
        packageConfigs.put("test", packageConfig);

        Mock mockContainer = new Mock(Container.class);
        mockContainer.matchAndReturn("getInstance", C.args(C.eq(ObjectFactory.class)), new ObjectFactory());
        String reloadConfigs = container.getInstance(String.class, XWorkConstants.RELOAD_XML_CONFIGURATION);
        mockContainer.expectAndReturn("getInstance", C.args(C.eq(String.class), C.eq(XWorkConstants.RELOAD_XML_CONFIGURATION)),
                reloadConfigs);

        Mock mockConfiguration = new Mock(Configuration.class);
View Full Code Here

TOP

Related Classes of com.buschmais.jqassistant.core.report.schema.v1.ObjectFactory

Copyright © 2018 www.massapicom. 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.