Download and Install junit version 4.4 on Mac OS X
Wednesday the 23rd of July, 2008

    junit  most recent diff


      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.4 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
      Google
      Web Darwinports.com



      # $Id: Portfile 32815 2008-01-14 02:44:04Z nox macports.org $

      PortSystem 1.0

      Name: junit
      Version: 4.4
      Category: java devel
      Platform: darwin
      Maintainers: nox
      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 4755aa0af58a834bedce1f0119dc9514 sha1 83be34288bf8e595a6eb5a1de9c6cd96042d8c32 rmd160 915d20222030f5678a2d74cf07080a305c0c1407

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

      eval delete ${worksrcpath}/javadoc ${worksrcpath}/temp.hamcrest.source [glob -directory ${worksrcpath} *.jar]

      fs-traverse {f} ${worksrcpath} {
      if {[string match *.class ${f}]} {
      delete ${f}
      }
      }
      }

      depends_lib port:hamcrest-core

      use_configure no

      set docdir ${prefix}/share/doc/${name}-${version}
      set javadir ${prefix}/share/java
      set hamcrestpkg ${javadir}/hamcrest-core.jar
      set junitpkg junit.jar
      set l [string length ${worksrcpath}/]

      build {
      set sources {}

      fs-traverse {f} ${worksrcpath}/src {
      if {[string match *.java ${f}]} {
      lappend sources [string range ${f} ${l} end]
      }
      }

      file mkdir ${worksrcpath}/classes
      foreach {source} ${sources} {
      set cmdstring "cd ${worksrcpath} && javac -d classes -cp ${hamcrestpkg} -sourcepath src ${source}"
      ui_debug ${cmdstring}
      system ${cmdstring}
      }

      set cmdstring "cd ${worksrcpath} && jar -cf ${worksrcpath}/${junitpkg} -C classes ."
      ui_debug ${cmdstring}
      system ${cmdstring}
      }

      test {
      set sources {}

      fs-traverse {f} "${worksrcpath}/junit/tests ${worksrcpath}/org/junit/tests" {
      if {[string match *.java ${f}]} {
      lappend sources [string range ${f} ${l} end]
      }
      }

      file mkdir ${worksrcpath}/classes
      foreach {source} ${sources} {
      set cmdstring "cd ${worksrcpath} && javac -d classes -cp ${hamcrestpkg}:${junitpkg} -sourcepath . ${source}"
      ui_debug ${cmdstring}
      system ${cmdstring}
      }

      foreach {p} {junit org.junit} {
      set class ${p}.tests.AllTests
      set cmdstring "cd ${worksrcpath} && java -cp classes:${junitpkg}:${hamcrestpkg} org.junit.runner.JUnitCore ${class}"
      ui_debug ${cmdstring}
      system ${cmdstring}
      }
      }

      destroot {
      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} {
      post-build {
      file mkdir ${worksrcpath}/javadoc
      set cmdstring "cd ${worksrcpath} && javadoc -d javadoc -sourcepath src -subpackages junit:org -classpath .:${hamcrestpkg}"
      ui_debug ${cmdstring}
      system ${cmdstring}
      }

      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



    image test