| Summary: | Provide an OMBundle.getClasses() method | ||
|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Eike Stepper <stepper> |
| Component: | cdo.net4j | Assignee: | Eike Stepper <stepper> |
| Status: | CLOSED FIXED | QA Contact: | Eike Stepper <stepper> |
| Severity: | enhancement | ||
| Priority: | P3 | ||
| Version: | 4.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | Power to the People | ||
|
Description
Eike Stepper
This makes it possible to add Bugzilla tests automatically, see ConfigTestSuite:
protected List<Class<? extends ConfigTest>> getTestClasses(OMBundle bundle, String packageName)
{
List<Class<? extends ConfigTest>> result = new ArrayList<Class<? extends ConfigTest>>();
for (Iterator<Class<?>> it = bundle.getClasses(); it.hasNext();)
{
Class<?> c = it.next();
if (ConfigTest.class.isAssignableFrom(c) && c.getName().startsWith(packageName))
{
@SuppressWarnings("unchecked")
Class<? extends ConfigTest> configTest = (Class<? extends ConfigTest>)c;
result.add(configTest);
}
}
Collections.sort(result, new Comparator<Class<? extends ConfigTest>>()
{
public int compare(Class<? extends ConfigTest> c1, Class<? extends ConfigTest> c2)
{
return c1.getName().compareTo(c2.getName());
}
});
return result;
}
commit 206773b98acdf77c2691c60eded4775853b440fe Author: Eike Stepper <stepper@esc-net.de> 2011-12-10 10:23:23 Committer: Eike Stepper <stepper@esc-net.de> 2011-12-10 10:23:23 Parent: f4c6530fe89f4c3bfa6f4486c0abc0dd1fe277be ([365204] Invalidate transition creates illegal object for audit view https://bugs.eclipse.org/bugs/show_bug.cgi?id=365204) Branches: master [366290] Provide an OMBundle.getClasses() method https://bugs.eclipse.org/bugs/show_bug.cgi?id=366290 JarFile only starts in JDK7 to implement Closeable ;-( commit 666a16e73cd70e59f572f66b8325e4c5dedc3f29 Fixed bug in OSGiBundle: commit 20527bdddd1d43eb05d371fd2c91eb48ff4f6f43 Closing. |