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

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


    }

    private List<Class<?>> getDescriptorTypes(List<JqassistantPlugin> plugins) throws PluginRepositoryException {
        List<Class<?>> types = new ArrayList<>();
        for (JqassistantPlugin plugin : plugins) {
            ModelType modelType = plugin.getModel();
            if (modelType != null) {
                for (String typeName : modelType.getClazz()) {
                    types.add(getType(typeName));
                }
            }
        }
        return types;
View Full Code Here


    }

    private List<ReportPlugin> getReportPlugins(List<JqassistantPlugin> plugins, Map<String, Object> properties) throws PluginRepositoryException {
        List<ReportPlugin> reportPlugins = new ArrayList<>();
        for (JqassistantPlugin plugin : plugins) {
            ReportType reportType = plugin.getReport();
            if (reportType != null) {
                for (String reportPluginName : reportType.getClazz()) {
                    ReportPlugin reportPlugin = createInstance(reportPluginName);
                    if (reportPlugin != null) {
                        try {
                            reportPlugin.initialize(new HashMap<>(properties));
                        } catch (AnalysisListenerException e) {
View Full Code Here

    }

    private List<Source> getRuleSources(List<JqassistantPlugin> plugins) {
        List<Source> sources = new ArrayList<>();
        for (JqassistantPlugin plugin : plugins) {
            RulesType rulesType = plugin.getRules();
            if (rulesType != null) {
                String directory = rulesType.getDirectory();
                for (String resource : rulesType.getResource()) {
                    StringBuffer fullResource = new StringBuffer();
                    if (directory != null) {
                        fullResource.append(directory);
                    }
                    fullResource.append(resource);
View Full Code Here

    private <T extends ScannerPlugin> List<T> getScannerPlugins(List<JqassistantPlugin> plugins, Store store, Map<String, Object> properties)
            throws PluginRepositoryException {
        List<T> scannerPlugins = new ArrayList<>();
        for (JqassistantPlugin plugin : plugins) {
            ScannerType scannerType = plugin.getScanner();
            if (scannerType != null) {
                for (String scannerPluginName : scannerType.getClazz()) {
                    T scannerPlugin = createInstance(scannerPluginName);
                    if (scannerPlugin != null) {
                        // properties is mutable, so every plugin should get its
                        // own copy
                        scannerPlugin.initialize(store, new HashMap<>(properties));
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.plugin.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.