我有一个测试用例如下:
static LaunchpadBuilder builder = new LaunchpadBuilder().bndrun("bnd.bnd");
@Service
BundleContext context;
@Test
public void quickstart() throws Exception
{
try (Launchpad launchpad = builder.create().inject(this))
{
assertNotNull(context);
assertEquals(context.getBundle().getSymbolicName(), "ch.eugster.herakles.icon.provider");
assertTrue(context.getBundles().length > 0);
for (Bundle bundle : context.getBundles())
{
System.out.println("Bundle: " + bundle.getSymbolicName());
}
}
}
此测试用例失败,因为我的bundles符号名的Assert不匹配。打印出捆绑包的符号名称显示,我的捆绑包的符号名称是大写字母:
Bundle: org.eclipse.osgi
Bundle: org.eclipse.core.commands
Bundle: org.eclipse.equinox.common
Bundle: org.eclipse.jface
Bundle: org.eclipse.swt
Bundle: CH.EUGSTER.HERAKLES.ICON.PROVIDER
我的问题是:为什么我自己的包的符号名是大写字母?
bnd.bnd如下所示:
Bundle-Version: 1.0.0.${tstamp}
-testpath: \
${junit},\
${mockito},\
${mockito-deps},\
biz.aQute.launchpad;version='5.2',\
slf4j.api;version='1.7',\
slf4j.simple;version='1.7'
-buildpath: \
osgi.annotation;version='7.0.0',\
org.eclipse.swt;version='3.115',\
org.eclipse.swt.cocoa.macosx.x86_64;version='3.115',\
org.eclipse.jface;version='3.21',\
org.eclipse.equinox.common;version='3.13',\
osgi.core;version='7.0.0',\
osgi.cmpn;version='7.0.0',\
org.osgi.service.component.annotations;version='1.4'
-runfw: org.eclipse.osgi;version='[3.13.100.v20180827-1536,3.13.100.v20180827-1536]'
-runee: JavaSE-1.8
-runrequires: bnd.identity;version='3.21.0';id='org.eclipse.jface'
-runbundles: \
org.eclipse.core.commands;version='[3.9.700,3.9.701)',\
org.eclipse.equinox.common;version='[3.13.0,3.13.1)',\
org.eclipse.jface;version='[3.21.0,3.21.1)',\
org.eclipse.swt;version='[3.115.0,3.115.1)'
-includeresource: src, resources
Bundle-Name: Icon Provider for Herakles Application
-resolve: auto
暂无答案!
目前还没有任何答案,快来回答吧!