當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。