6 Replies Latest reply on Mar 18, 2008 10:41 AM by rhauch

    Problem getting started

    romney

      I decided to give it a try. After checkout of the project I did a mvn install.

      I got a dependency error I fixed by adding (to the pom.xml):

      <dependency>
       <groupId>org.hamcrest</groupId>
       <artifactId>hamcrest-library</artifactId>
       <version>1.1</version>
       <scope>test</scope>
      </dependency>


      And to ensure that I could download al the require jar I added (also to the pom.xml):

      <repositories>
       <repository>
       <id>repository.jboss.org</id>
       <name>JBoss Repository</name>
       <url>http://repository.jboss.org/maven2</url>
       </repository>
      </repositories>


      It seems to do the trick :-)

      Unfortunatly, I got 6 failures in the following tests:
      - shouldReportTotalTime(org.jboss.dna.common.stats.StopwatchTest) Time elapsed: 0.062 sec <<< FAILURE!
      java.lang.AssertionError: expected:<40.0> but was:<61.0>
      - shouldReportAverageTime(org.jboss.dna.common.stats.StopwatchTest) Time elapsed: 0.063 sec <<< FAILURE!
      java.lang.AssertionError: expected:<10> but was:<14>
      ...
      - shouldConvertDateToStringAndBack(org.jboss.dna.common.util.DateUtilTest) Time elapsed: 0 sec <<< ERROR!
      java.lang.NumberFormatException: For input string: "+01"
      ...

      The errors are related to time and date. Any ideas that is wrong. I am testing using jdk 1.6.0_04.

      Thanks in advanced


        • 1. Re: Problem getting started

          hi romney and rhauch,

          the test unit for the method DateUtil.getCalendarFromStandardString() does't work because of a bug in the method.

          possible value of timeZoneHour can be +01 or -01 etc.
          the parse of the value -01 to -1 is possible but the parse of +01 to 1 isn't possible with the Integer.parseInt("+01") and thereby the method throws a java.lang.NumberFormatException: For input string: "+01"

          int zoneOffsetInMillis = Integer.parseInt(timeZoneHour) * 60 * 60 * 1000;


          @romney use jdk 1.5 in place of jdk 1.6.0_04, because the JBDNA is configured to be compiled and tested with jdk 1.5

          <!-- Specify the compiler options and settings -->
           <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
           <configuration>
           <source>1.5</source>
           <target>1.5</target>
           <showDeprecation>false</showDeprecation>
           <showWarnings>false</showWarnings>
           </configuration>
           </plugin>


          • 2. Re: Problem getting started
            rhauch

            @romney: did you check out all of the projects, or just the 'dna-common' project?

            @romney, @sisepago: Thanks for finding this problem. I've logged a new JIRA issue (http://jira.jboss.org/jira/browse/DNA-20), added a test case for a time zone prefixed with '+', and made a fix. The unit tests related to stopwatch are likely failing because Thread.sleep appears to be wildly inaccurate. Still looking into a good way of handling that.

            • 3. Re: Problem getting started
              romney

              I belive I got the entire project containing the following dir. structure:

              dna-common
              dna-integration-tests
              dna-maven-classloader
              dna-services
              docs



              • 4. Re: Problem getting started
                rhauch

                The reason I asked is that I'm wondering why you needed to add the hamcrest library to the (dna-common?) pom.xml. That should have been inherited from the parent POM, which is right under 'trunk' (see https://svn.jboss.org/repos/dna/trunk/).

                What version of Maven are you using? I'm using 2.0.7.

                • 5. Re: Problem getting started
                  romney

                  I am using maven 2.0.8.

                  I did not add the hamcrest library to dna-common pom.xml, but to the parent pom.xml. After looking through the logs I can see the hamcrest library was added to the parent pom.xml in revision 66.

                  Anyway, after updating parent pom.xml (and now using revision 66) everything works fine.

                  • 6. Re: Problem getting started
                    rhauch

                    Great! Thanks again for running the tests. Stay tuned to the blog for announcements.