Menu

TestRunner CFC moved in v0.2

Help
2005-09-19
2013-04-17
  • Robert Blackburn

    If you have any tests written for v0.1, you will get an error when you upgrade to v0.2 because the TestRunner CFC has moved from the runner folder to the framework folder.

    Fixing this is easy, in the CFML template you created to run the tests, just change this code...
    <pre>
    &lt;cfinvoke component="net.sourceforge.cfunit.runner.TestRunner" method="run"&gt;
        &lt;cfinvokeargument name="test" value="#testsuite#"&gt;
        &lt;cfinvokeargument name="name" value=""&gt;
    &lt;/cfinvoke&gt;
    </pre>
    To This:
    <pre>
    &lt;cfinvoke component="net.sourceforge.cfunit. framework.TestRunner" method="run"&gt;
        &lt;cfinvokeargument name="test" value="#testsuite#"&gt;
        &lt;cfinvokeargument name="name" value=""&gt;
    &lt;/cfinvoke&gt;
    </pre>

    Also, if you have a lot of code that you do not want to switch over right away, you can add a TestRunnder CFC to the /net/sourceforge/cfunit/runner folder that just extends the new TestRunner in the framework folder:
    <pre>
    &lt;cfcomponent name="TestRunner" extends="net.sourceforge.cfunit.framework.TestRunner"&gt;
    &lt;/cfcomponent&gt;
    </pre>
    This will keep you existing test running until you have time to switch them over.

     
    • Robert Blackburn

      If you have any tests written for v0.1, you will get an error when you upgrade to v0.2 because the TestRunner CFC has moved from the runner folder to the framework folder.

      Fixing this is easy, in the CFML template you created to run the tests, just change this code...
      <cfinvoke component="net.sourceforge.cfunit.runner.TestRunner" method="run">
          <cfinvokeargument name="test" value="#testsuite#">
          <cfinvokeargument name="name" value="">
      </cfinvoke>

      To This:
      <cfinvoke component="net.sourceforge.cfunit.framework.TestRunner" method="run">
          <cfinvokeargument name="test" value="#testsuite#">
          <cfinvokeargument name="name" value="">
      </cfinvoke>

      Also, if you have a lot of code that you do not want to switch over right away, you can add a TestRunnder CFC to the /net/sourceforge/cfunit/runner folder that just extends the new TestRunner in the framework folder:
      <cfcomponent name="TestRunner" extends="net.sourceforge.cfunit.framework.TestRunner">
      </cfcomponent>

      This will keep you existing test running until you have time to switch them over.

       

Log in to post a comment.