diff --git a/containers/pax-exam-container-remote/pom.xml b/containers/pax-exam-container-remote/pom.xml deleted file mode 100644 index 9699dfdb4..000000000 --- a/containers/pax-exam-container-remote/pom.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - 4.0.0 - - - org.ops4j.pax - exam - 4.13.6-SNAPSHOT - ../../pom - - - org.ops4j.pax.exam - pax-exam-container-remote - jar - - OPS4J Pax Exam TestContainer Remote - - - - org.ops4j.pax.exam - pax-exam - ${project.version} - - - org.ops4j.pax.exam - pax-exam-container-rbc-client - ${project.version} - - - org.ops4j.pax.exam - pax-exam-spi - ${project.version} - - - org.osgi - osgi.core - provided - - - org.ops4j.pax.swissbox - pax-swissbox-core - - - org.ops4j.base - ops4j-base-lang - - - org.ops4j.base - ops4j-base-net - - - org.slf4j - slf4j-api - - - junit - junit - - - - - \ No newline at end of file diff --git a/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/Parser.java b/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/Parser.java deleted file mode 100644 index db39d724c..000000000 --- a/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/Parser.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2010 Toni Menzel - * - * Licensed 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.ops4j.pax.exam.container.remote; - -import static org.ops4j.pax.exam.OptionUtils.filter; - -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.container.remote.options.RBCLookupTimeoutOption; -import org.ops4j.pax.exam.container.remote.options.RBCPortOption; - -/** - * Minimal parser for the rbcremote fragment. - */ -public class Parser { - - private String host; - - private Integer port; - - private long timeout; - - public Parser(Option[] options) { - extractArguments(filter(RBCPortOption.class, options)); - extractArguments(filter(RBCLookupTimeoutOption.class, options)); - assert port != null : "Port should never be null."; - assert host != null : "Host should never be null."; - - } - - private void extractArguments(RBCLookupTimeoutOption[] options) { - for (RBCLookupTimeoutOption op : options) { - timeout = op.getTimeout(); - } - } - - private void extractArguments(RBCPortOption[] rbcPortOptions) { - for (RBCPortOption op : rbcPortOptions) { - host = op.getHost(); - port = op.getPort(); - } - } - - public String getHost() { - return host; - } - - public Integer getRMIPort() { - return port; - } - - public long getRMILookupTimpout() { - return timeout; - } - - public Integer getPort() { - return port; - } -} diff --git a/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/RBCRemoteContainer.java b/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/RBCRemoteContainer.java deleted file mode 100644 index e6c50e118..000000000 --- a/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/RBCRemoteContainer.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2009 Toni Menzel. - * - * Licensed 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.ops4j.pax.exam.container.remote; - -import java.io.InputStream; - -import org.ops4j.pax.exam.TestAddress; -import org.ops4j.pax.exam.TestContainer; - -/** - * Graceful delegator to underlying target instance. All other TestContainer services are do nothing - * calls. - * - * @author Toni Menzel - * @since Jan 26, 2010 - */ -public class RBCRemoteContainer implements TestContainer { - - private final TestContainer target; - - public RBCRemoteContainer(final TestContainer target) { - this.target = target; - } - - public void call(TestAddress address) { - target.call(address); - } - - public long install(String location, InputStream stream) { - return target.install(location, stream); - } - - public long install(InputStream stream) { - return install("local", stream); - } - - public TestContainer start() { - // do nothing - return this; - } - - public TestContainer stop() { - return this; - } - - @Override - public String toString() { - return "Remote:" + target.toString(); - } - - @Override - public long installProbe(InputStream stream) { - return install(stream); - } - - @Override - public void uninstallProbe() { - target.uninstallProbe(); - } -} diff --git a/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/RBCRemoteContainerFactory.java b/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/RBCRemoteContainerFactory.java deleted file mode 100644 index 7ac6a08ad..000000000 --- a/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/RBCRemoteContainerFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2009 Toni Menzel. - * - * Licensed 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.ops4j.pax.exam.container.remote; - -import org.ops4j.pax.exam.ExamSystem; -import org.ops4j.pax.exam.TestContainer; -import org.ops4j.pax.exam.TestContainerFactory; - -/** - * @author Toni Menzel - * @since Jan 26, 2010 - */ -public class RBCRemoteContainerFactory implements TestContainerFactory { - - /** - * Not used yet. - */ - public TestContainer[] create(final ExamSystem system) { - return new TestContainer[] { - - }; - } -} diff --git a/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/RBCRemoteTarget.java b/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/RBCRemoteTarget.java deleted file mode 100644 index 41fa722a0..000000000 --- a/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/RBCRemoteTarget.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2009 Toni Menzel. - * - * Licensed 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.ops4j.pax.exam.container.remote; - -import java.io.InputStream; - -import org.ops4j.pax.exam.RelativeTimeout; -import org.ops4j.pax.exam.TestAddress; -import org.ops4j.pax.exam.TestContainer; -import org.ops4j.pax.exam.rbc.client.RemoteBundleContextClient; -import org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * TODO Needs JavaDoc - * - * @author Toni Menzel - * @since Jan 25, 2010 - */ -public class RBCRemoteTarget implements TestContainer { - - private static final Logger LOG = LoggerFactory.getLogger(RBCRemoteTarget.class); - - private RemoteBundleContextClient remoteBundleContextClient; - private Long probeId; - - public RBCRemoteTarget(String name, Integer registry, RelativeTimeout timeout) { - remoteBundleContextClient = new RemoteBundleContextClientImpl(name, registry, timeout); - } - - /** - * This access is kind of sneaky. Need to improve here. Usually this kind of raw access should - * not be allowed. - * - * @return underlying access - */ - public RemoteBundleContextClient getClientRBC() { - return remoteBundleContextClient; - } - - public void call(TestAddress address) { - LOG.debug("call [" + address + "]"); - remoteBundleContextClient.call(address); - } - - public TestContainer start() { - return this; - } - - public long install(String location, InputStream probe) { - LOG.debug("Preparing and Installing bundle (from stream ).."); - - long id = 0; - id = remoteBundleContextClient.install(location, probe); - LOG.debug("Installed bundle (from stream)" + " as ID: " + id); - return id; - } - - public long install(InputStream probe) { - return install("local", probe); - } - - public TestContainer stop() { - remoteBundleContextClient.cleanup(); - - return this; - } - - @Override - public long installProbe(InputStream stream) { - this.probeId = install(stream); - return probeId; - } - - @Override - public void uninstallProbe() { - remoteBundleContextClient.uninstall(probeId); - } - -} diff --git a/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/RBCRemoteTargetOptions.java b/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/RBCRemoteTargetOptions.java deleted file mode 100644 index 50a3ce0ac..000000000 --- a/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/RBCRemoteTargetOptions.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2009 Toni Menzel. - * - * Licensed 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.ops4j.pax.exam.container.remote; - -import org.ops4j.pax.exam.container.remote.options.RBCLookupTimeoutOption; -import org.ops4j.pax.exam.container.remote.options.RBCPortOption; - -/** - * @author Toni Menzel - * @since Jan 25, 2010 - */ -public class RBCRemoteTargetOptions { - - /** Hidden utility class constructor. */ - private RBCRemoteTargetOptions() { - } - - /** - * Creates a {@link org.ops4j.pax.exam.container.remote.options.RBCLookupTimeoutOption}. - * - * @param timeoutInMillis - * timeout in millis - * - * @return timeout option - */ - public static RBCLookupTimeoutOption waitForRBCFor(final Integer timeoutInMillis) { - return new RBCLookupTimeoutOption(timeoutInMillis); - } - - /** - * Creates a {@link org.ops4j.pax.exam.container.remote.options.RBCLookupTimeoutOption}. - * - * @param host - * to use for rmi rgistry - * @param port - * port where the rbc server is listening at - * - * @return port option - */ - public static RBCPortOption location(String host, final Integer port) { - return new RBCPortOption(host, port); - } -} diff --git a/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/options/RBCLookupTimeoutOption.java b/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/options/RBCLookupTimeoutOption.java deleted file mode 100644 index 816ba4d7c..000000000 --- a/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/options/RBCLookupTimeoutOption.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2008 Alin Dreghiciu. - * - * Licensed 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.ops4j.pax.exam.container.remote.options; - -import org.ops4j.pax.exam.options.TimeoutOption; - -/** - * Option specifying the timeout (in milliseconds) while looking up the container process. - * - * @author Alin Dreghiciu (adreghiciu@gmail.com) - * @since 0.3.0 December 10, 2008 - */ -public class RBCLookupTimeoutOption extends TimeoutOption { - - /** - * Constructor. - * - * @param timeoutInMillis - * timeout (in millis) to look up the server part - * - * @throws IllegalArgumentException - * - If timeout is null - */ - public RBCLookupTimeoutOption(final long timeoutInMillis) { - super(timeoutInMillis); - } - -} diff --git a/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/options/RBCPortOption.java b/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/options/RBCPortOption.java deleted file mode 100644 index f56dba773..000000000 --- a/containers/pax-exam-container-remote/src/main/java/org/ops4j/pax/exam/container/remote/options/RBCPortOption.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2009 Toni Menzel. - * - * Licensed 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.ops4j.pax.exam.container.remote.options; - -import org.ops4j.pax.exam.Option; - -/** - * @author Toni Menzel - * @since Jan 25, 2010 - */ -public class RBCPortOption implements Option { - - private Integer port; - private String host; - - public RBCPortOption(String host, Integer port) { - assert host != null : "Host should never be null."; - assert port != null : "Port should never be null."; - - this.host = host; - this.port = port; - } - - public String getHost() { - return host; - } - - public Integer getPort() { - return port; - } -} diff --git a/containers/pax-exam-container-remote/src/test/java/org/ops4j/pax/exam/container/remote/ParserTest.java b/containers/pax-exam-container-remote/src/test/java/org/ops4j/pax/exam/container/remote/ParserTest.java deleted file mode 100644 index ffb0e8eb5..000000000 --- a/containers/pax-exam-container-remote/src/test/java/org/ops4j/pax/exam/container/remote/ParserTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2010 Toni Menzel - * - * Licensed 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.ops4j.pax.exam.container.remote; - -import org.junit.Test; -import org.ops4j.pax.exam.CoreOptions; -import org.ops4j.pax.exam.Option; - -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; - -/** - * Test for this modules Options Parser implementation. - */ -public class ParserTest { - - @Test(expected = AssertionError.class) - public void testDefaults() { - Option[] options = CoreOptions.options(); - new Parser(options); - } - - @Test - public void testParsing() { - Option[] options = CoreOptions.options(RBCRemoteTargetOptions.location("bee", 1234)); - - Parser parser = new Parser(options); - - assertThat(parser.getHost(), is("bee")); - assertThat(parser.getRMIPort(), is(1234)); - - } -} diff --git a/pom.xml b/pom.xml index 8ca122f4a..aad8ad6d2 100644 --- a/pom.xml +++ b/pom.xml @@ -47,7 +47,6 @@ samples containers/pax-exam-container-native - containers/pax-exam-container-remote containers/pax-exam-container-forked containers/pax-exam-container-karaf