Loading ...
Sorry, an error occurred while loading the content.

Re: [fitnesse] Re: Using jmockit with FitNesse

Expand Messages
  • Gregor Gramlich
    Hi Simon It looks like your command pattern does not start any Fit / FitLibrary or Slim server. Click on the blue i or the yellow triangle in the top right
    Message 1 of 7 , Jun 1, 2011
    • 0 Attachment
      Hi Simon

      It looks like your command pattern does not start any Fit / FitLibrary
      or Slim server.
      Click on the blue "i" or the yellow triangle in the top right corner
      after you ran the test to see what is actually called.

      I guess you need something like

      !define COMMAND_PATTERN {java -javaagent:../lib/jmockit.jar -cp %p %m}

      Gregor

      2011/6/1 simon.tower <simon.tower@...>
      >
      >
      >
      > The classpath is included already. Jmockit requires the java vm argument "javaagent" to be defined as well. I'm not sure why the argument is required, but it is nonetheless.
      >
      > --- In fitnesse@yahoogroups.com, Rick Mugridge <rick@...> wrote:
      > >
      > > Why can't you just include it in the classpath, as usual? That is:
      > >
      > > !path ../lib/jmockit.jar
      > >
      > > Cheers, Rick
      > >
      > > On 1/06/2011 9:10 a.m., simon.tower wrote:
      > > >
      > > > Hello FitNesse folks,
      > > >
      > > > I'm trying to get FitNesse to work with a mocking framework named jmockit.
      > > >
      > > > Has anyone had experience integrating FitNesse with jmockit?
      > > >
      > > > To use jmockit in a FitNesse test, a command pattern variable has to
      > > > be defined, like so:
      > > >
      > > > !define COMMAND_PATTERN {java -javaagent:../lib/jmockit.jar}
      > > >
      > > > However, when I run the test with this variable, the test gets stuck
      > > > in "running" and never returns any results.
      > > >
      > > > Thanks for any help!
      > > >
      > > >
      > >
      >
      >
    • simon.tower
      Hi Gregor, Thanks for the tip, but I am still confused. I already have a FitNesse server started when I access the test page. I am still a bit new to FitNesse.
      Message 2 of 7 , Jun 1, 2011
      • 0 Attachment
        Hi Gregor,

        Thanks for the tip, but I am still confused.
        I already have a FitNesse server started when I access the test page. I am still a bit new to FitNesse. Is the FitNesse server started by the fitnesse.jar different fron a Fit/Fitlibrary/Slim server?

        I also have the classpath defined on the root page. Why would I have to define it again within the command pattern?

        Thanks for any help! I am really stuck in a rut here.

        -Simon

        --- In fitnesse@yahoogroups.com, Gregor Gramlich <gramlich@...> wrote:
        >
        > Hi Simon
        >
        > It looks like your command pattern does not start any Fit / FitLibrary
        > or Slim server.
        > Click on the blue "i" or the yellow triangle in the top right corner
        > after you ran the test to see what is actually called.
        >
        > I guess you need something like
        >
        > !define COMMAND_PATTERN {java -javaagent:../lib/jmockit.jar -cp %p %m}
        >
        > Gregor
        >
        > 2011/6/1 simon.tower <simon.tower@...>
        > >
        > >
        > >
        > > The classpath is included already. Jmockit requires the java vm argument "javaagent" to be defined as well. I'm not sure why the argument is required, but it is nonetheless.
        > >
        > > --- In fitnesse@yahoogroups.com, Rick Mugridge <rick@> wrote:
        > > >
        > > > Why can't you just include it in the classpath, as usual? That is:
        > > >
        > > > !path ../lib/jmockit.jar
        > > >
        > > > Cheers, Rick
        > > >
        > > > On 1/06/2011 9:10 a.m., simon.tower wrote:
        > > > >
        > > > > Hello FitNesse folks,
        > > > >
        > > > > I'm trying to get FitNesse to work with a mocking framework named jmockit.
        > > > >
        > > > > Has anyone had experience integrating FitNesse with jmockit?
        > > > >
        > > > > To use jmockit in a FitNesse test, a command pattern variable has to
        > > > > be defined, like so:
        > > > >
        > > > > !define COMMAND_PATTERN {java -javaagent:../lib/jmockit.jar}
        > > > >
        > > > > However, when I run the test with this variable, the test gets stuck
        > > > > in "running" and never returns any results.
        > > > >
        > > > > Thanks for any help!
        > > > >
        > > > >
        > > >
        > >
        > >
        >
      • Gregor Gramlich
        Hi Simon, this page may help a bit http://fitnesse.org/FitNesse.UserGuide.CustomizingTestExecution
        Message 3 of 7 , Jun 1, 2011
        • 0 Attachment
          Hi Simon,

          this page may help a bit


          The %p is replaced by all the !path declarations from the ancestor pages as well as the fitnesse.jar

          When you look at this picture:
          the parts immediately to the right of the process boundary line are the ones that are started by the command that you see when you click on the symbol in the upper right after the test. Usually this is a fitnesse.jar (e.g. Java Slim) or it might be a fitlibrary.jar when using fitlibrary.

          Gregor




          2011/6/1 simon.tower <simon.tower@...>
           

          Hi Gregor,

          Thanks for the tip, but I am still confused.
          I already have a FitNesse server started when I access the test page. I am still a bit new to FitNesse. Is the FitNesse server started by the fitnesse.jar different fron a Fit/Fitlibrary/Slim server?

          I also have the classpath defined on the root page. Why would I have to define it again within the command pattern?

          Thanks for any help! I am really stuck in a rut here.

          -Simon



          --- In fitnesse@yahoogroups.com, Gregor Gramlich <gramlich@...> wrote:
          >
          > Hi Simon
          >
          > It looks like your command pattern does not start any Fit / FitLibrary
          > or Slim server.
          > Click on the blue "i" or the yellow triangle in the top right corner
          > after you ran the test to see what is actually called.
          >
          > I guess you need something like
          >
          > !define COMMAND_PATTERN {java -javaagent:../lib/jmockit.jar -cp %p %m}
          >
          > Gregor
          >
          > 2011/6/1 simon.tower <simon.tower@...>

          > >
          > >
          > >
          > > The classpath is included already. Jmockit requires the java vm argument "javaagent" to be defined as well. I'm not sure why the argument is required, but it is nonetheless.
          > >
          > > --- In fitnesse@yahoogroups.com, Rick Mugridge <rick@> wrote:
          > > >
          > > > Why can't you just include it in the classpath, as usual? That is:
          > > >
          > > > !path ../lib/jmockit.jar
          > > >
          > > > Cheers, Rick
          > > >
          > > > On 1/06/2011 9:10 a.m., simon.tower wrote:
          > > > >
          > > > > Hello FitNesse folks,
          > > > >
          > > > > I'm trying to get FitNesse to work with a mocking framework named jmockit.
          > > > >
          > > > > Has anyone had experience integrating FitNesse with jmockit?
          > > > >
          > > > > To use jmockit in a FitNesse test, a command pattern variable has to
          > > > > be defined, like so:
          > > > >
          > > > > !define COMMAND_PATTERN {java -javaagent:../lib/jmockit.jar}
          > > > >
          > > > > However, when I run the test with this variable, the test gets stuck
          > > > > in "running" and never returns any results.
          > > > >
          > > > > Thanks for any help!
          > > > >
          > > > >
          > > >
          > >
          > >
          >


        • simon.tower
          Hi Gregor, Thank you very much! The links you provided were a great help. I think I am past the problems I was having with FitNesse, now I just have to solve
          Message 4 of 7 , Jun 1, 2011
          • 0 Attachment
            Hi Gregor,

            Thank you very much! The links you provided were a great help.
            I think I am past the problems I was having with FitNesse, now I just have to solve the problems I am having with jmockit.

            When I try to run the test now, I get the following exception when I declare new jmockit expectations:

            java.lang.IllegalStateException: Invalid context for the recording of expectations

            The captured output reports another exception:

            Exception in thread "Thread-0" java.lang.IllegalStateException: No "src" directories found under "C:\projects\IHub-trunk\FitNesse"

            If I move the server origin point around, or if I copy the "src" directory to live in the Fitnesse root, the captured output error goes away, but the exception reported in the test is still there.

            This looks like it is simply a configuration problem with jmockit. There is no help that I can find online for the problem, though.

            I'll post again if I do find the fix. Thanks for all your help!

            -Simon


            --- In fitnesse@yahoogroups.com, Gregor Gramlich <gramlich@...> wrote:
            >
            > Hi Simon,
            >
            > this page may help a bit
            >
            > http://fitnesse.org/FitNesse.UserGuide.CustomizingTestExecution
            >
            > <http://fitnesse.org/FitNesse.UserGuide.CustomizingTestExecution>The %p is
            > replaced by all the !path declarations from the ancestor pages as well as
            > the fitnesse.jar
            >
            > When you look at this picture:
            > http://fitnesse.org/FitNesse.UserGuide.TestSystems
            > the parts immediately to the right of the process boundary line are the ones
            > that are started by the command that you see when you click on the symbol in
            > the upper right after the test. Usually this is a fitnesse.jar (e.g. Java
            > Slim) or it might be a fitlibrary.jar when using fitlibrary.
            >
            > Gregor
            >
            >
            >
            >
            > 2011/6/1 simon.tower <simon.tower@...>
            >
            > >
            > >
            > > Hi Gregor,
            > >
            > > Thanks for the tip, but I am still confused.
            > > I already have a FitNesse server started when I access the test page. I am
            > > still a bit new to FitNesse. Is the FitNesse server started by the
            > > fitnesse.jar different fron a Fit/Fitlibrary/Slim server?
            > >
            > > I also have the classpath defined on the root page. Why would I have to
            > > define it again within the command pattern?
            > >
            > > Thanks for any help! I am really stuck in a rut here.
            > >
            > > -Simon
            > >
            > >
            > > --- In fitnesse@yahoogroups.com, Gregor Gramlich <gramlich@> wrote:
            > > >
            > > > Hi Simon
            > > >
            > > > It looks like your command pattern does not start any Fit / FitLibrary
            > > > or Slim server.
            > > > Click on the blue "i" or the yellow triangle in the top right corner
            > > > after you ran the test to see what is actually called.
            > > >
            > > > I guess you need something like
            > > >
            > > > !define COMMAND_PATTERN {java -javaagent:../lib/jmockit.jar -cp %p %m}
            > > >
            > > > Gregor
            > > >
            > > > 2011/6/1 simon.tower <simon.tower@>
            > >
            > > > >
            > > > >
            > > > >
            > > > > The classpath is included already. Jmockit requires the java vm
            > > argument "javaagent" to be defined as well. I'm not sure why the argument is
            > > required, but it is nonetheless.
            > > > >
            > > > > --- In fitnesse@yahoogroups.com, Rick Mugridge <rick@> wrote:
            > > > > >
            > > > > > Why can't you just include it in the classpath, as usual? That is:
            > > > > >
            > > > > > !path ../lib/jmockit.jar
            > > > > >
            > > > > > Cheers, Rick
            > > > > >
            > > > > > On 1/06/2011 9:10 a.m., simon.tower wrote:
            > > > > > >
            > > > > > > Hello FitNesse folks,
            > > > > > >
            > > > > > > I'm trying to get FitNesse to work with a mocking framework named
            > > jmockit.
            > > > > > >
            > > > > > > Has anyone had experience integrating FitNesse with jmockit?
            > > > > > >
            > > > > > > To use jmockit in a FitNesse test, a command pattern variable has
            > > to
            > > > > > > be defined, like so:
            > > > > > >
            > > > > > > !define COMMAND_PATTERN {java -javaagent:../lib/jmockit.jar}
            > > > > > >
            > > > > > > However, when I run the test with this variable, the test gets
            > > stuck
            > > > > > > in "running" and never returns any results.
            > > > > > >
            > > > > > > Thanks for any help!
            > > > > > >
            > > > > > >
            > > > > >
            > > > >
            > > > >
            > > >
            > >
            > >
            > >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.