本文整理汇总了Java中com.googlecode.guice.bundle.OSGiTestActivator类的典型用法代码示例。如果您正苦于以下问题:Java OSGiTestActivator类的具体用法?Java OSGiTestActivator怎么用?Java OSGiTestActivator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OSGiTestActivator类属于com.googlecode.guice.bundle包,在下文中一共展示了OSGiTestActivator类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import com.googlecode.guice.bundle.OSGiTestActivator; //导入依赖的package包/类
@Override protected void setUp()
throws Exception {
// verify properties
assertTrue(failMsg(), new File(BUILD_DIR).isDirectory());
assertTrue(failMsg(), new File(GUICE_JAR).isFile());
/*if[AOP]*/
assertTrue(failMsg(), new File(AOPALLIANCE_JAR).isFile());
/*end[AOP]*/
assertTrue(failMsg(), new File(JAVAX_INJECT_JAR).isFile());
Properties instructions = new Properties();
/*if[AOP]*/
// aopalliance is an API bundle --> export the full API
instructions.setProperty("Export-Package", "org.aopalliance.*");
buildBundle("aopalliance", instructions, AOPALLIANCE_JAR);
instructions.clear();
/*end[AOP]*/
// javax.inject is an API bundle --> export the full API
instructions.setProperty("Export-Package", "javax.inject.*");
buildBundle("javax.inject", instructions, JAVAX_INJECT_JAR);
instructions.clear();
// strict imports to make sure test bundle only has access to these packages
instructions.setProperty("Import-Package", "org.osgi.framework,"
/*if[AOP]*/
+ "org.aopalliance.intercept,"
/*end[AOP]*/
+ "com.google.inject(|.binder|.matcher|.name)");
// test bundle should only contain the local test classes, nothing else
instructions.setProperty("Bundle-Activator", OSGiTestActivator.class.getName());
instructions.setProperty("Private-Package", OSGiTestActivator.class.getPackage().getName());
buildBundle("osgitests", instructions, BUILD_TEST_DIR);
instructions.clear();
}
示例2: setUp
import com.googlecode.guice.bundle.OSGiTestActivator; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
// verify properties
assertTrue(failMsg(), new File(BUILD_DIR).isDirectory());
assertTrue(failMsg(), new File(GUICE_JAR).isFile());
/*if[AOP]*/
assertTrue(failMsg(), new File(AOPALLIANCE_JAR).isFile());
/*end[AOP]*/
assertTrue(failMsg(), new File(JAVAX_INJECT_JAR).isFile());
assertTrue(failMsg(), new File(GUAVA_JAR).isFile());
Properties instructions = new Properties();
/*if[AOP]*/
// aopalliance is an API bundle --> export the full API
instructions.setProperty("Export-Package", "org.aopalliance.*");
buildBundle("aopalliance", instructions, AOPALLIANCE_JAR);
instructions.clear();
/*end[AOP]*/
// javax.inject is an API bundle --> export the full API
instructions.setProperty("Export-Package", "javax.inject.*");
buildBundle("javax.inject", instructions, JAVAX_INJECT_JAR);
instructions.clear();
// early versions of guava did not ship with OSGi metadata
instructions.setProperty("Export-Package", "com.google.common.*");
instructions.setProperty("Import-Package", "*;resolution:=optional");
buildBundle("guava", instructions, GUAVA_JAR);
instructions.clear();
// strict imports to make sure test bundle only has access to these packages
instructions.setProperty(
"Import-Package",
"org.osgi.framework,"
/*if[AOP]*/
+ "org.aopalliance.intercept,"
/*end[AOP]*/
+ "com.google.inject(|.binder|.matcher|.name)");
// test bundle should only contain the local test classes, nothing else
instructions.setProperty("Bundle-Activator", OSGiTestActivator.class.getName());
instructions.setProperty("Private-Package", OSGiTestActivator.class.getPackage().getName());
buildBundle("osgitests", instructions, BUILD_TEST_DIR);
instructions.clear();
}
示例3: setUp
import com.googlecode.guice.bundle.OSGiTestActivator; //导入依赖的package包/类
@Override protected void setUp()
throws Exception {
// verify properties
assertTrue(failMsg(), new File(BUILD_DIR).isDirectory());
assertTrue(failMsg(), new File(GUICE_JAR).isFile());
/*if[AOP]*/
assertTrue(failMsg(), new File(AOPALLIANCE_JAR).isFile());
/*end[AOP]*/
assertTrue(failMsg(), new File(JAVAX_INJECT_JAR).isFile());
assertTrue(failMsg(), new File(GUAVA_JAR).isFile());
Properties instructions = new Properties();
/*if[AOP]*/
// aopalliance is an API bundle --> export the full API
instructions.setProperty("Export-Package", "org.aopalliance.*");
buildBundle("aopalliance", instructions, AOPALLIANCE_JAR);
instructions.clear();
/*end[AOP]*/
// javax.inject is an API bundle --> export the full API
instructions.setProperty("Export-Package", "javax.inject.*");
buildBundle("javax.inject", instructions, JAVAX_INJECT_JAR);
instructions.clear();
// early versions of guava did not ship with OSGi metadata
instructions.setProperty("Export-Package", "com.google.common.*");
instructions.setProperty("Import-Package", "*;resolution:=optional");
buildBundle("guava", instructions, GUAVA_JAR);
instructions.clear();
// strict imports to make sure test bundle only has access to these packages
instructions.setProperty("Import-Package", "org.osgi.framework,"
/*if[AOP]*/
+ "org.aopalliance.intercept,"
/*end[AOP]*/
+ "com.google.inject(|.binder|.matcher|.name)");
// test bundle should only contain the local test classes, nothing else
instructions.setProperty("Bundle-Activator", OSGiTestActivator.class.getName());
instructions.setProperty("Private-Package", OSGiTestActivator.class.getPackage().getName());
buildBundle("osgitests", instructions, BUILD_TEST_DIR);
instructions.clear();
}