[Reproducible-commits] [strip-nondeterminism] 03/04: javaproperties.t: test bundleplugin is stripped in jars

Chris West faux-guest at moszumanska.debian.org
Sun Aug 16 19:34:50 UTC 2015


This is an automated email from the git hooks/post-receive script.

faux-guest pushed a commit to branch master
in repository strip-nondeterminism.

commit 31ebfbaa09b55190e0dc1cfb3de88245ab1859d7
Author: Chris West (Faux) <git at goeswhere.com>
Date:   Sun Aug 16 20:33:35 2015 +0100

    javaproperties.t: test bundleplugin is stripped in jars
---
 t/javaproperties.t | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/t/javaproperties.t b/t/javaproperties.t
index 9f17403..3c7dc42 100644
--- a/t/javaproperties.t
+++ b/t/javaproperties.t
@@ -20,6 +20,7 @@
 # along with strip-nondeterminism.  If not, see <http://www.gnu.org/licenses/>.
 #
 
+use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
 use File::Temp 'tempdir';
 use Test::More tests => 6;
 use File::StripNondeterminism;
@@ -90,23 +91,29 @@ close($fh);
 # felix bundle pom.properties
 #
 
-$path = "$dir/pom.properties";
-open($fh, '>', $path) or die("error opening $path");
-
-print $fh <<'ORIGINAL';
+$path = "$dir/foo.jar";
+my $zip = Archive::Zip->new();
+$zip->addString(<<'ORIGINAL'
 #Generated by org.apache.felix.bundleplugin
 #Mon Aug 10 07:12:44 GMT-12:00 2015
 version=1.5
 ORIGINAL
-close($fh);
+, 'pom.properties');
+
+unless ($zip->writeToFileNamed($path) == AZ_OK) {
+    die("couldn't write test zip");
+}
 
 normalise($path);
 
-open($fh, '<', $path) or die("error opening $path");
-is(do { local $/; <$fh> }, <<'EXPECTED');
+my $afterzip = Archive::Zip->new();
+unless ( $afterzip->read($path) == AZ_OK ) {
+    die("couldn't read test zip");
+}
+
+is($afterzip->memberNamed('pom.properties')->contents(), <<'EXPECTED'
 #Generated by org.apache.felix.bundleplugin
 version=1.5
 EXPECTED
-close($fh);
-
+);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/strip-nondeterminism.git



More information about the Reproducible-commits mailing list