当前位置: 首页>>代码示例>>Java>>正文


Java OSGiTestActivator类代码示例

本文整理汇总了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();
  }
 
开发者ID:utopiazh,项目名称:google-guice,代码行数:40,代码来源:OSGiContainerTest.java

示例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();
}
 
开发者ID:google,项目名称:guice,代码行数:49,代码来源:OSGiContainerTest.java

示例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();
  }
 
开发者ID:cgruber,项目名称:guice-old,代码行数:47,代码来源:OSGiContainerTest.java


注:本文中的com.googlecode.guice.bundle.OSGiTestActivator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。