You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2014/12/14 18:20:24 UTC
svn commit: r1645474 - in /directory/sandbox/seelmann/osgi-testing: ./
api-paxexam-osgi-test/ api-paxexam-osgi-test/src/
api-paxexam-osgi-test/src/main/ api-paxexam-osgi-test/src/main/java/
api-paxexam-osgi-test/src/main/resources/ api-paxexam-osgi-tes...
Author: seelmann
Date: Sun Dec 14 17:20:23 2014
New Revision: 1645474
URL: http://svn.apache.org/r1645474
Log:
Added som paxexam tests for API
Added:
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/ (with props)
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/pom.xml
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/main/
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/main/java/
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/main/resources/
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiAsn1ApiOsgiTest.java
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiAsn1BerOsgiTest.java
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiI18nOsgiTest.java
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiModelLdapOsgiTest.java
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiOsgiTestBase.java
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiUtilOsgiTest.java
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/resources/
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/resources/exam.properties
directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/resources/logback.xml
Modified:
directory/sandbox/seelmann/osgi-testing/pom.xml
Propchange: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Dec 14 17:20:23 2014
@@ -0,0 +1,10 @@
+target
+bin
+.classpath
+.project
+.settings
+*.log
+*.iml
+*.ipr
+META-INF
+
Added: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/pom.xml?rev=1645474&view=auto
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/pom.xml (added)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/pom.xml Sun Dec 14 17:20:23 2014
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.directory.osgitesting</groupId>
+ <artifactId>osgitesting-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>api-paxexam-osgi-test</artifactId>
+
+ <properties>
+ <exam.version>3.4.0</exam.version>
+ <url.version>1.6.0</url.version>
+ <logback.version>1.0.6</logback.version>
+ <felix.version>4.0.2</felix.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.directory.api</groupId>
+ <artifactId>api-ldap-model</artifactId>
+ <version>${api.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>antlr</groupId>
+ <artifactId>antlr</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.studio</groupId>
+ <artifactId>org.antlr.antlr</artifactId>
+ <version>2.7.7</version>
+ <exclusions>
+ <exclusion>
+ <groupId>antlr</groupId>
+ <artifactId>antlr</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- Test and PAX dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>${logback.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-container-forked</artifactId>
+ <version>${exam.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-junit4</artifactId>
+ <version>${exam.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-link-mvn</artifactId>
+ <version>${exam.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.url</groupId>
+ <artifactId>pax-url-aether</artifactId>
+ <version>${url.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.framework</artifactId>
+ <version>${felix.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>list</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ <configuration>
+ <includeScope>runtime</includeScope>
+ <outputFile>${project.build.directory}/test-classes/deps.txt</outputFile>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>
+ org.apache.maven.plugins
+ </groupId>
+ <artifactId>
+ maven-dependency-plugin
+ </artifactId>
+ <versionRange>
+ [2.8,)
+ </versionRange>
+ <goals>
+ <goal>list</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
Added: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiAsn1ApiOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiAsn1ApiOsgiTest.java?rev=1645474&view=auto
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiAsn1ApiOsgiTest.java (added)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiAsn1ApiOsgiTest.java Sun Dec 14 17:20:23 2014
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.api.osgi;
+
+
+import org.apache.directory.api.asn1.EncoderException;
+import org.apache.directory.api.asn1.util.BitString;
+import org.apache.directory.api.asn1.util.Oid;
+
+
+public class ApiAsn1ApiOsgiTest extends ApiOsgiTestBase
+{
+
+ @Override
+ protected String getBundleName()
+ {
+ return "org.apache.directory.api.asn1.api";
+ }
+
+
+ @Override
+ protected void useBundleClasses() throws Exception
+ {
+ new EncoderException( "foo" );
+ new Oid( "1.2.3" );
+ new BitString( 8 );
+ }
+
+}
Added: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiAsn1BerOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiAsn1BerOsgiTest.java?rev=1645474&view=auto
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiAsn1BerOsgiTest.java (added)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiAsn1BerOsgiTest.java Sun Dec 14 17:20:23 2014
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.api.osgi;
+
+
+import org.apache.directory.api.asn1.actions.CheckNotNullLength;
+import org.apache.directory.api.asn1.ber.Asn1Container;
+import org.apache.directory.api.asn1.ber.Asn1Decoder;
+import org.apache.directory.api.asn1.ber.tlv.BerValue;
+import org.apache.directory.api.asn1.ber.tlv.TLV;
+
+
+public class ApiAsn1BerOsgiTest extends ApiOsgiTestBase
+{
+
+ @Override
+ protected String getBundleName()
+ {
+ return "org.apache.directory.api.asn1.ber";
+ }
+
+
+ @Override
+ protected void useBundleClasses() throws Exception
+ {
+ new CheckNotNullLength<Asn1Container>();
+ new Asn1Decoder().getMaxLengthLength();
+ new BerValue().init( 5 );
+ new TLV( 1 ).getValue();
+ }
+
+}
Added: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiI18nOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiI18nOsgiTest.java?rev=1645474&view=auto
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiI18nOsgiTest.java (added)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiI18nOsgiTest.java Sun Dec 14 17:20:23 2014
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.api.osgi;
+
+
+import static org.junit.Assert.assertNotNull;
+
+import org.apache.directory.api.i18n.I18n;
+
+
+public class ApiI18nOsgiTest extends ApiOsgiTestBase
+{
+
+ @Override
+ protected String getBundleName()
+ {
+ return "org.apache.directory.api.i18n";
+ }
+
+
+ @Override
+ protected void useBundleClasses() throws Exception
+ {
+ I18n errorCode = I18n.ERR_00001_BAD_TRANSITION_FROM_STATE;
+ assertNotNull( errorCode );
+ assertNotNull( errorCode.getErrorCode() );
+ assertNotNull( I18n.err( errorCode ) );
+ }
+
+}
Added: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiModelLdapOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiModelLdapOsgiTest.java?rev=1645474&view=auto
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiModelLdapOsgiTest.java (added)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiModelLdapOsgiTest.java Sun Dec 14 17:20:23 2014
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.api.osgi;
+
+
+import org.apache.directory.api.ldap.model.entry.DefaultAttribute;
+import org.apache.directory.api.ldap.model.entry.DefaultEntry;
+import org.apache.directory.api.ldap.model.entry.StringValue;
+import org.apache.directory.api.ldap.model.filter.EqualityNode;
+import org.apache.directory.api.ldap.model.message.BindRequestImpl;
+import org.apache.directory.api.ldap.model.name.Dn;
+import org.apache.directory.api.ldap.model.schema.parsers.ObjectClassDescriptionSchemaParser;
+import org.apache.directory.api.ldap.model.url.LdapUrl;
+
+
+public class ApiModelLdapOsgiTest extends ApiOsgiTestBase
+{
+
+ @Override
+ protected String getBundleName()
+ {
+ return "org.apache.directory.api.ldap.model";
+ }
+
+
+ @Override
+ protected void useBundleClasses() throws Exception
+ {
+ new Dn( "dc=example,dc=com" ); // uses FastDnParser
+ new Dn( "cn=a+sn=b,dc=example,dc=com" ); // uses ComplexDnparser (antlr based)
+ new StringValue( "foo" );
+ new DefaultAttribute( "cn" );
+ new DefaultEntry();
+
+ new BindRequestImpl();
+
+ new EqualityNode<String>( "cn", new StringValue( "foo" ) );
+
+ new LdapUrl( "ldap://ldap.example.com:10389/dc=example,dc=com?objectclass" );
+
+ new ObjectClassDescriptionSchemaParser()
+ .parse( "( 2.5.6.0 NAME 'top' DESC 'top of the superclass chain' ABSTRACT MUST objectClass )" );
+ }
+
+}
Added: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiOsgiTestBase.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiOsgiTestBase.java?rev=1645474&view=auto
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiOsgiTestBase.java (added)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiOsgiTestBase.java Sun Dec 14 17:20:23 2014
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.api.osgi;
+
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.CoreOptions.composite;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.inject.Inject;
+
+import org.apache.commons.io.IOUtils;
+import org.junit.Test;
+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.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.ops4j.pax.exam.util.PathUtils;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public abstract class ApiOsgiTestBase
+{
+
+ @Inject
+ private BundleContext context;
+
+ private static Map<String, String> REPLACEMENTS = new HashMap<String, String>();
+ static
+ {
+ // REPLACEMENTS.put( "antlr:antlr:jar:2.7.7:compile", "org.apache.directory.studio:org.antlr.antlr:jar:2.7.7:compile" );
+ }
+
+
+ @Configuration
+ public Option[] config() throws IOException
+ {
+ // read transitive dependencies from file which was generated by maven-dependency-plugin
+ Pattern pattern = Pattern.compile( "\\s*(.+?)\\:(.+?)\\:jar\\:(.+?)\\:compile" );
+ List<String> lines = IOUtils.readLines( getClass().getResourceAsStream( "/deps.txt" ) );
+ List<Option> mavibotDependencies = new ArrayList<Option>();
+ for ( String line : lines )
+ {
+ line = fix( line );
+ Matcher matcher = pattern.matcher( line );
+ if ( matcher.matches() )
+ {
+ String group = matcher.group( 1 );
+ String artifactId = matcher.group( 2 );
+ String version = matcher.group( 3 );
+ mavibotDependencies.add( mavenBundle( group, artifactId, version ) );
+ }
+ }
+
+ return options(
+ systemProperty( "org.ops4j.pax.logging.DefaultServiceLog.level" ).value( "WARN" ),
+ systemProperty( "logback.configurationFile" ).value(
+ "file:" + PathUtils.getBaseDir() + "/src/test/resources/logback.xml" ),
+ mavenBundle( "ch.qos.logback", "logback-classic", "1.0.6" ),
+ mavenBundle( "ch.qos.logback", "logback-core", "1.0.6" ), junitBundles(),
+ composite( mavibotDependencies.toArray( new Option[0] ) ) );
+ }
+
+
+ private String fix( String line )
+ {
+ line = line.trim();
+ if ( REPLACEMENTS.containsKey( line ) )
+ {
+ return REPLACEMENTS.get( line );
+ }
+ return line;
+ }
+
+
+ @Test
+ public void testInjectContext()
+ {
+ assertNotNull( context );
+ }
+
+
+ @Test
+ public void testBundleActivation()
+ {
+ String bundleName = getBundleName();
+
+ boolean bundleFound = false;
+ boolean bundleActive = false;
+ Bundle[] bundles = context.getBundles();
+ for ( Bundle bundle : bundles )
+ {
+ //System.out.println( "### bundle=" + bundle );
+ if ( bundle != null && bundle.getSymbolicName() != null && bundle.getSymbolicName().equals( bundleName ) )
+ {
+ bundleFound = true;
+ if ( bundle.getState() == Bundle.ACTIVE )
+ {
+ bundleActive = true;
+ }
+ }
+ }
+
+ assertTrue( "Bundle " + bundleName + " not found.", bundleFound );
+ assertTrue( "Bundle " + bundleName + " is not active.", bundleActive );
+ }
+
+
+ /**
+ * @return the symbolic name of the bundle under test.
+ */
+ protected abstract String getBundleName();
+
+
+ @Test
+ public void testUseBundleClasses() throws Exception
+ {
+ useBundleClasses();
+ }
+
+
+ /**
+ * Implementations should use the bundle's classes to check if they are accessible.
+ * @throws Exception
+ */
+ protected abstract void useBundleClasses() throws Exception;
+
+}
Added: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiUtilOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiUtilOsgiTest.java?rev=1645474&view=auto
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiUtilOsgiTest.java (added)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiUtilOsgiTest.java Sun Dec 14 17:20:23 2014
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.api.osgi;
+
+
+import java.util.Date;
+
+import org.apache.directory.api.util.GeneralizedTime;
+import org.apache.directory.api.util.exception.MultiException;
+
+
+public class ApiUtilOsgiTest extends ApiOsgiTestBase
+{
+
+ @Override
+ protected String getBundleName()
+ {
+ return "org.apache.directory.api.util";
+ }
+
+
+ @Override
+ protected void useBundleClasses() throws Exception
+ {
+ new GeneralizedTime( new Date() ).getHour();
+ new MultiException();
+ }
+
+}
Added: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/resources/exam.properties
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/resources/exam.properties?rev=1645474&view=auto
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/resources/exam.properties (added)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/resources/exam.properties Sun Dec 14 17:20:23 2014
@@ -0,0 +1,18 @@
+#############################################################################
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#############################################################################
+
+pax.exam.logging = none
Added: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/resources/logback.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/resources/logback.xml?rev=1645474&view=auto
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/resources/logback.xml (added)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/resources/logback.xml Sun Dec 14 17:20:23 2014
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<configuration>
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <root level="error">
+ <appender-ref ref="STDOUT" />
+ </root>
+</configuration>
\ No newline at end of file
Modified: directory/sandbox/seelmann/osgi-testing/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/pom.xml?rev=1645474&r1=1645473&r2=1645474&view=diff
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/pom.xml (original)
+++ directory/sandbox/seelmann/osgi-testing/pom.xml Sun Dec 14 17:20:23 2014
@@ -78,17 +78,14 @@
<properties>
<!-- Dependencies versions ========================================== -->
<junit.version>4.11</junit.version>
-<!-- <commons.collections.version>3.2.1</commons.collections.version> -->
-<!-- <slf4j.version>1.7.7</slf4j.version> -->
-<!-- <slf4j.api.version>1.7.7</slf4j.api.version> -->
-<!-- <slf4j.log4j12.version>1.7.7</slf4j.log4j12.version> -->
-
<mavibot.version>1.0.0-M7-SNAPSHOT</mavibot.version>
+ <api.version>1.0.0-M27-SNAPSHOT</api.version>
</properties>
<modules>
<module>mavibot-paxexam-osgi-test</module>
- <module>eclipse-test</module>
+ <module>api-paxexam-osgi-test</module>
+ <!-- <module>eclipse-test</module> -->
</modules>
<dependencyManagement>