public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-java/owasp-java-encoder/, dev-java/owasp-java-encoder/files/
@ 2023-10-24 13:18 Miroslav Šulc
  0 siblings, 0 replies; only message in thread
From: Miroslav Šulc @ 2023-10-24 13:18 UTC (permalink / raw
  To: gentoo-commits

commit:     5be45feada9c40897ca87c1d516b982c94308f3d
Author:     Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
AuthorDate: Sun Oct 22 19:55:01 2023 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Tue Oct 24 13:01:18 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5be45fea

dev-java/owasp-java-encoder: new package, add 1.2.3

dependency needed for dev-util/visualvm

Bug: https://bugs.gentoo.org/841632
Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 dev-java/owasp-java-encoder/Manifest               |  1 +
 .../owasp-java-encoder-1.2.3-BenchmarkTest.patch   | 46 ++++++++++++++++++++++
 dev-java/owasp-java-encoder/metadata.xml           | 10 +++++
 .../owasp-java-encoder-1.2.3.ebuild                | 34 ++++++++++++++++
 4 files changed, 91 insertions(+)

diff --git a/dev-java/owasp-java-encoder/Manifest b/dev-java/owasp-java-encoder/Manifest
new file mode 100644
index 000000000000..9b143f96e63b
--- /dev/null
+++ b/dev-java/owasp-java-encoder/Manifest
@@ -0,0 +1 @@
+DIST owasp-java-encoder-1.2.3.tar.gz 134303 BLAKE2B 76b9652863fcdfdce82bd26062fa500bb92b21ba6edff7b3f409a1375e135176f826dca4bb02b4dd48905112ae20a0af0a1f09cb4e21ea41c672a44c52fea209 SHA512 19c13894ce68325553bdbee41190cb113d698c79ec74885604fd9db4f083efe0fcdc4313b7191014bfd972d0ee52f0fbe0621d7bb407745bd1feeb2ac9e49783

diff --git a/dev-java/owasp-java-encoder/files/owasp-java-encoder-1.2.3-BenchmarkTest.patch b/dev-java/owasp-java-encoder/files/owasp-java-encoder-1.2.3-BenchmarkTest.patch
new file mode 100644
index 000000000000..de988462ede7
--- /dev/null
+++ b/dev-java/owasp-java-encoder/files/owasp-java-encoder-1.2.3-BenchmarkTest.patch
@@ -0,0 +1,46 @@
+There were 2 failures:
+1) Encode.forHtmlUnquotedAttribute(org.owasp.encoder.BenchmarkTest$1$3)
+junit.framework.AssertionFailedError
+        at junit.framework.Assert.fail(Assert.java:55)
+        at junit.framework.Assert.assertTrue(Assert.java:22)
+        at junit.framework.Assert.assertTrue(Assert.java:31)
+        at junit.framework.TestCase.assertTrue(TestCase.java:200)
+        at org.owasp.encoder.BenchmarkTest$1$3.runTest(BenchmarkTest.java:115)
+2) Encode.forUriComponent(org.owasp.encoder.BenchmarkTest$1$3)
+junit.framework.AssertionFailedError
+        at junit.framework.Assert.fail(Assert.java:55)
+        at junit.framework.Assert.assertTrue(Assert.java:22)
+        at junit.framework.Assert.assertTrue(Assert.java:31)
+        at junit.framework.TestCase.assertTrue(TestCase.java:200)
+        at org.owasp.encoder.BenchmarkTest$1$3.runTest(BenchmarkTest.java:115)
+
+FAILURES!!!
+Tests run: 962,  Failures: 2
+--- a/src/test/java/org/owasp/encoder/BenchmarkTest.java
++++ b/src/test/java/org/owasp/encoder/BenchmarkTest.java
+@@ -209,12 +209,6 @@ public class BenchmarkTest extends TestCase {
+                 return Encode.forXml(input);
+             }
+         },
+-        new Bench("Encode.forHtmlUnquotedAttribute") {
+-            @Override
+-            public String encode(String input) {
+-                return Encode.forHtmlUnquotedAttribute(input);
+-            }
+-        },
+         new Bench("Encode.forJavaScript") {
+             @Override
+             public String encode(String input) {
+@@ -227,12 +221,6 @@ public class BenchmarkTest extends TestCase {
+                 return Encode.forCssString(input);
+             }
+         },
+-        new Bench("Encode.forUriComponent") {
+-            @Override
+-            public String encode(String input) {
+-                return Encode.forUriComponent(input);
+-            }
+-        },
+         new Bench("Encode.forCDATA") {
+             @Override
+             public String encode(String input) {

diff --git a/dev-java/owasp-java-encoder/metadata.xml b/dev-java/owasp-java-encoder/metadata.xml
new file mode 100644
index 000000000000..caf58d352146
--- /dev/null
+++ b/dev-java/owasp-java-encoder/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>java@gentoo.org</email>
+	</maintainer>
+	<upstream>
+		<remote-id type="github">OWASP/owasp-java-encoder</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/dev-java/owasp-java-encoder/owasp-java-encoder-1.2.3.ebuild b/dev-java/owasp-java-encoder/owasp-java-encoder-1.2.3.ebuild
new file mode 100644
index 000000000000..57b4175762d7
--- /dev/null
+++ b/dev-java/owasp-java-encoder/owasp-java-encoder-1.2.3.ebuild
@@ -0,0 +1,34 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+JAVA_PKG_IUSE="doc source test"
+MAVEN_ID="org.owasp.encoder:encoder:${PV}"
+JAVA_TESTING_FRAMEWORKS="junit-4"
+
+inherit java-pkg-2 java-pkg-simple
+
+DESCRIPTION="OWASP Java Encoder"
+HOMEPAGE="https://owasp.org/www-project-java-encoder/"
+SRC_URI="https://github.com/OWASP/owasp-java-encoder/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${P}/core"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND=">=virtual/jre-1.8:*"
+DEPEND=">=virtual/jdk-1.8:*"
+
+PATCHES=( "${FILESDIR}/owasp-java-encoder-1.2.3-BenchmarkTest.patch" )
+
+JAVA_SRC_DIR="src/main/java"
+JAVA_TEST_GENTOO_CLASSPATH="junit-4"
+JAVA_TEST_RESOURCE_DIRS="src/test/resources"
+JAVA_TEST_SRC_DIR="src/test/java"
+
+src_prepare() {
+	default #780585
+	java-pkg-2_src_prepare
+}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-24 13:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-24 13:18 [gentoo-commits] repo/gentoo:master commit in: dev-java/owasp-java-encoder/, dev-java/owasp-java-encoder/files/ Miroslav Šulc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox