Package org.jboss.jopr.jsfunit.exceptions

Examples of org.jboss.jopr.jsfunit.exceptions.EmbJoprTestException


        }

        if( expectedNumMessages != numMessages ){
          String msg = emptyTableMessage + "Incorrect number of messages displayed in the results table." +
                  " Expected: "+expectedNumMessages+" Actual: "+numMessages+";  Page dumped.";
          new EmbJoprTestException(msg, this);
          fail(msg);
        }
       
        Iterator i = rows.iterator();
       
View Full Code Here


        }

        // Check whether the list is empty / non-empty as expected.
        if(shouldBeEmpty) {
          if( subscCount != 0 ){
            throw new EmbJoprTestException("Expected empty list but found "+subscCount+" subscriptions. See the log for more info. Page dumped.", this);
          }
        } else {
          if( subscCount <= 0 ){
            throw new EmbJoprTestException("Expected non-empty list. See the log for more info. Page dumped.", this);
          }
        }

         
        // Clean up
View Full Code Here

      } catch (Exception ex) { log.error("Can't dump page.", ex); }
    }

    if( this.throwExceptionOnTimout ){
      String message = "Timeout expired while waiting for condition: "+condition.getDescription();
      throw new EmbJoprTestException(message);
    }

    return false;
  }
View Full Code Here

    ContentTable connList = ejtt.tabMenu.getTabContentBox().getFirstTable();

    // HTTP
    ContentTableRow rowHttp = connList.getFirstRowContainingText("http://");
    if( null == rowHttp )
      throw new EmbJoprTestException("HTTP connector not listed.", this);
    String status = rowHttp.getCellTextByColumnName("Status");
    if( ! "UP".equals(status) )
      throw new EmbJoprTestException("HTTP connector is not UP, but: "+status);

    // AJP
    ContentTableRow rowAjp  = connList.getFirstRowContainingText("ajp://");
    if( null == rowAjp )
      throw new EmbJoprTestException("AJP connector not listed.", this);
    status = rowAjp.getCellTextByColumnName("Status");
    if( ! "UP".equals(status) )
      throw new EmbJoprTestException("AJP connector is not UP, but: "+status);


    // Get all children nodes
    ejtt.navTree.getNodeByLabel(NAV_CONNECTORS).expand();
    List<NavTreeNode> childNodes = ejtt.navTree.getNodeByLabel(NAV_CONNECTORS).getChildren();
View Full Code Here

        fail("Cache '"+name+"' is not UP, but '"+status+"'.");
      if( JBCACHE_HA_PARTITION.equals(name) )
        haparPresent = true;
    }
    if( !haparPresent)
      throw new EmbJoprTestException("The '"+JBCACHE_HA_PARTITION+"' cache is not present.");

    // Click on the first row link.
    rows.get(0).getFirstLinkFromColumn(COL_RESOURCE_NAME).click();

    // Check that we got to the Summary page.
View Full Code Here

      log.info("Found node: "+node.getName());
      names.remove( node.getName() );
    }
    // The remaining names are missing.
    if( names.size() > 0 ){
      throw new EmbJoprTestException("These cache nodes are not present: "+StringUtils.join(names, ", "), this);
    }


    // Click through all the subnodes (exception could occur).
    for( String name : subnodesNames ){
View Full Code Here

    ContentTable scriptsListingTable = ejtt.tabMenu.getTabContentBox().getFirstTable();

    // Go through the dir, and check whether each *.sh file is listed in the page.
    File binDir = new File(ejtt.getJBossHomeDir());
    if( !binDir.isDirectory() )
      throw new EmbJoprTestException(binDir.getAbsolutePath()+" is not a directory.");

    // Get the list of .sh files in the <JBOSS_HOME>/bin dir.
    log.info("Scanning directory "+binDir.getAbsolutePath());
    //File scriptFiles[] = binDir.listFiles(new FilenameSuffixFilter("sh"));
    File scriptFiles[] = binDir.listFiles((FilenameFilter)new SuffixFileFilter(".sh"));

    /*
    List<String> notListedScripts = new ArrayList();

    for( File file : scriptFiles ) {
      // Go to the scripts node.
      ejtt.navTree.getNodeByLabel(NAV_SCRIPTS).click();

      // Check whether the script is listed (on any page).
      ContentTableRow row = ejtt.getTabMenu().getTabContentBox().findLinkRowInDataTableUsingPagination(file.getName());
      if( null == row )
        notListedScripts.add("");
    }
    /*/

    // Faster method.
    List<String> notListedScripts = new ArrayList();
    for( File file : scriptFiles ) {
      notListedScripts.add(file.getName());
      log.info("Script in bin/ : "+file.getName());
    }

    // Go to the scripts node.
    ejtt.navTree.getNodeByLabel(NAV_SCRIPTS).click();

    int curPage = 1;

    do {

      log.info("Scanning scripts listing, page "+curPage);

      // Remove all scripts listed on this page from the not-listed list.
      ContentTable scriptListingTable = ejtt.getTabMenu().getTabContentBox().getDefaultTable();
      for( ContentTableRow row : scriptListingTable.getRows() ) {
        String scriptName = row.getCell(0).getTextContent().trim();
        notListedScripts.remove(scriptName);
        log.info("Listed script: '"+scriptName+"'");
      }
      // Go to the next page. If there's no next page, quit the loop.
      Page originalPage = ejtt.getClient().getContentPage();
      boolean wentNext = ejtt.getTabMenu().getTabContentBox().getPagination().goNext();
      if( !wentNext )
        break;
      if( originalPage.equals( ejtt.getClient().getContentPage() ) )
        break;
             
    } while( true );
    /**/


    // If some of the scripts from the <JBOSS_HOME>/bin directory are not listed, throw.
    if( 0 < notListedScripts.size() ){
      throw new EmbJoprTestException("Following <JBOSS_HOME>/bin/*.sh files are not listed: "+notListedScripts.toArray( new String[0] ) );
    }

  }
View Full Code Here

      }
      catch( EmbJoprTestException ex ){
        throw ex;
      }
      catch( Exception ex ){
        throw new EmbJoprTestException( ex.getMessage(), ex );
      }
    }
    finally {
      // Delete the test script file if it exists.
      if( scriptFile.exists() )
View Full Code Here

      }*/


    }
    catch( IOException ex ){
      throw new EmbJoprTestException(ex);
    }

  }// testSummary()
View Full Code Here

      // TODO: check the result.

    }
    catch( IOException ex ){
      throw new EmbJoprTestException(ex);
    }

  }
View Full Code Here

TOP

Related Classes of org.jboss.jopr.jsfunit.exceptions.EmbJoprTestException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.