Skip to content

Commit

Permalink
Preparing a release script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Jitianu committed Aug 18, 2017
1 parent 415c08d commit 7e89a1a
Show file tree
Hide file tree
Showing 11 changed files with 219 additions and 37 deletions.
24 changes: 24 additions & 0 deletions assembly-framework.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

<!-- This is an assembly file used for all the sample plugins. -->

<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>framework</id>
<formats>
<format>zip</format>
</formats>

<fileSets>
<fileSet>
<directory>frameworks/xspec</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</fileSets>


</assembly>
14 changes: 0 additions & 14 deletions frameworks/xspec/oxygen-results-view/unit-report-oxygen.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
xmlns:pkg="http://expath.org/ns/pkg"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:local="http://oxygenxml.com/local"
exclude-result-prefixes="x xs test pkg xhtml fn xsl">

<xsl:param name="report-css-uri" select="
Expand All @@ -24,18 +23,6 @@

<xsl:import href="../src/reporter/format-utils.xsl"/>

<!--
Oxygen Patch START
Exclude all prefixes.
TODO Which prefixes to we actually need excluding????
-->
<xsl:include href="id-generation.xsl"/>
<!-- Oxygen Patch END -->


<!--
Expand Down Expand Up @@ -97,7 +84,6 @@

<xsl:variable name="id" select="generate-id()"/>
<div class="testcase" data-name="{xs:string(x:label/text())}">
<xsl:attribute name="template-id" select="@template-id"/>
<xsl:variable name="status">
<xsl:choose>
<xsl:when test="@pending">skipped</xsl:when>
Expand Down
42 changes: 42 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,50 @@
</descriptors>
</configuration>
</execution>
<execution>
<id>make-framework-package</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archiveBaseDirectory>${project.basedir}</archiveBaseDirectory>
<descriptors>
<descriptor>assembly-framework.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>


<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-resources</id>
<!-- here the phase you need -->
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}</directory>
<includes>
<include>update_site.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.ImageIcon;
import javax.swing.JComponent;

import com.oxygenxml.xspec.XSpecUtil.OperationCanceledException;
Expand Down Expand Up @@ -38,6 +39,8 @@ public void customizeView(ViewInfo viewInfo) {
if (viewInfo.getViewID().equals(XSpecResultsView.RESULTS)) {
viewInfo.setComponent(resultsPresenter);
viewInfo.setTitle("XSpec Test Results");
ImageIcon ic = new ImageIcon(getClass().getClassLoader().getResource("failures.gif"));
viewInfo.setIcon(ic);
}
}
});
Expand Down
31 changes: 19 additions & 12 deletions src/test/java/com/oxygenxml/xspec/jfx/XSpecMetaTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public void testRunScenario_Passed() throws Exception {
" date=\"XXX\">\n" +
// The source attribute is present.
// To ensure back mapping we need to remember in which file a scenario was defined.
" <x:scenario source=\"" + xspecURL.toString() + "\">\n" +
" <x:scenario source=\"" + xspecURL.toString() + "\"\n" +
" template-id=\"x98729d4e-69c1-3033-bf4b-b060a2d27b46\">\n" +
" <x:label>No escaping</x:label>\n" +
" <x:call function=\"functx:escape-for-regex\">\n" +
" <x:param select=\"'Hello'\"/>\n" +
Expand Down Expand Up @@ -70,7 +71,7 @@ public void testRunScenario_Passed() throws Exception {
+ "\"><script type=\"text/javascript\" src=\""
+ js.toURI().toURL().toString() + "\"></script></head>\n" +
" <body>\n" +
" <div class=\"testsuite\" data-name=\"No escaping\" "
" <div class=\"testsuite\" data-name=\"No escaping\" template-id=\"x98729d4e-69c1-3033-bf4b-b060a2d27b46\" "

+ "data-source=\"" + xspecURL.toString() + "\" "
+ "data-tests=\"1\" "
Expand Down Expand Up @@ -110,7 +111,8 @@ public void testRunScenario_Failed() throws Exception {
" xmlns:functx=\"http://www.functx.com\"\n" +
" stylesheet=\"" + xslURL.toString() + "\"\n" +
" date=\"XXX\">\n" +
" <x:scenario source=\"" + xspecFile.toURI().toURL().toString() + "\">\n" +
" <x:scenario source=\"" + xspecFile.toURI().toURL().toString() + "\"\n" +
" template-id=\"xcf3714bf-337b-3d28-9db1-cce1e8d7a11d\">\n" +
" <x:label>When processing a list of phrases</x:label>\n" +
" <x:context>\n" +
" <phrases>\n" +
Expand Down Expand Up @@ -143,7 +145,8 @@ public void testRunScenario_Failed() throws Exception {
" </x:scenario>\n" +
// The source attribute is present.
// To ensure back mapping we need to remember in which file a scenario was defined.
" <x:scenario source=\"" + importedXSpecURL.toString() + "\">\n" +
" <x:scenario source=\"" + importedXSpecURL.toString() + "\"\n" +
" template-id=\"xdf4d3bc9-c326-3719-8163-46ff873a00b8\">\n" +
" <x:label>No escaping</x:label>\n" +
" <x:call function=\"functx:escape-for-regex\">\n" +
" <x:param select=\"'Hello'\"/>\n" +
Expand Down Expand Up @@ -174,7 +177,7 @@ public void testRunScenario_Failed() throws Exception {
" <body>\n" +
" <div class=\"testsuite\" "
// Scenario name
+ "data-name=\"When processing a list of phrases\" "
+ "data-name=\"When processing a list of phrases\" template-id=\"xcf3714bf-337b-3d28-9db1-cce1e8d7a11d\" "
// Scenario source
+ "data-source=\"" + xspecFile.toURI().toURL().toString() + "\" data-tests=\"2\" data-failures=\"1\">\n" +
" <p style=\"margin:0px;\"><span>When processing a list of phrases</span><span>&nbsp;</span><a class=\"button\" onclick=\"runScenario(this)\">Run</a></p>\n" +
Expand Down Expand Up @@ -234,7 +237,7 @@ public void testRunScenario_Failed() throws Exception {
"</phrases>\n" +
"</div></pre></div>\n" +
" </div>\n" +
" <div class=\"testsuite\" data-name=\"No escaping\" data-source=\"file:/C:/Users/alex_jitianu/Documents/Git-workspace/oXygen-XML-editor-xspec-plugin/target/test-classes/meta/escape-for-regex.xspec\" data-tests=\"1\" data-failures=\"0\">\n" +
" <div class=\"testsuite\" data-name=\"No escaping\" template-id=\"xdf4d3bc9-c326-3719-8163-46ff873a00b8\" data-source=\"file:/C:/Users/alex_jitianu/Documents/Git-workspace/oXygen-XML-editor-xspec-plugin/target/test-classes/meta/escape-for-regex.xspec\" data-tests=\"1\" data-failures=\"0\">\n" +
" <p style=\"margin:0px;\"><span>No escaping</span><span>&nbsp;</span><a class=\"button\" onclick=\"runScenario(this)\">Run</a></p>\n" +
" <div class=\"testcase\" data-name=\"Must not be escaped at all\">\n" +
" <p class=\"passed\"><span class=\"test-passed\" onclick=\"toggleResult(this)\">Must not be escaped at all</span><span>&nbsp;</span><a class=\"button\" onclick=\"showTest(this)\">Show</a></p>\n" +
Expand Down Expand Up @@ -268,7 +271,8 @@ public void testRunSpecificScenarios_1() throws Exception {
" xmlns:functx=\"http://www.functx.com\"\n" +
" stylesheet=\"" + xslURL.toString() + "\"\n" +
" date=\"XXX\">\n" +
" <x:scenario source=\"" + xspecURL.toString() + "\">\n" +
" <x:scenario source=\"" + xspecURL.toString() + "\"\n" +
" template-id=\"xd756eeb0-86de-39c7-b405-7d53298b0633\">\n" +
" <x:label>Test no.1</x:label>\n" +
" <x:call function=\"functx:escape-for-regex\">\n" +
" <x:param select=\"'Hello'\"/>\n" +
Expand All @@ -279,7 +283,8 @@ public void testRunSpecificScenarios_1() throws Exception {
" <x:expect select=\"'Hello'\"/>\n" +
" </x:test>\n" +
" </x:scenario>\n" +
" <x:scenario source=\"" + xspecURL.toString() + "\">\n" +
" <x:scenario source=\"" + xspecURL.toString() + "\"\n" +
" template-id=\"x42dcc336-c523-3a81-8407-c1cf465dac0f\">\n" +
" <x:label>Test no.2</x:label>\n" +
" <x:call function=\"functx:escape-for-regex\">\n" +
" <x:param select=\"'(Hello)'\"/>\n" +
Expand All @@ -306,14 +311,14 @@ public void testRunSpecificScenarios_1() throws Exception {
" <link rel=\"stylesheet\" type=\"text/css\" href=\"" + css.toURI().toURL().toString() + "\"><script type=\"text/javascript\" src=\"" + js.toURI().toURL().toString()
+ "\"></script></head>\n" +
" <body>\n" +
" <div class=\"testsuite\" data-name=\"Test no.1\" data-source=\"" + xspecURL.toString()
" <div class=\"testsuite\" data-name=\"Test no.1\" template-id=\"xd756eeb0-86de-39c7-b405-7d53298b0633\" data-source=\"" + xspecURL.toString()
+ "\" data-tests=\"1\" data-failures=\"0\">\n" +
" <p style=\"margin:0px;\"><span>Test no.1</span><span>&nbsp;</span><a class=\"button\" onclick=\"runScenario(this)\">Run</a></p>\n" +
" <div class=\"testcase\" data-name=\"Must not be escaped at all\">\n" +
" <p class=\"passed\"><span class=\"test-passed\" onclick=\"toggleResult(this)\">Must not be escaped at all</span><span>&nbsp;</span><a class=\"button\" onclick=\"showTest(this)\">Show</a></p>\n" +
" </div>\n" +
" </div>\n" +
" <div class=\"testsuite\" data-name=\"Test no.2\" data-source=\"" + xspecURL.toString()
" <div class=\"testsuite\" data-name=\"Test no.2\" template-id=\"x42dcc336-c523-3a81-8407-c1cf465dac0f\" data-source=\"" + xspecURL.toString()
+ "\" data-tests=\"1\" data-failures=\"0\">\n" +
" <p style=\"margin:0px;\"><span>Test no.2</span><span>&nbsp;</span><a class=\"button\" onclick=\"runScenario(this)\">Run</a></p>\n" +
" <div class=\"testcase\" data-name=\"Must not be escaped at all\">\n" +
Expand Down Expand Up @@ -361,7 +366,8 @@ public void testRunSpecificScenarios_2() throws Exception {
" xmlns:x=\"http://www.jenitennison.com/xslt/xspec\">\n" +
" <x:scenario xmlns:test=\"http://www.jenitennison.com/xslt/unit-test\"\n" +
" xmlns:functx=\"http://www.functx.com\"\n" +
" source=\"" + xspecURL.toString() + "\">\n" +
" source=\"" + xspecURL.toString() + "\"\n" +
" template-id=\"xd756eeb0-86de-39c7-b405-7d53298b0633\">\n" +
" <x:label>Test no.1</x:label>\n" +
" <x:call function=\"functx:escape-for-regex\">\n" +
" <x:param select=\"'Hello'\"/>\n" +
Expand All @@ -374,7 +380,8 @@ public void testRunSpecificScenarios_2() throws Exception {
" </x:scenario>\n" +
" <x:scenario xmlns:test=\"http://www.jenitennison.com/xslt/unit-test\"\n" +
" xmlns:functx=\"http://www.functx.com\"\n" +
" source=\"" + xspecURL.toString() + "\">\n" +
" source=\"" + xspecURL.toString() + "\"\n" +
" template-id=\"x42dcc336-c523-3a81-8407-c1cf465dac0f\">\n" +
" <x:label>Test no.2</x:label>\n" +
" <x:call function=\"functx:escape-for-regex\">\n" +
" <x:param select=\"'(Hello)'\"/>\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ public void run() {
waitForFX();

StringBuilder expected = new StringBuilder();
expected.append(XSpecUtil.generateId("No escaping bad")).append(" ")
.append(XSpecUtil.generateId("When processing a list of phrases"));
expected.append(XSpecUtil.generateId(" / No escaping bad(0)")).append(" ")
.append(XSpecUtil.generateId(" / When processing a list of phrases(2)"));
assertEquals(expected.toString(), b.toString());
}

Expand Down
18 changes: 9 additions & 9 deletions src/test/resources/runFailed/escape-for-regex-report.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<html xmlns:test="http://www.jenitennison.com/xslt/unit-test">
<html xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns:local="http://oxygenxml.com/local">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="file:/C:/Users/alex_jitianu/Documents/Git-workspace/oXygen-XML-editor-xspec-plugin/frameworks/xspec/oxygen-results-view/test-report.css"><script type="text/javascript" src="file:/C:/Users/alex_jitianu/Documents/Git-workspace/oXygen-XML-editor-xspec-plugin/frameworks/xspec/oxygen-results-view/test-report.js"></script></head>
<body>
<div class="testsuite" data-name="No escaping bad" data-source="file:/D:/projects/eXml/samples/xspec/escape-for-regex.xspec" data-tests="1" data-failures="1">
<div class="testsuite" data-name="No escaping bad" template-id="x0ddb55c8-52da-3621-92c5-abfdf2f860d4" data-source="file:/C:/Users/alex_jitianu/Documents/Git-workspace/oXygen-XML-editor-xspec-plugin/src/test/resources/runFailed/escape-for-regex.xspec" data-tests="1" data-failures="1">
<p style="margin:0px;"><span>No escaping bad</span><span>&nbsp;</span><a class="button" onclick="runScenario(this)">Run</a></p>
<div class="testcase" data-name="Must not be escaped at all">
<div class="testcase" data-name="Must not be escaped at all" template-id="">
<p class="failed"><span class="test-failed" onclick="toggleResult(this)">Must not be escaped at all</span><span>&nbsp;</span><a class="button" onclick="showTest(this)">Show</a><span>&nbsp;</span><a class="button" onclick="toggleResult(this)">Q-Diff</a><span>&nbsp;</span><a class="button" onclick="showDiff(this)">Diff</a></p>
<div class="failure" id="d3e16" style="display:none;">
<div class="failure" id="d4e16" style="display:none;">
<table class="xspecResult">
<thead>
<tr>
Expand All @@ -24,18 +24,18 @@
</table>
</div><pre class="embeded.diff.data" style="display:none;"><div class="embeded.diff.result" style="white-space:pre;"></div><div class="embeded.diff.expected" style="white-space:pre;"></div></pre></div>
</div>
<div class="testsuite" data-name="No escaping" data-source="file:/D:/projects/eXml/samples/xspec/escape-for-regex.xspec" data-tests="1" data-failures="0">
<div class="testsuite" data-name="No escaping" template-id="xdf4d3bc9-c326-3719-8163-46ff873a00b8" data-source="file:/C:/Users/alex_jitianu/Documents/Git-workspace/oXygen-XML-editor-xspec-plugin/src/test/resources/runFailed/escape-for-regex.xspec" data-tests="1" data-failures="0">
<p style="margin:0px;"><span>No escaping</span><span>&nbsp;</span><a class="button" onclick="runScenario(this)">Run</a></p>
<div class="testcase" data-name="Must not be escaped at all">
<div class="testcase" data-name="Must not be escaped at all" template-id="">
<p class="passed"><span class="test-passed" onclick="toggleResult(this)">Must not be escaped at all</span><span>&nbsp;</span><a class="button" onclick="showTest(this)">Show</a></p>
</div>
</div>
<div class="testsuite" data-name="When processing a list of phrases" data-source="file:/D:/projects/eXml/samples/xspec/escape-for-regex.xspec" data-tests="1" data-failures="1">
<div class="testsuite" data-name="When processing a list of phrases" template-id="x519f87e9-a7f0-3d6e-a258-ce66109169f5" data-source="file:/C:/Users/alex_jitianu/Documents/Git-workspace/oXygen-XML-editor-xspec-plugin/src/test/resources/runFailed/escape-for-regex.xspec" data-tests="1" data-failures="1">
<p style="margin:0px;"><span>When processing a list of phrases</span><span>&nbsp;</span><a class="button" onclick="runScenario(this)">Run</a></p>
<div class="testcase" data-name="Strings should be escaped and status attributes should be added. The 'status' attribute are not as expected, indicating a problem in the tested template.">
<div class="testcase" data-name="Strings should be escaped and status attributes should be added. The 'status' attribute are not as expected, indicating a problem in the tested template." template-id="">
<p class="failed"><span class="test-failed" onclick="toggleResult(this)">Strings should be escaped and status attributes should be added. The 'status' attribute
are not as expected, indicating a problem in the tested template.</span><span>&nbsp;</span><a class="button" onclick="showTest(this)">Show</a><span>&nbsp;</span><a class="button" onclick="toggleResult(this)">Q-Diff</a><span>&nbsp;</span><a class="button" onclick="showDiff(this)">Diff</a></p>
<div class="failure" id="d3e81" style="display:none;">
<div class="failure" id="d4e81" style="display:none;">
<table class="xspecResult">
<thead>
<tr>
Expand Down
48 changes: 48 additions & 0 deletions src/test/resources/runFailed/escape-for-regex.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:functx="http://www.functx.com" xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs" version="2.0">

<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
<desc>The <b>functx:escape-for-regex</b> function escapes a string that you wish to be taken
literally rather than treated like a regular expression. This is useful when, for
example, you are calling the built-in fn:replace function and you want any periods or
parentheses to be treated like literal characters rather than regex special characters.
From: <a href="http://www.xsltfunctions.com/xsl/functx_escape-for-regex.html"
>http://www.xsltfunctions.com/xsl/functx_escape-for-regex.html</a></desc>
</doc>
<xsl:function name="functx:escape-for-regex" as="xs:string">
<xsl:param name="arg" as="xs:string?"/>

<xsl:sequence
select="
replace($arg,
'(\.|\[|\]|\\|\||\-|\^|\$|\?|\*|\+|\{|\}|\(|\))','\\$1')
"
/>
</xsl:function>


<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
<desc>Escapes regexes in a list of phrases.</desc>
</doc>
<xsl:template match="phrases">
<phrases>
<xsl:apply-templates select="phrase"/>
</phrases>
</xsl:template>

<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
<desc>Escaped the regexp from a phrase and marks the altered phrases with a <b>status</b>
attribute. <p><b>Note:</b> The template has an intentional error in evaluating the value
of attribute *status*. This error will be caught in an XSLT Unit Test.</p>
</desc>
</doc>
<xsl:template match="phrase">
<xsl:variable name="escaped-text" select="functx:escape-for-regex(.)"/>
<phrase status="{if (. = $escaped-text) then 'changed' else 'same'}">
<xsl:value-of select="functx:escape-for-regex(.)"/>
</phrase>
</xsl:template>

</xsl:stylesheet>
4 changes: 4 additions & 0 deletions travis/checkForTag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if [[ ! -z ${TRAVIS_TAG} ]]
then mvn versions:set -DnewVersion="${TRAVIS_TAG}";
echo "The tag is -------------------------------- ${TRAVIS_TAG}";
fi
Loading

0 comments on commit 7e89a1a

Please sign in to comment.