Examples of ManifestModel


Examples of org.geoserver.ManifestLoader.AboutModel.ManifestModel

    @Test
    public void filterPropertyByKeyOrValueTest() throws IllegalArgumentException {
        AboutModel resources = ManifestLoader.getResources();

        // extract first resource
        ManifestModel mm = resources.getManifests().first();
        if (mm == null) {
            LOGGER.log(Level.WARNING, "Unable to test with this resource name: " + resourceName
                    + "\nNo resource found.");
            return;
        }

        // extract first property
        Iterator<Entry<String, String>> it = mm.getEntries().entrySet().iterator();
        if (!it.hasNext()) {
            LOGGER.log(Level.WARNING,
                    "Unable to test with this resource name which does not has properties.");
            return;
        }
        Entry<String, String> entry = it.next();
        String propertyKey = entry.getKey();
        String propertyVal = entry.getValue();

        // check keys
        AboutModel filtered = resources.filterPropertyByKey(propertyKey);
        Iterator<ManifestModel> mit = filtered.getManifests().iterator();
        while (mit.hasNext()) {
            final ManifestModel model = mit.next();
            Assert.isTrue(model.getEntries().containsKey(propertyKey));
        }

        // check values
        filtered = resources.filterPropertyByValue(propertyVal);
        mit = filtered.getManifests().iterator();
        while (mit.hasNext()) {
            final ManifestModel model = mit.next();
            Assert.isTrue(model.getEntries().containsValue(propertyVal));
        }
    }
View Full Code Here

Examples of org.geoserver.ManifestLoader.AboutModel.ManifestModel

    @Test
    public void filterPropertyByKeyAndValueTest() throws IllegalArgumentException {
        AboutModel resources = ManifestLoader.getResources();

        // extract first resource
        ManifestModel mm = resources.getManifests().first();
        if (mm == null) {
            LOGGER.log(Level.WARNING, "Unable to test with this resource name: " + resourceName
                    + "\nNo resource found.");
            return;
        }

        // extract first property
        Iterator<Entry<String, String>> it = mm.getEntries().entrySet().iterator();
        if (!it.hasNext()) {
            LOGGER.log(Level.WARNING,
                    "Unable to test with this resource name which does not has properties.");
            return;
        }
        Entry<String, String> entry = it.next();
        String propertyKey = entry.getKey();
        String propertyVal = entry.getValue();

        // extract models
        AboutModel filtered = resources.filterPropertyByKeyValue(propertyKey, propertyVal);
        // check keys and values
        Iterator<ManifestModel> mit = filtered.getManifests().iterator();
        while (mit.hasNext()) {
            final ManifestModel model = mit.next();
            // check keys
            Assert.isTrue(model.getEntries().containsKey(propertyKey));
            String value = model.getEntries().get(propertyKey);
            // check value
            Assert.isTrue(value.equals(propertyVal));
        }
    }
View Full Code Here

Examples of org.geoserver.ManifestLoader.AboutModel.ManifestModel

    public void removeTest() {

        AboutModel resources = ManifestLoader.getResources();
        AboutModel newResources = ManifestLoader.getResources();

        ManifestModel mm = newResources.getManifests().first();

        Assert.isTrue(resources.getManifests().contains(mm));

        // test remove
        resources.remove(mm.getName());

        Assert.isTrue(!resources.getManifests().contains(mm));
    }
View Full Code Here

Examples of org.geoserver.ManifestLoader.AboutModel.ManifestModel

        @Override
        protected void onSetUp(SystemTestData testData) throws Exception {
            AboutModel resources = ManifestLoader.getResources();

            // extract first resource
            ManifestModel mm = resources.getManifests().first();
            if (mm == null) {
                LOGGER.log(Level.WARNING, "Unable to test with this resource name: " + resourceName
                        + "\nNo resource found.");
                return;
            }

            // extract a property
            Iterator<Entry<String, String>> it = mm.getEntries().entrySet().iterator();
            if (!it.hasNext()) {
                LOGGER.log(Level.WARNING,
                        "Unable to test with this resource name which does not has properties.");
                return;
            }
View Full Code Here

Examples of org.switchyard.component.common.knowledge.config.model.ManifestModel

     * @param model the specified KnowledgeComponentImplementationModel
     * @return the ContainerModel
     */
    public static ContainerModel getContainerModel(KnowledgeComponentImplementationModel model) {
        if (model != null) {
            ManifestModel manifestModel = model.getManifest();
            if (manifestModel != null) {
                return manifestModel.getContainer();
            }
        }
        return null;
    }
View Full Code Here

Examples of org.switchyard.component.common.knowledge.config.model.ManifestModel

    public static KnowledgeSessionFactory newSessionFactory(KnowledgeComponentImplementationModel model, ClassLoader loader, ServiceDomain domain, Properties propertyOverrides) {
        // XXX: how bad is this???
        // make sure we can load jbpm classes in osgi environment
        final ClassLoader origTCCL = Classes.setTCCL(loader);
        try {
            ManifestModel manifestModel = model.getManifest();
            if (manifestModel != null) {
                if (manifestModel.getContainer() == null) {
                    ResourcesModel resourcesModel = manifestModel.getResources();
                    if (resourcesModel != null) {
                        return new KnowledgeBuilderSessionFactory(model, loader, domain, propertyOverrides);
                    }
                    RemoteModel remoteModel = manifestModel.getRemote();
                    if (remoteModel != null) {
                        return new KnowledgeRemoteSessionFactory(model, loader, domain, propertyOverrides);
                    }
                }
            }
View Full Code Here

Examples of org.switchyard.component.common.knowledge.config.model.ManifestModel

     * @param model the model
     * @param loader the class loader
     * @param fileSystem the kie file system
     */
    public static void addResources(KnowledgeComponentImplementationModel model, ClassLoader loader, KieFileSystem fileSystem) {
        ManifestModel manifestModel = model.getManifest();
        if (manifestModel != null) {
            ResourcesModel resourcesModel = manifestModel.getResources();
            if (resourcesModel != null) {
                KieResources kieResources = KieServices.Factory.get().getResources();
                for (Resource syResource : resourcesModel.getResources()) {
                    URL locationURL = syResource.getLocationURL(loader);
                    if (locationURL != null) {
View Full Code Here

Examples of org.switchyard.component.common.knowledge.config.model.ManifestModel

        Assert.assertEquals(DebugRuleRuntimeEventListener.class, listener.getClazz(loader));
        LoggerModel logger = rules.getLoggers().getLoggers().get(0);
        Assert.assertEquals(Integer.valueOf(2000), logger.getInterval());
        Assert.assertEquals("theLog", logger.getLog());
        Assert.assertEquals(LoggerType.CONSOLE, logger.getType());
        ManifestModel manifest = rules.getManifest();
        ContainerModel container = manifest.getContainer();
        ResourcesModel resources = manifest.getResources();
        RemoteModel remote = manifest.getRemote();
        if (CONTAINER_XML.equals(xml)) {
            ReleaseId rid = Containers.toReleaseId(container.getReleaseId());
            Assert.assertEquals("theGroupId", rid.getGroupId());
            Assert.assertEquals("theArtifactId", rid.getArtifactId());
            Assert.assertEquals("theVersion", rid.getVersion());
View Full Code Here

Examples of org.switchyard.component.common.knowledge.config.model.ManifestModel

        Assert.assertEquals(DebugProcessEventListener.class, listener.getClazz(loader));
        LoggerModel logger = bpm.getLoggers().getLoggers().get(0);
        Assert.assertEquals(Integer.valueOf(2000), logger.getInterval());
        Assert.assertEquals("theLog", logger.getLog());
        Assert.assertEquals(LoggerType.CONSOLE, logger.getType());
        ManifestModel manifest = bpm.getManifest();
        ContainerModel container = manifest.getContainer();
        ResourcesModel resources = manifest.getResources();
        RemoteModel remote = manifest.getRemote();
        if (CONTAINER_XML.equals(xml)) {
            Assert.assertNull(resources);
            Assert.assertNull(remote);
            ReleaseId rid = Containers.toReleaseId(container.getReleaseId());
            Assert.assertEquals("theGroupId", rid.getGroupId());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.