summaryrefslogtreecommitdiff
path: root/dev-java/owasp-java-encoder
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-10-24 20:44:11 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-10-24 20:44:11 +0100
commit342922f04a58a969ff23806acc427c7ff79119ce (patch)
tree7c491f1183b65ff952aefc31909ea49a54196be0 /dev-java/owasp-java-encoder
parent27f59f8e16510831cc751de1406f71afbf464653 (diff)
gentoo auto-resync : 24:10:2023 - 20:44:11
Diffstat (limited to 'dev-java/owasp-java-encoder')
-rw-r--r--dev-java/owasp-java-encoder/Manifest4
-rw-r--r--dev-java/owasp-java-encoder/files/owasp-java-encoder-1.2.3-BenchmarkTest.patch46
-rw-r--r--dev-java/owasp-java-encoder/metadata.xml10
-rw-r--r--dev-java/owasp-java-encoder/owasp-java-encoder-1.2.3.ebuild34
4 files changed, 94 insertions, 0 deletions
diff --git a/dev-java/owasp-java-encoder/Manifest b/dev-java/owasp-java-encoder/Manifest
new file mode 100644
index 000000000000..12fc30747a35
--- /dev/null
+++ b/dev-java/owasp-java-encoder/Manifest
@@ -0,0 +1,4 @@
+AUX owasp-java-encoder-1.2.3-BenchmarkTest.patch 1971 BLAKE2B 1a4d60fb1b16b98878f1c9bd056d1600327768613a9df9017395f40f8d249b7034bb44b5573638307398ab5296c01f618f0e5348023e84aa526ca0d76ab41113 SHA512 376c5cad6e7cb4ebc3fe6998d90155c71bdfa793ecb132ea49e018169f6fe150485cd0b79984e5f88c96afb3ceb80cfdb68f49fe9aea4cabffc29ec3a7fc40e0
+DIST owasp-java-encoder-1.2.3.tar.gz 134303 BLAKE2B 76b9652863fcdfdce82bd26062fa500bb92b21ba6edff7b3f409a1375e135176f826dca4bb02b4dd48905112ae20a0af0a1f09cb4e21ea41c672a44c52fea209 SHA512 19c13894ce68325553bdbee41190cb113d698c79ec74885604fd9db4f083efe0fcdc4313b7191014bfd972d0ee52f0fbe0621d7bb407745bd1feeb2ac9e49783
+EBUILD owasp-java-encoder-1.2.3.ebuild 838 BLAKE2B b3894fa1e53146bcb4f384dbc316413c8d59e0e0d0898c9347edd9d0dee23bc01db4178514a07c61d5339ee8fec0f87c6b8f22a68040349ea0c17e590551e337 SHA512 31bcf6e488822edecf2e2c1175da97ddf6e03c7d4622daf6e26849dd82d1bc7cd4c139d7e844c7338c659d4386ae3a107aa17f64cff3fee066487c0e7cc023a3
+MISC metadata.xml 306 BLAKE2B 8dfe8c2f01f21e1e865973e9865f3a9439a7a378d2acc52a6e148dcf70e3ef0f0fcce4efff20d89c0e2872e5d23fb0795b2d669eb18c278abf3ae6406db8f84a SHA512 c696a3c2763ff1868b3b80ee7c4b47fc697679a0539c2b9b300f0a969ad3bcd168e75f5d0275c10bac5b1ba7052e2e498c2c7daf3290f593cd0be8c9f35940fd
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
+}