diff --git a/README.md b/README.md index 3827884..f34cab2 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,13 @@ # java-jmock1 +JMock is a library that supports test-driven development1 of Java2 code with mock objects3. +Mock objects help you design and test the interactions between the objects in your programs. + +The jMock library: + +* makes it quick and easy to define mock objects, so you don't break the rhythm of programming. +* lets you precisely specify the interactions between your objects, reducing the brittleness of your tests. +* works well with the autocompletion and refactoring features of your IDE +* plugs into your favourite test framework +* is easy to extend. + diff --git a/java-jmock-1.2.0-AssertMo.patch b/java-jmock-1.2.0-AssertMo.patch new file mode 100644 index 0000000..d73cfa8 --- /dev/null +++ b/java-jmock-1.2.0-AssertMo.patch @@ -0,0 +1,12 @@ +--- src/org/jmock/expectation/AssertMo.java.sav 2007-07-13 17:44:35.000000000 +0200 ++++ src/org/jmock/expectation/AssertMo.java 2007-07-13 17:45:06.000000000 +0200 +@@ -73,7 +73,7 @@ + assertTrue("Should not have verified", threwException); + } + +- static protected void failNotEquals( String message, ++ public static void failNotEquals( String message, + Object expected, + Object actual ) { + String formatted = ""; + diff --git a/java-jmock-1.2.0-build_xml.patch b/java-jmock-1.2.0-build_xml.patch new file mode 100644 index 0000000..5f2eb77 --- /dev/null +++ b/java-jmock-1.2.0-build_xml.patch @@ -0,0 +1,46 @@ +--- build.xml.sav 2007-07-15 11:18:10.000000000 +0200 ++++ build.xml 2007-07-15 11:19:51.000000000 +0200 +@@ -1,5 +1,5 @@ + +- ++ + + + +@@ -27,11 +27,13 @@ + + + ++ + + + +@@ -39,9 +41,11 @@ + + + ++ + + + +@@ -98,8 +102,8 @@ + srcdir="testdata" + debug="yes" + failonerror="yes" +- source="1.5" +- target="1.5"/> ++ source="1.4" ++ target="1.4"/> + + + diff --git a/java-jmock1.spec b/java-jmock1.spec new file mode 100644 index 0000000..6f3eebc --- /dev/null +++ b/java-jmock1.spec @@ -0,0 +1,121 @@ +%define javahome %{_jvmdir}/jdk +Name: java-jmock1 +Version: 1.2.0 +Release: 3mamba +Summary: Test Java code using mock objects +Group: Development/Libraries/Java +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://jmock.codehaus.org/ +# svn export http://svn.codehaus.org/jmock/tags/1.2.0/ jmock-1.2.0.svn-src +# tar czf jmock-1.2.0.svn-src.tar.gz jmock-1.2.0.svn-src +Source0: jmock-%{version}.svn-src.tar.gz +Patch0: java-jmock-1.2.0-AssertMo.patch +Patch1: java-jmock-1.2.0-build_xml.patch +License: Open Source +## AUTOBUILDREQ-BEGIN +## AUTOBUILDREQ-END +BuildRequires: apache-ant +#BuildRequires: java-cglib21 +#BuildRequires: java-junit3 +BuildRequires: jpackage-utils +#BuildRequires: objectweb-asm1 + +%description +JMock is a library that supports test-driven development1 of Java2 code with mock objects3. +Mock objects help you design and test the interactions between the objects in your programs. + +The jMock library: + +* makes it quick and easy to define mock objects, so you don't break the rhythm of programming. +* lets you precisely specify the interactions between your objects, reducing the brittleness of your tests. +* works well with the autocompletion and refactoring features of your IDE +* plugs into your favourite test framework +* is easy to extend. + +%package javadoc +Group: Documentation +Summary: Javadoc for %{name} + +%description javadoc +JMock is a library that supports test-driven development1 of Java2 code with mock objects3. +Mock objects help you design and test the interactions between the objects in your programs. + +This package contains documentation for %{name}. + +%prep +%setup -q -n jmock-%{version}.svn-src + +for j in $(find . -name "*.jar"); do + mv $j $j.no +done +%patch0 -p0 -b .sav +%patch1 -b .sav + +pushd lib + ln -sf $(build-classpath junit-3.8.2) junit-3.8.1.jar + ln -sf $(build-classpath cglib21-nodep) cglib-nodep-2.1_3.jar + ln -sf $(build-classpath cglib21) cglib-2.1_3.jar +popd + +%build +export JAVA_HOME=%javahome +%if "%{stage1}" != "1" +export CLASSPATH=$(build-classpath cglib21 asm1/asm asm1/asm-util asm1/asm-tree asm1/asm-xml junit-3.8.2 ant/ant-junit):build/classes +%else +export CLASSPATH=$(build-classpath asm1/asm asm1/asm-util asm1/asm-tree asm1/asm-xml junit-3.8.2 ant/ant-junit):build/classes +%endif +ant package + +#-Dbuild.sysclasspath=only +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +mkdir -p %{buildroot}%{_javadir} +install -pm 644 build/jmock-core-%{version}.jar \ + %{buildroot}%{_javadir}/jmock1-%{version}.jar +install -pm 644 build/jmock-cglib-%{version}.jar \ + %{buildroot}%{_javadir}/jmock1-cglib-%{version}.jar +install -pm 644 build/jmock-tests-%{version}.jar \ + %{buildroot}%{_javadir}/jmock1-tests-%{version}.jar + +( + cd %{buildroot}%{_javadir} + for jar in *-%{version}.jar; do + ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"` + done +) + +mkdir -p %{buildroot}%{_javadocdir}/jmock-%{version} +cp -pr build/javadoc-%{version}/* %{buildroot}%{_javadocdir}/jmock-%{version} +ln -s jmock-%{version} %{buildroot}%{_javadocdir}/jmock + +#%{_bindir}/aot-compile-rpm + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%files +%defattr(-,root,root) +%{_javadir}/jmock1-%{version}.jar +%{_javadir}/jmock1-cglib-%{version}.jar +%{_javadir}/jmock1-cglib.jar +%{_javadir}/jmock1-tests-%{version}.jar +%{_javadir}/jmock1-tests.jar +%{_javadir}/jmock1.jar + +%files javadoc +%defattr(-,root,root) +%{_javadocdir}/jmock-%{version} +%{_javadocdir}/jmock + +%changelog +* Sat Mar 26 2011 gil 1.2.0-3mamba +- rebuilt with java-openjdk support + +* Thu Nov 04 2010 gil 1.2.0-2mamba +- rebuilt devel + +* Tue Mar 03 2009 gil 1.2.0-1mamba +- package created by autospec