Uploaded image for project: 'JBoss Metadata'
  1. JBoss Metadata
  2. JBMETA-444

org.jboss.metadata.test.ComparePreviousSchemasTestCase failed due to version comparison

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 15.3.0.Final
    • None
    • None
    • None
    • False
    • None
    • False
    • Untriaged

      org.jboss.metadata.test.ComparePreviousSchemasTestCase failed when comparing the current schema version against the last release version.

      When parsing the version value, it uses dot (.) as the delimiter. But current version is of the form 15.3.0-SNAPSHOT, which yields:

      15
      0
      0-SNAPSHOT

      The 3rd element has the unwanted suffix, which will fail in the following:

              if(current[2].equals("0")) {
                  //not a point release, we want to test against a previous major
                  int m1 = Integer.parseInt(current[0]);
                  int m2 = Integer.parseInt(test[0]);
                  if(m1 == m2) {
                      //same major version, check the minor
                      m1 = Integer.parseInt(current[1]);
                      m2 = Integer.parseInt(test[1]);
                      if(m2 + 1 != m1) {
                          failTestVersion();
                      }
                  } else {
                      if(m2 + 1 != m1) {
                          failTestVersion();
                      }
                  }
              } else {
                  //this is a point release, we should be testing against another version with the same major/minor
                 if(!current[0].equals(test[0]) || !current[1].equals(test[1])) {
                     failTestVersion();
                 }
              }
      

              ehugonne1@redhat.com Emmanuel Hugonnet
              cfang@redhat.com Cheng Fang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: