You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cl...@apache.org on 2013/05/05 15:55:10 UTC
svn commit: r1479322 [1/5] - in /felix/trunk/ipojo/runtime: core-it/
core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/
core-it/src/it/ipojo-core-configuration-admin-test/src/test/java/org/apa...
Author: clement
Date: Sun May 5 13:55:09 2013
New Revision: 1479322
URL: http://svn.apache.org/r1479322
Log:
Refactor tests
Add TIME_FACTOR to invoker
Removed:
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-admin-test/src/test/java/org/apache/felix/ipojo/runtime/core/ConfigurationMonitor.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata-policies.xml
Modified:
felix/trunk/ipojo/runtime/core-it/pom.xml
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/Common.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestAggregateDependency.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestArchitecture.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestCustomAnnotations.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestDependency.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestDependencyPolicy.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestEventAdmin.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestExtender.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestFactory.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestFilteredDependency.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestInstantiate.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestJMX.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestLifecycleCallbacks.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestLifecycleController.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestOptionalDependency.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestProperties.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestRankedDependency.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestServiceProdiving.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestTemporalDependencies.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestWhiteBoard.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-admin-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-admin-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestManagedServiceFactoryTestForImmediate.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-admin-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestManagedServiceFactoryTestForServices.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-admin-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestManagedServiceTestForImmediate.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-admin-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestManagedServiceTestForService.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-processor-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-processor-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestComplexConfigurations.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-processor-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestConfigurationInAnotherBundle.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-processor-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestConfigurationOfMyComponent.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-processor-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestConfigurationOfThreeInstancesUsingMethods.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-processor-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestConfigurationOfTwoInstances.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-processor-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestConfigurationWithInheritedInstance.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-processor-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestConfigurationWithOverriddenInstance.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-processor-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestEmptyConfiguration.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-processor-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestSeveralConfigurations.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestDynamicallyConfigurablePropertiesUsingConfigAdmin.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestUpdatedMethodAndConfigAdmin.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestUpdatedMethodAndManagedService.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestUpdatedNoArgMethodAndConfigAdmin.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/Common.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-external-handlers-test/src/test/java/org/apache/felix/ipojo/runtime/externalhandlers/test/HandlerTest.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-factory-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-factory-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestConfigAdmin.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-factory-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestReconfiguration.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/Common.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/VersionConflictTest.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-handler-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-lifecycle-callback-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-lifecycle-controller-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-logger-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-optional-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/Common.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-policies/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/Common.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-proxies/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/Common.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata.xml
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/Common.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/TestSimpleDependencies.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestProvidedServiceArchitecture.java
felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/inheritence/InheritanceTest.java
felix/trunk/ipojo/runtime/core/src/test/java/org/apache/felix/ipojo/configuration/InstanceDSLTest.java
Modified: felix/trunk/ipojo/runtime/core-it/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/pom.xml?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/pom.xml (original)
+++ felix/trunk/ipojo/runtime/core-it/pom.xml Sun May 5 13:55:09 2013
@@ -87,6 +87,9 @@
<properties>
<exam.version>3.0.1</exam.version>
<url.version>1.5.1</url.version>
+
+
+
</properties>
<dependencies>
@@ -194,7 +197,7 @@
<dependency>
<groupId>org.ow2.chameleon.testing</groupId>
<artifactId>osgi-helpers</artifactId>
- <version>0.6.0</version>
+ <version>0.6.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
@@ -373,6 +376,10 @@
<goal>test</goal>
</goals>
<cloneClean>true</cloneClean>
+ <environmentVariables>
+ <!-- TIME_FACTOR can be set from the command line with -DTIME_FACTOR=9-->
+ <TIME_FACTOR>${TIME_FACTOR}</TIME_FACTOR>
+ </environmentVariables>
</configuration>
<executions>
<execution>
@@ -411,6 +418,10 @@
<goal>test</goal>
</goals>
<cloneClean>true</cloneClean>
+ <environmentVariables>
+ <!-- TIME_FACTOR can be set from the command line with -DTIME_FACTOR=9-->
+ <TIME_FACTOR>${TIME_FACTOR}</TIME_FACTOR>
+ </environmentVariables>
</configuration>
<executions>
<execution>
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/Common.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/Common.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/Common.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/Common.java Sun May 5 13:55:09 2013
@@ -39,6 +39,7 @@ import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
+import org.ow2.chameleon.testing.helpers.BaseTest;
import org.ow2.chameleon.testing.helpers.IPOJOHelper;
import org.ow2.chameleon.testing.helpers.OSGiHelper;
import org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy;
@@ -58,61 +59,13 @@ import static org.ops4j.pax.exam.CoreOpt
/**
* Bootstrap the test from this project
*/
-@RunWith(PaxExam.class)
-@ExamReactorStrategy(PerClass.class)
-public class Common {
-
- @Inject
- BundleContext bc;
-
- OSGiHelper osgiHelper;
- IPOJOHelper ipojoHelper;
-
- Bundle testedBundle;
-
- @Configuration
- public Option[] config() throws MalformedURLException {
- Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
- root.setLevel(Level.INFO);
-
- return options(
- cleanCaches(),
- ipojoBundles(),
- junitBundles(),
- testedBundle(),
- eventadmin(),
- systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("WARN")
- );
- }
-
- @Before
- public void commonSetUp() {
- osgiHelper = new OSGiHelper(bc);
- ipojoHelper = new IPOJOHelper(bc);
-
- testedBundle = osgiHelper.getBundle("test.bundle");
-
- // Dump OSGi Framework information
- String vendor = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VENDOR);
- if (vendor == null) {
- vendor = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_SYMBOLICNAME);
- }
- String version = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VERSION);
- System.out.println("OSGi Framework : " + vendor + " - " + version);
-
- waitForStability(bc);
- }
+public class Common extends BaseTest {
- @After
- public void commonTearDown() {
- osgiHelper.dispose();
- ipojoHelper.dispose();
- }
-
- public CompositeOption ipojoBundles() {
- return new DefaultCompositeOption(
- mavenBundle("org.apache.felix", "org.apache.felix.ipojo").versionAsInProject(),
- mavenBundle("org.ow2.chameleon.testing", "osgi-helpers").versionAsInProject());
+ @Override
+ protected Option[] getCustomOptions() {
+ return new Option[] {
+ eventadmin()
+ };
}
public CompositeOption eventadmin() {
@@ -122,129 +75,4 @@ public class Common {
"1.8.0").versionAsInProject());
}
- public Option testedBundle() throws MalformedURLException {
- File out = new File("target/tested/bundle.jar");
- if (out.exists()) { return bundle(out.toURI().toURL().toExternalForm()); }
-
- TinyBundle tested = TinyBundles.bundle();
-
- // We look inside target/classes to find the class and resources
- File classes = new File("target/classes");
- Collection<File> files = FileUtils.listFilesAndDirs(classes, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
- List<File> services = new ArrayList<File>();
- for (File file : files) {
- if (file.isDirectory()) {
- // By convention we export of .services and .service package
- if (file.getName().endsWith("services") || file.getName().endsWith("service")) {
- services.add(file);
- }
- } else {
- // We need to compute the path
- String path = file.getAbsolutePath().substring(classes.getAbsolutePath().length() + 1);
- tested.add(path, file.toURI().toURL());
- System.out.println(file.getName() + " added to " + path);
- }
- }
-
- String export = "";
- for (File file : services) {
- if (export.length() > 0) {
- export += ", ";
- }
- String path = file.getAbsolutePath().substring(classes.getAbsolutePath().length() + 1);
- String packageName = path.replace('/', '.');
- export += packageName;
- }
-
- System.out.println("Exported packages : " + export);
-
- InputStream inputStream = tested
- .set(Constants.BUNDLE_SYMBOLICNAME, "test.bundle")
- .set(Constants.IMPORT_PACKAGE, "*")
- .set(Constants.EXPORT_PACKAGE, export)
- .build(IPOJOStrategy.withiPOJO(new File("src/main/resources")));
-
- try {
- org.apache.commons.io.FileUtils.copyInputStreamToFile(inputStream, out);
- return bundle(out.toURI().toURL().toExternalForm());
- } catch (MalformedURLException e) {
- throw new RuntimeException("Cannot compute the url of the manipulated bundle");
- } catch (IOException e) {
- throw new RuntimeException("Cannot write of the manipulated bundle");
- }
- }
-
- /**
- * Waits for stability:
- * <ul>
- * <li>all bundles are activated
- * <li>service count is stable
- * </ul>
- * If the stability can't be reached after a specified time,
- * the method throws a {@link IllegalStateException}.
- * @param context the bundle context
- * @throws IllegalStateException when the stability can't be reach after a several attempts.
- */
- private void waitForStability(BundleContext context) throws IllegalStateException {
- // Wait for bundle initialization.
- boolean bundleStability = getBundleStability(context);
- int count = 0;
- while (!bundleStability && count < 500) {
- try {
- Thread.sleep(5);
- } catch (InterruptedException e) {
- // Interrupted
- }
- count++;
- bundleStability = getBundleStability(context);
- }
-
- if (count == 500) {
- for (Bundle bundle : bc.getBundles()) {
- System.out.println("Bundle " + bundle.getSymbolicName() + " - " + bundle.getState());
- }
- System.err.println("Bundle stability isn't reached after 500 tries");
- throw new IllegalStateException("Cannot reach the bundle stability");
- }
-
- boolean serviceStability = false;
- count = 0;
- int count1 = 0;
- int count2 = 0;
- while (! serviceStability && count < 500) {
- try {
- ServiceReference[] refs = context.getServiceReferences((String) null, null);
- count1 = refs.length;
- Thread.sleep(500);
- refs = context.getServiceReferences((String) null, null);
- count2 = refs.length;
- serviceStability = count1 == count2;
- } catch (Exception e) {
- System.err.println(e);
- serviceStability = false;
- // Nothing to do, while recheck the condition
- }
- count++;
- }
-
- if (count == 500) {
- System.err.println("Service stability isn't reached after 500 tries (" + count1 + " != " + count2);
- throw new IllegalStateException("Cannot reach the service stability");
- }
- }
-
- /**
- * Are bundle stables.
- * @param bc the bundle context
- * @return <code>true</code> if every bundles are activated.
- */
- private boolean getBundleStability(BundleContext bc) {
- boolean stability = true;
- Bundle[] bundles = bc.getBundles();
- for (int i = 0; i < bundles.length; i++) {
- stability = stability && (bundles[i].getState() == Bundle.ACTIVE);
- }
- return stability;
- }
-
}
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestAggregateDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestAggregateDependency.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestAggregateDependency.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestAggregateDependency.java Sun May 5 13:55:09 2013
@@ -32,7 +32,8 @@ public class TestAggregateDependency ext
@Before
public void setUp() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.AggregateDependency");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components" +
+ ".AggregateDependency");
deps = meta.getElements("requires");
}
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestArchitecture.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestArchitecture.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestArchitecture.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestArchitecture.java Sun May 5 13:55:09 2013
@@ -29,7 +29,7 @@ public class TestArchitecture extends Co
@Test
public void testArch() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components" +
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components" +
".Arch");
String arch = meta.getAttribute("architecture");
assertNotNull("Architecture exists ", arch);
@@ -38,7 +38,7 @@ public class TestArchitecture extends Co
@Test
public void testNoArch() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components" +
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components" +
".NoArch");
String arch = meta.getAttribute("architecture");
assertNotNull("Architecture exists ", arch);
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestCustomAnnotations.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestCustomAnnotations.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestCustomAnnotations.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestCustomAnnotations.java Sun May 5 13:55:09 2013
@@ -33,14 +33,14 @@ public class TestCustomAnnotations exten
@Test
public void testThatCustomAnnotationAreCorrectlyAdded() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.CustomAnnotationWithEnum");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.CustomAnnotationWithEnum");
Element[] ann = meta.getElements("IPOJOFoo", "foo.ipojo");
assertNotNull("Annotation exists ", ann);
}
@Test
public void testThatCustomAnnotationAreSupportingEnums() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.CustomAnnotationWithEnum");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.CustomAnnotationWithEnum");
Element[] ann = meta.getElements("IPOJOFoo", "foo.ipojo");
assertNotNull("Annotation exists ", ann);
Element element = ann[0];
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestDependency.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestDependency.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestDependency.java Sun May 5 13:55:09 2013
@@ -30,7 +30,7 @@ public class TestDependency extends Comm
@Test
public void testDependencyDeclaration() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.Dependency");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.Dependency");
Element[] deps = meta.getElements("requires");
// Check fs
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestDependencyPolicy.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestDependencyPolicy.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestDependencyPolicy.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestDependencyPolicy.java Sun May 5 13:55:09 2013
@@ -32,7 +32,7 @@ public class TestDependencyPolicy extend
@Before
public void setUp() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.PolicyDependency");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.PolicyDependency");
deps = meta.getElements("requires");
}
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestEventAdmin.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestEventAdmin.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestEventAdmin.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestEventAdmin.java Sun May 5 13:55:09 2013
@@ -41,9 +41,9 @@ public class TestEventAdmin extends Comm
@Before
public void setUp() {
- component = ipojoHelper.getMetadata(testedBundle, type);
- componentDeprecated = ipojoHelper.getMetadata(testedBundle, deprecated);
- componentWithPublishes = ipojoHelper.getMetadata(testedBundle, publishes);
+ component = ipojoHelper.getMetadata(getTestBundle(), type);
+ componentDeprecated = ipojoHelper.getMetadata(getTestBundle(), deprecated);
+ componentWithPublishes = ipojoHelper.getMetadata(getTestBundle(), publishes);
assertNotNull("Check component", component);
assertNotNull("Check deprecated", componentDeprecated);
assertNotNull("Check publishes", componentWithPublishes);
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestExtender.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestExtender.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestExtender.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestExtender.java Sun May 5 13:55:09 2013
@@ -33,7 +33,7 @@ public class TestExtender extends Common
@Test
public void testMetadata() {
- Element meta = ipojoHelper.getMetadata(testedBundle, type);
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), type);
assertNotNull("Check meta", meta);
Element[] ext = meta.getElements("extender", namespace);
assertEquals("Check size", 1, ext.length);
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestFactory.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestFactory.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestFactory.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestFactory.java Sun May 5 13:55:09 2013
@@ -31,7 +31,7 @@ public class TestFactory extends Common
@Test
public void testArchDeprecated() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.FactoryDeprecated");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.FactoryDeprecated");
String fact = meta.getAttribute("public");
String name = meta.getAttribute("name");
assertNotNull("Factory exists ", fact);
@@ -42,7 +42,7 @@ public class TestFactory extends Common
@Test
public void testArch() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.Factory");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.Factory");
String fact = meta.getAttribute("public");
String name = meta.getAttribute("name");
assertNotNull("Factory exists ", fact);
@@ -53,7 +53,7 @@ public class TestFactory extends Common
@Test
public void testNoArch() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.NoFactory");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.NoFactory");
String fact = meta.getAttribute("public");
String name = meta.getAttribute("name");
assertNotNull("Factory exists ", fact);
@@ -64,7 +64,7 @@ public class TestFactory extends Common
@Test
public void testFactoryMethod() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.FactoryMethod");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.FactoryMethod");
String method = meta.getAttribute("factory-method");
assertNotNull("Method exists ", method);
assertEquals("Method value", "create", method);
@@ -72,7 +72,7 @@ public class TestFactory extends Common
@Test
public void testFactoryMethodDeprecated() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.FactoryMethodDeprecated");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.FactoryMethodDeprecated");
String method = meta.getAttribute("factory-method");
assertNotNull("Method exists ", method);
assertEquals("Method value", "create", method);
@@ -80,7 +80,7 @@ public class TestFactory extends Common
@Test
public void testVersion() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.ComponentTypeVersion");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.ComponentTypeVersion");
String version = meta.getAttribute("version");
assertNotNull("Version exist", version);
assertEquals("Version value", "1.0.0", version);
@@ -88,7 +88,7 @@ public class TestFactory extends Common
@Test
public void testNoVersion() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.FactoryMethod");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.FactoryMethod");
String version = meta.getAttribute("version");
assertNull("No Version", version);
}
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestFilteredDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestFilteredDependency.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestFilteredDependency.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestFilteredDependency.java Sun May 5 13:55:09 2013
@@ -35,10 +35,10 @@ public class TestFilteredDependency exte
@Before
public void setUp() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.FilteredDependency");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.FilteredDependency");
deps = meta.getElements("requires");
- Element meta2 = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.FromDependency");
+ Element meta2 = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.FromDependency");
froms = meta2.getElements("requires");
}
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestInstantiate.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestInstantiate.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestInstantiate.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestInstantiate.java Sun May 5 13:55:09 2013
@@ -39,7 +39,7 @@ public class TestInstantiate extends Com
@Test
public void testInstantiateSimple() {
- Element[] meta = getInstanceMetadata(testedBundle,
+ Element[] meta = getInstanceMetadata(getTestBundle(),
"org.apache.felix.ipojo.runtime.core.test" +
".components" +
".InstantiateSimple");
@@ -52,7 +52,7 @@ public class TestInstantiate extends Com
@Test
public void testInstantiateWithName() {
// Check instance tag
- Element[] meta = getInstanceMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components" +
+ Element[] meta = getInstanceMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components" +
".InstantiateWithName");
assertNotNull(meta);
assertEquals(1, meta.length);
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestJMX.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestJMX.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestJMX.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestJMX.java Sun May 5 13:55:09 2013
@@ -30,7 +30,7 @@ public class TestJMX extends Common {
@Test
public void testDeprecated() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.jmx.JMXDeprecated");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.jmx.JMXDeprecated");
/*
* org.apache.felix.ipojo.handlers.jmx:config domain="my-domain" usesmosgi="false"
org.apache.felix.ipojo.handlers.jmx:property field="m_foo" name="prop" rights="w" notification="true"
@@ -57,7 +57,7 @@ public class TestJMX extends Common {
@Test
public void test() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.jmx.JMXSimple");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.jmx.JMXSimple");
/*
* org.apache.felix.ipojo.handlers.jmx:config domain="my-domain" usesmosgi="false"
org.apache.felix.ipojo.handlers.jmx:property field="m_foo" name="prop" rights="w" notification="true"
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestLifecycleCallbacks.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestLifecycleCallbacks.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestLifecycleCallbacks.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestLifecycleCallbacks.java Sun May 5 13:55:09 2013
@@ -31,7 +31,7 @@ public class TestLifecycleCallbacks exte
@Test
public void testCallbacks() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.Lifecycle");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.Lifecycle");
Element[] cbs = meta.getElements("callback");
assertNotNull("Callbacks exists ", cbs);
assertEquals("Callbacks count ", 2, cbs.length);
@@ -47,14 +47,14 @@ public class TestLifecycleCallbacks exte
@Test
public void testImmediate() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.Immediate");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.Immediate");
assertNotNull("Immediate attribute", meta.getAttribute("immediate"));
assertEquals("Immediate attribute value", "true", meta.getAttribute("immediate"));
}
@Test
public void testNoImmediate() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.NoImmediate");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.NoImmediate");
assertNotNull("Immediate attribute", meta.getAttribute("immediate"));
assertEquals("Immediate attribute value", "false", meta.getAttribute("immediate"));
}
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestLifecycleController.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestLifecycleController.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestLifecycleController.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestLifecycleController.java Sun May 5 13:55:09 2013
@@ -29,7 +29,7 @@ public class TestLifecycleController ext
@Test
public void testLFC() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.Lifecycle");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.Lifecycle");
Element[] ctrls = meta.getElements("controller");
assertNotNull("Controller exists ", ctrls);
Element ctrl = ctrls[0];
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestOptionalDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestOptionalDependency.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestOptionalDependency.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestOptionalDependency.java Sun May 5 13:55:09 2013
@@ -34,7 +34,7 @@ public class TestOptionalDependency exte
@Before
public void setUp() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.OptionalDependency");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.OptionalDependency");
deps = meta.getElements("requires");
}
@@ -89,7 +89,7 @@ public class TestOptionalDependency exte
@Test
public void testNullable() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.NullableDependency");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.NullableDependency");
Element[] deps = meta.getElements("requires");
Element fs = getDependencyById(deps, "fs");
String nullable = fs.getAttribute("nullable");
@@ -99,7 +99,7 @@ public class TestOptionalDependency exte
@Test
public void testNoNullable() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.NullableDependency");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.NullableDependency");
Element[] deps = meta.getElements("requires");
Element fs = getDependencyById(deps, "fs2");
String nullable = fs.getAttribute("nullable");
@@ -109,7 +109,7 @@ public class TestOptionalDependency exte
@Test
public void testDefaultImplementation() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.DefaultImplementationDependency");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.DefaultImplementationDependency");
Element[] deps = meta.getElements("requires");
Element fs = getDependencyById(deps, "fs");
String di = fs.getAttribute("default-implementation");
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestProperties.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestProperties.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestProperties.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestProperties.java Sun May 5 13:55:09 2013
@@ -28,7 +28,7 @@ public class TestProperties extends Comm
@Test
public void testProperties() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.Properties");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.Properties");
Element[] provs = meta.getElements("properties");
assertNotNull("Properties exists ", provs);
Element prov = provs[0];
@@ -62,7 +62,7 @@ public class TestProperties extends Comm
@Test
public void testAbsentPropagation() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.Properties");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.Properties");
Element[] provs = meta.getElements("properties");
assertNotNull("Properties exists ", provs);
Element prov = provs[0];
@@ -72,7 +72,7 @@ public class TestProperties extends Comm
@Test
public void testPropagation() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.Propagation");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.Propagation");
Element[] provs = meta.getElements("properties");
assertNotNull("Properties exists ", provs);
Element prov = provs[0];
@@ -83,7 +83,7 @@ public class TestProperties extends Comm
@Test
public void testNoPropagation() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.NoPropagation");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.NoPropagation");
Element[] provs = meta.getElements("properties");
assertNotNull("Properties exists ", provs);
Element prov = provs[0];
@@ -94,7 +94,7 @@ public class TestProperties extends Comm
@Test
public void testPID() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.ManagedServicePID");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.ManagedServicePID");
Element[] provs = meta.getElements("properties");
assertNotNull("Properties exists ", provs);
Element prov = provs[0];
@@ -105,7 +105,7 @@ public class TestProperties extends Comm
@Test
public void testAbsentPID() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.Properties");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.Properties");
Element[] provs = meta.getElements("properties");
assertNotNull("Properties exists ", provs);
Element prov = provs[0];
@@ -115,7 +115,7 @@ public class TestProperties extends Comm
@Test
public void testPropagationAndPID() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.PropagationandPID");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.PropagationandPID");
Element[] provs = meta.getElements("properties");
assertNotNull("Properties exists ", provs);
Element prov = provs[0];
@@ -129,7 +129,7 @@ public class TestProperties extends Comm
@Test
public void testPIDAndPropagation() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.PIDandPropagation");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.PIDandPropagation");
Element[] provs = meta.getElements("properties");
assertNotNull("Properties exists ", provs);
Element prov = provs[0];
@@ -143,7 +143,7 @@ public class TestProperties extends Comm
@Test
public void testUpdatedAndPID() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.UpdatedWithManagedService");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.UpdatedWithManagedService");
Element[] provs = meta.getElements("properties");
assertNotNull("Properties exists ", provs);
Element prov = provs[0];
@@ -158,7 +158,7 @@ public class TestProperties extends Comm
@Test
public void testUpdatedAndProperties() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.UpdatedWithProperties");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.UpdatedWithProperties");
Element[] provs = meta.getElements("properties");
assertNotNull("Properties exists ", provs);
Element prov = provs[0];
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestRankedDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestRankedDependency.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestRankedDependency.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestRankedDependency.java Sun May 5 13:55:09 2013
@@ -33,7 +33,7 @@ public class TestRankedDependency extend
@Before
public void setUp() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.RankedDependency");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.RankedDependency");
deps = meta.getElements("requires");
}
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestServiceProdiving.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestServiceProdiving.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestServiceProdiving.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestServiceProdiving.java Sun May 5 13:55:09 2013
@@ -33,21 +33,21 @@ public class TestServiceProdiving extend
@Test
public void testProvidesSimple() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.ProvidesSimple");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.ProvidesSimple");
Element[] provs = meta.getElements("provides");
assertNotNull("Provides exists ", provs);
}
@Test
public void testProvidesDouble() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.ProvidesDouble");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.ProvidesDouble");
Element[] provs = meta.getElements("provides");
assertNotNull("Provides exists ", provs);
}
@Test
public void testProvidesTriple() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.ProvidesTriple");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.ProvidesTriple");
Element[] provs = meta.getElements("provides");
assertNotNull("Provides exists ", provs);
Element prov = provs[0];
@@ -58,7 +58,7 @@ public class TestServiceProdiving extend
@Test
public void testProvidesQuatro() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.ProvidesQuatro");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.ProvidesQuatro");
Element[] provs = meta.getElements("provides");
assertNotNull("Provides exists ", provs);
Element prov = provs[0];
@@ -70,7 +70,7 @@ public class TestServiceProdiving extend
@Test
public void testProperties() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.ProvidesProperties");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.ProvidesProperties");
Element[] provs = meta.getElements("provides");
assertNotNull("Provides exists ", provs);
Element prov = provs[0];
@@ -101,7 +101,7 @@ public class TestServiceProdiving extend
@Test
public void testStaticProperties() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.ProvidesStaticProperties");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.ProvidesStaticProperties");
Element[] provs = meta.getElements("provides");
assertNotNull("Provides exists ", provs);
Element prov = provs[0];
@@ -149,7 +149,7 @@ public class TestServiceProdiving extend
@Test
public void testServiceController() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.PSServiceController");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.PSServiceController");
Element[] provs = meta.getElements("provides");
assertNotNull("Provides exists ", provs);
System.out.println(provs[0].toString());
@@ -160,7 +160,7 @@ public class TestServiceProdiving extend
@Test
public void testServiceControllerWithSpecification() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.PSServiceControllerSpec");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.PSServiceControllerSpec");
Element[] provs = meta.getElements("provides");
assertNotNull("Provides exists ", provs);
System.out.println(provs[0].toString());
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestTemporalDependencies.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestTemporalDependencies.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestTemporalDependencies.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestTemporalDependencies.java Sun May 5 13:55:09 2013
@@ -31,7 +31,7 @@ public class TestTemporalDependencies ex
@Test
public void testSimple() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalSimple");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalSimple");
Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
assertNotNull("Temporal exists ", provs);
String field = provs[0].getAttribute("field");
@@ -45,7 +45,7 @@ public class TestTemporalDependencies ex
@Test
public void testTemporal() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.temporal.Temporal");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.temporal.Temporal");
Element[] provs = meta.getElements("temporal", "org.apache.felix.ipojo.handler.temporal");
assertNotNull("Temporal exists ", provs);
String field = provs[0].getAttribute("field");
@@ -59,7 +59,7 @@ public class TestTemporalDependencies ex
@Test
public void testDI() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalWithDI");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalWithDI");
Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
assertNotNull("Temporal exists ", provs);
String field = provs[0].getAttribute("field");
@@ -73,7 +73,7 @@ public class TestTemporalDependencies ex
@Test
public void testEmptyArray() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalWithEmptyArray");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalWithEmptyArray");
Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
assertNotNull("Temporal exists ", provs);
String field = provs[0].getAttribute("field");
@@ -87,7 +87,7 @@ public class TestTemporalDependencies ex
@Test
public void testNull() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalWithNull");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalWithNull");
Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
assertNotNull("Temporal exists ", provs);
String field = provs[0].getAttribute("field");
@@ -101,7 +101,7 @@ public class TestTemporalDependencies ex
@Test
public void testNullable() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalWithNullable");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalWithNullable");
Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
assertNotNull("Temporal exists ", provs);
String field = provs[0].getAttribute("field");
@@ -115,7 +115,7 @@ public class TestTemporalDependencies ex
@Test
public void testFilter() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalWithFilter");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalWithFilter");
Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
assertNotNull("Temporal exists ", provs);
String field = provs[0].getAttribute("field");
@@ -129,7 +129,7 @@ public class TestTemporalDependencies ex
@Test
public void testTimeout() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalWithTimeout");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalWithTimeout");
Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
assertNotNull("Temporal exists ", provs);
String field = provs[0].getAttribute("field");
@@ -143,7 +143,7 @@ public class TestTemporalDependencies ex
@Test
public void testSimpleCollection() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalCollection");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalCollection");
Element dep = getElementPerField(meta, "fs1");
String spec = dep.getAttribute("specification");
assertNotNull("Specification not null", spec);
@@ -152,7 +152,7 @@ public class TestTemporalDependencies ex
@Test
public void testCollectionWithTimeout() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalCollection");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalCollection");
Element dep = getElementPerField(meta, "fs2");
String spec = dep.getAttribute("specification");
assertNotNull("Specification not null", spec);
@@ -163,7 +163,7 @@ public class TestTemporalDependencies ex
@Test
public void testCollectionWithPolicy() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalCollection");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalCollection");
Element dep = getElementPerField(meta, "fs3");
String spec = dep.getAttribute("specification");
assertNotNull("Specification not null", spec);
@@ -174,7 +174,7 @@ public class TestTemporalDependencies ex
@Test
public void testCollectionWithProxy() {
- Element meta = ipojoHelper.getMetadata(testedBundle, "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalCollection");
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), "org.apache.felix.ipojo.runtime.core.test.components.temporal.TemporalCollection");
Element dep = getElementPerField(meta, "fs4");
String spec = dep.getAttribute("specification");
assertNotNull("Specification not null", spec);
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestWhiteBoard.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestWhiteBoard.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestWhiteBoard.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-annotations-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/annotations/TestWhiteBoard.java Sun May 5 13:55:09 2013
@@ -36,7 +36,7 @@ public class TestWhiteBoard extends Comm
@Test
public void testMetadataWithOnModification() {
- Element meta = ipojoHelper.getMetadata(testedBundle, typeWI);
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), typeWI);
assertNotNull("Check meta", meta);
Element[] ext = meta.getElements("wbp", namespace);
assertEquals("Check size", 1, ext.length);
@@ -55,7 +55,7 @@ public class TestWhiteBoard extends Comm
@Test
public void testMetadataWithoutOnModification() {
- Element meta = ipojoHelper.getMetadata(testedBundle, typeWO);
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), typeWO);
assertNotNull("Check meta", meta);
Element[] ext = meta.getElements("wbp", namespace);
assertEquals("Check size", 1, ext.length);
@@ -74,7 +74,7 @@ public class TestWhiteBoard extends Comm
@Test
public void testWhiteboards() {
- Element meta = ipojoHelper.getMetadata(testedBundle, typeWhiteboards);
+ Element meta = ipojoHelper.getMetadata(getTestBundle(), typeWhiteboards);
assertNotNull("Check meta", meta);
Element[] ext = meta.getElements("whiteboards", namespace);
assertEquals("Check size", 1, ext.length);
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-admin-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-admin-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-admin-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-admin-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java Sun May 5 13:55:09 2013
@@ -19,230 +19,41 @@
package org.apache.felix.ipojo.runtime.core;
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.Logger;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.filefilter.TrueFileFilter;
-import org.apache.felix.ipojo.runtime.core.components.*;
-import org.apache.felix.ipojo.runtime.core.services.CheckService;
-import org.apache.felix.ipojo.runtime.core.services.FooService;
import org.junit.After;
import org.junit.Before;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.options.CompositeOption;
-import org.ops4j.pax.exam.options.DefaultCompositeOption;
-import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
-import org.ops4j.pax.exam.spi.reactors.PerClass;
-import org.ops4j.pax.tinybundles.core.TinyBundle;
-import org.ops4j.pax.tinybundles.core.TinyBundles;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-import org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy;
-import org.slf4j.LoggerFactory;
-
-import javax.inject.Inject;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import static org.ops4j.pax.exam.CoreOptions.*;
-
-/**
- * Bootstrap the test from this project
- */
-@RunWith(PaxExam.class)
-@ExamReactorStrategy(PerClass.class)
-public class Common {
-
- public static long UPDATE_WAIT_TIME = 2000;
-
- @Inject
- BundleContext bc;
-
- OSGiHelper osgiHelper;
- IPOJOHelper ipojoHelper;
-
- @Configuration
- public Option[] config() throws MalformedURLException {
- Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
- root.setLevel(Level.INFO);
-
- return options(
- ipojoBundles(),
- junitBundles(),
- testedBundle(),
- systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("WARN")
- );
- }
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.ow2.chameleon.testing.helpers.BaseTest;
+import org.ow2.chameleon.testing.helpers.ConfigAdminHelper;
+import org.ow2.chameleon.testing.helpers.TimeUtils;
- @Before
- public void commonSetUp() {
- osgiHelper = new OSGiHelper(bc);
- ipojoHelper = new IPOJOHelper(bc);
-
- // Dump OSGi Framework information
- String vendor = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VENDOR);
- if (vendor == null) {
- vendor = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_SYMBOLICNAME);
- }
- String version = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VERSION);
- System.out.println("OSGi Framework : " + vendor + " - " + version);
+public class Common extends BaseTest {
- waitForStability(bc);
- }
+ public static int UPDATE_WAIT_TIME = 2000;
- public Bundle getTestBundle() {
- return osgiHelper.getBundle("test.bundle");
- }
+ public ConfigAdminHelper caHelper = null;
- @After
- public void commonTearDown() {
- ipojoHelper.dispose();
- osgiHelper.dispose();
- }
+ public ConfigurationAdmin admin;
- public CompositeOption ipojoBundles() {
- return new DefaultCompositeOption(
- mavenBundle("org.apache.felix", "org.apache.felix.ipojo").versionAsInProject(),
- mavenBundle("org.ow2.chameleon.testing", "osgi-helpers").versionAsInProject(),
- mavenBundle("org.apache.felix", "org.apache.felix.configadmin").versionAsInProject());
+ public void grace() {
+ TimeUtils.grace(UPDATE_WAIT_TIME);
}
- public Option testedBundle() throws MalformedURLException {
- File out = new File("target/tested/bundle.jar");
-
- TinyBundle tested = TinyBundles.bundle();
-
- // We look inside target/classes to find the class and resources
- File classes = new File("target/classes");
- Collection<File> files = FileUtils.listFilesAndDirs(classes, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
- List<File> services = new ArrayList<File>();
- for (File file : files) {
- if (file.isDirectory()) {
- // By convention we export of .services and .service package
- if (file.getName().endsWith("services") || file.getName().endsWith("service")) {
- services.add(file);
- }
- } else {
- // We need to compute the path
- String path = file.getAbsolutePath().substring(classes.getAbsolutePath().length() +1);
- tested.add(path, file.toURI().toURL());
- System.out.println(file.getName() + " added to " + path);
- }
- }
-
- String export = "";
- for (File file : services) {
- if (export.length() > 0) { export += ", "; }
- String path = file.getAbsolutePath().substring(classes.getAbsolutePath().length() +1);
- String packageName = path.replace('/', '.');
- export += packageName;
- }
-
- System.out.println("Exported packages : " + export);
-
- InputStream inputStream = tested
- .set(Constants.BUNDLE_SYMBOLICNAME, "test.bundle")
- .set(Constants.IMPORT_PACKAGE, "*")
- .set(Constants.EXPORT_PACKAGE, export)
- .build(IPOJOStrategy.withiPOJO(new File("src/main/resources")));
-
- try {
- org.apache.commons.io.FileUtils.copyInputStreamToFile(inputStream, out);
- return bundle(out.toURI().toURL().toExternalForm());
- } catch (MalformedURLException e) {
- throw new RuntimeException("Cannot compute the url of the manipulated bundle");
- } catch (IOException e) {
- throw new RuntimeException("Cannot write of the manipulated bundle");
- }
- }
-
- /**
- * Waits for stability:
- * <ul>
- * <li>all bundles are activated
- * <li>service count is stable
- * </ul>
- * If the stability can't be reached after a specified time,
- * the method throws a {@link IllegalStateException}.
- *
- * @param context the bundle context
- * @throws IllegalStateException when the stability can't be reach after a several attempts.
- */
- private void waitForStability(BundleContext context) throws IllegalStateException {
- // Wait for bundle initialization.
- boolean bundleStability = getBundleStability(context);
- int count = 0;
- while (!bundleStability && count < 500) {
- try {
- Thread.sleep(5);
- } catch (InterruptedException e) {
- // Interrupted
- }
- count++;
- bundleStability = getBundleStability(context);
- }
-
- if (count == 500) {
- System.err.println("Bundle stability isn't reached after 500 tries");
- throw new IllegalStateException("Cannot reach the bundle stability");
- }
-
- boolean serviceStability = false;
- count = 0;
- int count1 = 0;
- int count2 = 0;
- while (!serviceStability && count < 500) {
- try {
- ServiceReference[] refs = context.getServiceReferences((String) null, null);
- count1 = refs.length;
- Thread.sleep(500);
- refs = context.getServiceReferences((String) null, null);
- count2 = refs.length;
- serviceStability = count1 == count2;
- } catch (Exception e) {
- System.err.println(e);
- serviceStability = false;
- // Nothing to do, while recheck the condition
- }
- count++;
- }
-
- if (count == 500) {
- System.err.println("Service stability isn't reached after 500 tries (" + count1 + " != " + count2);
- throw new IllegalStateException("Cannot reach the service stability");
- }
+ @Override
+ public boolean deployConfigAdmin() {
+ return true;
}
- /**
- * Are bundle stables.
- *
- * @param bc the bundle context
- * @return <code>true</code> if every bundles are activated.
- */
- private boolean getBundleStability(BundleContext bc) {
- boolean stability = true;
- Bundle[] bundles = bc.getBundles();
- for (Bundle bundle : bundles) {
- stability = stability && (bundle.getState() == Bundle.ACTIVE);
- }
- return stability;
+ @Before
+ public void initializeConfigAdmin() {
+ caHelper = new ConfigAdminHelper(bc);
+ admin = caHelper.getConfigurationAdmin();
+ caHelper.deleteAllConfigurations();
}
- public boolean isKF() {
- return bc.getClass().toString().contains("knopflerfish");
+ @After
+ public void stoppingConfigAdmin() {
+ caHelper.deleteAllConfigurations();
+ caHelper.dispose();
}
-
}
Modified: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-admin-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestManagedServiceFactoryTestForImmediate.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-admin-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestManagedServiceFactoryTestForImmediate.java?rev=1479322&r1=1479321&r2=1479322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-admin-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestManagedServiceFactoryTestForImmediate.java (original)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-configuration-admin-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestManagedServiceFactoryTestForImmediate.java Sun May 5 13:55:09 2013
@@ -23,60 +23,26 @@ import org.apache.felix.ipojo.ComponentF
import org.apache.felix.ipojo.PrimitiveInstanceDescription;
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.runtime.core.services.FooService;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.Configuration;
-import org.osgi.service.cm.ConfigurationAdmin;
import java.io.IOException;
import java.util.Dictionary;
import java.util.Properties;
import static junit.framework.Assert.assertEquals;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
public class TestManagedServiceFactoryTestForImmediate extends Common {
private ComponentFactory factory;
- private ConfigurationAdmin admin;
@Before
public void setUp() {
factory = (ComponentFactory) ipojoHelper.getFactory("CA-ImmConfigurableProvider");
- admin = (ConfigurationAdmin) osgiHelper.getServiceObject(ConfigurationAdmin.class.getName(), null);
- assertNotNull("Check configuration admin availability", admin);
- try {
- Configuration[] configurations = admin.listConfigurations("(service.factoryPid=CA-ImmConfigurableProvider)");
- for (int i = 0; configurations != null && i < configurations.length; i++) {
- configurations[i].delete();
- }
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InvalidSyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- @After
- public void tearDown() {
- try {
- Configuration[] configurations = admin.listConfigurations("(service.factoryPid=CA-ImmConfigurableProvider)");
- for (int i = 0; configurations != null && i < configurations.length; i++) {
- configurations[i].delete();
- }
- } catch (IOException e) {
- e.printStackTrace();
- } catch (InvalidSyntaxException e) {
- e.printStackTrace();
- }
- admin = null;
-
-
}
@Test
@@ -102,11 +68,7 @@ public class TestManagedServiceFactoryTe
String pid = configuration.getPid();
// Wait for the processing of the first configuration.
- try {
- Thread.sleep(UPDATE_WAIT_TIME);
- } catch (InterruptedException e1) {
- fail(e1.getMessage());
- }
+ grace();
// The instance should be created, wait for the architecture service
osgiHelper.waitForService(Architecture.class.getName(), "(architecture.instance=" + pid + ")", 1000);
@@ -128,7 +90,7 @@ public class TestManagedServiceFactoryTe
try {
configuration.update(props);
// Update the configuration ...
- Thread.sleep(UPDATE_WAIT_TIME);
+ grace();
} catch (Exception e) {
fail(e.getMessage());
}
@@ -145,7 +107,7 @@ public class TestManagedServiceFactoryTe
try {
configuration.delete();
- Thread.sleep(UPDATE_WAIT_TIME);
+ grace();
} catch (Exception e) {
fail(e.getMessage());
}
@@ -179,11 +141,7 @@ public class TestManagedServiceFactoryTe
System.out.println("PID : " + pid);
// Wait for the processing of the first configuration.
- try {
- Thread.sleep(UPDATE_WAIT_TIME);
- } catch (InterruptedException e1) {
- fail(e1.getMessage());
- }
+ grace();
// The instance should be created, wait for the architecture service
osgiHelper.waitForService(Architecture.class.getName(), "(architecture.instance=" + pid + ")", 1000);
@@ -195,7 +153,7 @@ public class TestManagedServiceFactoryTe
try {
configuration.update(props);
// Update the configuration ...
- Thread.sleep(UPDATE_WAIT_TIME);
+ grace();
} catch (Exception e) {
fail(e.getMessage());
}
@@ -217,7 +175,7 @@ public class TestManagedServiceFactoryTe
try {
configuration.delete();
- Thread.sleep(UPDATE_WAIT_TIME);
+ grace();
} catch (Exception e) {
fail(e.getMessage());
}
@@ -250,11 +208,7 @@ public class TestManagedServiceFactoryTe
String pid = configuration.getPid();
// Wait for the processing of the first configuration.
- try {
- Thread.sleep(UPDATE_WAIT_TIME);
- } catch (InterruptedException e1) {
- fail(e1.getMessage());
- }
+ grace();
assertNull("check no instance", osgiHelper.getServiceObject(Architecture.class.getName(), "(architecture.instance=" + pid + ")"));
@@ -262,11 +216,7 @@ public class TestManagedServiceFactoryTe
// Wait for the processing of the first configuration.
- try {
- Thread.sleep(UPDATE_WAIT_TIME);
- } catch (InterruptedException e1) {
- fail(e1.getMessage());
- }
+ grace();
// The instance should be created, wait for the architecture service
@@ -289,7 +239,7 @@ public class TestManagedServiceFactoryTe
try {
configuration.update(props);
// Update the configuration ...
- Thread.sleep(UPDATE_WAIT_TIME);
+ grace();
} catch (Exception e) {
fail(e.getMessage());
}
@@ -307,7 +257,7 @@ public class TestManagedServiceFactoryTe
try {
configuration.delete();
- Thread.sleep(UPDATE_WAIT_TIME);
+ grace();
} catch (Exception e) {
fail(e.getMessage());
}
@@ -341,22 +291,14 @@ public class TestManagedServiceFactoryTe
String pid = configuration.getPid();
// Wait for the processing of the first configuration.
- try {
- Thread.sleep(UPDATE_WAIT_TIME);
- } catch (InterruptedException e1) {
- fail(e1.getMessage());
- }
+ grace();
assertNull("check no instance", osgiHelper.getServiceObject(Architecture.class.getName(), "(architecture.instance=" + pid + ")"));
factory.start();
// Wait for the processing of the first configuration.
- try {
- Thread.sleep(UPDATE_WAIT_TIME);
- } catch (InterruptedException e1) {
- fail(e1.getMessage());
- }
+ grace();
// The instance should be created, wait for the architecture service
@@ -369,7 +311,7 @@ public class TestManagedServiceFactoryTe
try {
configuration.update(props);
// Update the configuration ...
- Thread.sleep(UPDATE_WAIT_TIME);
+ grace();
} catch (Exception e) {
fail(e.getMessage());
}
@@ -391,7 +333,7 @@ public class TestManagedServiceFactoryTe
try {
configuration.delete();
- Thread.sleep(UPDATE_WAIT_TIME);
+ grace();
} catch (Exception e) {
fail(e.getMessage());
}