Hi Martin,

you had me worried there for a moment, thought I'd emailed the wrong list!

But anyway, I'll be surprised if you can reproduce it unless I send you my whole project.

Actually perhaps I should try recreating the eclipse project.

however here is the pom.xml - unless the mailing list strips off the attachment.

There are no batchrun plug-ins, and in case the name of the class is confusing, the TestRunManager has nothing to do with the maven test run, except of course that it gets tested like all the other classes.

Just surefire, war and maven-openjpa (which affects the entity beans, not the Manager classes).

In case you wonder, I have no other classes in any of my dependent projects (atomic, testdatarepo, parent project) called TestRunManager - unless it's hiding.

Thanks
Adam

Martin Gainty on 02/04/09 16:22, wrote:
experiencing a bit of difficulty reproducing this error
can you supply

pom.xml?
any plugins (junit-test-gen/batchrun) you may be using ?
empty org.permacode.patternrepo.basic.TestRunManagerTest Java class?

Date: Thu, 2 Apr 2009 14:26:32 +0100
From: adam.ma...@cyberspaceroad.com
To: users@maven.apache.org
Subject: strange error with hopefully easy solution?

My search results showed nothing in google or anything relevant in the archives, but I have an intractable error in my test batchrun, which seems to be a compilation problem.

The test is fine when executed in isolation.

This is what happens when I run all my test with "mvn clean test":


Tests in error:
   initializationError0(org.permacode.patternrepo.basic.TestRunManagerTest$1)

The actual test file 'TestRunManagerTest' is all OK, I think. The $1 suffix is incriminating evidence. These are the files that appear in my directory tree:

a...@gondor:~/projects/pattern-repo$ find . -name TestRunManager* -exec ls -la 
{} \;
-rw-r--r-- 1 adam adam 534 2009-02-24 10:00 ./src/main/java/org/permacode/patternrepo/domain/TestRunManager.java -rw-r--r-- 1 adam adam 8276 2009-03-03 14:36 ./src/test/java/org/permacode/patternrepo/basic/TestRunManagerTest.java -rw-r--r-- 1 adam adam 808 2009-04-02 14:09 ./target/classes/org/permacode/patternrepo/domain/TestRunManager.class -rw-r--r-- 1 adam adam 2305 2009-04-02 14:09 ./target/test-classes/org/permacode/patternrepo/basic/TestRunManagerTest$1.class -rw-r--r-- 1 adam adam 7665 2009-04-02 14:09 ./target/test-classes/org/permacode/patternrepo/basic/TestRunManagerTest.class -rw-r--r-- 1 adam adam 808 2009-04-02 14:08 ./build/classes/org/permacode/patternrepo/domain/TestRunManager.class -rw-r--r-- 1 adam adam 2289 2009-04-02 14:08 ./build/classes/org/permacode/patternrepo/basic/TestRunManagerTest$1.class -rw-r--r-- 1 adam adam 7699 2009-04-02 14:08 ./build/classes/org/permacode/patternrepo/basic/TestRunManagerTest.class


So you can see that maven and eclipse both compile the normal test class file, but also create a TestRunManagerTest$1.class file. This one causes the build to file with this output:

initializationError0(org.permacode.patternrepo.basic.TestRunManagerTest$1) Time elapsed: 0.061 sec <<< ERROR!
java.lang.Exception: Test class should have public zero-argument constructor
at org.junit.internal.runners.MethodValidator.validateNoArgConstructor(MethodValidator.java:54)


so the TestRunManagerTest$1 is obviously the result of jdk1.6.0_12 messing up the compilation, right?

Does anyone know what I can do about it? And perhaps what I did that caused it?

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                      http://maven.apache.org/xsd/maven-4.0.0.xsd";>
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.permacode</groupId>
    <artifactId>permacode-pom</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <groupId>org.permacode</groupId>
  <artifactId>pattern-repo</artifactId>
  <packaging>war</packaging>
  <name>Permacode Pattern Repo</name>
  <version>0.0.1-SNAPSHOT</version>
  <description>PatternRepo</description>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <forkMode>once</forkMode>
          <childDelegation>false</childDelegation>
          <argLine>
            -Djava.awt.headless=true -XX:MaxPermSize=128m -Xmx512m
          </argLine>
          <!--             -javaagent:/home/java/m2-repo/org/apache/openjpa/openjpa/1.2.0/openjpa-1.2.0.jar=properties=META-INF/persistence.xml#OpenJpaTest
          -->
          <excludes>
            <exclude>**/itest/*</exclude>
          </excludes>
          <systemProperties>
            <property>
              <name>java.util.logging.config.file</name>
              <value>/home/java/java/jre/lib/test-logging.properties</value>
            </property>
          </systemProperties>
        </configuration>
        <executions>
          <execution>
            <id>surefire-itest</id>
            <phase>integration-test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <includes>
                <include>**/itest/**</include>
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <warName>${project.artifactId}</warName>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>openjpa-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>process-classes</phase>
            <id>enhanceEntities</id>
            <goals>
              <goal>enhance</goal>
            </goals>
            <configuration>
              <classes>
                ${build.outputDirectory}/org/permacode/patternrepo/domain/entity
              </classes>
              <toolProperties>
                <property>
                  <name>properties</name>
                  <value>
                    ${build.outputDirectory}/META-INF/persistence.xml#OpenJpaJdbc
                  </value>
                </property>
              </toolProperties>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!--plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
        <execution>
        <phase>process-test-classes</phase>
        <configuration>
        <tasks>
        <path id="cp">
        <path refid="maven.test.classpath" />
        <path refid="maven.compile.classpath" />
        <path refid="maven.runtime.classpath" />
        <path refid="maven.dependency.classpath" />
        </path>
        <fileset id="enhance.path.ref" dir=".">
        <include
        name="${build.outputDirectory}/org/permacode/patternrepo/domain/entity/*.class" />
        <include
        name="${build.testOutputDirectory}/org/permacode/patternrepo/domain/entity/*.class" />
        <include
        name="org/permacode/atomic/0.0.1-SNAPSHOT/atomic-0.0.1-SNAPSHOT.jar!/org/permacode/atomic/domain/AtomicEntity.class" />
        </fileset>
        <echo message="Enhancing classes...." />
        <java classname="org.apache.openjpa.enhance.PCEnhancer"
        classpathref="cp" dir="${build.outputDirectory}"
        fork="true">
        <arg line="-properties META-INF/persistence.xml#OpenJpaJdbc" />
        <arg
        file="${build.outputDirectory}/org/permacode/atomic/domain/AtomicEntity.class" />
        <arg
        file="${build.outputDirectory}/org/permacode/patternrepo/domain/entity/Category.class" />
        <arg
        file="${build.outputDirectory}/org/permacode/patternrepo/domain/entity/DollarReturn.class" />
        <arg
        file="${build.outputDirectory}/org/permacode/patternrepo/domain/entity/Market.class" />
        <arg
        file="${build.outputDirectory}/org/permacode/patternrepo/domain/entity/MarketSystem.class" />
        <arg
        file="${build.outputDirectory}/org/permacode/patternrepo/domain/entity/Portfolio.class" />
        <arg
        file="${build.outputDirectory}/org/permacode/patternrepo/domain/entity/RequiredParam.class" />
        <arg
        file="${build.outputDirectory}/org/permacode/patternrepo/domain/entity/TestAnalysis.class" />
        <arg
        file="${build.outputDirectory}/org/permacode/patternrepo/domain/entity/TestRun.class" />
        <arg
        file="${build.outputDirectory}/org/permacode/patternrepo/domain/entity/Trade.class" />
        <arg
        file="${build.outputDirectory}/org/permacode/patternrepo/domain/entity/TradingParam.class" />
        <arg
        file="${build.outputDirectory}/org/permacode/patternrepo/domain/entity/TradingSystem.class" />
        <arg
        file="${build.outputDirectory}/org/permacode/patternrepo/domain/entity/Weighting.class" />
        <arg
        file="${build.testOutputDirectory}/org/permacode/patternrepo/domain/entity/DummyCategoryRepoLink.class" />
        </java>
        <echo message="Enhancing classes for OpenJPA done!" />
        </tasks>
        </configuration>
        <goals>
        <goal>run</goal>
        </goals>
        </execution>
        </executions>
        </plugin-->
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.permacode</groupId>
      <artifactId>atomic</artifactId>
      <version>0.0.1-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>org.permacode</groupId>
      <artifactId>testdatarepo</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.3.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymockclassextension</artifactId>
      <version>2.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.tiles</groupId>
      <artifactId>tiles-jsp</artifactId>
      <version>2.0.6</version>
    </dependency>
    <dependency>
      <groupId>taglibs</groupId>
      <artifactId>standard</artifactId>
      <version>1.1.2</version>
    </dependency>
    <dependency>
      <groupId>commons-fileupload</groupId>
      <artifactId>commons-fileupload</artifactId>
      <version>1.2.1</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-io</artifactId>
      <version>1.3.2</version>
    </dependency>
    <dependency>
      <groupId>p6spy</groupId>
      <artifactId>p6spy</artifactId>
      <version>1.3-patch</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.0.5</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>1.0.64</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
      <version>1.8.0.7</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>8.2-507.jdbc3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derby</artifactId>
      <version>10.3.1.4</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>httpunit</groupId>
      <artifactId>httpunit</artifactId>
      <version>1.6.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>rhino</groupId>
      <artifactId>js</artifactId>
      <version>1.6R5</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.tomcat</groupId>
      <artifactId>jasper</artifactId>
      <version>6.0.13</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-math</groupId>
      <artifactId>commons-math</artifactId>
      <version>1.2</version>
    </dependency>
    <dependency>
      <groupId>jfree</groupId>
      <artifactId>jfreechart</artifactId>
      <version>1.0.9</version>
    </dependency>
    <dependency>
      <groupId>com.ib</groupId>
      <artifactId>client</artifactId>
      <version>9.60</version>
    </dependency>
  </dependencies>
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to