Permalink
Browse files

Fixed: Inner test classes were not excluded properly (Carsten Guberna…

…tor)
  • Loading branch information...
1 parent 88b7299 commit 6006c867e4ea4519af6c460732013c8d75c7af5b cbeust committed Nov 2, 2009
Showing with 9 additions and 2 deletions.
  1. +3 −2 .classpath
  2. +1 −0 CHANGES.txt
  3. +5 −0 src/main/org/testng/internal/ClassHelper.java
View
5 .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"/>
@@ -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>
View
1 CHANGES.txt
@@ -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)
View
5 src/main/org/testng/internal/ClassHelper.java
@@ -399,6 +399,11 @@ public static Object createInstance(Class<?> declaringClass,
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" });
}

0 comments on commit 6006c86

Please sign in to comment.