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

Re: Overriding Variable definitions from outside of FitNesse

Expand Messages
  • arnaud.baillly
    Hi Etienne, Thanks for your answer. Actually yes, the trinidad plugin by Gojko Adzic picks up the classpath from maven, something I recently discovered. My
    Message 1 of 10 , Apr 1, 2010
      Hi Etienne,

      Thanks for your answer. Actually yes, the trinidad plugin by Gojko Adzic picks up the classpath from maven, something I recently discovered. My question was more general as I may want to deploy fitnesse and run it from arbitrary settings. And I would like to know how other people are managing their test pages and the relationship with their code.



      --- In fitnesse@yahoogroups.com, Etienne Charignon <etienne.charignon@...> wrote:
      >
      > Hi Arnaud,
      >
      > When you run your tests with maven isn't it taking the classpath from maven
      > ? I remember that there was a maven plugin dedicated to fitnesse that was
      > doing it (but that was before the introduction of trinidad. I'm not sure if
      > it continue to work).
      >
      > Etienne
      >
      > 2010/3/31 arnaud.baillly <abailly@...>
      >
      > >
      > >
      > > Hello,
      > > I would like to be able to run a bunch of fitnesse tests through maven
      > > using the trinidad plugin. This works OK but I have one concern: My test
      > > pages contain references to classpath entries which are absolute but of
      > > course if I want to store my pages with my code source and be able to check
      > > out everything in an arbitrary directory (on an arbitrary system), I would
      > > like to make my classpaht entries somehow relative, pointing to an uber-jar
      > > for example in Java or to a directory relative to some basedir.
      > >
      > > I can imagine solving this issue if Fitnesse is able to interpret
      > > environment variables and expand them within its own variables system, but I
      > > could not find any information on this in the UserGuide. Maybe I missed
      > > something...
      > >
      > > What would you advise me to do? More generally, what is the right approach
      > > to this issue?
      > >
      > > Best regards,
      > > Arnaud Bailly
      > >
      > >
      > >
      >
      >
      >
      > --
      > Étienne Charignon
      > Consultant Valtech Technology
      > 06 81 81 99 84
      > http://etienne.charignon.free.fr
      >
    • Etienne Charignon
      Hi Arnaud, Here is how I do it. That s very basic. If someone has a better mean please tell me. I have absolute paths in my fitnesse root page. I set up all
      Message 2 of 10 , Apr 1, 2010
        Hi Arnaud,

        Here is how I do it. That's very basic. If someone has a better mean please tell me.

        I have absolute paths in my fitnesse "root" page.
        I set up all developpers' machine with the same path (all eclipse workspace at the same place).

        In the root page, I have 2 or 3 times the same classpath with a different roots
        - one for developers,
        - one for the integration server (referencing a path in the Hudson architecture). I realize that I could remove this part by using Trinidad plugin.
        - one the demonstration server. (optional)

        I use a small java piece of code to generate this trimple instance of classpath from the output of the command : mvn dependency:build-classpath

        I get something like this :

        !define TEST_SYSTEM {slim}
        !path classes
        !path fitnesse.jar

        !path D:\workspace\core\target\classes
        !path D:\workspace\web\target\classes
        !path D:\workspace\web\target\test-classes

        !path D:\hudson\jobs\ProjectX\core\target\classes
        !path D:\hudson\jobs\ProjectX\web\target\classes
        !path D:\hudson\jobs\ProjectX\web\target\test-classes

        !define MAVEN_REPO_DEV {D:\m2-repo}
        !define MAVEN_REPO_IC {/logiciels/maven/MavenRepo/repository}

        !path ${MAVEN_REPO_DEV}/antlr/antlr/2.7.6/antlr-2.7.6.jar
        !path ${MAVEN_REPO_DEV}/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
        !path ${MAVEN_REPO_DEV}/bouncycastle/bcmail-jdk14/138/bcmail-jdk14-138.jar
        ...

        !path ${MAVEN_REPO_IC}/antlr/antlr/2.7.6/antlr-2.7.6.jar
        !path ${MAVEN_REPO_IC}/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
        !path ${MAVEN_REPO_IC}/bouncycastle/bcmail-jdk14/138/bcmail-jdk14-138.jar
        ...


        2010/4/1 arnaud.baillly <abailly@...>
         

        Hi Etienne,

        Thanks for your answer. Actually yes, the trinidad plugin by Gojko Adzic picks up the classpath from maven, something I recently discovered. My question was more general as I may want to deploy fitnesse and run it from arbitrary settings. And I would like to know how other people are managing their test pages and the relationship with their code.



        --- In fitnesse@yahoogroups.com, Etienne Charignon <etienne.charignon@...> wrote:
        >
        > Hi Arnaud,
        >
        > When you run your tests with maven isn't it taking the classpath from maven
        > ? I remember that there was a maven plugin dedicated to fitnesse that was
        > doing it (but that was before the introduction of trinidad. I'm not sure if
        > it continue to work).
        >
        > Etienne
        >
        > 2010/3/31 arnaud.baillly <abailly@...>

        >
        > >
        > >
        > > Hello,
        > > I would like to be able to run a bunch of fitnesse tests through maven
        > > using the trinidad plugin. This works OK but I have one concern: My test
        > > pages contain references to classpath entries which are absolute but of
        > > course if I want to store my pages with my code source and be able to check
        > > out everything in an arbitrary directory (on an arbitrary system), I would
        > > like to make my classpaht entries somehow relative, pointing to an uber-jar
        > > for example in Java or to a directory relative to some basedir.
        > >
        > > I can imagine solving this issue if Fitnesse is able to interpret
        > > environment variables and expand them within its own variables system, but I
        > > could not find any information on this in the UserGuide. Maybe I missed
        > > something...
        > >
        > > What would you advise me to do? More generally, what is the right approach
        > > to this issue?
        > >
        > > Best regards,
        > > Arnaud Bailly
        > >
        > >
        > >
        >
        >
        >
        > --
        > Étienne Charignon
        > Consultant Valtech Technology
        > 06 81 81 99 84
        > http://etienne.charignon.free.fr
        >




        --
        Étienne Charignon
        Consultant Valtech Technology
        06 81 81 99 84
        http://etienne.charignon.free.fr

      • Gregor Gramlich
        Hi Arnaud, I usually define my !path relative to the FitNesseRoot directory. For example I have a structure like this +src +classes +FitNesseRoot +lib ... then
        Message 3 of 10 , Apr 1, 2010
          Hi Arnaud,

          I usually define my !path relative to the FitNesseRoot directory.

          For example I have a structure like this

          +src
          +classes
          +FitNesseRoot
          +lib
           |- fitnesse.jar

          then I put
          !path ${FITNESSE_ROOTPATH}/lib/fitnesse.jar
          !path ${FITNESSE_ROOTPATH}/classes

          into the root page.

          Another thing that we did was to put the java class path and a token string into the root context.txt which allows us to override a variable definition through our ant script. That project has a root page like this

          content.txt
          --------------
          !define TEST_SYSTEM {slim}
          !path ${java.class.path}

          !define TOMCAT_PORT {8080}
          !define SELENIUM_PORT {4444}

          !**> Do not change the following lines they are set by the ant script
          @ALTERNATIVE_PATH@
          @VARIABLE_DEFINITIONS@

          **!

          Selenium Port: ${SELENIUM_PORT}
          ----------

          and a target in our ant script

              <property name="TomcatPort" value="8081" />
              <property name="SeleniumPort" value="4445" />

              <target name="copy-fitnessewiki">
                  <copy todir="target/FitNesseRoot">
                      <fileset dir="FitNesseRoot" />
                  </copy>
                  <replace file="target/FitNesseRoot/content.txt" token="@VARIABLE_DEFINITIONS@">
                      <replacevalue>!define TOMCAT_PORT {@TOMCAT_PORT@}
          !define SELENIUM_PORT {@SELENIUM_PORT@}
                      </replacevalue>
                  </replace>
                  <replace file="target/FitNesseRoot/content.txt">
                      <replacefilter token="@TOMCAT_PORT@" value="${TomcatPort}" />
                      <replacefilter token="@SELENIUM_PORT@" value="${SeleniumPort}" />
                  </replace>
              </target>


          Gregor



          2010/3/31 arnaud.baillly <abailly@...>
           

          Hello,
          I would like to be able to run a bunch of fitnesse tests through maven using the trinidad plugin. This works OK but I have one concern: My test pages contain references to classpath entries which are absolute but of course if I want to store my pages with my code source and be able to check out everything in an arbitrary directory (on an arbitrary system), I would like to make my classpaht entries somehow relative, pointing to an uber-jar for example in Java or to a directory relative to some basedir.

          I can imagine solving this issue if Fitnesse is able to interpret environment variables and expand them within its own variables system, but I could not find any information on this in the UserGuide. Maybe I missed something...

          What would you advise me to do? More generally, what is the right approach to this issue?

          Best regards,
          Arnaud Bailly


        • arnaud.baillly
          Thanks a lot! Yes, the replacement seems a good way to go, easy to do as part of the checkout/build. Are you versionning your pages along with your code ?
          Message 4 of 10 , Apr 1, 2010
            Thanks a lot! Yes, the replacement seems a good way to go, easy to do as part of the checkout/build. Are you versionning your pages along with your code ?

            Regards,
            Arnaud


            --- In fitnesse@yahoogroups.com, "arnaud.baillly" <abailly@...> wrote:
            >
            > Hello,
            > I would like to be able to run a bunch of fitnesse tests through maven using the trinidad plugin. This works OK but I have one concern: My test pages contain references to classpath entries which are absolute but of course if I want to store my pages with my code source and be able to check out everything in an arbitrary directory (on an arbitrary system), I would like to make my classpaht entries somehow relative, pointing to an uber-jar for example in Java or to a directory relative to some basedir.
            >
            > I can imagine solving this issue if Fitnesse is able to interpret environment variables and expand them within its own variables system, but I could not find any information on this in the UserGuide. Maybe I missed something...
            >
            > What would you advise me to do? More generally, what is the right approach to this issue?
            >
            > Best regards,
            > Arnaud Bailly
            >
          • Etienne Charignon
            I don t know if your question was directed to me, but yes I do put the full fitnesse tree into subversion (except the zips). You can also make an eclipse
            Message 5 of 10 , Apr 2, 2010
              I don't know if your question was directed to me, but yes I do put the full fitnesse tree into subversion (except the zips).

              You can also make an eclipse projects on that tree what make me able to search for strings and refactor the table for example.

              Etienne

              2010/4/1 arnaud.baillly <abailly@...>
               


              Thanks a lot! Yes, the replacement seems a good way to go, easy to do as part of the checkout/build. Are you versionning your pages along with your code ?

              Regards,
              Arnaud



              --- In fitnesse@yahoogroups.com, "arnaud.baillly" <abailly@...> wrote:
              >
              > Hello,
              > I would like to be able to run a bunch of fitnesse tests through maven using the trinidad plugin. This works OK but I have one concern: My test pages contain references to classpath entries which are absolute but of course if I want to store my pages with my code source and be able to check out everything in an arbitrary directory (on an arbitrary system), I would like to make my classpaht entries somehow relative, pointing to an uber-jar for example in Java or to a directory relative to some basedir.
              >
              > I can imagine solving this issue if Fitnesse is able to interpret environment variables and expand them within its own variables system, but I could not find any information on this in the UserGuide. Maybe I missed something...
              >
              > What would you advise me to do? More generally, what is the right approach to this issue?
              >
              > Best regards,
              > Arnaud Bailly
              >




              --
              Étienne Charignon
              Consultant Valtech Technology
              06 81 81 99 84
              http://etienne.charignon.free.fr

            • Robert Martin
              ... In FitNesse, if you say ${ENVVAR} where ENVVAR is an environment variable, it will replace it with the value of the environment variable. ... Robert C.
              Message 6 of 10 , Apr 2, 2010
                > Overriding Variable definitions from outside of FitNesse
                > Posted by: "arnaud.baillly" abailly@... arnaud.baillly
                > Wed Mar 31, 2010 7:42 am (PDT)
                >
                >
                >
                > Hello,
                > I would like to be able to run a bunch of fitnesse tests through maven using the trinidad plugin. This works OK but I have one concern: My test pages contain references to classpath entries which are absolute but of course if I want to store my pages with my code source and be able to check out everything in an arbitrary directory (on an arbitrary system), I would like to make my classpaht entries somehow relative, pointing to an uber-jar for example in Java or to a directory relative to some basedir.
                >
                > I can imagine solving this issue if Fitnesse is able to interpret environment variables and expand them within its own variables system, but I could not find any information on this in the UserGuide. Maybe I missed something...
                >
                > What would you advise me to do? More generally, what is the right approach to this issue?


                In FitNesse, if you say ${ENVVAR} where ENVVAR is an environment variable, it will replace it with the value of the environment variable.


                ----
                Robert C. Martin (Uncle Bob) | email: unclebob@...
                Object Mentor Inc. | blog: blog.objectmentor.com
                The Agile Transition Experts | web: www.objectmentor.com
                847.249.4209 | twitter: unclebobmartin
              • arnaud.baillly
                That s what I was looking for but could not find in the documentation. Did I miss something? Thanks a lot Arnaud
                Message 7 of 10 , Apr 2, 2010
                  That's what I was looking for but could not find in the documentation. Did I miss something?

                  Thanks a lot
                  Arnaud

                  --- In fitnesse@yahoogroups.com, Robert Martin <UncleBob@...> wrote:
                  >
                  > > Overriding Variable definitions from outside of FitNesse
                  > > Posted by: "arnaud.baillly" abailly@... arnaud.baillly
                  > > Wed Mar 31, 2010 7:42 am (PDT)
                  > >
                  > >
                  > >
                  > > Hello,
                  > > I would like to be able to run a bunch of fitnesse tests through maven using the trinidad plugin. This works OK but I have one concern: My test pages contain references to classpath entries which are absolute but of course if I want to store my pages with my code source and be able to check out everything in an arbitrary directory (on an arbitrary system), I would like to make my classpaht entries somehow relative, pointing to an uber-jar for example in Java or to a directory relative to some basedir.
                  > >
                  > > I can imagine solving this issue if Fitnesse is able to interpret environment variables and expand them within its own variables system, but I could not find any information on this in the UserGuide. Maybe I missed something...
                  > >
                  > > What would you advise me to do? More generally, what is the right approach to this issue?
                  >
                  >
                  > In FitNesse, if you say ${ENVVAR} where ENVVAR is an environment variable, it will replace it with the value of the environment variable.
                  >
                  >
                  > ----
                  > Robert C. Martin (Uncle Bob) | email: unclebob@...
                  > Object Mentor Inc. | blog: blog.objectmentor.com
                  > The Agile Transition Experts | web: www.objectmentor.com
                  > 847.249.4209 | twitter: unclebobmartin
                  >
                • Gregor Gramlich
                  Hi Uncle Bob, the current implementation makes !define override a system property. This is also documented in
                  Message 8 of 10 , Apr 2, 2010
                    Hi Uncle Bob,

                    the current implementation makes !define override a system property.

                    This is also documented in

                    Is there a way to do it the other way around, i.e. define a default value on the page which is only used if the system property was not set?

                    Gregor




                    2010/4/2 Robert Martin <UncleBob@...>
                     

                    > Overriding Variable definitions from outside of FitNesse
                    > Posted by: "arnaud.baillly" abailly@... arnaud.baillly
                    > Wed Mar 31, 2010 7:42 am (PDT)


                    >
                    >
                    >
                    > Hello,
                    > I would like to be able to run a bunch of fitnesse tests through maven using the trinidad plugin. This works OK but I have one concern: My test pages contain references to classpath entries which are absolute but of course if I want to store my pages with my code source and be able to check out everything in an arbitrary directory (on an arbitrary system), I would like to make my classpaht entries somehow relative, pointing to an uber-jar for example in Java or to a directory relative to some basedir.
                    >
                    > I can imagine solving this issue if Fitnesse is able to interpret environment variables and expand them within its own variables system, but I could not find any information on this in the UserGuide. Maybe I missed something...
                    >
                    > What would you advise me to do? More generally, what is the right approach to this issue?

                    In FitNesse, if you say ${ENVVAR} where ENVVAR is an environment variable, it will replace it with the value of the environment variable.


                    ----
                    Robert C. Martin (Uncle Bob) | email: unclebob@...
                    Object Mentor Inc. | blog: blog.objectmentor.com
                    The Agile Transition Experts | web: www.objectmentor.com
                    847.249.4209 | twitter: unclebobmartin


                  Your message has been successfully submitted and would be delivered to recipients shortly.