Package eu.planets_project.ifr.core.services.migration.genericwrapper2.utils

Examples of eu.planets_project.ifr.core.services.migration.genericwrapper2.utils.DocumentLocator


    @Before
    public void setUp() throws Exception {

  this.testParameters.add(new Parameter("mode", "complete"));

  DocumentLocator documentLocator = new DocumentLocator(
    "deprecatedGenericWrapperV1ExampleConfigFile.xml");
  this.genericWrapper = new GenericMigrationWrapper(documentLocator
    .getDocument(), this.getClass().getCanonicalName());

    }
View Full Code Here


    /**
     * @throws Exception
     */
    public MigrationPathsTest() throws Exception {
        final DocumentLocator documentLocator = new DocumentLocator(
                TEST_CONFIGURATION_FILE_NAME);
        final Document pathsConfiguration = documentLocator.getDocument();

        final MigrationPathsFactory migrationPathsFactory = new MigrationPathsFactory();
        this.migrationPathsToTest = migrationPathsFactory
                .getMigrationPaths(pathsConfiguration);
    }
View Full Code Here

        // Verify that all identifiers in commandLineIdentifiers are associated
        // with a value in identifierMap
        if (!identifierMap.keySet().containsAll(commandLineIdentifiers)) {
            commandLineIdentifiers.removeAll(identifierMap.keySet());
            throw new ConfigurationException("Cannot build the command line. "
                    + "Missing values for these identifiers: "
                    + commandLineIdentifiers);
        }

        // Replace the identifiers in the command line fragments with their
View Full Code Here

                        presetCategoryID = parameter.getName();
                        final Preset preset = toolPresets
                                .getPreset(presetCategoryID);
                        presetSetting = preset.getSetting(parameter.getValue());
                        if (presetSetting == null) {
                            throw new ConfigurationException(String.format(
                                    "The preset '%s = %s' has not been defined"
                                            + " in the configuration.",
                                    parameter.getName(), parameter.getValue()));
                        }
                    } else {
                        throw new ConfigurationException(String.format(
                                "More than one preset was specified in the "
                                        + "parameters. Found '%s"
                                        + " = %s' and '%s = %s'.",
                                presetCategoryID, presetSetting.getName(),
                                parameter.getName(), parameter.getValue()));
View Full Code Here

            builder.properties(serviceProperties);

            return builder.build();

        } catch (XPathExpressionException xPathExpressionException) {
            throw new ConfigurationException(String.format(
                    "Failed parsing the '%s' element in the '%s' element.",
                    ConfigurationFileTagsV1.SERVICE_DESCRIPTION_ELEMENT_XPATH,
                    this.configuration.getNodeName()), xPathExpressionException);
        } catch (NullPointerException nullPointerException) {
            throw new ConfigurationException(String.format(
                    "Failed parsing the '%s' element in the '%s' element.",
                    ConfigurationFileTagsV1.SERVICE_DESCRIPTION_ELEMENT_XPATH,
                    this.configuration.getNodeName()), nullPointerException);
        }
    }
View Full Code Here

            return elementNode.getTextContent().trim();

        } catch (Exception exception) {
            // This is a mandatory element, thus no exceptions are tolerated.
            throw new ConfigurationException(String.format(
                    "Failed parsing the '%s' element in the '%s' element.",
                    elementName, nodeWithMandatoryElement.getNodeName()),
                    exception);
        }
    }
View Full Code Here

        } catch (XPathExpressionException xpee) {
            // The URI element is optional, thus ignore exceptions.
        } catch (NullPointerException npe) {
            // The URI element is optional, thus ignore exceptions.
        } catch (URISyntaxException uriSyntalException) {
            throw new ConfigurationException(String.format(
                    "Failed parsing the '%s' element and creating a URI, in "
                            + "the '%s' element.", elementName,
                    nodeWithOptionalURIElement.getNodeName()),
                    uriSyntalException);
        }
View Full Code Here

        } catch (XPathExpressionException xpee) {
            // The URI element is optional, thus ignore exceptions.
        } catch (NullPointerException npe) {
            // The URI element is optional, thus ignore exceptions.
        } catch (MalformedURLException malformedURLException) {
            throw new ConfigurationException(String.format(
                    "Failed parsing the '%s' element and creating a URL, in "
                            + "the '%s' element.", elementName,
                    nodeWithOptionalURLElement.getNodeName()),
                    malformedURLException);
        }
View Full Code Here

                properties.add(propertyBuilder.build());
            }
            return properties.toArray(new Property[properties.size()]);
        } catch (Exception exception) {
            throw new ConfigurationException(String.format(
                    "Failed parsing the '%s' element of the configuration"
                            + " document.", serviceDescriptionNode
                            .getNodeName()), exception);
        }
    }
View Full Code Here

            final Tool toolDescription = new Tool(identifierURI, name, version,
                    description, homePageURL);

            return toolDescription;
        } catch (XPathExpressionException xPathExpressionException) {
            throw new ConfigurationException(String.format(
                    "Failed parsing the '%s' element in the element: %s",
                    ConfigurationFileTagsV1.TOOL_ELEMENT,
                    nodeWithToolDescription.getNodeName()),
                    xPathExpressionException);
        }
View Full Code Here

TOP

Related Classes of eu.planets_project.ifr.core.services.migration.genericwrapper2.utils.DocumentLocator

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.