Junit version 4.6 - How to Download and Install on Mac OS X
Saturday the 7th of November, 2009

    version 4.6

      View the most recent changes for the junit port at: junit.darwinports.com/diff
      Scroll down toward the bottom of the page to get installation instructions for junit.
      The raw portfile for junit 4.6 is located here:
      http://junit.darwinports.com/dports/java/junit/Portfile
      Find related portfiles with the unique DarwinPorts.com search feature.
      Check for any related Fink projects here: pdb.finkproject.org/pdb/package.php/junit


      # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
      The junit Portfile 52234 2009-06-12 20:20:09Z nox macports.org $

      PortSystem 1.0

      Name: junit
      Version: 4.6
      Revision: 1
      Category: java devel
      Platform: darwin
      Maintainers: nox openmaintainer
      Description: Java framework for repeatable tests

      Long Description: JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks.

      Homepage: http://www.junit.org/
      Master Sites: sourceforge
      distname ${name}${version}
      use_zip yes

      Checksums: md5 2e59ed558001fd3b10d2146189167ff5 sha1 98c8c625e999f0c7463397a684a5c47a0ea106e3 rmd160 4f87024e91b7252af89ad925db5cda0e17128525

      Patch Files: patch-build.xml.diff patch-src-main-java-org-junit-matchers-package-info.java.diff patch-hamcrest-1.2-upgrade.diff

      post-extract {
      file mkdir ${worksrcpath}/src/main/java
      system "cd ${worksrcpath}/src/main/java && jar xvf ${worksrcpath}/${name}-${version}-src.jar"
      }


      depends_build bin:ant:apache-ant
      depends_lib port:hamcrest-core

      use_configure no

      build.cmd ant
      build.target build
      build.args -Dprefix=${prefix} -Dtestsrc=org/junit/tests -Ddist=.

      set docdir ${prefix}/share/doc/${name}-${version}
      set javadir ${prefix}/share/java
      set junitpkg junit.jar

      destroot {
      system "jar cvf ${worksrcpath}/${junitpkg} -C ${worksrcpath}/target/main ."
      xinstall -d ${destroot}${javadir} ${destroot}${docdir}
      xinstall -m 0644 ${worksrcpath}/${junitpkg} ${destroot}${javadir}
      copy ${worksrcpath}/doc ${destroot}${docdir}/html
      }

      Variant: doc description {Install extra documentation} {
      build.target-append javadoc

      post-destroot {
      file copy ${worksrcpath}/javadoc ${destroot}${docdir}/
      }
      }

      universal_variant no

    If you haven't already installed Darwin Ports, you can find easy instructions for doing so at the main Darwin Ports page.

    Once Darwin Ports has been installed, in a terminal window and while online, type the following and hit return:


      %  cd /opt/local/bin/portslocation/dports/junit
      % sudo port install junit
      Password:
    You will then be prompted for your root password, which you should enter. You may have to wait for a few minutes while the software is retrieved from the network and installed for you. Y ou should see something that looks similar to:

      ---> Fetching junit
      ---> Verifying checksum for junit
      ---> Extracting junit
      ---> Configuring junit
      ---> Building junit with target all
      ---> Staging junit into destroot
      ---> Installing junit
    - Make sure that you do not close the terminal window while Darwin Ports is working. Once the software has been installed, you can find further information about using junit with these commands:
      %  man junit
      % apropos junit
      % which junit
      % locate junit

     Where to find more information:

    Darwin Ports



    Lightbox this page.