Skip to content

Commit

Permalink
Fixed: Inner test classes were not excluded properly (Carsten Guberna…
Browse files Browse the repository at this point in the history
…tor)
  • Loading branch information
cbeust committed Nov 2, 2009
1 parent 88b7299 commit 6006c86
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .classpath
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main"/>
<classpathentry kind="src" path="examples/src"/>
<classpathentry kind="src" path="test/src"/>
<classpathentry kind="src" path="src/jdk15"/>
<classpathentry kind="src" path="resources"/>
Expand All @@ -10,7 +9,9 @@
<classpathentry kind="lib" path="3rdparty/ant-launcher.jar"/>
<classpathentry kind="lib" path="3rdparty/ant.jar"/>
<classpathentry kind="lib" path="3rdparty/qdox-1.6.1.jar"/>
<classpathentry kind="var" path="TOOLS15_LIB"/>
<classpathentry kind="lib" path="3rdparty/backport-util-concurrent-2.2.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="lib" path="/home/cbeust/java/jdk1.5.0_09/jdk1.5.0/lib/tools.jar"/>
<classpathentry kind="output" path="z_build"/>
</classpath>
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -2,6 +2,7 @@ Current:

Added: dataProviderThreadCount can be set from the command line and from ant (Adrian Grealish)
Added: ITestAnnotation#setDataProvider
Fixed: Inner test classes were not excluded properly (Carsten Gubernator)
Fixed: threadPoolSize without invocationCount was causing reporters not to be invoked
Fixed: A @Factory throwing an exception did not cause any error
Fixed: <classfilesetref> was not working properly in the ant task (Ed Randall)
Expand Down
5 changes: 5 additions & 0 deletions src/main/org/testng/internal/ClassHelper.java
Expand Up @@ -399,6 +399,11 @@ private static Constructor<?> findAnnotatedConstructor(IAnnotationFinder finder,
public static <T> T tryOtherConstructor(Class<T> declaringClass) {
T result;
try {
// Special case for inner classes
if (declaringClass.getModifiers() == 0) {
return null;
}

Constructor<T> ctor = declaringClass.getConstructor(new Class[] { String.class });
result = ctor.newInstance(new Object[] { "Default test name" });
}
Expand Down

0 comments on commit 6006c86

Please sign in to comment.