diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..596c9b2 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,74 @@ +on: + workflow_call: + +env: + MAVEN_VERSION: 3.8.6 + +defaults: + run: + shell: bash + +jobs: + build-and-test: + strategy: + # Don't fail other run's if one fails. Let them all finish. + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + java: [11, 17] + + name: Build and test + runs-on: ${{ matrix.os }} + timeout-minutes: 60 + steps: + # Checkout the code + - name: checkout + uses: actions/checkout@v4 + + # Setup Java + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: '${{ matrix.java }}' + distribution: 'temurin' + architecture: x64 + cache: 'maven' + + # Build with Maven + - name: Build + run: mvn --batch-mode install -DskipTests + working-directory: ./PowerDeComposer + + # Test with Maven + - name: Run Unit Tests + run: mvn --batch-mode test -Dtest="RunPDCUnitTest" + working-directory: ./PowerDeComposer + + - name: Test Report + uses: phoenix-actions/test-reporting@v12 + id: test-report # Set ID reference for step + if: success() || failure() # run this step even if previous step failed + with: + name: test-results-${{ matrix.os }}-java-${{ matrix.java }} + path: PowerDeComposer/target/surefire-reports/TEST-*.xml + reporter: java-junit + + # Build single jar + - name: Assemble Jar + if: runner.os == 'Linux' + run: mvn --batch-mode assembly:single -DskipTests + working-directory: ./PowerDeComposer + + # Publish jars. + - uses: actions/upload-artifact@v4 + if: runner.os == 'Linux' + with: + name: jar-without-dependencies-java-${{ matrix.java }} + path: PowerDeComposer/target/PowerDeComposer-*[0-9].jar + compression-level: 0 # no compression, since jar is already compressed + - uses: actions/upload-artifact@v4 + if: runner.os == 'Linux' + with: + name: jar-with-dependencies-java-${{ matrix.java }} + path: PowerDeComposer/target/PowerDeComposer-*[0-9]-jar-with-dependencies.jar + compression-level: 0 # no compression, since jar is already compressed \ No newline at end of file diff --git a/.github/workflows/cicd-feature.yml b/.github/workflows/cicd-feature.yml new file mode 100644 index 0000000..56e34ac --- /dev/null +++ b/.github/workflows/cicd-feature.yml @@ -0,0 +1,13 @@ +name: cicd-feature + +on: + push: + branches: + - feature/* + pull_request: + branches: + - feature/* + +jobs: + build-and-test: + uses: ./.github/workflows/build-and-test.yml \ No newline at end of file diff --git a/.github/workflows/cicd-main.yml b/.github/workflows/cicd-main.yml new file mode 100644 index 0000000..51cc210 --- /dev/null +++ b/.github/workflows/cicd-main.yml @@ -0,0 +1,10 @@ +name: cicd-main + +on: + push: + branches: + - main + +jobs: + build-and-test: + uses: ./.github/workflows/build-and-test.yml \ No newline at end of file diff --git a/.gitignore b/.gitignore index 57935f8..acd1445 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,3 @@ target /bin/ /target/ **/*.xjb -PowerDeComposer/src/main/resources/com/xbreeze/xml/config/schema1.xsd diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index bc9fc8e..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "azure-pipelines.customSchemaFile": "https://dev.azure.com/x-breeze/_apis/distributedtask/yamlschema", - "files.associations": { - "**/azure-pipeline.yml": "azure-pipelines" - }, - "java.configuration.updateBuildConfiguration": "automatic" -} \ No newline at end of file diff --git a/Documentation/docs/Configuration.md b/Documentation/docs/Configuration.md index 7f1fd35..0b58639 100644 --- a/Documentation/docs/Configuration.md +++ b/Documentation/docs/Configuration.md @@ -7,7 +7,7 @@ The PowerDeComposer configuration for composing and decomposing model files. ```xml - + @@ -84,7 +84,7 @@ The PowerDeComposer configuration for composing and decomposing model files. | Config element | Description | |:--- |:--- | | fileRemovalStrategy | Specify a file removal strategy that is used to remove previously decomposed files. "includes" will traverse the includes tree of the decomposed files and build the list based on them. This is also the default value that is used if not specified. "files" will traverse the decomposed directory and build the list based on the files that are present. | -| formalizeExtendedAtrributes | Indicate whether extended attributes should be formalized during de-composing of PowerDesigner models. Extended attributes are stored as a piece of text, while formalizing this text is translated into XML elements which can more easily be accessed using XPath (for example when using CrossGenerate). When this attribute is not specified in the config, the value will be "true". Possible values are "true" and "false". | +| formalizeExtendedAttributes | Indicate whether extended attributes should be formalized during de-composing of PowerDesigner models. Extended attributes are stored as a piece of text, while formalizing this text is translated into XML elements which can more easily be accessed using XPath (for example when using CrossGenerate). When this attribute is not specified in the config, the value will be "true". Possible values are "true" and "false". | | ChangeDetection | Node to evaluate on the composed and decomposed models. Of the value is empty on at least one side or the value differs the decompose is executed. | | IdentifierReplacement | Instruction to replace identifiers with alternative values. The identifierNodeXPath is the node which contains the identifier in the composed model. The replacementValueXPath must be executed to get the new identifier value. The referencingNodeXPath value is optional, it if specified the value in these nodes will also be replaced using the value of the old identifier and the new identifier. | | NodeRemoval | Instruction to remove nodes before decomposing. The XPath is evaluated to find the nodes to remove. An example for such an instruction is to remove the modification date on referenced objects. | diff --git a/PowerDeComposer/.classpath b/PowerDeComposer/.classpath index 88bbe5c..dd846c3 100644 --- a/PowerDeComposer/.classpath +++ b/PowerDeComposer/.classpath @@ -18,25 +18,21 @@ - + + - + + - - - - - - - + - + diff --git a/PowerDeComposer/pom.xml b/PowerDeComposer/pom.xml index 8a49def..2d76775 100644 --- a/PowerDeComposer/pom.xml +++ b/PowerDeComposer/pom.xml @@ -24,42 +24,47 @@ 4.0.0 com.x-breeze.powerdecomposer PowerDeComposer - 1.6.0 + 1.6.1 jar CrossBreeze PowerDeComposer PowerDeComposer is a utility that enables integrating PowerDesigner with the version control system of your choice. - http://http://powerdecomposer.x-breeze.com + http://http://powerdecomposer.x-breeze.com - - The GNU General Public License, Version 3 - https://www.gnu.org/licenses/gpl-3.0.html - + + The GNU General Public License, Version 3 + https://www.gnu.org/licenses/gpl-3.0.html + - + Willem Otten Willem@x-breeze.com CrossBreeze - http://x-breeze.com - - + http://crossbreeze.nl + + Harmen Wessels Harmen@x-breeze.com CrossBreeze - http://x-breeze.com - + http://crossbreeze.nl + + - https://x-breeze@dev.azure.com/x-breeze/PowerDeComposer_Public/_git/PowerDeComposer_Public - https://x-breeze@dev.azure.com/x-breeze/PowerDeComposer_Public/_git/PowerDeComposer_Public - https://dev.azure.com/x-breeze/_git/PowerDeComposer_Public + scm:git:https://github.com/CrossBreezeNL/PowerDeComposer.git + scm:git:https://github.com/CrossBreezeNL/PowerDeComposer.git + https://github.com/CrossBreezeNL/PowerDeComposer + 1.8 1.8 1.8 UTF-8 - + 7.11.2 + 5.9.2 + + ossrh @@ -70,6 +75,26 @@ https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + org.junit + junit-bom + ${junit.version} + pom + import + + + io.cucumber + cucumber-bom + ${cucumber.version} + pom + import + + + + @@ -99,7 +124,30 @@ jaxb-impl 4.0.2 + + + + io.cucumber + cucumber-java + test + + + io.cucumber + cucumber-junit-platform-engine + test + + + org.junit.platform + junit-platform-suite + test + + + org.junit.jupiter + junit-jupiter + test + + release @@ -173,70 +221,110 @@ - - executableJar - - - - org.apache.maven.plugins - maven-assembly-plugin - 3.5.0 - - - - - com.xbreeze.xml.Executor - - - - - jar-with-dependencies - - - - - - + src/main/java + src/test/java src/main/resources + + **/*.java + + + + src/test/resources + + **/*.java + + + org.apache.maven.plugins maven-compiler-plugin 3.11.0 + + ${project.build.sourceEncoding} + ${java.version} + ${java.version} + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.6.0 + + + execution + + single + + + + + + + + com.xbreeze.xml.Executor + + + + + jar-with-dependencies + + + - - org.codehaus.mojo - jaxb2-maven-plugin + + org.codehaus.mojo + jaxb2-maven-plugin 3.1.0 - - - schemagen - - schemagen - - - + + + schemagen + + schemagen + + + ${basedir}/src/main/resources/com/xbreeze/xml/config/ false false src/main/java/com/xbreeze/xml/config/PowerDeComposerConfig.java + src/main/java/com/xbreeze/xml/decompose/config - - + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0 + + + test-execution + test + + + + plain + + **/*UnitTest.java + + ${project.build.sourceEncoding} + -Dfile.encoding=${project.build.sourceEncoding} + + - \ No newline at end of file diff --git a/PowerDeComposer/src/main/java/com/xbreeze/xml/Executor.java b/PowerDeComposer/src/main/java/com/xbreeze/xml/Executor.java index 1f7255b..9d78a6a 100644 --- a/PowerDeComposer/src/main/java/com/xbreeze/xml/Executor.java +++ b/PowerDeComposer/src/main/java/com/xbreeze/xml/Executor.java @@ -26,10 +26,8 @@ import java.io.OutputStream; import java.nio.file.Paths; import java.util.logging.ConsoleHandler; -import java.util.logging.Filter; import java.util.logging.Level; import java.util.logging.LogManager; -import java.util.logging.LogRecord; import java.util.logging.Logger; import com.xbreeze.xml.compose.XmlComposer; @@ -38,7 +36,7 @@ public class Executor { - private static final Logger logger = Logger.getLogger(""); + public static final Logger logger = Logger.getGlobal(); /** * Main function to start the Xml Compose/Decompose process. @@ -57,24 +55,19 @@ public static void main(String[] args) throws Exception { } // Add a logger for the console to log message below warning (and error). - ConsoleHandler outputConsoleHandler = new ConsoleHandler() { + ConsoleHandler outputConsoleHandler = new ConsoleHandler() + { @Override protected synchronized void setOutputStream(OutputStream out) throws SecurityException { super.setOutputStream(System.out); } }; - Level consoleLogLevel = getLogLevel("INFO"); - outputConsoleHandler.setLevel(consoleLogLevel); - // Only log message with a lower level then warning. - outputConsoleHandler.setFilter(new Filter() { - @Override - public boolean isLoggable(LogRecord record) { - return record.getLevel().intValue() < Level.SEVERE.intValue(); - } - }); - // Update the log level to the lowest level. - logger.setLevel((consoleLogLevel.intValue() < logger.getLevel().intValue()) ? consoleLogLevel : logger.getLevel()); + // Set the console handler to handle all levels (the shown log levels are steered using the logging.properties file). + outputConsoleHandler.setLevel(Level.ALL); + // Add the new console handler to the global logger. logger.addHandler(outputConsoleHandler); + // Disable using any parent handlers (to make sure there not logged twice). + logger.setUseParentHandlers(false); // Check the passed arguments. if (args.length == 3 || args.length == 4) { @@ -107,17 +100,4 @@ public boolean isLoggable(LogRecord record) { throw new Exception("Expecting exactly 3 or 4 arguments: (decompose, xml-file-path, target-directory[, config-file-location]) or (compose, xml-source-file, xml-target-file[, config-file-location])."); } } - /** - * Get the log level using the textual representation from the config. - * @param level The log level - * @return The Level constant. - * @throws GeneratorException - */ - private static Level getLogLevel(String level) throws Exception { - try { - return Level.parse(level.toUpperCase()); - } catch (IllegalArgumentException | NullPointerException e) { - throw new Exception(String.format("Unknown LogLevel specified: '%s'", level), e); - } - } } diff --git a/PowerDeComposer/src/main/java/com/xbreeze/xml/compose/XmlComposer.java b/PowerDeComposer/src/main/java/com/xbreeze/xml/compose/XmlComposer.java index cd80a4a..8a39761 100644 --- a/PowerDeComposer/src/main/java/com/xbreeze/xml/compose/XmlComposer.java +++ b/PowerDeComposer/src/main/java/com/xbreeze/xml/compose/XmlComposer.java @@ -43,7 +43,7 @@ import com.ximpleware.XPathParseException; public class XmlComposer { - private static final Logger logger = Logger.getLogger(""); + private static final Logger logger = Logger.getGlobal(); public XmlComposer(String xmlFilePath, String xmlTargetFilePath) throws Exception { composeXml(xmlFilePath, xmlTargetFilePath); diff --git a/PowerDeComposer/src/main/java/com/xbreeze/xml/decompose/XmlDecomposer.java b/PowerDeComposer/src/main/java/com/xbreeze/xml/decompose/XmlDecomposer.java index 8e2906c..2f5ea18 100644 --- a/PowerDeComposer/src/main/java/com/xbreeze/xml/decompose/XmlDecomposer.java +++ b/PowerDeComposer/src/main/java/com/xbreeze/xml/decompose/XmlDecomposer.java @@ -22,9 +22,7 @@ *******************************************************************************/ package com.xbreeze.xml.decompose; -import java.io.ByteArrayOutputStream; import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Files; @@ -59,7 +57,7 @@ import com.ximpleware.XPathParseException; public class XmlDecomposer { - private static final Logger logger = Logger.getLogger(XmlDecomposer.class.getName()); + private static final Logger logger = Logger.getGlobal(); private static final String STR_PREFIX_SPACER = " "; @@ -175,7 +173,7 @@ else if (decomposedCDValue.equals(composedCDValue)) { } // Transform the ExtendedAttributeText elements to separate XML elements. - if (decomposeConfig.formalizeExtendedAtrributes()) { + if (decomposeConfig.formalizeExtendedAttributes()) { nv = formalizeExtendedAttributesText(nv); } @@ -754,17 +752,17 @@ private Path parseAndWriteDocumentParts(VTDNav nv, Charset fileCharset, TargetFi } // Get the contents of the XML Fragment. - String objectXmlPart = nv.toRawString(elementOffset, elementLength); + byte[] xmlFragmentBytes = nv.getXML().getBytes(elementOffset, elementLength); // Parse the XML Fragment and write it to its own file. //logger.fine(String.format("Target folder name: '%s'; child target file name: '%s'", childTargetFolderName, childTargetFileName)); - // Remove the xml node which is being referenced. + // Remove the xml fragment, which will be written in a separate file. xm.removeContent(elementOffset, elementLength); // Create a VTDNav for navigating the document. VTDNav partNv; try { - partNv = XMLUtils.getVTDNav(objectXmlPart, fileCharset, false); + partNv = XMLUtils.getVTDNav(xmlFragmentBytes, false); } catch (Exception e) { throw new Exception(String.format("Error while parsing Xml Part: %s", e.getMessage()), e); } @@ -830,13 +828,7 @@ private Path parseAndWriteDocumentParts(VTDNav nv, Charset fileCharset, TargetFi // Write the target Xml file. logger.fine(String.format("%s - Writing file: %s", prefix, targetFile.toString())); // Write the XML file into a array output stream. - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - xm.output(baos); - FileOutputStream fos = new FileOutputStream(targetFilePath.toString()); - // Replace single LF without CR with CRLF and write it to the file. - fos.write(baos.toString(fileCharset).replaceAll("(? _identifierReplacementConfigs; @@ -38,12 +38,12 @@ public void setFileRemovalStrategy(String fileRemovalStrategy) { this._fileRemovalStrategy = fileRemovalStrategy; } - public Boolean formalizeExtendedAtrributes() { - return _formalizeExtendedAtrributes; + public Boolean formalizeExtendedAttributes() { + return _formalizeExtendedAttributes; } - public void setFormalizeExtendedAttributes(Boolean formalizeExtendedAtrributes) { - this._formalizeExtendedAtrributes = formalizeExtendedAtrributes; + public void setFormalizeExtendedAttributes(Boolean formalizeExtendedAttributes) { + this._formalizeExtendedAttributes = formalizeExtendedAttributes; } @XmlElement(name = "ChangeDetection") diff --git a/PowerDeComposer/src/main/java/com/xbreeze/xml/utils/XMLUtils.java b/PowerDeComposer/src/main/java/com/xbreeze/xml/utils/XMLUtils.java index 041a330..7c8d9d2 100644 --- a/PowerDeComposer/src/main/java/com/xbreeze/xml/utils/XMLUtils.java +++ b/PowerDeComposer/src/main/java/com/xbreeze/xml/utils/XMLUtils.java @@ -78,13 +78,24 @@ public static VTDNav getVTDNav(String xmlDocument, Charset charsetToUse, boolean /** * Get the VTDNav object for a XML document. - * See: https://vtd-xml.sourceforge.io/javadoc/. - * @param xmlDocument The XML document as a String. + * @param xmlFileContentsAndCharset The XML document wrapped in a FileContentAndCharset object. * @param namespaceAware Whether the parser is namespace aware. * @return The VTDNav. * @throws GeneratorException */ public static VTDNav getVTDNav(FileContentAndCharset xmlFileContentsAndCharset, boolean namespaceAware) throws Exception { + return getVTDNav(xmlFileContentsAndCharset.getBytes(), namespaceAware); + } + + /** + * Get the VTDNav object for a XML document. + * See: https://vtd-xml.sourceforge.io/javadoc/. + * @param xmlFileBytes The XML document as a byte[]. + * @param namespaceAware Whether the parser is namespace aware. + * @return The VTDNav. + * @throws GeneratorException + */ + public static VTDNav getVTDNav(byte[] xmlFileBytes, boolean namespaceAware) throws Exception { // Create a VTGGen object. VTDGen vg = new VTDGen(); @@ -92,7 +103,7 @@ public static VTDNav getVTDNav(FileContentAndCharset xmlFileContentsAndCharset, vg.enableIgnoredWhiteSpace(true); // Set the document (in original file encoding). - vg.setDoc(xmlFileContentsAndCharset.getBytes()); + vg.setDoc(xmlFileBytes); // When enabling namespace awareness, you must map the URLs of all used namespaces here. try { diff --git a/PowerDeComposer/src/main/resources/com/xbreeze/xml/config/META-INF/JAXB/episode_schemagen.xjb b/PowerDeComposer/src/main/resources/com/xbreeze/xml/config/META-INF/JAXB/episode_schemagen.xjb deleted file mode 100644 index b2593f2..0000000 --- a/PowerDeComposer/src/main/resources/com/xbreeze/xml/config/META-INF/JAXB/episode_schemagen.xjb +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/PowerDeComposer/src/main/resources/com/xbreeze/xml/config/PowerDeComposerConfig.xsd b/PowerDeComposer/src/main/resources/com/xbreeze/xml/config/PowerDeComposerConfig.xsd index 2b44e35..14bc1de 100644 --- a/PowerDeComposer/src/main/resources/com/xbreeze/xml/config/PowerDeComposerConfig.xsd +++ b/PowerDeComposer/src/main/resources/com/xbreeze/xml/config/PowerDeComposerConfig.xsd @@ -1,126 +1,222 @@ - - + + - + + - + + + + - + + - - + + + + + + - + + + + + - + + + + - + + + + + - + + + + - + + + - + + + + - + + + + - + + + + + + - + + + + - + + + + - + + + + + - + + + + - + + + + + - + + + + - + + + + + + + + + - + + - + + + + + + + + - + + + + + + - + + + + + - + + + + + - + + - + + + + + + + + - + + + + + - diff --git a/PowerDeComposer/src/main/resources/com/xbreeze/xml/logging.properties b/PowerDeComposer/src/main/resources/com/xbreeze/xml/logging.properties index aebd924..c17c3a5 100644 --- a/PowerDeComposer/src/main/resources/com/xbreeze/xml/logging.properties +++ b/PowerDeComposer/src/main/resources/com/xbreeze/xml/logging.properties @@ -29,10 +29,4 @@ handlers = java.util.logging.ConsoleHandler java.util.logging.SimpleFormatter.format = [%1$tF %1$tT] [%4$-7s] %5$s %n # Set the default properties for the console handler. -# All SEVERE message will be written to the System.err -java.util.logging.ConsoleHandler.level = SEVERE java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter - -# Set the default properties for the file handler. -#java.util.logging.FileHandler.level = INFO -#java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter diff --git a/PowerDeComposerTest/src/test/java/com/xbreeze/xml/test/PowerDeComposerTestSteps.java b/PowerDeComposer/src/test/java/com/xbreeze/xml/test/PowerDeComposerTestSteps.java similarity index 66% rename from PowerDeComposerTest/src/test/java/com/xbreeze/xml/test/PowerDeComposerTestSteps.java rename to PowerDeComposer/src/test/java/com/xbreeze/xml/test/PowerDeComposerTestSteps.java index ad9be23..ef714f5 100644 --- a/PowerDeComposerTest/src/test/java/com/xbreeze/xml/test/PowerDeComposerTestSteps.java +++ b/PowerDeComposer/src/test/java/com/xbreeze/xml/test/PowerDeComposerTestSteps.java @@ -7,6 +7,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileWriter; +import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Path; @@ -36,9 +37,9 @@ public class PowerDeComposerTestSteps { // The folder of the target files. private Path _decomposedFolderPath; // The resource path of the feature under test. - private Path _featureResourcePath; - // The resource path for composed and decomposed files for the feature under test. - private Path _featureFileResourcePath; + private Path _scenarioResourcePath; + // The resource path for runtime composed and decomposed files for the feature under test. + private Path _scenarioRuntimeResourcePath; @Before public void before(final Scenario scenario) throws Exception { @@ -48,22 +49,24 @@ public void before(final Scenario scenario) throws Exception { // Get the classpath path of the current scenario. // Create a path of it and get the parent path (so we have the classpath folder the resource files are in). - this._featureResourcePath = Path.of(loader.getResource(scenario.getUri().getRawSchemeSpecificPart()).toURI()).getParent(); - this._featureFileResourcePath = _featureResourcePath.resolve(scenario.getName().replace(' ', '_')); + Path featureFilePath = Path.of(loader.getResource(scenario.getUri().getRawSchemeSpecificPart()).toURI()); + String featureName = featureFilePath.getFileName().toFile().toString().replace(".feature", ""); + this._scenarioResourcePath = featureFilePath.getParent().resolve(featureName).resolve(scenario.getName().replace(' ', '_')); + this._scenarioRuntimeResourcePath = _scenarioResourcePath.resolve(scenario.getId()); // Create the file resource - this.createDirectoryIfItDoesntExist(this._featureFileResourcePath); + this.createDirectoryIfItDoesntExist(this._scenarioRuntimeResourcePath); // Initialize the paths to the default values. - _configFolderPath = this._featureFileResourcePath.resolve("Config"); - _composedFolderPath = this._featureFileResourcePath.resolve("Composed"); - _decomposedFolderPath = this._featureFileResourcePath.resolve("Decomposed"); + _configFolderPath = this._scenarioRuntimeResourcePath.resolve("Config"); + _composedFolderPath = this._scenarioRuntimeResourcePath.resolve("Composed"); + _decomposedFolderPath = this._scenarioRuntimeResourcePath.resolve("Decomposed"); // Init the file paths (these can be overridden when the composed or decompose folder path is changes using a phrase. initFilePaths(); // Log the paths. - scenario.log(String.format("Feature resource path: %s", _featureResourcePath.toString())); - scenario.log(String.format("Feature file-resource path: %s", _featureFileResourcePath.toString())); + scenario.log(String.format("Feature resource path: %s", _scenarioResourcePath.toString())); + scenario.log(String.format("Feature file-resource path: %s", _scenarioRuntimeResourcePath.toString())); } public void createDirectoryIfItDoesntExist(Path directoryPath) throws Exception { @@ -93,25 +96,25 @@ private void initFilePaths() throws Exception { @Given("^the config folder location '(.*)'$") public void givenTheConfigFolderLocation(String configFolderLocation) throws Throwable { - this._configFolderPath = this._featureFileResourcePath.resolve(configFolderLocation); + this._configFolderPath = this._scenarioResourcePath.resolve(configFolderLocation); initFilePaths(); } @Given("^the composed folder location '(.*)'$") public void givenTheComposedFolderLocation(String composedFolderLocation) throws Throwable { - this._composedFolderPath = this._featureFileResourcePath.resolve(composedFolderLocation); + this._composedFolderPath = this._scenarioResourcePath.resolve(composedFolderLocation); initFilePaths(); } @Given("^the decomposed folder location '(.*)'$") public void givenTheDecomposedFolderLocation(String decomposedFolderLocation) throws Throwable { - this._decomposedFolderPath = this._featureFileResourcePath.resolve(decomposedFolderLocation); + this._decomposedFolderPath = this._scenarioResourcePath.resolve(decomposedFolderLocation); initFilePaths(); } @Given("^the config file '(.*)'$") public void givenTheConfigFileLocation(String pdcConfigLocation) throws Throwable { - this._pdcConfigPath = this._featureResourcePath.resolve(pdcConfigLocation); + this._pdcConfigPath = this._scenarioResourcePath.resolve(pdcConfigLocation); } @Given("^the config file:$") @@ -123,7 +126,7 @@ public void givenTheConfigFileContents(String pdcConfigFileContents) throws Thro @Given("^the composed file '(.*)'$") public void givenTheXmlComposedFileLocation(String composedFileLocation) throws Throwable { - this._composedFilePath = this._featureResourcePath.resolve(composedFileLocation); + this._composedFilePath = this._scenarioResourcePath.resolve(composedFileLocation); } @Given("^the composed file '(.*)':$") @@ -143,7 +146,7 @@ public void givenTheXmlComposedFileContents(String composedFileContents) throws @Given("^the decomposed file '(.*)'$") public void givenTheDecomposedFileLocation(String xmlFileLocation) throws Throwable { - this._decomposedFilePath = this._featureResourcePath.resolve(xmlFileLocation); + this._decomposedFilePath = this._scenarioResourcePath.resolve(xmlFileLocation); } @Given("^the decomposed file '(.*)':$") @@ -171,7 +174,6 @@ public void writeXmlFile(Path targetFilePath, String fileContents) throws Except } // Write the file. FileWriter targetFileWrite = new FileWriter(targetFilePath.toFile(), Charset.forName("UTF-8")); - //System.out.println(String.format("Writing file contents: %s", fileContents)); // Replacing LF with preceding CR with CRLF (since Cucumber remove's it from the string. IOUtils.write(fileContents.replaceAll("(? - - C2B4D530-BB77-4024-BF09-68D766A416FD - left_CONCERN_CUSTOMER_RISK_HISTOR_INCEPTION - left_CONCERN_CUSTOMER_RISK_HISTOR_INCEPTION - - """ - And the config file: - """ - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - C2B4D530-BB77-4024-BF09-68D766A416FD - left_CONCERN_CUSTOMER_RISK_HISTOR_INCEPTION - left_CONCERN_CUSTOMER_RISK_HISTOR_INCEPTION - +Feature: Character set detection + Here we test whether PowerDeComposer can handle the characters sets needed. + + # KnownIssue: Currently with VTD-Nav we can't handle certain special characters. + @KnownIssue + Scenario: UTF-16 character set + # In Eclipse you don't see any special characters here, but the Name contains a special character. You can see this in VS Code. + Given the composed file: + """ + + + C2B4D530-BB77-4024-BF09-68D766A416FD + left_CONCERN_CUSTOMER_RISK_HISTOR_INCEPTION + left_CONCERN_CUSTOMER_RISK_HISTOR_INCEPTION + + """ + And the config file: + """ + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + C2B4D530-BB77-4024-BF09-68D766A416FD + left_CONCERN_CUSTOMER_RISK_HISTOR_INCEPTION + left_CONCERN_CUSTOMER_RISK_HISTOR_INCEPTION + """ \ No newline at end of file diff --git a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/charset/SpecialCharacters.feature b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/charset/SpecialCharacters.feature similarity index 88% rename from PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/charset/SpecialCharacters.feature rename to PowerDeComposer/src/test/resources/com/xbreeze/xml/test/charset/SpecialCharacters.feature index 1e0c388..2e9037e 100644 --- a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/charset/SpecialCharacters.feature +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/charset/SpecialCharacters.feature @@ -1,30 +1,30 @@ -@Unit - -Feature: Special characters - Here we test whether PowerDeComposer can handle special characters correctly. - - Scenario: Special charachter in file - Given the composed file: - """ - - - Willem Ötten - - """ - And the config file: - """ - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - Willem Ötten - +@Unit + +Feature: Special characters + Here we test whether PowerDeComposer can handle special characters correctly. + + Scenario: Special charachter in file + Given the composed file: + """ + + + Willem Ötten + + """ + And the config file: + """ + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + Willem Ötten + """ \ No newline at end of file diff --git a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/compose/Compose.feature b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/Compose.feature similarity index 96% rename from PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/compose/Compose.feature rename to PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/Compose.feature index 14e3c34..964b1e9 100644 --- a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/compose/Compose.feature +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/Compose.feature @@ -1,227 +1,227 @@ -@Unit -Feature: Compose - Here we test the compose. - - Scenario Outline: Compose - Given the decomposed file: - """ - - - - - - - - """ - And the decomposed file 'FirstFileName.xml': - """ - - FirstName - - """ - And the decomposed file 'SecondFileName.xml': - """ - - SecondName - - """ - When I perform a compose - Then I expect a composed file with the following content: - """ - - - - - FirstName - - - SecondName - - - - """ - - Examples: - | Scenario | SubFolder | - | in one folder | | - | in Unix style subfolder | SubFolder/ | - | in Windows style subfolder | SubFolder\\ | - - Scenario: Compose recursive - Given the decomposed file: - """ - - - - - - - """ - And the decomposed file 'ChildElements/FirstFileName.xml': - """ - - FirstName - - - - - """ - And the decomposed file 'ChildElements/FirstFileName/ChildElements/SecondFileName.xml': - """ - - SecondName - - """ - When I perform a compose - Then I expect a composed file with the following content: - """ - - - - - FirstName - - - SecondName - - - - - - """ - - Scenario: Compose include with own XML declaration - Given the decomposed file: - """ - - - - - - - - """ - And the decomposed file 'FirstFileName.xml': - """ - - - FirstName - - """ - When I perform a compose - Then I expect a composed file with the following content: - """ - - - - - - FirstName - - - - """ - - Scenario: Compose with processing instruction - Given the decomposed file: - """ - - - - - - """ - When I perform a compose - Then I expect a composed file with the following content: - """ - - - - - - """ - - Scenario: Compose with two processing instructions - Given the decomposed file: - """ - - - - - - - """ - When I perform a compose - Then I expect a composed file with the following content: - """ - - - - - - - """ - - Scenario: Compose with comment before root node - Given the decomposed file: - """ - - - - """ - When I perform a compose - Then I expect a composed file with the following content: - """ - - - - """ - - Scenario: Compose with whitespace before root node - Given the decomposed file: - """ - - - - """ - When I perform a compose - Then I expect a composed file with the following content: - """ - - - - """ - - Scenario: Compose with whitespace inside root node - Given the decomposed file: - """ - - - - - """ - When I perform a compose - Then I expect a composed file with the following content: - """ - - - - - """ - - Scenario: Compose with comment inside root node - Given the decomposed file: - """ - - - - - """ - When I perform a compose - Then I expect a composed file with the following content: - """ - - - - +@Unit +Feature: Compose + Here we test the compose. + + Scenario Outline: Compose + Given the decomposed file: + """ + + + + + + + + """ + And the decomposed file 'FirstFileName.xml': + """ + + FirstName + + """ + And the decomposed file 'SecondFileName.xml': + """ + + SecondName + + """ + When I perform a compose + Then I expect a composed file with the following content: + """ + + + + + FirstName + + + SecondName + + + + """ + + Examples: + | Scenario | SubFolder | + | in one folder | | + | in Unix style subfolder | SubFolder/ | + | in Windows style subfolder | SubFolder\\ | + + Scenario: Compose recursive + Given the decomposed file: + """ + + + + + + + """ + And the decomposed file 'ChildElements/FirstFileName.xml': + """ + + FirstName + + + + + """ + And the decomposed file 'ChildElements/FirstFileName/ChildElements/SecondFileName.xml': + """ + + SecondName + + """ + When I perform a compose + Then I expect a composed file with the following content: + """ + + + + + FirstName + + + SecondName + + + + + + """ + + Scenario: Compose include with own XML declaration + Given the decomposed file: + """ + + + + + + + + """ + And the decomposed file 'FirstFileName.xml': + """ + + + FirstName + + """ + When I perform a compose + Then I expect a composed file with the following content: + """ + + + + + + FirstName + + + + """ + + Scenario: Compose with processing instruction + Given the decomposed file: + """ + + + + + + """ + When I perform a compose + Then I expect a composed file with the following content: + """ + + + + + + """ + + Scenario: Compose with two processing instructions + Given the decomposed file: + """ + + + + + + + """ + When I perform a compose + Then I expect a composed file with the following content: + """ + + + + + + + """ + + Scenario: Compose with comment before root node + Given the decomposed file: + """ + + + + """ + When I perform a compose + Then I expect a composed file with the following content: + """ + + + + """ + + Scenario: Compose with whitespace before root node + Given the decomposed file: + """ + + + + """ + When I perform a compose + Then I expect a composed file with the following content: + """ + + + + """ + + Scenario: Compose with whitespace inside root node + Given the decomposed file: + """ + + + + + """ + When I perform a compose + Then I expect a composed file with the following content: + """ + + + + + """ + + Scenario: Compose with comment inside root node + Given the decomposed file: + """ + + + + + """ + When I perform a compose + Then I expect a composed file with the following content: + """ + + + + """ \ No newline at end of file diff --git a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/compose/ExtendedAttributes.feature b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/ExtendedAttributes.feature similarity index 98% rename from PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/compose/ExtendedAttributes.feature rename to PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/ExtendedAttributes.feature index aa8b79c..d774645 100644 --- a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/compose/ExtendedAttributes.feature +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/ExtendedAttributes.feature @@ -1,71 +1,71 @@ -@Unit -Feature: Compose Extended Attributes - Here we test the compose of extended attributes. During decomposing these extended attributes are formalized toe XML elements, which we need to reverse during composing. - - Scenario: Compose with extended attributes - Given the decomposed file: - """ - - - - - true - This is test text - with NewLine. - - - 23 - 4/24/2023 - {C1179E53-39F4-461A-9349-EFF754344DD5},ThirdTestField,76={49F389E0-A1B2-4FFB-BEF1-57FA2A8EBA45},TestFromAnotherExtension, 9=test text - - - LocalTestValue - - - - """ - When I perform a compose - Then I expect a composed file with the following content: - """ - - - {4202E4F4-4187-47CE-83BE-51088F229451},TestExtension,154={DA1CC8BE-C80A-4B74-BB79-10F50BE06CBC},TestBooleanField,4=true - {18ECABD7-88E7-4D0E-8107-0382CDF1E4D3},TestTextField,32=This is test text - with NewLine. - - {2ABE46A1-ED92-45C8-B191-7C85DD336346},AnotherTestExtension,346={A2A57166-AB6A-4776-867B-95E7775EFC9F},SecondTestFromAnotherExtension,2=23 - {49F389E0-A1B2-4FFB-BEF1-57FA2A8EBA45},TestFromAnotherExtension,9=4/24/2023 - {C1179E53-39F4-461A-9349-EFF754344DD5},ThirdTestField,133={C1179E53-39F4-461A-9349-EFF754344DD5},ThirdTestField,76={49F389E0-A1B2-4FFB-BEF1-57FA2A8EBA45},TestFromAnotherExtension, 9=test text - - {8D660A8B-DD11-4310-A56E-DA20411AD4A3},LocalExtension,77={95993098-3FA0-4867-AE7B-29EA684DE890},TestFieldFromLocal,14=LocalTestValue - - - - """ - - Scenario: Compose extended attributes in child element - Given the decomposed file: - """ - - - - - - true - - - - - """ - When I perform a compose - Then I expect a composed file with the following content: - """ - - - - {4202E4F4-4187-47CE-83BE-51088F229451},TestExtension,64={DA1CC8BE-C80A-4B74-BB79-10F50BE06CBC},TestBooleanField,4=true - - - - +@Unit +Feature: Compose Extended Attributes + Here we test the compose of extended attributes. During decomposing these extended attributes are formalized toe XML elements, which we need to reverse during composing. + + Scenario: Compose with extended attributes + Given the decomposed file: + """ + + + + + true + This is test text + with NewLine. + + + 23 + 4/24/2023 + {C1179E53-39F4-461A-9349-EFF754344DD5},ThirdTestField,76={49F389E0-A1B2-4FFB-BEF1-57FA2A8EBA45},TestFromAnotherExtension, 9=test text + + + LocalTestValue + + + + """ + When I perform a compose + Then I expect a composed file with the following content: + """ + + + {4202E4F4-4187-47CE-83BE-51088F229451},TestExtension,154={DA1CC8BE-C80A-4B74-BB79-10F50BE06CBC},TestBooleanField,4=true + {18ECABD7-88E7-4D0E-8107-0382CDF1E4D3},TestTextField,32=This is test text + with NewLine. + + {2ABE46A1-ED92-45C8-B191-7C85DD336346},AnotherTestExtension,346={A2A57166-AB6A-4776-867B-95E7775EFC9F},SecondTestFromAnotherExtension,2=23 + {49F389E0-A1B2-4FFB-BEF1-57FA2A8EBA45},TestFromAnotherExtension,9=4/24/2023 + {C1179E53-39F4-461A-9349-EFF754344DD5},ThirdTestField,133={C1179E53-39F4-461A-9349-EFF754344DD5},ThirdTestField,76={49F389E0-A1B2-4FFB-BEF1-57FA2A8EBA45},TestFromAnotherExtension, 9=test text + + {8D660A8B-DD11-4310-A56E-DA20411AD4A3},LocalExtension,77={95993098-3FA0-4867-AE7B-29EA684DE890},TestFieldFromLocal,14=LocalTestValue + + + + """ + + Scenario: Compose extended attributes in child element + Given the decomposed file: + """ + + + + + + true + + + + + """ + When I perform a compose + Then I expect a composed file with the following content: + """ + + + + {4202E4F4-4187-47CE-83BE-51088F229451},TestExtension,64={DA1CC8BE-C80A-4B74-BB79-10F50BE06CBC},TestBooleanField,4=true + + + + """ \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling.feature b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling.feature new file mode 100644 index 0000000..7e74b16 --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling.feature @@ -0,0 +1,16 @@ +@Unit + +Feature: Compose New Line Handling + Here we test whether PowerDeComposer Compose can handle different newline characters correctly. + + Scenario: CRLF handling + Given the config file 'Config/Config.xml' + And the decomposed file 'Decomposed/RootFile.xml' + When I perform a compose + Then I expect a composed file with the content equal to 'Composed/ExpectedComposedFile.xml' + + Scenario: LF handling + Given the config file 'Config/Config.xml' + And the decomposed file 'Decomposed/RootFile.xml' + When I perform a compose + Then I expect a composed file with the content equal to 'Composed/ExpectedComposedFile.xml' \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/CRLF_handling/Composed/ExpectedComposedFile.xml b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/CRLF_handling/Composed/ExpectedComposedFile.xml new file mode 100644 index 0000000..4bb1348 --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/CRLF_handling/Composed/ExpectedComposedFile.xml @@ -0,0 +1,8 @@ + + + + + FirstName + + + \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/CRLF_handling/Config/Config.xml b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/CRLF_handling/Config/Config.xml new file mode 100644 index 0000000..5e5f6b8 --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/CRLF_handling/Config/Config.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/CRLF_handling/Decomposed/IncludedFile.xml b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/CRLF_handling/Decomposed/IncludedFile.xml new file mode 100644 index 0000000..a7f1eb8 --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/CRLF_handling/Decomposed/IncludedFile.xml @@ -0,0 +1,3 @@ + + FirstName + \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/CRLF_handling/Decomposed/RootFile.xml b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/CRLF_handling/Decomposed/RootFile.xml new file mode 100644 index 0000000..cf32957 --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/CRLF_handling/Decomposed/RootFile.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/LF_handling/Composed/ExpectedComposedFile.xml b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/LF_handling/Composed/ExpectedComposedFile.xml new file mode 100644 index 0000000..b1fbf2c --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/LF_handling/Composed/ExpectedComposedFile.xml @@ -0,0 +1,8 @@ + + + + + FirstName + + + \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/LF_handling/Config/Config.xml b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/LF_handling/Config/Config.xml new file mode 100644 index 0000000..f133405 --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/LF_handling/Config/Config.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/LF_handling/Decomposed/IncludedFile.xml b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/LF_handling/Decomposed/IncludedFile.xml new file mode 100644 index 0000000..4545591 --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/LF_handling/Decomposed/IncludedFile.xml @@ -0,0 +1,3 @@ + + FirstName + \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/LF_handling/Decomposed/RootFile.xml b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/LF_handling/Decomposed/RootFile.xml new file mode 100644 index 0000000..9b81026 --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/compose/NewLineHandling/LF_handling/Decomposed/RootFile.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/ChangeDetection.feature b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/ChangeDetection.feature similarity index 97% rename from PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/ChangeDetection.feature rename to PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/ChangeDetection.feature index 8a2714e..48a4890 100644 --- a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/ChangeDetection.feature +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/ChangeDetection.feature @@ -1,51 +1,51 @@ -@Unit -Feature: Configure ChangeDetection - Here we test the usage of the ChangeDetection configuration during decompose. - - Scenario Outline: ChangeDetection detects - Given the composed file: - """ - - - - - - """ - Given the decomposed file: - """ - - - - - - """ - And the config file: - """ - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - - - """ - - Examples: - | Scenario | InputChanged | TargetChanged | ResultChanged | SomethingElse | - | composed changed | true | false | true | B | - | both unchanged | false | false | false | A | - | decomposed changed | false | true | false | B | - | both changed | true | true | true | A | - | composed empty | | false | | B | - | decomposed empty | false | | false | B | - | both empty | | | | A | +@Unit +Feature: Configure ChangeDetection + Here we test the usage of the ChangeDetection configuration during decompose. + + Scenario Outline: ChangeDetection detects + Given the composed file: + """ + + + + + + """ + Given the decomposed file: + """ + + + + + + """ + And the config file: + """ + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + + + """ + + Examples: + | Scenario | InputChanged | TargetChanged | ResultChanged | SomethingElse | + | composed changed | true | false | true | B | + | both unchanged | false | false | false | A | + | decomposed changed | false | true | false | B | + | both changed | true | true | true | A | + | composed empty | | false | | B | + | decomposed empty | false | | false | B | + | both empty | | | | A | diff --git a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/AllConditions.feature b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/AllConditions.feature similarity index 97% rename from PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/AllConditions.feature rename to PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/AllConditions.feature index 4b55918..2391f9e 100644 --- a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/AllConditions.feature +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/AllConditions.feature @@ -1,53 +1,53 @@ -@Unit -Feature: Configure AllConditions - Here we test the usage of the AllConditions configuration during decompose. - - Scenario Outline: AllConditions - Given the composed file: - """ - - - - - - - - """ - And the config file: - """ - - - - - - - - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - - - - - """ - - Examples: - | Scenario | firstConditionXPath | secondConditionXPath | FirstElementOutput | SecondElementOutput | - | always both true | ./@id | parent::node()[starts-with(name(), 'c:')] | | | - | always one true | ./@id | @nonExistingAttribute | | | - | always none true | ./@nonExistingAttribute | @anotherNonExistingAttribute | | | - | sometimes both true | ./@id | starts-with(name(), 'Second') | | | - | sometimes one true | @id < 2 | starts-with(name(), 'Second') | | | +@Unit +Feature: Configure AllConditions + Here we test the usage of the AllConditions configuration during decompose. + + Scenario Outline: AllConditions + Given the composed file: + """ + + + + + + + + """ + And the config file: + """ + + + + + + + + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + + + + + """ + + Examples: + | Scenario | firstConditionXPath | secondConditionXPath | FirstElementOutput | SecondElementOutput | + | always both true | ./@id | parent::node()[starts-with(name(), 'c:')] | | | + | always one true | ./@id | @nonExistingAttribute | | | + | always none true | ./@nonExistingAttribute | @anotherNonExistingAttribute | | | + | sometimes both true | ./@id | starts-with(name(), 'Second') | | | + | sometimes one true | @id < 2 | starts-with(name(), 'Second') | | | diff --git a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/ElementCondition.feature b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/ElementCondition.feature similarity index 97% rename from PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/ElementCondition.feature rename to PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/ElementCondition.feature index 7ccdde0..325d9f1 100644 --- a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/ElementCondition.feature +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/ElementCondition.feature @@ -1,50 +1,50 @@ -@Unit -Feature: Configure ElementCondition - Here we test the usage of the ElementCondition configuration during decompose. - - Scenario Outline: ElementCondition using - Given the composed file: - """ - - - - - - - - """ - And the config file: - """ - - - - - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - - - - - """ - - Examples: - | Scenario | elementConditionXPath | FirstElementOutput | SecondElementOutput | - | attribute existence | ./@id | | | - | attribute condition | @id < 2 | | | - | element condition | starts-with(name(), 'Second') | | | - | parent condition | parent::node()[starts-with(name(), 'c:')] | | | - | multiple conditions existence | ./@id and parent::node()[starts-with(name(), 'c:')] | | | +@Unit +Feature: Configure ElementCondition + Here we test the usage of the ElementCondition configuration during decompose. + + Scenario Outline: ElementCondition using + Given the composed file: + """ + + + + + + + + """ + And the config file: + """ + + + + + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + + + + + """ + + Examples: + | Scenario | elementConditionXPath | FirstElementOutput | SecondElementOutput | + | attribute existence | ./@id | | | + | attribute condition | @id < 2 | | | + | element condition | starts-with(name(), 'Second') | | | + | parent condition | parent::node()[starts-with(name(), 'c:')] | | | + | multiple conditions existence | ./@id and parent::node()[starts-with(name(), 'c:')] | | | diff --git a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/IncludeAttribute.feature b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/IncludeAttribute.feature similarity index 97% rename from PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/IncludeAttribute.feature rename to PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/IncludeAttribute.feature index dea6204..5dcfb63 100644 --- a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/IncludeAttribute.feature +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/IncludeAttribute.feature @@ -1,55 +1,55 @@ -@Unit -Feature: Configure IncludeAttribute - Here we test the usage of the IncludeAttributes configuration during decompose. - - Scenario Outline: IncludeAttribute using - Given the composed file: - """ - - - - - FirstName - - - SecondName - - - - """ - And the config file: - """ - - - - - - - - - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - ="" /> - ="" /> - - - """ - - Examples: - | Scenario | IncludeAttributeName | IncludeAttributeXPath | IncludeAttributeFirstValue | IncludeAttributeSecondValue | - | attribute | Id | ./@id | 1 | 2 | - | element | Name | ./Name | FirstName | SecondName | +@Unit +Feature: Configure IncludeAttribute + Here we test the usage of the IncludeAttributes configuration during decompose. + + Scenario Outline: IncludeAttribute using + Given the composed file: + """ + + + + + FirstName + + + SecondName + + + + """ + And the config file: + """ + + + + + + + + + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + ="" /> + ="" /> + + + """ + + Examples: + | Scenario | IncludeAttributeName | IncludeAttributeXPath | IncludeAttributeFirstValue | IncludeAttributeSecondValue | + | attribute | Id | ./@id | 1 | 2 | + | element | Name | ./Name | FirstName | SecondName | diff --git a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/OneOffConditions.feature b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/OneOffConditions.feature similarity index 98% rename from PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/OneOffConditions.feature rename to PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/OneOffConditions.feature index 85ad92e..0a33494 100644 --- a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/OneOffConditions.feature +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/OneOffConditions.feature @@ -1,54 +1,54 @@ -@Unit -Feature: Configure OneOffConditions - Here we test the usage of the OneOffConditions configuration during decompose. - - Scenario Outline: OneOffConditions - Given the composed file: - """ - - - - - - - - """ - And the config file: - """ - - - - - - - - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - - - - - """ - - Examples: - | Scenario | firstConditionXPath | secondConditionXPath | FirstElementOutput | SecondElementOutput | - | always both true | ./@id | parent::node()[starts-with(name(), 'c:')] | | | - | always one true | ./@id | @nonExistingAttribute | | | - | always none true | ./@nonExistingAttribute | @anotherNonExistingAttribute | | | - | sometimes both true | ./@id | starts-with(name(), 'Second') | | | - | sometimes one true | @id < 2 | starts-with(name(), 'Second') | | | - | sometimes none true | @id > 1 | starts-with(name(), 'Second') | | | +@Unit +Feature: Configure OneOffConditions + Here we test the usage of the OneOffConditions configuration during decompose. + + Scenario Outline: OneOffConditions + Given the composed file: + """ + + + + + + + + """ + And the config file: + """ + + + + + + + + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + + + + + """ + + Examples: + | Scenario | firstConditionXPath | secondConditionXPath | FirstElementOutput | SecondElementOutput | + | always both true | ./@id | parent::node()[starts-with(name(), 'c:')] | | | + | always one true | ./@id | @nonExistingAttribute | | | + | always none true | ./@nonExistingAttribute | @anotherNonExistingAttribute | | | + | sometimes both true | ./@id | starts-with(name(), 'Second') | | | + | sometimes one true | @id < 2 | starts-with(name(), 'Second') | | | + | sometimes none true | @id > 1 | starts-with(name(), 'Second') | | | diff --git a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/TargetFileName.feature b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/TargetFileName.feature similarity index 97% rename from PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/TargetFileName.feature rename to PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/TargetFileName.feature index f6681e1..39f77c3 100644 --- a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/TargetFileName.feature +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/TargetFileName.feature @@ -1,66 +1,66 @@ -@Unit -Feature: Configure TargetFileName - Here we test the usage of the TargetFileNames configuration during decompose. - - Scenario Outline: TargetFileName is value of - Given the composed file: - """ - - - - - - - - - - - - """ - And the config file: - """ - - - - - - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - - - - - """ - And I expect a decomposed file '.xml' with the following content: - """ - - - - """ - And I expect a decomposed file '.xml' with the following content: - """ - - - - """ - - Examples: - | Scenario | FirstId | FirstName | SecondId | SecondName | FirstFileName | SecondFileName | - | unique names | 1 | FirstName | 2 | SecondName | ChildElements/FirstName | ChildElements/SecondName | - | non-unique names | 1 | FirstName | 2 | FirstName | ChildElements/FirstName | ChildElements/2 | - | empty name | 1 | FirstName | 2 | | ChildElements/FirstName | ChildElements/2 | - | case different names | 1 | firstname | 2 | FirstName | ChildElements/firstname | ChildElements/2 | +@Unit +Feature: Configure TargetFileName + Here we test the usage of the TargetFileNames configuration during decompose. + + Scenario Outline: TargetFileName is value of + Given the composed file: + """ + + + + + + + + + + + + """ + And the config file: + """ + + + + + + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + + + + + """ + And I expect a decomposed file '.xml' with the following content: + """ + + + + """ + And I expect a decomposed file '.xml' with the following content: + """ + + + + """ + + Examples: + | Scenario | FirstId | FirstName | SecondId | SecondName | FirstFileName | SecondFileName | + | unique names | 1 | FirstName | 2 | SecondName | ChildElements/FirstName | ChildElements/SecondName | + | non-unique names | 1 | FirstName | 2 | FirstName | ChildElements/FirstName | ChildElements/2 | + | empty name | 1 | FirstName | 2 | | ChildElements/FirstName | ChildElements/2 | + | case different names | 1 | firstname | 2 | FirstName | ChildElements/firstname | ChildElements/2 | diff --git a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/TargetFolderName.feature b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/TargetFolderName.feature similarity index 98% rename from PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/TargetFolderName.feature rename to PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/TargetFolderName.feature index fb3854b..9e0f45a 100644 --- a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/TargetFolderName.feature +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/DecomposableElement/TargetFolderName.feature @@ -1,173 +1,173 @@ -@Unit -Feature: Configure TargetFolderName - Here we test the usage of the TargetFolderNames configuration during decompose. - - Scenario Outline: TargetFolderName is - Given the composed file: - """ - - - - - - - - - - - - """ - And the config file: - """ - - - - - - - - - /> - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - - - - - """ - And I expect a decomposed file '.xml' with the following content: - """ - - - - """ - And I expect a decomposed file '.xml' with the following content: - """ - - - - """ - - Examples: - | Scenario | ConfigOverrideParent | FirstType | FirstName | SecondType | SecondName | FirstFileName | SecondFileName | - | the same | | SameType | FirstName | SameType | SecondName | ChildElements/SameType/FirstName | ChildElements/SameType/SecondName | - | different | | FirstType | FirstName | SecondType | SecondName | ChildElements/FirstType/FirstName | ChildElements/SecondType/SecondName | - | the same and same filename | | SameType | SameName | SameType | SameName | ChildElements/SameType/SameName | ChildElements/SameType/2 | - | different case and same filename | | sametype | SameName | SameType | SameName | ChildElements/sametype/SameName | ChildElements/SameType/2 | - | the same dont override parent | overrideParent="false" | SameType | FirstName | SameType | SecondName | ChildElements/SameType/FirstName | ChildElements/SameType/SecondName | - | the same override parent | overrideParent="true" | SameType | FirstName | SameType | SecondName | SameType/FirstName | SameType/SecondName | - - Scenario Outline: TargetFolderName is with child-elements - Given the decomposed folder location '' - And the composed file: - """ - - - - - - - - ThirdName - - - - - - - - FourthName - - - - - - """ - And the config file: - """ - - - - - - - - - /> - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - - - - - """ - And I expect a decomposed file '.xml' with the following content: - """ - - - - - - - """ - And I expect a decomposed file '.xml' with the following content: - """ - - - - - - - """ - And I expect a decomposed file '.xml' with the following content: - """ - - ThirdName - - """ - And I expect a decomposed file '.xml' with the following content: - """ - - FourthName - - """ - - Examples: - | Scenario | ConfigOverrideParent | DecomposedFolder | FirstType | FirstName | SecondType | SecondName | FirstFilePath | FirstFileName | SecondFilePath | SecondFileName | ThirdFileName | FourthFileName | - | the same | | Decomposed | SameType | FirstName | SameType | SecondName | ChildElements/SameType/FirstName/ | FirstName | ChildElements/SameType/SecondName/ | SecondName | ChildElements/ThirdName | ChildElements/FourthName | - | different | | Decomposed | FirstType | FirstName | SecondType | SecondName | ChildElements/FirstType/FirstName/ | FirstName | ChildElements/SecondType/SecondName/ | SecondName | ChildElements/ThirdName | ChildElements/FourthName | - # The problem with this last scenario is that during decompose at the time the file name is derived it's not known yet whether the file will be written into a seperate folder if the current element contains childs. - | the same and same filename | | Decomposed | SameType | SameName | SameType | SameName | ChildElements/SameType/SameName/ | SameName | ChildElements/SameType/2/ | 2 | ChildElements/ThirdName | ChildElements/FourthName | - | the same and same filename with relative backward slash folder | | Decomposed\\dummySubFolder\\..\\realTargetFolder | SameType | SameName | SameType | SameName | ChildElements/SameType/SameName/ | SameName | ChildElements/SameType/2/ | 2 | ChildElements/ThirdName | ChildElements/FourthName | - # Disabled the test below, since it fails in linux. - #| the same and same filename with relative forward slash folder | |Decomposed\\dummySubFolder/../realTargetFolder | SameType | SameName | SameType | SameName | ChildElements/SameType/SameName/ | SameName | ChildElements/SameType/2/ | 2 | ChildElements/ThirdName | ChildElements/FourthName | - | the same dont override parent | overrideParent="false" | Decomposed | SameType | FirstName | SameType | SecondName | ChildElements/SameType/FirstName/ | FirstName | ChildElements/SameType/SecondName/ | SecondName | ChildElements/ThirdName | ChildElements/FourthName | - | the same override parent | overrideParent="true" | Decomposed | SameType | FirstName | SameType | SecondName | SameType/FirstName/ | FirstName | SameType/SecondName/ | SecondName | ChildElements/ThirdName | ChildElements/FourthName | +@Unit +Feature: Configure TargetFolderName + Here we test the usage of the TargetFolderNames configuration during decompose. + + Scenario Outline: TargetFolderName is + Given the composed file: + """ + + + + + + + + + + + + """ + And the config file: + """ + + + + + + + + + /> + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + + + + + """ + And I expect a decomposed file '.xml' with the following content: + """ + + + + """ + And I expect a decomposed file '.xml' with the following content: + """ + + + + """ + + Examples: + | Scenario | ConfigOverrideParent | FirstType | FirstName | SecondType | SecondName | FirstFileName | SecondFileName | + | the same | | SameType | FirstName | SameType | SecondName | ChildElements/SameType/FirstName | ChildElements/SameType/SecondName | + | different | | FirstType | FirstName | SecondType | SecondName | ChildElements/FirstType/FirstName | ChildElements/SecondType/SecondName | + | the same and same filename | | SameType | SameName | SameType | SameName | ChildElements/SameType/SameName | ChildElements/SameType/2 | + | different case and same filename | | sametype | SameName | SameType | SameName | ChildElements/sametype/SameName | ChildElements/SameType/2 | + | the same dont override parent | overrideParent="false" | SameType | FirstName | SameType | SecondName | ChildElements/SameType/FirstName | ChildElements/SameType/SecondName | + | the same override parent | overrideParent="true" | SameType | FirstName | SameType | SecondName | SameType/FirstName | SameType/SecondName | + + Scenario Outline: TargetFolderName is with child-elements + Given the decomposed folder location '' + And the composed file: + """ + + + + + + + + ThirdName + + + + + + + + FourthName + + + + + + """ + And the config file: + """ + + + + + + + + + /> + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + + + + + """ + And I expect a decomposed file '.xml' with the following content: + """ + + + + + + + """ + And I expect a decomposed file '.xml' with the following content: + """ + + + + + + + """ + And I expect a decomposed file '.xml' with the following content: + """ + + ThirdName + + """ + And I expect a decomposed file '.xml' with the following content: + """ + + FourthName + + """ + + Examples: + | Scenario | ConfigOverrideParent | DecomposedFolder | FirstType | FirstName | SecondType | SecondName | FirstFilePath | FirstFileName | SecondFilePath | SecondFileName | ThirdFileName | FourthFileName | + | the same | | Decomposed | SameType | FirstName | SameType | SecondName | ChildElements/SameType/FirstName/ | FirstName | ChildElements/SameType/SecondName/ | SecondName | ChildElements/ThirdName | ChildElements/FourthName | + | different | | Decomposed | FirstType | FirstName | SecondType | SecondName | ChildElements/FirstType/FirstName/ | FirstName | ChildElements/SecondType/SecondName/ | SecondName | ChildElements/ThirdName | ChildElements/FourthName | + # The problem with this last scenario is that during decompose at the time the file name is derived it's not known yet whether the file will be written into a seperate folder if the current element contains childs. + | the same and same filename | | Decomposed | SameType | SameName | SameType | SameName | ChildElements/SameType/SameName/ | SameName | ChildElements/SameType/2/ | 2 | ChildElements/ThirdName | ChildElements/FourthName | + | the same and same filename with relative backward slash folder | | Decomposed\\dummySubFolder\\..\\realTargetFolder | SameType | SameName | SameType | SameName | ChildElements/SameType/SameName/ | SameName | ChildElements/SameType/2/ | 2 | ChildElements/ThirdName | ChildElements/FourthName | + # Disabled the test below, since it fails in linux. + #| the same and same filename with relative forward slash folder | |Decomposed\\dummySubFolder/../realTargetFolder | SameType | SameName | SameType | SameName | ChildElements/SameType/SameName/ | SameName | ChildElements/SameType/2/ | 2 | ChildElements/ThirdName | ChildElements/FourthName | + | the same dont override parent | overrideParent="false" | Decomposed | SameType | FirstName | SameType | SecondName | ChildElements/SameType/FirstName/ | FirstName | ChildElements/SameType/SecondName/ | SecondName | ChildElements/ThirdName | ChildElements/FourthName | + | the same override parent | overrideParent="true" | Decomposed | SameType | FirstName | SameType | SecondName | SameType/FirstName/ | FirstName | SameType/SecondName/ | SecondName | ChildElements/ThirdName | ChildElements/FourthName | diff --git a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/ExtendedAttributes.feature b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/ExtendedAttributes.feature similarity index 96% rename from PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/ExtendedAttributes.feature rename to PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/ExtendedAttributes.feature index 67a08f2..9ed22db 100644 --- a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/ExtendedAttributes.feature +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/ExtendedAttributes.feature @@ -1,151 +1,151 @@ -@Unit -Feature: Decompose Extended Attributes - Here we verify whether PowerDeComposer decomposed Extended Attributes correctly. - - Scenario: Enable formalize extended attributes - Given the config file: - """ - - - - - - - """ - Given the composed file: - """ - - - {4202E4F4-4187-47CE-83BE-51088F229451},TestExtension,64={DA1CC8BE-C80A-4B74-BB79-10F50BE06CBC},TestBooleanField,4=true - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - - true - - - - """ - - Scenario: Disable formalize extended attributes - Given the config file: - """ - - - - - - - """ - Given the composed file: - """ - - - {4202E4F4-4187-47CE-83BE-51088F229451},TestExtension,64={DA1CC8BE-C80A-4B74-BB79-10F50BE06CBC},TestBooleanField,4=true - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - {4202E4F4-4187-47CE-83BE-51088F229451},TestExtension,64={DA1CC8BE-C80A-4B74-BB79-10F50BE06CBC},TestBooleanField,4=true - - - - """ - - Scenario: Formalize multiple extended attributes - Given the config file: - """ - - - - - - - """ - Given the composed file: - """ - - - {4202E4F4-4187-47CE-83BE-51088F229451},TestExtension,154={DA1CC8BE-C80A-4B74-BB79-10F50BE06CBC},TestBooleanField,4=true - {18ECABD7-88E7-4D0E-8107-0382CDF1E4D3},TestTextField,32=This is test text - with NewLine. - - {2ABE46A1-ED92-45C8-B191-7C85DD336346},AnotherTestExtension,346={A2A57166-AB6A-4776-867B-95E7775EFC9F},SecondTestFromAnotherExtension,2=23 - {49F389E0-A1B2-4FFB-BEF1-57FA2A8EBA45},TestFromAnotherExtension,9=4/24/2023 - {C1179E53-39F4-461A-9349-EFF754344DD5},ThirdTestField,133={C1179E53-39F4-461A-9349-EFF754344DD5},ThirdTestField,76={49F389E0-A1B2-4FFB-BEF1-57FA2A8EBA45},TestFromAnotherExtension, 9=test text - - {8D660A8B-DD11-4310-A56E-DA20411AD4A3},LocalExtension,77={95993098-3FA0-4867-AE7B-29EA684DE890},TestFieldFromLocal,14=LocalTestValue - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - - true - This is test text - with NewLine. - - - 23 - 4/24/2023 - {C1179E53-39F4-461A-9349-EFF754344DD5},ThirdTestField,76={49F389E0-A1B2-4FFB-BEF1-57FA2A8EBA45},TestFromAnotherExtension, 9=test text - - - LocalTestValue - - - - """ - - Scenario: Formalize extended attributes in child element - Given the config file: - """ - - - - - - - """ - And the composed file: - """ - - - - {4202E4F4-4187-47CE-83BE-51088F229451},TestExtension,64={DA1CC8BE-C80A-4B74-BB79-10F50BE06CBC},TestBooleanField,4=true - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - - - true - - - - - """ +@Unit +Feature: Decompose Extended Attributes + Here we verify whether PowerDeComposer decomposed Extended Attributes correctly. + + Scenario: Enable formalize extended attributes + Given the config file: + """ + + + + + + + """ + Given the composed file: + """ + + + {4202E4F4-4187-47CE-83BE-51088F229451},TestExtension,64={DA1CC8BE-C80A-4B74-BB79-10F50BE06CBC},TestBooleanField,4=true + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + + true + + + + """ + + Scenario: Disable formalize extended attributes + Given the config file: + """ + + + + + + + """ + Given the composed file: + """ + + + {4202E4F4-4187-47CE-83BE-51088F229451},TestExtension,64={DA1CC8BE-C80A-4B74-BB79-10F50BE06CBC},TestBooleanField,4=true + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + {4202E4F4-4187-47CE-83BE-51088F229451},TestExtension,64={DA1CC8BE-C80A-4B74-BB79-10F50BE06CBC},TestBooleanField,4=true + + + + """ + + Scenario: Formalize multiple extended attributes + Given the config file: + """ + + + + + + + """ + Given the composed file: + """ + + + {4202E4F4-4187-47CE-83BE-51088F229451},TestExtension,154={DA1CC8BE-C80A-4B74-BB79-10F50BE06CBC},TestBooleanField,4=true + {18ECABD7-88E7-4D0E-8107-0382CDF1E4D3},TestTextField,32=This is test text + with NewLine. + + {2ABE46A1-ED92-45C8-B191-7C85DD336346},AnotherTestExtension,346={A2A57166-AB6A-4776-867B-95E7775EFC9F},SecondTestFromAnotherExtension,2=23 + {49F389E0-A1B2-4FFB-BEF1-57FA2A8EBA45},TestFromAnotherExtension,9=4/24/2023 + {C1179E53-39F4-461A-9349-EFF754344DD5},ThirdTestField,133={C1179E53-39F4-461A-9349-EFF754344DD5},ThirdTestField,76={49F389E0-A1B2-4FFB-BEF1-57FA2A8EBA45},TestFromAnotherExtension, 9=test text + + {8D660A8B-DD11-4310-A56E-DA20411AD4A3},LocalExtension,77={95993098-3FA0-4867-AE7B-29EA684DE890},TestFieldFromLocal,14=LocalTestValue + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + + true + This is test text + with NewLine. + + + 23 + 4/24/2023 + {C1179E53-39F4-461A-9349-EFF754344DD5},ThirdTestField,76={49F389E0-A1B2-4FFB-BEF1-57FA2A8EBA45},TestFromAnotherExtension, 9=test text + + + LocalTestValue + + + + """ + + Scenario: Formalize extended attributes in child element + Given the config file: + """ + + + + + + + """ + And the composed file: + """ + + + + {4202E4F4-4187-47CE-83BE-51088F229451},TestExtension,64={DA1CC8BE-C80A-4B74-BB79-10F50BE06CBC},TestBooleanField,4=true + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + + + true + + + + + """ diff --git a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/FileRemovalStrategy.feature b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/FileRemovalStrategy.feature similarity index 96% rename from PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/FileRemovalStrategy.feature rename to PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/FileRemovalStrategy.feature index 86ba428..b66a8bf 100644 --- a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/FileRemovalStrategy.feature +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/FileRemovalStrategy.feature @@ -1,57 +1,57 @@ -@Unit -Feature: Configure FileRemovalStrategy - Here we test the working of the fileRemovalStrategy attribute. - - Background: - Given the decomposed file: - """ - - - - - - - """ - And the decomposed file 'SubFolder/IncludedFileName.xml': - """ - - FirstName - - """ - And the decomposed file 'SubFolder/ExtraFileName.xml': - """ - - ExtraFile - - """ - And the composed file: - """ - - - - - FirstName - - - - """ - - Scenario Outline: fileRemovalStrategy - Given the config file: - """ - - - > - - - - - """ - When I perform a decompose - Then I expect the file 'SubFolder/ExtraFileName.xml' - - Examples: - | Scenario | FileRemovalStrategy | DoOrDont | - | includes | fileRemovalStrategy="includes" | do | - | files | fileRemovalStrategy="files" | do not | - | no-specified | | do | +@Unit +Feature: Configure FileRemovalStrategy + Here we test the working of the fileRemovalStrategy attribute. + + Background: + Given the decomposed file: + """ + + + + + + + """ + And the decomposed file 'SubFolder/IncludedFileName.xml': + """ + + FirstName + + """ + And the decomposed file 'SubFolder/ExtraFileName.xml': + """ + + ExtraFile + + """ + And the composed file: + """ + + + + + FirstName + + + + """ + + Scenario Outline: fileRemovalStrategy + Given the config file: + """ + + + > + + + + + """ + When I perform a decompose + Then I expect the file 'SubFolder/ExtraFileName.xml' + + Examples: + | Scenario | FileRemovalStrategy | DoOrDont | + | includes | fileRemovalStrategy="includes" | do | + | files | fileRemovalStrategy="files" | do not | + | no-specified | | do | diff --git a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/IdentifierReplacement.feature b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/IdentifierReplacement.feature similarity index 97% rename from PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/IdentifierReplacement.feature rename to PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/IdentifierReplacement.feature index 4b2f40d..2434333 100644 --- a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/IdentifierReplacement.feature +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/IdentifierReplacement.feature @@ -1,121 +1,121 @@ -@Unit -Feature: Configure IdentifierReplacement - Here we test the usage of the IdentifierReplacement configuration during decompose. - - Scenario Outline: IdentifierReplacement on attribute using - Given the composed file: - """ - - - - - """ - And the config file: - """ - - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - - """ - - Examples: - | Scenario | childElementXML | identifierNodeXPath | replacementValueXPath | replacedId | - | root-attribute | | //*/@id | ../@rootAttribute | rootAttributeValue | - | child-element | childElementValue | //*/@id | ../ChildElement | childElementValue | - | child-element-attribute | | //*/@id | ../ChildElement/@childElementAttribute | childElementAttributeValue | - - Scenario Outline: IdentifierReplacement on element-text using - Given the composed file: - """ - - - original-id - - - """ - And the config file: - """ - - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - - - """ - - Examples: - | Scenario | childElementXML | identifierNodeXPath | replacementValueXPath | replacedId | - | root-attribute | | //*/Id/text() | ../../@rootAttribute | rootAttributeValue | - | child-element | childElementValue | //*/Id/text() | ../../ChildElement | childElementValue | - | child-element-attribute | | //*/Id/text() | ../../ChildElement/@childElementAttribute | childElementAttributeValue | - - Scenario: IdentifierReplacement with referencing nodes - Given the composed file: - """ - - - - - - - - - - - - """ - And the config file: - """ - - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - - - - - - - - - """ +@Unit +Feature: Configure IdentifierReplacement + Here we test the usage of the IdentifierReplacement configuration during decompose. + + Scenario Outline: IdentifierReplacement on attribute using + Given the composed file: + """ + + + + + """ + And the config file: + """ + + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + + """ + + Examples: + | Scenario | childElementXML | identifierNodeXPath | replacementValueXPath | replacedId | + | root-attribute | | //*/@id | ../@rootAttribute | rootAttributeValue | + | child-element | childElementValue | //*/@id | ../ChildElement | childElementValue | + | child-element-attribute | | //*/@id | ../ChildElement/@childElementAttribute | childElementAttributeValue | + + Scenario Outline: IdentifierReplacement on element-text using + Given the composed file: + """ + + + original-id + + + """ + And the config file: + """ + + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + + + """ + + Examples: + | Scenario | childElementXML | identifierNodeXPath | replacementValueXPath | replacedId | + | root-attribute | | //*/Id/text() | ../../@rootAttribute | rootAttributeValue | + | child-element | childElementValue | //*/Id/text() | ../../ChildElement | childElementValue | + | child-element-attribute | | //*/Id/text() | ../../ChildElement/@childElementAttribute | childElementAttributeValue | + + Scenario: IdentifierReplacement with referencing nodes + Given the composed file: + """ + + + + + + + + + + + + """ + And the config file: + """ + + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + + + + + + + + + """ diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling.feature b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling.feature new file mode 100644 index 0000000..d4ac01f --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling.feature @@ -0,0 +1,18 @@ +@Unit + +Feature: Decompose New Line Handling + Here we test whether PowerDeComposer Decompose can handle different newline characters correctly. + + Scenario: CRLF handling + Given the config file 'Config/Config.xml' + And the composed file 'Composed/ComposedFile.xml' + When I perform a decompose + Then I expect a decomposed file 'ComposedFile.xml' with content equal to 'Decomposed/ExpectedDecomposedFile.xml' + And I expect a decomposed file 'ChildElements/FirstId.xml' with content equal to 'Decomposed/ChildElements/FirstId.xml' + + Scenario: LF handling + Given the config file 'Config/Config.xml' + And the composed file 'Composed/ComposedFile.xml' + When I perform a decompose + Then I expect a decomposed file 'ComposedFile.xml' with content equal to 'Decomposed/ExpectedDecomposedFile.xml' + And I expect a decomposed file 'ChildElements/FirstId.xml' with content equal to 'Decomposed/ChildElements/FirstId.xml' \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/CRLF_handling/Composed/ComposedFile.xml b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/CRLF_handling/Composed/ComposedFile.xml new file mode 100644 index 0000000..4bb1348 --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/CRLF_handling/Composed/ComposedFile.xml @@ -0,0 +1,8 @@ + + + + + FirstName + + + \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/CRLF_handling/Config/Config.xml b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/CRLF_handling/Config/Config.xml new file mode 100644 index 0000000..d79dbc2 --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/CRLF_handling/Config/Config.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/CRLF_handling/Decomposed/ChildElements/FirstId.xml b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/CRLF_handling/Decomposed/ChildElements/FirstId.xml new file mode 100644 index 0000000..a7f1eb8 --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/CRLF_handling/Decomposed/ChildElements/FirstId.xml @@ -0,0 +1,3 @@ + + FirstName + \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/CRLF_handling/Decomposed/ExpectedDecomposedFile.xml b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/CRLF_handling/Decomposed/ExpectedDecomposedFile.xml new file mode 100644 index 0000000..3c020a3 --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/CRLF_handling/Decomposed/ExpectedDecomposedFile.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/LF_handling/Composed/ComposedFile.xml b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/LF_handling/Composed/ComposedFile.xml new file mode 100644 index 0000000..b1fbf2c --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/LF_handling/Composed/ComposedFile.xml @@ -0,0 +1,8 @@ + + + + + FirstName + + + \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/LF_handling/Config/Config.xml b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/LF_handling/Config/Config.xml new file mode 100644 index 0000000..7e1436e --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/LF_handling/Config/Config.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/LF_handling/Decomposed/ChildElements/FirstId.xml b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/LF_handling/Decomposed/ChildElements/FirstId.xml new file mode 100644 index 0000000..4545591 --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/LF_handling/Decomposed/ChildElements/FirstId.xml @@ -0,0 +1,3 @@ + + FirstName + \ No newline at end of file diff --git a/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/LF_handling/Decomposed/ExpectedDecomposedFile.xml b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/LF_handling/Decomposed/ExpectedDecomposedFile.xml new file mode 100644 index 0000000..168e9a4 --- /dev/null +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NewLineHandling/LF_handling/Decomposed/ExpectedDecomposedFile.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/NodeRemoval.feature b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NodeRemoval.feature similarity index 97% rename from PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/NodeRemoval.feature rename to PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NodeRemoval.feature index c5a868c..f253e3b 100644 --- a/PowerDeComposerTest/src/test/resources/com/xbreeze/xml/test/decompose/NodeRemoval.feature +++ b/PowerDeComposer/src/test/resources/com/xbreeze/xml/test/decompose/NodeRemoval.feature @@ -1,245 +1,245 @@ -@Unit -Feature: Configure NodeRemoval - Here we test the usage of the NodeRemoval configuration during decompose. - - Scenario Outline: Remove element - Given the composed file: - """ - - - - - """ - And the config file: - """ - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - """ - - Examples: - | Scenario | ElementXML | RemoveXPath | - | simple relative | | //RemoveElement | - | simple absolute | | /RootElement/RemoveElement | - | simple with attributes absolute | | /RootElement/RemoveElement | - | simple with attributes filtered | | /RootElement/RemoveElement[@ChildAttribute='A'] | - | complex absolute | | /RootElement/RemoveElement | - | complex with children absolute | | /RootElement/RemoveElement | - - Scenario Outline: Remove element negative - Given the composed file: - """ - - - - - """ - And the config file: - """ - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - - """ - - Examples: - | Scenario | ElementXML | RemoveXPath | - | simple relative | | //RemoveElemen | - | simple absolute | | /RootElement/RemoveElemen | - | simple with attributes absolute | | /RootElement/RemoveElemen | - | simple with attributes filtered | | /RootElement/RemoveElement[@ChildAttribute='B'] | - - Scenario Outline: Remove attribute - Given the composed file: - """ - - - - - """ - And the config file: - """ - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - - """ - - Examples: - | Scenario | RemoveXPath | - | simple relative | //@RemoveAttribute | - | simple absolute | /RootElement/Element/@RemoveAttribute | - | simple filtered | /RootElement/Element/@RemoveAttribute[.='B'] | - - Scenario Outline: Remove attribute negative - Given the composed file: - """ - - - - - """ - And the config file: - """ - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - - """ - - Examples: - | Scenario | RemoveXPath | - | simple relative | //@RemoveAttribut | - | simple absolute | /RootElement/Element/@RemoveAttribut | - | simple filtered | /RootElement/Element/@RemoveAttribute[.='A'] | - - Scenario Outline: Remove processing instruction element - Given the composed file: - """ - - - - """ - And the config file: - """ - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - """ - - Examples: - # Filtering on processing instructions is not supported (currently). - #| simple | | /processing-instruction('RemovePI')[@filter='true'] | - | Scenario | PIXML | RemoveXPath | - | simple | | /processing-instruction('RemovePI') | - | with attributes | | /processing-instruction('RemovePI') | - - Scenario Outline: Remove processing instruction attribute - Given the composed file: - """ - - - - """ - And the config file: - """ - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - """ - - Examples: - | Scenario | InputPI | OutputPI | RemoveXPath | - | attribute simple | | | /processing-instruction('ExamplePI')/@RemoveAttribute | - | attribute first attribute | | | /processing-instruction('ExamplePI')/@RemoveAttribute | - | attribute middle attribute | | | /processing-instruction('ExamplePI')/@RemoveAttribute | - | attribute last attribute | | | /processing-instruction('ExamplePI')/@RemoveAttribute | - | attribute with special character | | | /processing-instruction('ExamplePI')/@RemoveAttribute | - - Scenario: Remove multiline processing instruction attribute - Given the composed file: - """ - - - - """ - And the config file: - """ - - - - - - - - - - """ - When I perform a decompose - Then I expect a decomposed file with the following content: - """ - - - - """ +@Unit +Feature: Configure NodeRemoval + Here we test the usage of the NodeRemoval configuration during decompose. + + Scenario Outline: Remove element + Given the composed file: + """ + + + + + """ + And the config file: + """ + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + """ + + Examples: + | Scenario | ElementXML | RemoveXPath | + | simple relative | | //RemoveElement | + | simple absolute | | /RootElement/RemoveElement | + | simple with attributes absolute | | /RootElement/RemoveElement | + | simple with attributes filtered | | /RootElement/RemoveElement[@ChildAttribute='A'] | + | complex absolute | | /RootElement/RemoveElement | + | complex with children absolute | | /RootElement/RemoveElement | + + Scenario Outline: Remove element negative + Given the composed file: + """ + + + + + """ + And the config file: + """ + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + + """ + + Examples: + | Scenario | ElementXML | RemoveXPath | + | simple relative | | //RemoveElemen | + | simple absolute | | /RootElement/RemoveElemen | + | simple with attributes absolute | | /RootElement/RemoveElemen | + | simple with attributes filtered | | /RootElement/RemoveElement[@ChildAttribute='B'] | + + Scenario Outline: Remove attribute + Given the composed file: + """ + + + + + """ + And the config file: + """ + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + + """ + + Examples: + | Scenario | RemoveXPath | + | simple relative | //@RemoveAttribute | + | simple absolute | /RootElement/Element/@RemoveAttribute | + | simple filtered | /RootElement/Element/@RemoveAttribute[.='B'] | + + Scenario Outline: Remove attribute negative + Given the composed file: + """ + + + + + """ + And the config file: + """ + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + + """ + + Examples: + | Scenario | RemoveXPath | + | simple relative | //@RemoveAttribut | + | simple absolute | /RootElement/Element/@RemoveAttribut | + | simple filtered | /RootElement/Element/@RemoveAttribute[.='A'] | + + Scenario Outline: Remove processing instruction element + Given the composed file: + """ + + + + """ + And the config file: + """ + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + """ + + Examples: + # Filtering on processing instructions is not supported (currently). + #| simple | | /processing-instruction('RemovePI')[@filter='true'] | + | Scenario | PIXML | RemoveXPath | + | simple | | /processing-instruction('RemovePI') | + | with attributes | | /processing-instruction('RemovePI') | + + Scenario Outline: Remove processing instruction attribute + Given the composed file: + """ + + + + """ + And the config file: + """ + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + """ + + Examples: + | Scenario | InputPI | OutputPI | RemoveXPath | + | attribute simple | | | /processing-instruction('ExamplePI')/@RemoveAttribute | + | attribute first attribute | | | /processing-instruction('ExamplePI')/@RemoveAttribute | + | attribute middle attribute | | | /processing-instruction('ExamplePI')/@RemoveAttribute | + | attribute last attribute | | | /processing-instruction('ExamplePI')/@RemoveAttribute | + | attribute with special character | | | /processing-instruction('ExamplePI')/@RemoveAttribute | + + Scenario: Remove multiline processing instruction attribute + Given the composed file: + """ + + + + """ + And the config file: + """ + + + + + + + + + + """ + When I perform a decompose + Then I expect a decomposed file with the following content: + """ + + + + """ diff --git a/PowerDeComposer/src/test/resources/junit-platform.properties b/PowerDeComposer/src/test/resources/junit-platform.properties new file mode 100644 index 0000000..287a377 --- /dev/null +++ b/PowerDeComposer/src/test/resources/junit-platform.properties @@ -0,0 +1,3 @@ +cucumber.publish.quiet=true +cucumber.glue=com.xbreeze.xml.test +cucumber.junit-platform.naming-strategy=long \ No newline at end of file diff --git a/PowerDeComposerTest/.project b/PowerDeComposerTest/.project deleted file mode 100644 index d08807d..0000000 --- a/PowerDeComposerTest/.project +++ /dev/null @@ -1,45 +0,0 @@ - - - PowerDeComposerTest - - - - - - org.eclipse.jdt.core.javabuilder - - - - - cucumber.eclipse.builder.stepdefinition - - - - - cucumber.eclipse.builder.gherkin - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - cucumber.eclipse.nature - org.eclipse.m2e.core.maven2Nature - org.eclipse.jdt.core.javanature - - - - 1633618009555 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/PowerDeComposerTest/pom.xml b/PowerDeComposerTest/pom.xml deleted file mode 100644 index 4e88d3b..0000000 --- a/PowerDeComposerTest/pom.xml +++ /dev/null @@ -1,101 +0,0 @@ - - 4.0.0 - PowerDeComposerTest - PowerDeComposerTest - 0.0.1-SNAPSHOT - - - 1.6.0 - 7.11.2 - 5.9.2 - 1.8 - UTF-8 - - - - - - org.junit - junit-bom - ${junit.version} - pom - import - - - io.cucumber - cucumber-bom - ${cucumber.version} - pom - import - - - - - - - com.x-breeze.powerdecomposer - PowerDeComposer - ${pdc.version} - test - - - io.cucumber - cucumber-java - test - - - io.cucumber - cucumber-junit-platform-engine - test - - - org.junit.platform - junit-platform-suite - test - - - org.junit.jupiter - junit-jupiter - test - - - commons-io - commons-io - 2.11.0 - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.11.0 - - UTF-8 - ${java.version} - ${java.version} - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.0.0 - - **/*UnitTest.java - - - - cucumber.junit-platform.naming-strategy=long - - - -Dfile.encoding=UTF-8 - - - - - \ No newline at end of file diff --git a/PowerDeComposerTest/src/test/resources/junit-platform.properties b/PowerDeComposerTest/src/test/resources/junit-platform.properties deleted file mode 100644 index f79abc4..0000000 --- a/PowerDeComposerTest/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,2 +0,0 @@ -cucumber.publish.quiet=true -cucumber.glue=com.xbreeze.xml.test \ No newline at end of file diff --git a/PowerDeComposerTest/.classpath b/RunWithMaven/.classpath similarity index 61% rename from PowerDeComposerTest/.classpath rename to RunWithMaven/.classpath index 0419a00..ebde520 100644 --- a/PowerDeComposerTest/.classpath +++ b/RunWithMaven/.classpath @@ -1,38 +1,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RunWithMaven/.project b/RunWithMaven/.project new file mode 100644 index 0000000..54859df --- /dev/null +++ b/RunWithMaven/.project @@ -0,0 +1,23 @@ + + + RunWithMaven + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/azure-pipeline.yml b/azure-pipeline.yml deleted file mode 100644 index 5475e57..0000000 --- a/azure-pipeline.yml +++ /dev/null @@ -1,32 +0,0 @@ -# Build pipeline for PowerDeComposer. -# This will build PowerDeComposer and run the test suite defined in the PowerDeComposerTest folder. - -trigger: -- master -- feature/* - -pool: - vmImage: windows-latest # PowerDeComposer will run primary on Windows, so we use this in the build. - -steps: -- task: Maven@3 - inputs: - mavenPomFile: 'PowerDeComposer/pom.xml' - jdkVersionOption: '1.11' - goals: 'install' -- task: Maven@3 - inputs: - mavenPomFile: 'PowerDeComposerTest/pom.xml' - jdkVersionOption: '1.11' - publishJUnitResults: true - testResultsFiles: '**/surefire-reports/TEST-*.xml' - goals: 'test' -- task: PublishCucumberReport@1 - displayName: 'Publish Cucumber Report' - # Run this task also if the previous task has failed (so a test failed). - condition: succeededOrFailed() - inputs: - jsonDir: ./PowerDeComposerTest/target/cucumber-reports - outputPath: ./PowerDeComposerTest/target/cucumber-reports - name: 'Unit Tests' - title: PowerDeComposer \ No newline at end of file diff --git a/generate-executable-jar.ps1 b/generate-executable-jar.ps1 deleted file mode 100644 index 899493a..0000000 --- a/generate-executable-jar.ps1 +++ /dev/null @@ -1 +0,0 @@ -docker run --rm -it --name PowerDeComposer -v ${PWD}/PowerDeComposer:/usr/src/mymaven -v ${PWD}/.m2/:/usr/share/maven/ref -w /usr/src/mymaven maven:3.8.6-openjdk-11 mvn clean package assembly:single -PexecutableJar \ No newline at end of file