Examples of OSGiTestRunner


Examples of uk.co.brunella.osgi.bdt.runner.OSGiTestRunner

public class OSGiTestCase extends Fixture {

  private OSGiTestRunner testRunner;

  public OSGiTestCase() {
    testRunner = new OSGiTestRunner();
  }
View Full Code Here

Examples of uk.co.brunella.osgi.bdt.runner.OSGiTestRunner

    //   Reason: Missing Permission: (org.osgi.framework.PackagePermission org.osgi.framework export,import),
    //   Missing Constraint: Import-Package: org.osgi.framework; version="1.3.0"
    System.setSecurityManager(null);
   
    try {
      OSGiTestRunner runner = new OSGiTestRunner();
      runner.setFramework(frameworkName);
      runner.setRepositoryDirectory(repository);
      if (systemBundle != null) {
        runner.setSystemBundle(systemBundle.getName(), systemBundle.getVersion());
      }
      if (runnerBundle != null) {
        runner.setTestRunnerBundle(runnerBundle.getName(), runnerBundle.getVersion());
      }
      for (BundleDescriptor bundle : requiredBundles.getBundleDescriptors()) {
        runner.addRequiredBundle(bundle.getName(), bundle.getVersion());
      }
      for (BundleDescriptor bundle : testBundles.getBundleDescriptors()) {
        runner.addTestBundle(bundle.getName(), bundle.getVersion());
      }
      for (Parameter parameter : parameters.getParameters()) {
        runner.addTestParameter(parameter.getName(), parameter.getValue());
      }
     
      try {
        List<OSGiTestResult> results;
        PrintStream oldOutStream = System.out;
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        PrintStream newOutStream = new PrintStream(outStream);
        PrintStream oldErrStream = System.err;
        ByteArrayOutputStream errStream = new ByteArrayOutputStream();
        PrintStream newErrStream = new PrintStream(errStream);
        String out;
        String err;
        try {
          System.setErr(newErrStream);
          results = runner.runTests();
        } finally {
          out = outStream.toString();
          err = errStream.toString();
          newOutStream.close();
          System.setOut(oldOutStream);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.