Package org.testng

Examples of org.testng.TestNGException


      parse(inputStream, contentHandler);

      return contentHandler.getSuite();
    }
    catch (FileNotFoundException e) {
      throw new TestNGException(e);
    } catch (SAXException e) {
      throw new TestNGException(e);
    } catch (IOException e) {
      throw new TestNGException(e);
    }
  }
View Full Code Here


  private void xmlSuite(boolean start, Attributes attributes) {
    if (start) {
      pushLocation(Location.SUITE);
      String name = attributes.getValue("name");
      if (isStringBlank(name)) {
        throw new TestNGException("The <suite> tag must define the name attribute");
      }
      m_currentSuite = new XmlSuite();
      m_currentSuite.setFileName(m_fileName);
      m_currentSuite.setName(name);
      m_currentSuiteParameters = Maps.newHashMap();
View Full Code Here

      m_currentTest = new XmlTest(m_currentSuite, m_currentTestIndex++);
      pushLocation(Location.TEST);
      m_currentTestParameters = Maps.newHashMap();
      final String testName= attributes.getValue("name");
      if(isStringBlank(testName)) {
        throw new TestNGException("The <test> tag must define the name attribute");
      }
      m_currentTest.setName(attributes.getValue("name"));
      String verbose = attributes.getValue("verbose");
      if (null != verbose) {
        m_currentTest.setVerbose(Integer.parseInt(verbose));
View Full Code Here

  }

  public void addPredecessor(T tm, T predecessor) {
    Node<T> node = findNode(tm);
    if (null == node) {
      throw new TestNGException("Non-existing node: " + tm);
    }
    else {
      node.addPredecessor(predecessor);
      addNeighbor(tm, predecessor);
      // Remove these two nodes from the independent list
View Full Code Here

        StringBuilder sb = new StringBuilder();
        sb.append("The following methods have cyclic dependencies:\n");
        for (T m : cycle) {
          sb.append(m).append("\n");
        }
        throw new TestNGException(sb.toString());
      }
      else {
        m_strictlySortedNodes.add(node.getObject());
        removeFromNodes(nodes2, node);
      }
View Full Code Here

      parse(inputStream, handler);

      return null;
    }
    catch (FileNotFoundException e) {
      throw new TestNGException(e);
    } catch (SAXException e) {
      throw new TestNGException(e);
    } catch (IOException e) {
      throw new TestNGException(e);
    }
  }
View Full Code Here

    Injector injector = suite.getParentInjector();
    if (injector == null) {
      if (m_hasParentModule) {
        Class<?> parentModule = ClassHelper.forName(suite.getParentModule());
        if (parentModule == null) {
          throw new TestNGException("Cannot load parent Guice module class: " + parentModule);
        }
        Module module = (Module) ClassHelper.newInstance(parentModule);
        injector = com.google.inject.Guice.createInjector(module);
      } else {
        injector = com.google.inject.Guice.createInjector();
View Full Code Here

      }
      m_masterAdpter.init(properties);
    }
    catch( Exception e)
    {
      throw new TestNGException( "Fail to initialize master mode", e);
    }
  }
View Full Code Here

        }
        else {
          String p = parameterNames[j];
          String value = params.xmlParameters.get(p);
          if (null == value) {
            throw new TestNGException("Parameter '" + p + "' is required by "
                + methodAnnotation
                + " on method "
                + methodName
                + "\nbut has not been defined in " + xmlSuite.getFileName());
          }
View Full Code Here

    if(parameterNames.length == parameterTypes.length) return;
   
    for(int i= parameterTypes.length - 1; i >= parameterNames.length; i--) {
      if(!ITestContext.class.equals(parameterTypes[i])
          && !Method.class.equals(parameterTypes[i])) {
        throw new TestNGException( "Method " + methodName + " requires "
            + parameterTypes.length + " parameters but "
            + parameterNames.length
            + " were supplied in the "
            + methodAnnotation
            + " annotation.");       
View Full Code Here

TOP

Related Classes of org.testng.TestNGException

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.