Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running 'ant test' in a non-integration project causes exception #314

Closed
bosschaert opened this issue Feb 21, 2013 · 2 comments
Closed

Running 'ant test' in a non-integration project causes exception #314

bosschaert opened this issue Feb 21, 2013 · 2 comments

Comments

@bosschaert
Copy link
Member

The integration tests can be run from the command line by executing 'ant test'. However running this target in a project that does not have any integration tests causes an error (see below).

I think it would be better to silently continue in this case, just like the 'ant junit' target silently continues in projects that don't have any unit tests. This would allow people to run 'ant test' on all projects in a multi-project setup to have all the integration tests executed with one command.

The error I'm getting is:
[bndtest] Exception in thread "main" java.lang.NoClassDefFoundError: org/osgi/framework/ServiceListener
[bndtest] at java.lang.ClassLoader.defineClass1(Native Method)
[bndtest] at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
[bndtest] at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
[bndtest] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
[bndtest] at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
[bndtest] at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
[bndtest] at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
[bndtest] at java.security.AccessController.doPrivileged(Native Method)
[bndtest] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
[bndtest] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
[bndtest] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
[bndtest] at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
[bndtest] Caused by: java.lang.ClassNotFoundException: org.osgi.framework.ServiceListener
[bndtest] at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
[bndtest] at java.security.AccessController.doPrivileged(Native Method)
[bndtest] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
[bndtest] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
[bndtest] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
[bndtest] at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
[bndtest] ... 12 more
[bndtest] 1 Error(s)
[bndtest] Tests failed
[bndtest] at aQute.bnd.ant.TestTask.executeProject(TestTask.java:78)
[bndtest] at aQute.bnd.ant.TestTask.execute(TestTask.java:49)
[bndtest] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[bndtest] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[bndtest] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[bndtest] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[bndtest] at java.lang.reflect.Method.invoke(Method.java:597)
[bndtest] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[bndtest] at org.apache.tools.ant.Task.perform(Task.java:348)
[bndtest] at org.apache.tools.ant.Target.execute(Target.java:390)
[bndtest] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[bndtest] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[bndtest] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[bndtest] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[bndtest] at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[bndtest] at org.apache.tools.ant.Main.runBuild(Main.java:809)
[bndtest] at org.apache.tools.ant.Main.startAnt(Main.java:217)
[bndtest] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
[bndtest] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

@fhuberts
Copy link
Contributor

related to #186 ?

@pkriens
Copy link
Member

pkriens commented Mar 18, 2013

I agree this should not do anything. Guess the marker is the Test-Cases header

pkriens added a commit that referenced this issue Mar 18, 2013
#313 Will report # of errors passed on the commandline
@pkriens pkriens closed this as completed Mar 18, 2013
fhuberts added a commit that referenced this issue Mar 26, 2013
# By Peter Kriens (8) and others
# Via Peter Kriens
* commit '0be01d1d001cf54a0efbff8f0f437519f17f67d7':
  Added qualifier to version
  #314 Will not run OSGi tests if no Test-Cases header use #313 Will report # of errors passed on the commandline
  #315 Added a test for uppercase packages but it seems to work
  #281 and #316 Fixed defaults for required() in Meta.AD and fixed default for booleans.
  Added indents to json
  Add the bndrepo to the adjunct libs
  Bumped repoindex again (fixes for osgi.ee namespace)
  Bumped to repoindex 0.0.3
  ConsumerType: fix a typo in the javadoc
  ConsumerType is the default
  Removed jim bndrepo from bnd
  Backupt

Conflicts:
	biz.aQute.repository/bnd.bnd
	cnf/repo/org.osgi.impl.bundle.repoindex.lib/org.osgi.impl.bundle.repoindex.lib-latest.jar

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants