Accepting request 558207 from Java:packages
Misc fixes including jdk10 build OBS-URL: https://build.opensuse.org/request/show/558207 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/junit?expand=0&rev=21
This commit is contained in:
commit
4dbd185b6b
15
junit-jdk10.patch
Normal file
15
junit-jdk10.patch
Normal file
@ -0,0 +1,15 @@
|
||||
diff -urEbwB junit-r4.11/src/test/java/org/junit/tests/running/core/MainRunner.java junit-r4.11/src/test/java/org/junit/tests/running/core/MainRunner.java
|
||||
--- junit-r4.11/src/test/java/org/junit/tests/running/core/MainRunner.java 2012-11-13 21:10:09.000000000 +0100
|
||||
+++ junit-r4.11/src/test/java/org/junit/tests/running/core/MainRunner.java 2017-12-18 10:32:05.822083468 +0100
|
||||
@@ -40,11 +40,6 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
- public boolean getInCheck() {
|
||||
- return (originalSecurityManager != null) && originalSecurityManager.getInCheck();
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
public Object getSecurityContext() {
|
||||
return (originalSecurityManager == null) ? super.getSecurityContext() : originalSecurityManager.getSecurityContext();
|
||||
}
|
@ -1,3 +1,26 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 18 15:40:52 UTC 2017 - fstrba@suse.com
|
||||
|
||||
- Run fdupes on documentation
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 18 15:35:28 UTC 2017 - dimstar@opensuse.org
|
||||
|
||||
- Harden and fix the test suite:
|
||||
+ org.framework.junit is deprecated since junit 4.0
|
||||
+ Ensure we fail check when junit no longer returns what we
|
||||
expect it to (error code checking is useless, since Assert
|
||||
returns !0, like any other failure to start the test).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 18 09:34:48 UTC 2017 - fstrba@suse.com
|
||||
|
||||
- Added patch:
|
||||
* junit-jdk10.patch
|
||||
+ Remove a function getInCheck from NoExitSecurityManager,
|
||||
since it does not exist in the extended class in jdk10 and is
|
||||
deprecated in previous versions
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 8 08:42:24 UTC 2017 - fstrba@suse.com
|
||||
|
||||
|
14
junit.spec
14
junit.spec
@ -31,7 +31,9 @@ Patch0: junit-no-hamcrest-src.patch
|
||||
#PATCH-FIX-UPSTREAM: build with jdk8 and newer, already in upstream repo
|
||||
Patch1: junit-jdk8.patch
|
||||
Patch2: junit-jdk9.patch
|
||||
Patch3: junit-jdk10.patch
|
||||
BuildRequires: ant
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: hamcrest >= 1.3
|
||||
BuildRequires: java-devel >= 1.6.0
|
||||
BuildRequires: javapackages-local
|
||||
@ -43,7 +45,6 @@ Requires(post): javapackages-tools
|
||||
Requires(postun): javapackages-tools
|
||||
Provides: junit4 = %{version}
|
||||
Obsoletes: junit4 <= 4.10
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildArch: noarch
|
||||
|
||||
%description
|
||||
@ -85,6 +86,7 @@ Demos for %{name}.
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
|
||||
find . -type f -name "*.jar" -or -name "*.class" | xargs -t rm -rf
|
||||
|
||||
@ -109,6 +111,7 @@ install -m 644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
|
||||
# javadoc
|
||||
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
|
||||
cp -pr junit%{version}/javadoc/* %{buildroot}%{_javadocdir}/%{name}
|
||||
%fdupes -s %{buildroot}%{_javadocdir}/%{name}
|
||||
|
||||
# demo
|
||||
install -d -m 755 %{buildroot}%{_datadir}/%{name}/demo/junit # Not using % name for last part because it is
|
||||
@ -118,7 +121,7 @@ cp -pr junit%{version}/junit/* %{buildroot}%{_datadir}/%{name}/demo/junit
|
||||
%check
|
||||
|
||||
cat > test.java <<EOF
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
class test {
|
||||
|
||||
public static void main(String[] args) {
|
||||
@ -128,10 +131,10 @@ class test {
|
||||
}
|
||||
EOF
|
||||
javac -cp %{buildroot}/%{_javadir}/%{name}.jar test.java
|
||||
java -cp %{buildroot}/%{_javadir}/%{name}.jar: test && exit 42
|
||||
java -cp %{buildroot}/%{_javadir}/%{name}.jar: test 2>&1 | \
|
||||
grep 'Exception in thread "main" java.lang.AssertionError: Hello world from junit'
|
||||
|
||||
%files
|
||||
%defattr(0644,root,root,0755)
|
||||
%doc CODING_STYLE LICENSE README acknowledgements.txt
|
||||
%{_javadir}/%{name}.jar
|
||||
%{_javadir}/junit4.jar
|
||||
@ -139,15 +142,12 @@ java -cp %{buildroot}/%{_javadir}/%{name}.jar: test && exit 42
|
||||
%{_datadir}/maven-metadata/%{name}.xml*
|
||||
|
||||
%files demo
|
||||
%defattr(0644,root,root,0755)
|
||||
%{_datadir}/%{name}
|
||||
|
||||
%files javadoc
|
||||
%defattr(0644,root,root,0755)
|
||||
%{_javadocdir}/%{name}
|
||||
|
||||
%files manual
|
||||
%defattr(0644,root,root,0755)
|
||||
%doc junit%{version}/doc/*
|
||||
|
||||
%changelog
|
||||
|
Loading…
x
Reference in New Issue
Block a user