/** * {@inheritDoc} */ @Override public void setTestClass(ITestClass tc) { assert null != tc; if (! tc.getRealClass().equals(m_method.getDeclaringClass())) { assert m_method.getDeclaringClass().isAssignableFrom(tc.getRealClass()) : "\nMISMATCH : " + tc.getRealClass() + " " + m_method.getDeclaringClass(); } m_testClass = tc; }
private static String constructMethodNameUsingTestClass(String currentMethodName, ITestNGMethod m) { int lastIndex = currentMethodName.lastIndexOf('.'); if (lastIndex != -1) { return m.getTestClass().getRealClass().getName() + currentMethodName.substring(lastIndex); } return currentMethodName; }
private static String constructMethodNameUsingTestClass( String currentMethodName, ITestNGMethod m) { int lastIndex = currentMethodName.lastIndexOf('.'); if (lastIndex != -1) { return m.getTestClass().getRealClass().getName() + currentMethodName.substring(lastIndex); } return currentMethodName; } }
private void addResults(Set<ITestResult> allResults, Map<Class<?>, Set<ITestResult>> out) { for (ITestResult tr : allResults) { Class<?> cls = tr.getMethod().getTestClass().getRealClass(); Set<ITestResult> l = out.get(cls); if (l == null) { l = Sets.newHashSet(); out.put(cls, l); } l.add(tr); } }
private static List<IMethodInstance> findClasses( List<IMethodInstance> methodInstances, Class<?> c) { return methodInstances .stream() .filter(mi -> mi.getMethod().getTestClass().getRealClass() == c) .collect(Collectors.toList()); }
/** * {@inheritDoc} Compares two BaseTestMethod using the test class then the associated * Java Method. */ @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } BaseTestMethod other = (BaseTestMethod) obj; boolean isEqual = m_testClass == null ? other.m_testClass == null : other.m_testClass != null && m_testClass.getRealClass().equals(other.m_testClass.getRealClass()) && m_instance == other.getInstance(); return isEqual && getConstructorOrMethod().equals(other.getConstructorOrMethod()); }
private static List<IMethodInstance> findClasses(List<IMethodInstance> methodInstances, Class<?> c) { List<IMethodInstance> result = Lists.newArrayList(); for (IMethodInstance mi : methodInstances) { if (mi.getMethod().getTestClass().getRealClass() == c) { result.add(mi); } } return result; }
.append("<td>").append(cls.getRealClass().getName()).append("</td>\n") .append("<td> </td>") .append("<td> </td>")
private void addResults(Set<ITestResult> allResults, Map<Class<?>, Set<ITestResult>> out) { for (ITestResult tr : allResults) { Class<?> cls = tr.getMethod().getTestClass().getRealClass(); Set<ITestResult> l = out.computeIfAbsent(cls, k -> Sets.newHashSet()); l.add(tr); } }
/** {@inheritDoc} */ @Override public void setTestClass(ITestClass tc) { if (tc == null) { throw new IllegalArgumentException("test class cannot be null"); } boolean assignable = m_method.getDeclaringClass().isAssignableFrom(tc.getRealClass()); if (!assignable) { throw new IllegalArgumentException( "mismatch in classes between " + tc.getName() + " and " + m_method.getDeclaringClass().getName()); } m_testClass = tc; }
@Override public void onAfterClass(ITestClass testClass) { names.add("AfterClass=" + testClass.getRealClass().getSimpleName()); }
public void onAfterClass(ITestClass iTestClass) { Listener1284.testList.add(iTestClass.getRealClass().getName() + " - After Invocation"); } }
@Override public void onBeforeClass(ITestClass testClass) { names.add("BeforeClass=" + testClass.getRealClass().getSimpleName()); }
public void onBeforeClass(ITestClass iTestClass) { Listener1284.testList.add(iTestClass.getRealClass().getName() + " - Before Invocation"); }
Class<?> cls = clazz.getRealClass(); boolean shouldBeStatic = false; if (dataProviderClass != null) {
result = AnnotationHelper.findTest(finder, clazz.getRealClass());
@Override public String getContent(ISuite suite, XMLStringBuffer main) { XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent()); SetMultiMap<Class<?>, ITestNGMethod> map = Maps.newSetMultiMap(); for (ITestNGMethod method : suite.getExcludedMethods()) { map.put(method.getTestClass().getRealClass(), method); } for (Class<?> c : map.keySet()) { xsb.push(D, C, "ignored-class-div"); xsb.addRequired(S, c.getName(), C, "ignored-class-name"); xsb.push(D, C, "ignored-methods-div"); for (ITestNGMethod m : map.get(c)) { xsb.addRequired(S, m.getMethodName(), C, "ignored-method-name"); xsb.addEmptyElement("br"); } xsb.pop(D); xsb.pop(D); } return xsb.toXML(); }
public NoOpTestClass(ITestClass testClass) { m_testClass= testClass.getRealClass(); m_beforeSuiteMethods= testClass.getBeforeSuiteMethods(); m_beforeTestConfMethods= testClass.getBeforeTestConfigurationMethods(); m_beforeGroupsMethods= testClass.getBeforeGroupsMethods(); m_beforeClassMethods= testClass.getBeforeClassMethods(); m_beforeTestMethods= testClass.getBeforeTestMethods(); m_afterSuiteMethods= testClass.getAfterSuiteMethods(); m_afterTestConfMethods= testClass.getAfterTestConfigurationMethods(); m_afterGroupsMethods= testClass.getAfterGroupsMethods(); m_afterClassMethods= testClass.getAfterClassMethods(); m_afterTestMethods= testClass.getAfterTestMethods(); m_instances= testClass.getInstances(true); m_instanceHashes= testClass.getInstanceHashCodes(); m_xmlTest = testClass.getXmlTest(); m_xmlClass = testClass.getXmlClass(); }
@Override public String getContent(ISuite suite, XMLStringBuffer main) { XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent()); SetMultiMap<Class<?>, ITestNGMethod> map = Maps.newSetMultiMap(); for (ITestNGMethod method : suite.getExcludedMethods()) { map.put(method.getTestClass().getRealClass(), method); } for (Class<?> c : map.keySet()) { xsb.push(D, C, "ignored-class-div"); xsb.addRequired(S, c.getName(), C, "ignored-class-name"); xsb.push(D, C, "ignored-methods-div"); for (ITestNGMethod m : map.get(c)) { xsb.addRequired(S, m.getMethodName(), C, "ignored-method-name"); xsb.addEmptyElement("br"); } xsb.pop(D); xsb.pop(D); } return xsb.toXML(); }
public NoOpTestClass(ITestClass testClass) { m_testClass = testClass.getRealClass(); m_beforeSuiteMethods = testClass.getBeforeSuiteMethods(); m_beforeTestConfMethods = testClass.getBeforeTestConfigurationMethods(); m_beforeGroupsMethods = testClass.getBeforeGroupsMethods(); m_beforeClassMethods = testClass.getBeforeClassMethods(); m_beforeTestMethods = testClass.getBeforeTestMethods(); m_afterSuiteMethods = testClass.getAfterSuiteMethods(); m_afterTestConfMethods = testClass.getAfterTestConfigurationMethods(); m_afterGroupsMethods = testClass.getAfterGroupsMethods(); m_afterClassMethods = testClass.getAfterClassMethods(); m_afterTestMethods = testClass.getAfterTestMethods(); m_instances = testClass.getInstances(true); m_instanceHashes = testClass.getInstanceHashCodes(); m_xmlTest = testClass.getXmlTest(); m_xmlClass = testClass.getXmlClass(); }