curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grant Henke (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CURATOR-281) Usage of TestingServer fails when upgrading to 3.0
Date Fri, 13 Nov 2015 04:39:11 GMT
Grant Henke created CURATOR-281:
-----------------------------------

             Summary: Usage of TestingServer fails when upgrading to 3.0
                 Key: CURATOR-281
                 URL: https://issues.apache.org/jira/browse/CURATOR-281
             Project: Apache Curator
          Issue Type: Bug
            Reporter: Grant Henke
            Assignee: Jordan Zimmerman


If I upgrade from 2.9.2 to 3.0 and run my existing unit tests I get this error on all tests:
{noformat}
org.scurator.TestGetChildren > initializationError FAILED
    java.lang.NoClassDefFoundError: org/testng/Assert
        at org.apache.curator.test.TestingZooKeeperMain.blockUntilStarted(TestingZooKeeperMain.java:135)
        at org.apache.curator.test.TestingZooKeeperServer.start(TestingZooKeeperServer.java:159)
        at org.apache.curator.test.TestingServer.<init>(TestingServer.java:117)
        at org.apache.curator.test.TestingServer.<init>(TestingServer.java:100)
        at org.apache.curator.test.TestingServer.<init>(TestingServer.java:41)
        at org.scurator.BaseSCuratorTest$class.beforeEach(BaseSCuratorTest.scala:33)
        at org.scurator.TestGetChildren.org$scurator$SCuratorTestClient$$super$beforeEach(TestGetChildren.scala:14)
        at org.scurator.SCuratorTestClient$class.beforeEach(SCuratorTestClient.scala:20)
        at org.scurator.TestGetChildren.beforeEach(TestGetChildren.scala:14)
        at org.scalatest.BeforeAndAfterEach$class.beforeEach(BeforeAndAfterEach.scala:154)
        at org.scurator.TestGetChildren.beforeEach(TestGetChildren.scala:14)
        at org.scalatest.BeforeAndAfterEach$class.beforeEach(BeforeAndAfterEach.scala:173)
        at org.scurator.TestGetChildren.beforeEach(TestGetChildren.scala:14)
        at org.scalatest.BeforeAndAfterEach$class.runTest(BeforeAndAfterEach.scala:253)
        at org.scurator.TestGetChildren.runTest(TestGetChildren.scala:14)

        Caused by:
        java.lang.ClassNotFoundException: org.testng.Assert
            at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
            ... 15 more
{noformat}

The code it points to is here: 
https://github.com/apache/curator/blob/apache-curator-3.0.0/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java#L135

Its caused because I am an external user from the project and testng is marked as provided
here:
https://github.com/apache/curator/blob/apache-curator-3.0.0/curator-test/pom.xml#L53-L57

The only other place testng is used is BaseClassForTests.java, which makes sense. I propose
using a standard java assertion here to avoid the dependency for those using TestingServer.





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message