public void verifyPom(){
  String pomFileName=pomFile.getAbsolutePath();
  log.info("Verifying file " + pomFileName);
  XmlOrderedResult xmlOrderedResult=isPomElementsSorted();
  if (!xmlOrderedResult.isOrdered()) {
switch (verifyFailType) {
case WARN:
      log.warn(xmlOrderedResult.getErrorMessage());
    log.warn(String.format(TEXT_FILE_NOT_SORTED,pomFileName));
  break;
case SORT:
log.info(xmlOrderedResult.getErrorMessage());
log.info(String.format(TEXT_FILE_NOT_SORTED,pomFileName));
sortPom();
break;
case STOP:
log.error(xmlOrderedResult.getErrorMessage());
log.error(String.format(TEXT_FILE_NOT_SORTED,pomFileName));
throw new FailureException(String.format(TEXT_FILE_NOT_SORTED,pomFileName));
default :
log.error(xmlOrderedResult.getErrorMessage());
throw new IllegalStateException(verifyFailType.toString());
}
}
}

public void verifyPom ( ) { String pomFileName = pomFile . getAbsolutePath ( ) ; log . info ( "Verifying file " + pomFileName ) ; XmlOrderedResult xmlOrderedResult = isPomElementsSorted ( ) ; if ( ! xmlOrderedResult . isOrdered ( ) ) { switch ( verifyFailType ) { case WARN : log . warn ( xmlOrderedResult . getErrorMessage ( ) ) ; log . warn ( String . format ( TEXT_FILE_NOT_SORTED , pomFileName ) ) ; break ; case SORT : log . info ( xmlOrderedResult . getErrorMessage ( ) ) ; log . info ( String . format ( TEXT_FILE_NOT_SORTED , pomFileName ) ) ; sortPom ( ) ; break ; case STOP : log . error ( xmlOrderedResult . getErrorMessage ( ) ) ; log . error ( String . format ( TEXT_FILE_NOT_SORTED , pomFileName ) ) ; throw new FailureException ( String . format ( TEXT_FILE_NOT_SORTED , pomFileName ) ) ; default : log . error ( xmlOrderedResult . getErrorMessage ( ) ) ; throw new IllegalStateException ( verifyFailType . toString ( ) ) ; } } }
verify that the pom - file is sorted regardless of formatting
