Skip to content

Commit

Permalink
Merge pull request csierra/arquillian-extension-liferay#20 fixes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Sierra committed Apr 15, 2015
1 parent 41efd4a commit 2fc2f26
Show file tree
Hide file tree
Showing 25 changed files with 919 additions and 746 deletions.
12 changes: 3 additions & 9 deletions arquillian-container-liferay/pom.xml
Expand Up @@ -27,15 +27,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-karaf-remote</artifactId>
<version>2.1.0.CR18</version>
<exclusions>
<exclusion>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
</exclusion>
</exclusions>
<groupId>org.arquillian.liferay</groupId>
<artifactId>arquillian-container-osgi-with-extensions</artifactId>
<version>1.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
Expand Down
Expand Up @@ -14,14 +14,11 @@

package org.arquillian.container.liferay.remote;

import org.arquillian.container.liferay.remote.bundleclasspath.BundleClassPathAuxiliaryAppender;
import org.arquillian.container.liferay.remote.deploy.processor.AddAllExtensionsToApplicationArchiveProcessor;
import org.arquillian.container.liferay.remote.enricher.LiferayEnricherAuxiliaryAppender;
import org.arquillian.container.liferay.remote.wait.LiferayWaitForServiceAuxiliaryAppender;
import org.arquillian.container.osgi.remote.KarafWithoutBundleRemoteDeployableContainer;

import org.jboss.arquillian.container.osgi.karaf.remote.KarafRemoteDeployableContainer;
import org.jboss.arquillian.container.spi.client.container.DeployableContainer;
import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveAppender;
import org.jboss.arquillian.core.spi.LoadableExtension;

Expand All @@ -33,24 +30,17 @@ public class LiferayRemoteContainerExtension implements LoadableExtension {
@Override
public void register(ExtensionBuilder builder) {
builder.override(
DeployableContainer.class, KarafRemoteDeployableContainer.class,
DeployableContainer.class,
KarafWithoutBundleRemoteDeployableContainer.class,
LiferayRemoteDeployableContainer.class);

builder.service(
ApplicationArchiveProcessor.class,
AddAllExtensionsToApplicationArchiveProcessor.class);

builder.service(
AuxiliaryArchiveAppender.class,
LiferayEnricherAuxiliaryAppender.class);

builder.service(
AuxiliaryArchiveAppender.class,
LiferayWaitForServiceAuxiliaryAppender.class);

builder.service(
AuxiliaryArchiveAppender.class,
BundleClassPathAuxiliaryAppender.class);
}

}
Expand Up @@ -14,14 +14,9 @@

package org.arquillian.container.liferay.remote;

import java.io.IOException;
import org.arquillian.container.osgi.remote.KarafWithoutBundleRemoteDeployableContainer;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import org.jboss.arquillian.container.osgi.karaf.remote.KarafRemoteDeployableContainer;
import org.jboss.arquillian.container.spi.client.container.DeploymentException;
import org.jboss.arquillian.container.spi.client.container.LifecycleException;
import org.jboss.arquillian.container.spi.client.protocol.metadata.HTTPContext;
import org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData;
import org.jboss.shrinkwrap.api.Archive;
Expand All @@ -31,7 +26,7 @@
*/
public class LiferayRemoteDeployableContainer
<T extends LiferayRemoteContainerConfiguration>
extends KarafRemoteDeployableContainer<T> {
extends KarafWithoutBundleRemoteDeployableContainer<T> {

@Override
public ProtocolMetaData deploy(Archive<?> archive)
Expand Down Expand Up @@ -59,20 +54,6 @@ public void setup(T config) {
super.setup(config);
}

@Override
protected void awaitArquillianBundleActive(long timeout, TimeUnit unit)
throws InterruptedException, IOException, TimeoutException {

//On purpose: It is not needed to install an Arquillian Bundle
}

@Override
protected void installArquillianBundle()
throws IOException, LifecycleException {

//On purpose: It is not needed to install an Arquillian Bundle
}

protected LiferayRemoteContainerConfiguration config;

}
52 changes: 52 additions & 0 deletions arquillian-container-osgi-with-extensions/pom.xml
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<artifactId>arquillian-extension-liferay</artifactId>
<groupId>org.arquillian.liferay</groupId>
<version>1.0.0.Final-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>org.arquillian.liferay</groupId>
<artifactId>arquillian-container-osgi-with-extensions</artifactId>
<version>1.0.0.Final-SNAPSHOT</version>
<name>Arquillian Liferay Container Adapter</name>
<description>Arquillian Container OSGi that allow to use standars extensions</description>

<dependencies>
<dependency>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bndlib</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-karaf-remote</artifactId>
<version>2.1.0.CR18</version>
<exclusions>
<exclusion>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.enterprise</artifactId>
<version>5.0.0</version>
</dependency>
</dependencies>

</project>
@@ -0,0 +1,47 @@
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/

package org.arquillian.container.osgi.remote;

import java.io.IOException;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import org.jboss.arquillian.container.osgi.karaf.remote.KarafRemoteContainerConfiguration;
import org.jboss.arquillian.container.osgi.karaf.remote.KarafRemoteDeployableContainer;
import org.jboss.arquillian.container.spi.client.container.LifecycleException;

/**
* @author Cristina González
*/
public class KarafWithoutBundleRemoteDeployableContainer
<T extends KarafRemoteContainerConfiguration>
extends KarafRemoteDeployableContainer<T> {

@Override
protected void awaitArquillianBundleActive(long timeout, TimeUnit unit)
throws InterruptedException, IOException, TimeoutException {

//On purpose: It is not needed to install an Arquillian Bundle
}

@Override
protected void installArquillianBundle()
throws IOException, LifecycleException {

//On purpose: It is not needed to install an Arquillian Bundle
}

}
@@ -0,0 +1,46 @@
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/

package org.arquillian.container.osgi.remote;

import org.arquillian.container.osgi.remote.bundleclasspath.BundleClassPathAuxiliaryAppender;
import org.arquillian.container.osgi.remote.processor.AddAllExtensionsToApplicationArchiveProcessor;

import org.jboss.arquillian.container.osgi.karaf.remote.KarafRemoteDeployableContainer;
import org.jboss.arquillian.container.spi.client.container.DeployableContainer;
import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveAppender;
import org.jboss.arquillian.core.spi.LoadableExtension;

/**
* @author Cristina González
*/
public class OSGiAllInBundleExtension implements LoadableExtension {

@Override
public void register(ExtensionBuilder builder) {
builder.override(
DeployableContainer.class, KarafRemoteDeployableContainer.class,
KarafWithoutBundleRemoteDeployableContainer.class);

builder.service(
ApplicationArchiveProcessor.class,
AddAllExtensionsToApplicationArchiveProcessor.class);

builder.service(
AuxiliaryArchiveAppender.class,
BundleClassPathAuxiliaryAppender.class);
}

}
Expand Up @@ -12,7 +12,7 @@
* details.
*/

package org.arquillian.container.liferay.remote.activator;
package org.arquillian.container.osgi.remote.activator;

import java.io.BufferedReader;
import java.io.InputStream;
Expand Down
Expand Up @@ -12,7 +12,7 @@
* details.
*/

package org.arquillian.container.liferay.remote.bundleclasspath;
package org.arquillian.container.osgi.remote.bundleclasspath;

import org.jboss.arquillian.container.test.spi.RemoteLoadableExtension;
import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveAppender;
Expand Down
Expand Up @@ -12,7 +12,7 @@
* details.
*/

package org.arquillian.container.liferay.remote.bundleclasspath;
package org.arquillian.container.osgi.remote.bundleclasspath;

import org.jboss.arquillian.container.test.spi.RemoteLoadableExtension;

Expand Down
Expand Up @@ -12,7 +12,7 @@
* details.
*/

package org.arquillian.container.liferay.remote.bundleclasspath;
package org.arquillian.container.osgi.remote.bundleclasspath;

import org.jboss.arquillian.core.api.annotation.Observes;
import org.jboss.arquillian.core.spi.EventContext;
Expand Down
Expand Up @@ -12,7 +12,7 @@
* details.
*/

package org.arquillian.container.liferay.remote.deploy.processor;
package org.arquillian.container.osgi.remote.processor;

import aQute.bnd.osgi.Jar;

Expand All @@ -32,7 +32,7 @@
import java.util.jar.JarFile;
import java.util.jar.Manifest;

import org.arquillian.container.liferay.remote.activator.ArquillianBundleActivator;
import org.arquillian.container.osgi.remote.activator.ArquillianBundleActivator;

import org.jboss.arquillian.container.test.spi.RemoteLoadableExtension;
import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
Expand Down
Expand Up @@ -12,7 +12,7 @@
* details.
*/

package org.arquillian.container.liferay.remote.deploy.processor;
package org.arquillian.container.osgi.remote.processor;

import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
Expand Down
@@ -0,0 +1 @@
org.arquillian.container.osgi.remote.OSGiWithExtensionsExtension

0 comments on commit 2fc2f26

Please sign in to comment.