Package org.testng.eclipse.launch.components

Examples of org.testng.eclipse.launch.components.ITestContent


      for(int i = 0; i < types.length; i++) {
        Object t = types[i];
        if(t instanceof IType) {
          IType type = (IType) t;
          ITestContent content = TypeParser.parseType(type);
          Collection<String> groupNames = content.getGroups();
          if(!groupNames.isEmpty()) {
            for (String groupName : groupNames) {
              List<String> rtypes = result.get(groupName);
              if(null == rtypes) {
                rtypes = new ArrayList<String>();
View Full Code Here


       
        if(null == types || null == mainType || !hasSource(mainType)) {
          return;
        }

        ITestContent testContent = TypeParser.parseType(mainType);

        if(testContent.isTestNGClass()) {
          m_enabled= true;
          m_configName= mainType.getElementName();
         
          m_launchAttributes= LaunchUtil.createClassLaunchConfigurationMap(mainType, types, testContent.getAnnotationType());
        }       
      }
//      else if("xml".equals(file.getFileExtension())) {
//        m_actionText+= " suite";
//     
View Full Code Here

    boolean result= false;
    IType[] types = null;
   
    if(IJavaElement.METHOD == ije.getElementType()) {
      IMethod iMethod = (IMethod) ije;
      ITestContent content = TypeParser.parseType(iMethod.getDeclaringType());
      if(content.hasTestMethods()) {
        result= content.isTestMethod(iMethod);
        if(result) {
          s_isTestCache.put(ije, Boolean.TRUE);
        }
        return result;
      }
     
      return false;
    }
   
    if(IJavaElement.COMPILATION_UNIT == ije.getElementType()) {
      try {
        types = ((ICompilationUnit) ije).getAllTypes();
      }
      catch(JavaModelException jme) {
        TestNGPlugin.log(jme);
      }
    }
    else if(IJavaElement.TYPE == ije.getElementType()) {
      types = new IType[] {(IType) ije};
    }
    else {
      return false;
    }
   
    if(null != types) {
      for(int i = 0; i < types.length; i++) {
        ITestContent testContent = TypeParser.parseType(types[i]);
       
        if(testContent.hasTestMethods()) {
          s_isTestCache.put(ije, Boolean.TRUE);
          return true;
        }
      }
    }
View Full Code Here

    Properties attrs = new Properties();
    attrs.setProperty("name", testName);
   
    Properties clsAttrs = new Properties();
    for(int i = 0; i < types.length; i++) {
      ITestContent content = TypeParser.parseType(types[i]);
     
      if(content.hasTestMethods()) {
//        attrs.setProperty("annotations", convert(content.getAnnotationType()));
       
        if(i == 0) {
          buf.push("test", attrs);
          buf.push("classes");
View Full Code Here

    String testName = "Method test " + ije.getElementName();
    Properties attrs = new Properties();
    attrs.setProperty("name", testName);
   
    IType type = types[0];
    ITestContent content = TypeParser.parseType(type);
    if(!content.hasTestMethods()) {
      return;
    }
   
    Set testMethods = content.getTestMethods();
    IMethodDescriptor testMethodDescriptor = new MethodDescriptor((IMethod) ije);
    Properties methodAttrs = new Properties();
    for(Iterator it = testMethods.iterator(); it.hasNext(); ) {
      IMethodDescriptor imd = (IMethodDescriptor) it.next();
      if(imd.equals(testMethodDescriptor)) {
View Full Code Here

TOP

Related Classes of org.testng.eclipse.launch.components.ITestContent

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.