[javapackages] Fix maven_depmap test_packaging_pom_no_jar, second try
by Mikolaj Izdebski
commit e61f874d6d181d01e82c4e22f2ed180c733a3cb7
Author: Mikolaj Izdebski <mizdebsk(a)redhat.com>
Date: Wed Oct 2 15:45:04 2013 +0200
Fix maven_depmap test_packaging_pom_no_jar, second try
For POM artifacts both <maven> and <jpp> parts should contain
extension "pom".
.../test_packaging_pom_no_jar-want.xml | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/test/data/maven_depmap/test_packaging_pom_no_jar-want.xml b/test/data/maven_depmap/test_packaging_pom_no_jar-want.xml
index 33f5ce8..0d05fcd 100644
--- a/test/data/maven_depmap/test_packaging_pom_no_jar-want.xml
+++ b/test/data/maven_depmap/test_packaging_pom_no_jar-want.xml
@@ -10,6 +10,7 @@
<jpp>
<artifactId>apache-commons-io</artifactId>
<groupId>JPP</groupId>
+ <extension>pom</extension>
</jpp>
</dependency>
</dependencyMap>
10 years, 6 months
[javapackages] Fix maven_depmap test_packaging_pom_no_jar
by Mikolaj Izdebski
commit 0deef500d58bf5dfec061c88ef579f47d0b79bd6
Author: Mikolaj Izdebski <mizdebsk(a)redhat.com>
Date: Wed Oct 2 15:38:37 2013 +0200
Fix maven_depmap test_packaging_pom_no_jar
For POM artifacts <maven> part should contain extension "pom".
.../test_packaging_pom_no_jar-want.xml | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/test/data/maven_depmap/test_packaging_pom_no_jar-want.xml b/test/data/maven_depmap/test_packaging_pom_no_jar-want.xml
index 6860958..33f5ce8 100644
--- a/test/data/maven_depmap/test_packaging_pom_no_jar-want.xml
+++ b/test/data/maven_depmap/test_packaging_pom_no_jar-want.xml
@@ -5,6 +5,7 @@
<artifactId>commons-io</artifactId>
<groupId>commons-io</groupId>
<version>2</version>
+ <extension>pom</extension>
</maven>
<jpp>
<artifactId>apache-commons-io</artifactId>
10 years, 6 months
[javapackages] Add maven_depmap test case for CDATA elements
by Mikolaj Izdebski
commit 37aef4e9deaab454e91167ea3caed63e9ec4c0bc
Author: Mikolaj Izdebski <mizdebsk(a)redhat.com>
Date: Wed Oct 2 15:36:36 2013 +0200
Add maven_depmap test case for CDATA elements
test/data/maven_depmap/JPP-cdata.pom | 16 ++++++++++++++++
test/data/maven_depmap/test_cdata-want.xml | 14 ++++++++++++++
test/maven_depmap_test.py | 6 ++++++
3 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/test/data/maven_depmap/JPP-cdata.pom b/test/data/maven_depmap/JPP-cdata.pom
new file mode 100644
index 0000000..7d7e39a
--- /dev/null
+++ b/test/data/maven_depmap/JPP-cdata.pom
@@ -0,0 +1,16 @@
+<project
+
+>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId> g<![CDATA[r]]>ou<!--
+-->p
+</groupId>
+ <artifactId> ar<![CDATA[ti]]>fa<!--
+-->ct
+</artifactId>
+<packaging>
+ <![CDATA[p]]>o<!--
+-->m
+</packaging>
+ <version>1<![CDATA[.]]>2<![CDATA[.]]><!--4<![CDATA[.]]>-->3</version>
+</project>
diff --git a/test/data/maven_depmap/test_cdata-want.xml b/test/data/maven_depmap/test_cdata-want.xml
new file mode 100644
index 0000000..fd1fda2
--- /dev/null
+++ b/test/data/maven_depmap/test_cdata-want.xml
@@ -0,0 +1,14 @@
+<dependencyMap>
+ <dependency>
+ <maven>
+ <groupId>group</groupId>
+ <artifactId>artifact</artifactId>
+ <extension>artifact</extension>
+ <version>1.2.3</version>
+ </maven>
+ <jpp>
+ <groupId>JPP</groupId>
+ <artifactId>commons-war</artifactId>
+ </jpp>
+ </dependency>
+</dependencyMap>
diff --git a/test/maven_depmap_test.py b/test/maven_depmap_test.py
index 4807659..b4c61d5 100644
--- a/test/maven_depmap_test.py
+++ b/test/maven_depmap_test.py
@@ -297,6 +297,12 @@ class TestMavenDepmap(unittest.TestCase):
got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
depmap)
self.assertEqual(report, [])
+
+ @mvn_depmap('JPP-cdata.pom')
+ def test_cdata(self, stdout, stderr, return_value, depmap):
+ self.assertEqual(return_value, 0, stderr)
+ got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+ depmap)
self.assertEqual(res, True)
10 years, 6 months
[javapackages] More tests for maven_depmap.py
by Michael Šimáček
commit 611acb674d8f396d37d81f668e1c3e1b24abe4a5
Author: Michael Simacek <msimacek(a)redhat.com>
Date: Wed Oct 2 13:26:03 2013 +0200
More tests for maven_depmap.py
test/data/maven_depmap/FUU-commons-io.pom | 19 +++
test/data/maven_depmap/test_classifier-want.xml | 30 +++++
test/data/maven_depmap/test_group_id-want.xml | 14 +++
test/data/maven_depmap/test_version-want.xml | 52 +++++++++
.../data/maven_depmap/test_version_append-want.xml | 100 +++++++++++++++++
.../maven_depmap/test_version_namespace-want.xml | 116 ++++++++++++++++++++
test/maven_depmap_test.py | 94 +++++++++++++++-
7 files changed, 419 insertions(+), 6 deletions(-)
---
diff --git a/test/data/maven_depmap/FUU-commons-io.pom b/test/data/maven_depmap/FUU-commons-io.pom
new file mode 100644
index 0000000..ecf5e13
--- /dev/null
+++ b/test/data/maven_depmap/FUU-commons-io.pom
@@ -0,0 +1,19 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-parent</artifactId>
+ <version>17</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <name>Commons Lang</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>G</groupId>
+ <artifactId>G</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/test/data/maven_depmap/test_classifier-want.xml b/test/data/maven_depmap/test_classifier-want.xml
new file mode 100644
index 0000000..986e054
--- /dev/null
+++ b/test/data/maven_depmap/test_classifier-want.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" ?>
+<dependencyMap>
+ <dependency>
+ <maven>
+ <artifactId>y</artifactId>
+ <groupId>x</groupId>
+ <version>0.1</version>
+ <classifier>z</classifier>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <classifier>z</classifier>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>b</artifactId>
+ <groupId>a</groupId>
+ <extension>war</extension>
+ <version>12</version>
+ <classifier>c</classifier>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <classifier>z</classifier>
+ </jpp>
+ </dependency>
+</dependencyMap>
diff --git a/test/data/maven_depmap/test_group_id-want.xml b/test/data/maven_depmap/test_group_id-want.xml
new file mode 100644
index 0000000..30d906e
--- /dev/null
+++ b/test/data/maven_depmap/test_group_id-want.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" ?>
+<dependencyMap>
+ <dependency>
+ <maven>
+ <artifactId>y</artifactId>
+ <groupId>x</groupId>
+ <version>1</version>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP/commons-io</groupId>
+ </jpp>
+ </dependency>
+</dependencyMap>
diff --git a/test/data/maven_depmap/test_version-want.xml b/test/data/maven_depmap/test_version-want.xml
new file mode 100644
index 0000000..1626eef
--- /dev/null
+++ b/test/data/maven_depmap/test_version-want.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" ?>
+<dependencyMap>
+ <skipProvides/>
+ <dependency>
+ <maven>
+ <artifactId>y</artifactId>
+ <groupId>x</groupId>
+ <version>0.1</version>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>0.1</version>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>y</artifactId>
+ <groupId>x</groupId>
+ <version>0.1</version>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>1</version>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>y</artifactId>
+ <groupId>x</groupId>
+ <version>0.1</version>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>2</version>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>y</artifactId>
+ <groupId>x</groupId>
+ <version>0.1</version>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>3</version>
+ </jpp>
+ </dependency>
+</dependencyMap>
diff --git a/test/data/maven_depmap/test_version_append-want.xml b/test/data/maven_depmap/test_version_append-want.xml
new file mode 100644
index 0000000..93327c8
--- /dev/null
+++ b/test/data/maven_depmap/test_version_append-want.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" ?>
+<dependencyMap>
+ <skipProvides/>
+ <dependency>
+ <maven>
+ <artifactId>y</artifactId>
+ <groupId>x</groupId>
+ <version>0.1</version>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>0.1</version>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>b</artifactId>
+ <groupId>a</groupId>
+ <version>32</version>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>0.1</version>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>y</artifactId>
+ <groupId>x</groupId>
+ <version>0.1</version>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>1</version>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>b</artifactId>
+ <groupId>a</groupId>
+ <version>32</version>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>1</version>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>y</artifactId>
+ <groupId>x</groupId>
+ <version>0.1</version>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>2</version>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>b</artifactId>
+ <groupId>a</groupId>
+ <version>32</version>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>2</version>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>y</artifactId>
+ <groupId>x</groupId>
+ <version>0.1</version>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>3</version>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>b</artifactId>
+ <groupId>a</groupId>
+ <version>32</version>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>3</version>
+ </jpp>
+ </dependency>
+</dependencyMap>
diff --git a/test/data/maven_depmap/test_version_namespace-want.xml b/test/data/maven_depmap/test_version_namespace-want.xml
new file mode 100644
index 0000000..b700445
--- /dev/null
+++ b/test/data/maven_depmap/test_version_namespace-want.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0" ?>
+<dependencyMap>
+ <skipProvides/>
+ <dependency>
+ <maven>
+ <artifactId>y</artifactId>
+ <groupId>x</groupId>
+ <version>0.1</version>
+ <namespace>ns</namespace>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>0.1</version>
+ <namespace>ns</namespace>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>b</artifactId>
+ <groupId>a</groupId>
+ <version>32</version>
+ <namespace>ns</namespace>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>0.1</version>
+ <namespace>ns</namespace>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>y</artifactId>
+ <groupId>x</groupId>
+ <version>0.1</version>
+ <namespace>ns</namespace>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>1</version>
+ <namespace>ns</namespace>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>b</artifactId>
+ <groupId>a</groupId>
+ <version>32</version>
+ <namespace>ns</namespace>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>1</version>
+ <namespace>ns</namespace>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>y</artifactId>
+ <groupId>x</groupId>
+ <version>0.1</version>
+ <namespace>ns</namespace>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>2</version>
+ <namespace>ns</namespace>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>b</artifactId>
+ <groupId>a</groupId>
+ <version>32</version>
+ <namespace>ns</namespace>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>2</version>
+ <namespace>ns</namespace>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>y</artifactId>
+ <groupId>x</groupId>
+ <version>0.1</version>
+ <namespace>ns</namespace>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>3</version>
+ <namespace>ns</namespace>
+ </jpp>
+ </dependency>
+ <dependency>
+ <maven>
+ <artifactId>b</artifactId>
+ <groupId>a</groupId>
+ <version>32</version>
+ <namespace>ns</namespace>
+ </maven>
+ <jpp>
+ <artifactId>commons-io</artifactId>
+ <groupId>JPP</groupId>
+ <version>3</version>
+ <namespace>ns</namespace>
+ </jpp>
+ </dependency>
+</dependencyMap>
diff --git a/test/maven_depmap_test.py b/test/maven_depmap_test.py
index f2ecfc8..4807659 100644
--- a/test/maven_depmap_test.py
+++ b/test/maven_depmap_test.py
@@ -78,7 +78,7 @@ class TestMavenDepmap(unittest.TestCase):
@mvn_depmap('JPP-commons-io.pom')
def test_missing_jar_arg(self, stdout, stderr, return_value, depmap):
- self.assertEqual(return_value, 1, stderr)
+ self.assertNotEqual(return_value, 0)
@mvn_depmap('JPP-apache-commons-io.pom')
def test_packaging_pom_no_jar(self, stdout, stderr, return_value, depmap):
@@ -90,7 +90,7 @@ class TestMavenDepmap(unittest.TestCase):
@mvn_depmap('JPP-noversion.pom')
def test_missing_version(self, stdout, stderr, return_value, depmap):
- self.assertEqual(return_value, 1, stderr)
+ self.assertNotEqual(return_value, 0)
@mvn_depmap('JPP-commons-war.pom', 'usr/share/java/commons-war.war')
def test_war(self, stdout, stderr, return_value, depmap):
@@ -124,13 +124,32 @@ class TestMavenDepmap(unittest.TestCase):
self.assertEqual(report, [])
self.assertEqual(res, True)
- @mvn_depmap('JPP-commons-io-commons-io.pom', '/usr/share/java/commons-io.jar')
+ @mvn_depmap('JPP-commons-io-commons-io.pom', 'usr/share/java/commons-io.jar')
def test_incorrect_subdir1(self, stdout, stderr, return_value, depmap):
- self.assertEqual(return_value, 1, stderr)
+ self.assertNotEqual(return_value, 0)
- @mvn_depmap('JPP-commons-io.pom', '/usr/share/java/commons-io/commons-io.jar')
+ @mvn_depmap('JPP-commons-io.pom', 'usr/share/java/commons-io/commons-io.jar')
def test_incorrect_subdir2(self, stdout, stderr, return_value, depmap):
- self.assertEqual(return_value, 1, stderr)
+ self.assertNotEqual(return_value, 0)
+
+ @mvn_depmap('FUU-commons-io.pom', 'usr/share/java/commons-io.jar')
+ def test_not_JPP(self, stdout, stderr, return_value, depmap):
+ self.assertNotEqual(return_value, 0)
+
+ def test_not_pom(self):
+ stdout, stderr, return_value = call_script(os.path.join(dirpath, '..', 'java-utils', 'maven_depmap.py'),
+ ['.out', 'usr/share/java/commons-io.jar', 'usr/share/java/commons-io.jar'])
+ self.assertNotEqual(return_value, 0)
+
+ def test_no_pom(self):
+ stdout, stderr, return_value = call_script(os.path.join(dirpath, '..', 'java-utils', 'maven_depmap.py'),
+ ['.out'])
+ self.assertNotEqual(return_value, 0)
+
+ def test_no_args(self):
+ stdout, stderr, return_value = call_script(os.path.join(dirpath, '..', 'java-utils', 'maven_depmap.py'),
+ [])
+ self.assertNotEqual(return_value, 0)
@mvn_depmap('a:b:12', 'usr/share/java/commons-io.jar')
def test_mvn_spec(self, stdout, stderr, return_value, depmap):
@@ -217,6 +236,69 @@ class TestMavenDepmap(unittest.TestCase):
'usr/share/java/already-has-pom-properties.jar')
self.assertEqual(got, want)
+ @mvn_depmap('x:y:jar:z:0.1', 'usr/share/java/commons-io-z.jar', ['-a', 'a:b:war:c:12'])
+ def test_classifier(self, stdout, stderr, return_value, depmap):
+ self.assertEqual(return_value, 0, stderr)
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
+ depmap)
+ self.assertEqual(report, [])
+ self.assertEqual(res, True)
+
+ @mvn_depmap('x:y:0.1', 'usr/share/java/commons-io.jar', ['-r', '1,2,3'])
+ def test_version(self, stdout, stderr, return_value, depmap):
+ self.assertEqual(return_value, 0, stderr)
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
+ depmap)
+ self.assertEqual(report, [])
+ self.assertEqual(res, True)
+
+ @mvn_depmap('JPP/x:y:0.1', 'usr/share/java/commons-io.jar', ['--versions', '1,2,3'])
+ def test_version2(self, stdout, stderr, return_value, depmap):
+ self.assertEqual(return_value, 0, stderr)
+ got, want, res, report = self.check_result('test_version', depmap)
+ self.assertEqual(report, [])
+ self.assertEqual(res, True)
+
+ @mvn_depmap('x:y:0.1', 'usr/share/java/commons-io.jar', ['-r', '1,2,3', '-a', 'a:b:32'])
+ def test_version_append(self, stdout, stderr, return_value, depmap):
+ self.assertEqual(return_value, 0, stderr)
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
+ depmap)
+ self.assertEqual(report, [])
+ self.assertEqual(res, True)
+
+ @mvn_depmap('x:y:0.1', 'usr/share/java/commons-io.jar', ['-r', '1,2,3', '-n', 'ns', '-a', 'a:b:32'])
+ def test_version_namespace(self, stdout, stderr, return_value, depmap):
+ self.assertEqual(return_value, 0, stderr)
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
+ depmap)
+ self.assertEqual(report, [])
+ self.assertEqual(res, True)
+
+ @mvn_depmap('x:y', 'usr/share/java/commons-io.jar')
+ def test_missing_version2(self, stdout, stderr, return_value, depmap):
+ self.assertNotEqual(return_value, 0)
+
+ @mvn_depmap('x:y:war:1', 'usr/share/java/commons-io.jar')
+ def test_incorrect_extension(self, stdout, stderr, return_value, depmap):
+ self.assertNotEqual(return_value, 0)
+
+ @mvn_depmap('evil:', 'usr/share/java/commons-io.jar')
+ def test_incorrect_artifact(self, stdout, stderr, return_value, depmap):
+ self.assertNotEqual(return_value, 0)
+
+ @mvn_depmap('x:y::classfier:1', 'usr/share/java/commons-io.war')
+ def test_incorrect_classifier(self, stdout, stderr, return_value, depmap):
+ self.assertNotEqual(return_value, 0)
+
+ @mvn_depmap('x:y:1', 'usr/share/java/commons-io/commons-io.jar')
+ def test_group_id(self, stdout, stderr, return_value, depmap):
+ self.assertEqual(return_value, 0, stderr)
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
+ depmap)
+ self.assertEqual(report, [])
+ self.assertEqual(res, True)
+
if __name__ == '__main__':
unittest.main()
10 years, 6 months
[javapackages] XML comparison output is not interleaved with test output
by Michael Šimáček
commit da48e5cf6ec1449443138716f23c78eab36b69ab
Author: Michael Simacek <msimacek(a)redhat.com>
Date: Wed Oct 2 10:23:46 2013 +0200
XML comparison output is not interleaved with test output
test/maven_depmap_test.py | 53 ++++++++++++++++++++++++++++-----------------
1 files changed, 33 insertions(+), 20 deletions(-)
---
diff --git a/test/maven_depmap_test.py b/test/maven_depmap_test.py
index 7a31f91..f2ecfc8 100644
--- a/test/maven_depmap_test.py
+++ b/test/maven_depmap_test.py
@@ -33,15 +33,13 @@ class TestMavenDepmap(unittest.TestCase):
except OSError:
pass
- def xml_compare_reporter(self, report):
- print report
-
def check_result(self, test_name, depmap):
got = etree.fromstring(depmap)
want = etree.parse(os.path.join(self.workdir,
test_name+"-want.xml")).getroot()
- res = doctest_xml_compare.xml_compare(got, want, self.xml_compare_reporter)
- return got, want, res
+ report = []
+ res = doctest_xml_compare.xml_compare(got, want, lambda x: report.append(x))
+ return got, want, res, report
def check_archive(self, test_name, archive_path, keep_comments=False):
with ZipFile(archive_path, 'r') as got:
@@ -65,15 +63,17 @@ class TestMavenDepmap(unittest.TestCase):
@mvn_depmap('JPP-bndlib.pom', 'usr/share/java/bndlib.jar')
def test_basic(self, stdout, stderr, return_value, depmap):
self.assertEqual(return_value, 0)
- got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
depmap)
+ self.assertEqual(report, [])
self.assertEqual(res, True)
@mvn_depmap('JPP-aqute-bndlib.pom', 'usr/share/java/aqute-bndlib.jar')
def test_different_artifactId(self, stdout, stderr, return_value, depmap):
self.assertEqual(return_value, 0)
- got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
depmap)
+ self.assertEqual(report, [])
self.assertEqual(res, True)
@mvn_depmap('JPP-commons-io.pom')
@@ -83,8 +83,9 @@ class TestMavenDepmap(unittest.TestCase):
@mvn_depmap('JPP-apache-commons-io.pom')
def test_packaging_pom_no_jar(self, stdout, stderr, return_value, depmap):
self.assertEqual(return_value, 0, stderr)
- got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
depmap)
+ self.assertEqual(report, [])
self.assertEqual(res, True)
@mvn_depmap('JPP-noversion.pom')
@@ -94,29 +95,33 @@ class TestMavenDepmap(unittest.TestCase):
@mvn_depmap('JPP-commons-war.pom', 'usr/share/java/commons-war.war')
def test_war(self, stdout, stderr, return_value, depmap):
self.assertEqual(return_value, 0, stderr)
- got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
depmap)
+ self.assertEqual(report, [])
self.assertEqual(res, True)
@mvn_depmap('JPP-commons-weird.pom', 'usr/share/java/commons-weird.war')
def test_weird_packaging(self, stdout, stderr, return_value, depmap):
self.assertEqual(return_value, 0, stderr)
- got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
depmap)
+ self.assertEqual(report, [])
self.assertEqual(res, True)
@mvn_depmap('JPP-packaging-pom.pom', 'usr/share/java/packaging-pom.jar')
def test_packaging_pom_and_jar(self, stdout, stderr, return_value, depmap):
self.assertEqual(return_value, 0, stderr)
- got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
depmap)
+ self.assertEqual(report, [])
self.assertEqual(res, True)
@mvn_depmap('JPP.commons-io-commons-io.pom', 'usr/share/java/commons-io/commons-io.jar')
def test_subdirectory(self, stdout, stderr, return_value, depmap):
self.assertEqual(return_value, 0, stderr)
- got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
depmap)
+ self.assertEqual(report, [])
self.assertEqual(res, True)
@mvn_depmap('JPP-commons-io-commons-io.pom', '/usr/share/java/commons-io.jar')
@@ -130,57 +135,65 @@ class TestMavenDepmap(unittest.TestCase):
@mvn_depmap('a:b:12', 'usr/share/java/commons-io.jar')
def test_mvn_spec(self, stdout, stderr, return_value, depmap):
self.assertEqual(return_value, 0, stderr)
- got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
depmap)
+ self.assertEqual(report, [])
self.assertEqual(res, True)
@mvn_depmap('a:b:war::1', 'usr/share/java/commons-war.war')
def test_mvn_spec_war(self, stdout, stderr, return_value, depmap):
self.assertEqual(return_value, 0, stderr)
- got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
depmap)
+ self.assertEqual(report, [])
self.assertEqual(res, True)
@mvn_depmap('/builddir/build/BUILDROOT/pkg-2.5.2-2.fc21.x86_64/a:b:war::1', 'usr/share/java/commons-war.war')
def test_mvn_spec_buildroot(self, stdout, stderr, return_value, depmap):
self.assertEqual(return_value, 0, stderr)
- got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
depmap)
+ self.assertEqual(report, [])
self.assertEqual(res, True)
@mvn_depmap('a:b:12', 'usr/share/java/commons-io.jar', ['-a', 'x:y'])
def test_append(self, stdout, stderr, return_value, depmap):
self.assertEqual(return_value, 0, stderr)
- got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
depmap)
+ self.assertEqual(report, [])
self.assertEqual(res, True)
@mvn_depmap('a:b:12', 'usr/share/java/commons-io.jar', ['-a', 'x:y,z:w'])
def test_append_multiple(self, stdout, stderr, return_value, depmap):
self.assertEqual(return_value, 0, stderr)
- got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
depmap)
+ self.assertEqual(report, [])
self.assertEqual(res, True)
@mvn_depmap('a:b:12', 'usr/share/java/commons-io.jar', ['-n', 'myns'])
def test_namespace(self, stdout, stderr, return_value, depmap):
self.assertEqual(return_value, 0, stderr)
- got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
depmap)
+ self.assertEqual(report, [])
self.assertEqual(res, True)
@mvn_depmap('a:b:12', 'usr/share/java/commons-io.jar', ['--namespace=myns', '--append=x:y'])
def test_append_and_namespace(self, stdout, stderr, return_value, depmap):
self.assertEqual(return_value, 0, stderr)
- got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
depmap)
+ self.assertEqual(report, [])
self.assertEqual(res, True)
@mvn_depmap('a:b:12', 'usr/foo/share/java/foo.jar', ['-p', 'usr/foo'])
def test_prefix(self, stdout, stderr, return_value, depmap):
self.assertEqual(return_value, 0, stderr)
- got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+ got, want, res, report = self.check_result(inspect.currentframe().f_code.co_name,
depmap)
+ self.assertEqual(report, [])
self.assertEqual(res, True)
@mvn_depmap('a:b:12', 'usr/foo/share/java/.out_archive.jar')
10 years, 6 months
[Bug 1002223] New: No splash screen shown on launch of Myrtle
by Red Hat Bugzilla
https://bugzilla.redhat.com/show_bug.cgi?id=1002223
Bug ID: 1002223
Summary: No splash screen shown on launch of Myrtle
Product: Fedora
Version: 19
Component: snifflib
Severity: medium
Assignee: msimacek(a)redhat.com
Reporter: mray271(a)gmail.com
QA Contact: extras-qa(a)fedoraproject.org
CC: java-sig-commits(a)lists.fedoraproject.org,
mizdebsk(a)redhat.com, mray271(a)gmail.com,
msimacek(a)redhat.com, msrb(a)redhat.com,
sochotni(a)redhat.com
Created attachment 791459
--> https://bugzilla.redhat.com/attachment.cgi?id=791459&action=edit
Proposed patch to /usr/bin/myrtle
Description of problem:
Launching Myrtle spreadsheet by /usr/bin/myrtle script should produce splash
image.
Version-Release number of selected component (if applicable):
1.8.12-1.fc19.noarch
currently available from the fedora-updates-testing repository
How reproducible:
Always
Steps to Reproduce:
1. yum install myrtle
2. myrtle
3.
Actual results:
Spreadsheet application opens as intended, but no splash shown.
Expected results:
Splash image should be shown briefly prior to application launch.
Additional info:
The splash image is a resource in in snifflib.jar
(/usr/share/java/snifflib.jar) and has path
com/mockturtlesolutions/snifflib/spreadsheets/images/myrtlesplash.png
See attached patch.
--
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=ha0RKcnMwt&a=cc_unsubscribe
10 years, 6 months
[Bug 959454] New: plexus-digest: do not use algorithm name as regular expression
by Red Hat Bugzilla
Product: Fedora
https://bugzilla.redhat.com/show_bug.cgi?id=959454
Bug ID: 959454
Summary: plexus-digest: do not use algorithm name as regular
expression
Product: Fedora
Version: rawhide
Component: plexus-digest
Severity: unspecified
Priority: unspecified
Assignee: sochotni(a)redhat.com
Reporter: fweimer(a)redhat.com
QA Contact: extras-qa(a)fedoraproject.org
CC: java-sig-commits(a)lists.fedoraproject.org,
jcapik(a)redhat.com, mizdebsk(a)redhat.com,
msrb(a)redhat.com, overholt(a)gmail.com,
sochotni(a)redhat.com, tradej(a)redhat.com
Blocks: 959453
Category: ---
In org.codehaus.plexus.digest.DigestUtils.cleanChecksum(String, String,
String), the second parameter is used as part of the regular expression.
Compiling the resulting regular expression can result in a VM error with a
crafted algorithm name. The regular expression should be a constant, with a
capture group for the algorithm name, and the name should be checked after
matching.
--
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=k7YPjOe1Ue&a=cc_unsubscribe
10 years, 6 months
[bytecode-compatibility-transformer] Initial import
by Michal Srb
commit c7c5e335c38de64be523cb1a1d5591db45c91440
Author: Michal Srb <msrb(a)redhat.com>
Date: Wed Oct 2 08:32:59 2013 +0200
Initial import
.gitignore | 2 +
0001-Port-to-asm-asm.patch | 125 +++++++++++++++++++++++++++++++
bytecode-compatibility-transformer.spec | 65 ++++++++++++++++
sources | 2 +
4 files changed, 194 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..69ee3b5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/bytecode-compatibility-transformer-1.3.zip
+/LICENSE.txt
diff --git a/0001-Port-to-asm-asm.patch b/0001-Port-to-asm-asm.patch
new file mode 100644
index 0000000..65dfa81
--- /dev/null
+++ b/0001-Port-to-asm-asm.patch
@@ -0,0 +1,125 @@
+From 6ec9eb40783373d29ffec0668a38270adf9a29fe Mon Sep 17 00:00:00 2001
+From: Michal Srb <msrb(a)redhat.com>
+Date: Tue, 1 Oct 2013 10:03:09 +0200
+Subject: [PATCH] Port to asm:asm
+
+---
+ src/main/java/org/jenkinsci/bytecode/AdaptField.java | 8 ++++----
+ src/main/java/org/jenkinsci/bytecode/Kind.java | 2 +-
+ src/main/java/org/jenkinsci/bytecode/MemberAdapter.java | 4 ++--
+ .../java/org/jenkinsci/bytecode/MemberTransformSpec.java | 8 ++++----
+ src/main/java/org/jenkinsci/bytecode/Transformer.java | 16 ++++++++--------
+ 5 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/src/main/java/org/jenkinsci/bytecode/AdaptField.java b/src/main/java/org/jenkinsci/bytecode/AdaptField.java
+index fe85af8..cb1fea8 100644
+--- a/src/main/java/org/jenkinsci/bytecode/AdaptField.java
++++ b/src/main/java/org/jenkinsci/bytecode/AdaptField.java
+@@ -1,8 +1,8 @@
+ package org.jenkinsci.bytecode;
+
+ import org.jvnet.hudson.annotation_indexer.Indexed;
+-import org.kohsuke.asm3.MethodVisitor;
+-import org.kohsuke.asm3.Type;
++import org.objectweb.asm.MethodVisitor;
++import org.objectweb.asm.Type;
+
+ import java.lang.annotation.Retention;
+ import java.lang.annotation.Target;
+@@ -14,8 +14,8 @@ import java.lang.reflect.Modifier;
+
+ import static java.lang.annotation.ElementType.*;
+ import static java.lang.annotation.RetentionPolicy.*;
+-import static org.kohsuke.asm3.Opcodes.*;
+-import static org.kohsuke.asm3.Type.*;
++import static org.objectweb.asm.Opcodes.*;
++import static org.objectweb.asm.Type.*;
+
+ /**
+ * Rewrites a field reference by adapting the type of the field.
+diff --git a/src/main/java/org/jenkinsci/bytecode/Kind.java b/src/main/java/org/jenkinsci/bytecode/Kind.java
+index e6edd62..43f5f7b 100644
+--- a/src/main/java/org/jenkinsci/bytecode/Kind.java
++++ b/src/main/java/org/jenkinsci/bytecode/Kind.java
+@@ -1,6 +1,6 @@
+ package org.jenkinsci.bytecode;
+
+-import org.kohsuke.asm3.MethodVisitor;
++import org.objectweb.asm.MethodVisitor;
+
+ /**
+ * Rewriting a method reference and a field reference takes a very similar code path,
+diff --git a/src/main/java/org/jenkinsci/bytecode/MemberAdapter.java b/src/main/java/org/jenkinsci/bytecode/MemberAdapter.java
+index c7f3027..4b9393e 100644
+--- a/src/main/java/org/jenkinsci/bytecode/MemberAdapter.java
++++ b/src/main/java/org/jenkinsci/bytecode/MemberAdapter.java
+@@ -1,7 +1,7 @@
+ package org.jenkinsci.bytecode;
+
+-import org.kohsuke.asm3.MethodVisitor;
+-import org.kohsuke.asm3.Type;
++import org.objectweb.asm.MethodVisitor;
++import org.objectweb.asm.Type;
+
+ import java.lang.reflect.Member;
+
+diff --git a/src/main/java/org/jenkinsci/bytecode/MemberTransformSpec.java b/src/main/java/org/jenkinsci/bytecode/MemberTransformSpec.java
+index 8854e1b..6f171a9 100644
+--- a/src/main/java/org/jenkinsci/bytecode/MemberTransformSpec.java
++++ b/src/main/java/org/jenkinsci/bytecode/MemberTransformSpec.java
+@@ -1,15 +1,15 @@
+ package org.jenkinsci.bytecode;
+
+-import org.kohsuke.asm3.Label;
+-import org.kohsuke.asm3.MethodVisitor;
+-import org.kohsuke.asm3.Type;
++import org.objectweb.asm.Label;
++import org.objectweb.asm.MethodVisitor;
++import org.objectweb.asm.Type;
+
+ import java.util.HashMap;
+ import java.util.HashSet;
+ import java.util.Map.Entry;
+ import java.util.Set;
+
+-import static org.kohsuke.asm3.Opcodes.*;
++import static org.objectweb.asm.Opcodes.*;
+
+ /**
+ * All the adapters of {@linkplain #kind a specific member type} keyed by their name and descriptor.
+diff --git a/src/main/java/org/jenkinsci/bytecode/Transformer.java b/src/main/java/org/jenkinsci/bytecode/Transformer.java
+index 6a5bc77..6dccc01 100644
+--- a/src/main/java/org/jenkinsci/bytecode/Transformer.java
++++ b/src/main/java/org/jenkinsci/bytecode/Transformer.java
+@@ -1,12 +1,12 @@
+ package org.jenkinsci.bytecode;
+
+-import org.kohsuke.asm3.ClassAdapter;
+-import org.kohsuke.asm3.ClassReader;
+-import org.kohsuke.asm3.ClassWriter;
+-import org.kohsuke.asm3.Label;
+-import org.kohsuke.asm3.MethodAdapter;
+-import org.kohsuke.asm3.MethodVisitor;
+-import org.kohsuke.asm3.Type;
++import org.objectweb.asm.ClassAdapter;
++import org.objectweb.asm.ClassReader;
++import org.objectweb.asm.ClassWriter;
++import org.objectweb.asm.Label;
++import org.objectweb.asm.MethodAdapter;
++import org.objectweb.asm.MethodVisitor;
++import org.objectweb.asm.Type;
+
+ import java.io.IOException;
+ import java.util.Collection;
+@@ -14,7 +14,7 @@ import java.util.Collections;
+ import java.util.Set;
+ import java.util.logging.Logger;
+
+-import static org.kohsuke.asm3.Opcodes.*;
++import static org.objectweb.asm.Opcodes.*;
+
+ /**
+ * Transform byte code where code references bytecode rewrite annotations.
+--
+1.8.3.1
+
diff --git a/bytecode-compatibility-transformer.spec b/bytecode-compatibility-transformer.spec
new file mode 100644
index 0000000..c74d279
--- /dev/null
+++ b/bytecode-compatibility-transformer.spec
@@ -0,0 +1,65 @@
+Name: bytecode-compatibility-transformer
+Version: 1.3
+Release: 1%{?dist}
+Summary: Evolve modular codebase without losing compatibility
+
+# License is specified in pom.xml
+License: MIT
+URL: https://github.com/jenkinsci/bytecode-compatibility-transformer
+Source0: https://github.com/jenkinsci/%{name}/archive/%{name}-%{version}.zip
+# Taken from http://opensource.org/licenses/mit-license.php
+Source1: LICENSE.txt
+
+# use standard asm3, not forked version
+Patch0: 0001-Port-to-asm-asm.patch
+
+BuildRequires: maven-local
+BuildRequires: mvn(asm:asm)
+BuildRequires: mvn(commons-io:commons-io)
+BuildRequires: mvn(junit:junit)
+BuildRequires: mvn(org.apache.ant:ant)
+BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
+BuildRequires: mvn(org.jenkins-ci:annotation-indexer)
+BuildRequires: mvn(org.jenkins-ci:constant-pool-scanner)
+
+BuildArch: noarch
+
+%description
+This Java library provides a set of annotations and bytecode transformer
+that helps you evolve modular codebase without losing compatibility.
+
+%package javadoc
+Summary: Javadoc for %{name}
+
+%description javadoc
+This package contains the API documentation for %{name}.
+
+%prep
+%setup -q -n %{name}-%{name}-%{version}
+
+%patch0 -p1
+
+%pom_remove_parent
+%pom_xpath_inject pom:project "<groupId>org.jenkins-ci</groupId>"
+
+cp %{SOURCE1} .
+
+%pom_remove_dep :asm3
+%pom_add_dep asm:asm
+
+%build
+%mvn_build
+
+%install
+%mvn_install
+
+%files -f .mfiles
+%dir %{_javadir}/%{name}
+%doc LICENSE.txt
+%files javadoc -f .mfiles-javadoc
+%doc LICENSE.txt
+
+%changelog
+* Tue Oct 01 2013 Michal Srb <msrb(a)redhat.com> - 1.3-1
+- Initial packaging
+
diff --git a/sources b/sources
index e69de29..1c86834 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,2 @@
+4426574ebb180317fdcda817e1dd9932 bytecode-compatibility-transformer-1.3.zip
+1d87d0760b5698d0f43a61ba9261ea10 LICENSE.txt
10 years, 6 months