Accepting request 204780 from Java:packages

[NOT-FOR-OPENSUSE-13.1: this does replace junit4 package and drop old junit 3.x as it's deprecated upstream]
- Update to 4.11
  * Matchers: Upgrade to Hamcrest 1.3
    no longer included junit jar
  * Parameterized Tests
  * Specify Test execution order
  * New maven artifact 'junit:junit' w/o builtin hamcrest
  * Number of improvements into Rules
- Drop jdk7-testfailure.patch, fixed upstream
- Add junit-no-hamcrest-src.patch, don't bundle hamcrest into junit.jar
- Use SourceUrl for release tarball and pom
- Don't inject OSGI manifest, it breaks junit.jar 
- Provide/obsolete package junit4

OBS-URL: https://build.opensuse.org/request/show/204780
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/junit?expand=0&rev=15
This commit is contained in:
Stephan Kulow 2013-11-05 16:14:45 +00:00 committed by Git OBS Bridge
commit b0db1defa6
7 changed files with 229 additions and 173 deletions

68
junit-4.11.pom Normal file
View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<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 ">
<modelVersion>4.0.0</modelVersion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<name>JUnit</name>
<url>http://junit.org</url>
<description>
JUnit is a regression testing framework written by Erich Gamma and Kent Beck.
It is used by the developer who implements unit tests in Java.
</description>
<organization>
<name>JUnit</name>
<url>http://www.junit.org</url>
</organization>
<mailingLists>
<mailingList>
<name>JUnit Mailing List</name>
<post>junit@yahoogroups.com</post>
<archive>
http://tech.groups.yahoo.com/group/junit/
</archive>
</mailingList>
</mailingLists>
<licenses>
<license>
<name>Common Public License Version 1.0</name>
<url>http://www.opensource.org/licenses/cpl1.0.txt</url>
</license>
</licenses>
<scm>
<connection>scm:git:git://github.com/KentBeck/junit.git</connection>
<developerConnection>scm:git:git@github.com:KentBeck/junit.git</developerConnection>
<url>http://github.com/KentBeck/junit/tree/master</url>
</scm>
<developers>
<developer>
<id>dsaff</id>
<name>David Saff</name>
<email>david@saff.net</email>
</developer>
</developers>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<encoding>ISO-8859-1</encoding>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>compile</scope>
</dependency>
</dependencies>
<properties>
<jdk.version>1.5</jdk.version>
</properties>
</project>

View File

@ -0,0 +1,40 @@
diff --git a/build.xml b/build.xml
index 0efaf87..2efa11c 100644
--- a/build.xml
+++ b/build.xml
@@ -30,7 +30,6 @@
<property name="javadoczip" location="${dist}-javadoc.zip" />
<property name="hamcrestlib" location="lib/hamcrest-core-1.3.jar" />
<property name="hamcrestlibsources" location="lib/hamcrest-core-1.3-sources.jar" />
- <property name="hamcrestsrc" location="${dist}/temp.hamcrest.source" />
<property name="maven.deploy.goal" value="org.apache.maven.plugins:maven-gpg-plugin:1.1:sign-and-deploy-file" />
@@ -125,10 +124,6 @@
</copy>
</target>
- <target name="unjar.hamcrest">
- <unjar src="${hamcrestlibsources}" dest="${hamcrestsrc}" />
- </target>
-
<target name="release-notes">
<property name="basename" value="doc/ReleaseNotes${version-base}" />
<exec executable="perl" failonerror="true">
@@ -138,7 +133,7 @@
</exec>
</target>
- <target name="javadoc" depends="unjar.hamcrest">
+ <target name="javadoc">
<javadoc destdir="${javadocdir}"
author="false"
version="false"
@@ -151,7 +146,6 @@
<excludepackage name="org.junit.experimental.theories.internal.*" />
<sourcepath location="${src}" />
- <sourcepath location="${hamcrestsrc}" />
<link href="http://java.sun.com/javase/6/docs/api/" />
</javadoc>
</target>

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Fri Oct 25 07:39:22 UTC 2013 - mvyskocil@suse.com
- Update to 4.11
* Matchers: Upgrade to Hamcrest 1.3
no longer included junit jar
* Parameterized Tests
* Specify Test execution order
* New maven artifact 'junit:junit' w/o builtin hamcrest
* Number of improvements into Rules
- Drop jdk7-testfailure.patch, fixed upstream
- Add junit-no-hamcrest-src.patch, don't bundle hamcrest into junit.jar
- Use SourceUrl for release tarball and pom
- Don't inject OSGI manifest, it breaks junit.jar
- Provide/obsolete package junit4
-------------------------------------------------------------------
Fri Aug 23 09:35:53 UTC 2013 - mvyskocil@suse.com

View File

@ -14,100 +14,140 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# icecream 0
%define name junit
%define version 3.8.2
%define release 4jpp
%define section free
Name: junit
BuildRequires: ant
BuildRequires: java-1_5_0-gcj-compat-devel
BuildRequires: unzip
BuildRequires: xml-commons-apis
Version: 3.8.2
Version: 4.11
Release: 0
Summary: Java Regression Test Package
License: IPL-1.0
Summary: Java regression test package
License: CPL-1.0
Group: Development/Libraries/Java
Url: http://www.junit.org/
Source: http://osdn.dl.sourceforge.net/junit/junit%{version}.zip
Source1: %{name}%{version}-build.xml
Source0: https://github.com/junit-team/junit/archive/r%{version}.tar.gz
#Source1: http://search.maven.org/remotecontent?filepath=junit/junit/4.11/junit-4.11.pom
Source1: junit-4.11.pom
#PATCH-FIX-OPENSUSE: do not use bundled hamcrest sources, which btw fixes hamcrest build with junit4
Patch0: junit-no-hamcrest-src.patch
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: ant
BuildRequires: hamcrest >= 1.3
BuildRequires: java-devel >= 1.6.0
BuildRequires: javapackages-tools
BuildRequires: perl(Digest::MD5)
Requires(post): javapackages-tools
Requires(postun): javapackages-tools
Requires: hamcrest
Requires: java >= 1.6.0
Provides: junit4 = %{version}
Obsoletes: junit4 <= 4.10
%description
JUnit is a regression testing framework written by Erich Gamma and Kent
Beck. It is used by the developer who implements unit tests in Java.
JUnit is open source software, released under the IBM Public License
and hosted on SourceForge.
JUnit is a regression testing framework written by Erich Gamma and Kent Beck.
It is used by the developer who implements unit tests in Java. JUnit is Open
Source Software, released under the Common Public License Version 1.0 and
hosted on GitHub.
%package manual
Summary: Manual for junit
Group: Development/Libraries/Java
Summary: Manual for %{name}
Group: Documentation/Other
Provides: junit4-manual = %{version}
Obsoletes: junit4-manual <= 4.10
%description manual
JUnit is a regression testing framework written by Erich Gamma and Kent
Beck. It is used by the developer who implements unit tests in Java.
JUnit is Open Source Software, released under the IBM Public License
and hosted on SourceForge.
Manual for %{name}.
This package contains the manual for JUnit.
%package javadoc
Summary: Javadoc for %{name}
Group: Documentation/HTML
Provides: junit4-javadoc = %{version}
Obsoletes: junit4-javadoc <= 4.10
%description javadoc
Javadoc for %{name}.
%package demo
Summary: Demonstration and sample files for junit
Group: Development/Libraries/Java
Requires: %{name} = %{version}-%{release}
Summary: Demos for %{name}
Group: Documentation/Other
Requires: %{name} = %{version}
Provides: junit4-demo = %{version}
Obsoletes: junit4-demo <= 4.10
%description demo
JUnit is a regression testing framework written by Erich Gamma and Kent
Beck. It is used by the developer who implements unit tests in Java.
JUnit is Open Source Software, released under the IBM Public License
and hosted on SourceForge.
This package contains demonstration and sample files for JUnit.
Demos for %{name}.
%prep
%setup -q -n %{name}%{version}
# extract sources
jar xvf src.jar
# % patch
cp %{SOURCE1} build.xml
%setup -q -n junit-r%{version}
%patch0 -p1
find . -type f -name "*.jar" -or -name "*.class" | xargs -t rm -rf
ln -s $(build-classpath hamcrest/core) lib/hamcrest-core-1.3.jar
%build
ant dist
#export CLASSPATH=
#export OPT_JAR_LIST=:
#ant -Dant.build.javac.source=1.5 dist
ant dist -Dversion-status=
%install
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644 %{name}%{version}/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} ${jar/-%{version}/}; done)
# demo
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}
cp -pr %{name}%{version}/%{name}/* $RPM_BUILD_ROOT%{_datadir}/%{name}
install -d -m 755 %{buildroot}%{_javadir}
install -m 644 junit%{version}/junit-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
# compat symlink
ln -sf %{_javadir}/%{name}.jar %{buildroot}%{_javadir}/junit4.jar
%clean
rm -rf $RPM_BUILD_ROOT
# pom
install -d -m 755 %{buildroot}%{_mavenpomdir}
install -m 644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap
# javadoc
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -pr junit%{version}/javadoc/* %{buildroot}%{_javadocdir}/%{name}
# demo
install -d -m 755 %{buildroot}%{_datadir}/%{name}/demo/junit # Not using % name for last part because it is
# part of package name
cp -pr junit%{version}/junit/* %{buildroot}%{_datadir}/%{name}/demo/junit
%check
cat > test.java <<EOF
import junit.framework.Assert;
class test {
public static void main(String[] args) {
Assert.fail("Hello world from junit");
}
}
EOF
javac -cp %{buildroot}/%{_javadir}/%{name}.jar test.java
java -cp %{buildroot}/%{_javadir}/%{name}.jar: test && exit 42
%files
%defattr(0644,root,root,0755)
%doc README.html
%doc cpl-v10.html
%{_javadir}/*
%dir %{_datadir}/%{name}
%files manual
%defattr(0644,root,root,0755)
%doc %{name}%{version}/doc/*
%doc CODING_STYLE LICENSE README acknowledgements.txt
%{_javadir}/%{name}.jar
%{_javadir}/junit4.jar
%{_mavenpomdir}/*
%{_mavendepmapfragdir}/*
%files demo
%defattr(0644,root,root,0755)
%{_datadir}/%{name}/*
%{_datadir}/%{name}
%files javadoc
%defattr(0644,root,root,0755)
%{_javadocdir}/%{name}
%files manual
%defattr(0644,root,root,0755)
%doc junit%{version}/doc/*
%changelog

View File

@ -1,108 +0,0 @@
<!-- JUnit build script using ant 1.4 -->
<project name="junit" default="dist" basedir=".">
<property file="${user.home}/.junit.properties" />
<property name="build.compiler" value="classic" />
<property name="version" value="3.8.2" />
<property name="dist" value="junit${version}" />
<property name="versionfile" value="junit/runner/Version.java" />
<property name="zipfile" value="${dist}.zip" />
<target name="init">
<tstamp/>
</target>
<target name="versiontag" depends="init">
<filter token="version" value="${version}" />
<copy
file="${versionfile}"
tofile="${versionfile}tmp"
filtering="on"
/>
<move file="${versionfile}tmp" tofile="${versionfile}" />
</target>
<target name="build" depends="versiontag">
<javac
srcdir="."
destdir="."
debug="on"
/>
</target>
<target name="dist" depends="build">
<delete dir="${dist}" />
<mkdir dir="${dist}" />
<jar
jarfile="${dist}/src.jar"
basedir="."
excludes="**/*.jar, junit/tests/**, junit/samples/**, **/*.class, doc/**, README.html, .classpath, .project, cpl-v10.html"
/>
<jar
jarfile="${dist}/junit.jar"
basedir="."
excludes="**/*.jar, junit/tests/**, junit/samples/**, **/*.java, doc/**, README.html, build.xml, jar-manifest.txt, .classpath, .project, cpl-v10.html"
/>
<copy todir="${dist}/junit/samples">
<fileset dir="junit/samples" />
</copy>
<copy todir="${dist}/junit/tests">
<fileset dir="junit/tests" />
</copy>
<delete file="${dist}/junit/tests/runner/test.jar"/>
<jar jarfile="${dist}/junit/tests/runner/test.jar"
basedir="."
includes="junit/tests/runner/LoadedFromJar.class"
/>
<copy todir="${dist}/doc">
<fileset dir="doc"/>
</copy>
<copy file="README.html" tofile="${dist}/README.html" />
<copy file="cpl-v10.html" tofile="${dist}/cpl-v10.html" />
<java classname="junit.textui.TestRunner" fork="yes">
<arg value="junit.samples.AllTests" />
<classpath>
<pathelement location="${dist}" />
<pathelement location="${dist}/junit.jar" />
</classpath>
</java>
</target>
<target name="zip" depends="dist">
<zip
zipfile="${zipfile}"
basedir="."
includes="${dist}/**"
/>
</target>
<target name="awtui" depends="dist">
<java classname="junit.awtui.TestRunner" fork="yes">
<arg value="junit.samples.AllTests" />
<classpath>
<pathelement location="${dist}" />
<pathelement location="${dist}/junit.jar" />
</classpath>
</java>
</target>
<target name="swingui" depends="dist">
<java classname="junit.swingui.TestRunner" fork="yes">
<arg value="junit.samples.AllTests" />
<classpath>
<pathelement location="${dist}" />
<pathelement location="${dist}/junit.jar" />
</classpath>
</java>
</target>
<target name="clean">
<delete dir="${dist}" quiet="true"/>
<delete file="${zipfile}" quiet="true"/>
<delete>
<fileset dir="${basedir}" includes="**/*.class" />
</delete>
</target>
</project>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:aae23d20e6f4dc45b4bf0b10fedcbd209c100342a0cafce1aa07d2da6da1f24a
size 461426

3
r4.11.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7f427e18a21006ea5394fb71b268d2fa1d12a9f4575b5743ff093547c7ac7b37
size 1974196