You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by ti...@apache.org on 2021/09/14 16:11:50 UTC
[aries-rsa] branch master updated: Specify the supported intents as
a String[] not a single String
This is an automated email from the ASF dual-hosted git repository.
timothyjward pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git
The following commit(s) were added to refs/heads/master by this push:
new 2b0d2fb Specify the supported intents as a String[] not a single String
2b0d2fb is described below
commit 2b0d2fbd086c1003d4cce12fe633bd1a755b4478
Author: Tim Ward <ti...@apache.org>
AuthorDate: Tue Sep 14 17:11:37 2021 +0100
Specify the supported intents as a String[] not a single String
---
.../apache/aries/rsa/provider/tcp/Activator.java | 45 --------------------
.../apache/aries/rsa/provider/tcp/TCPProvider.java | 3 +-
.../aries/rsa/provider/tcp/ActivatorTest.java | 48 ----------------------
3 files changed, 2 insertions(+), 94 deletions(-)
diff --git a/provider/tcp/src/main/java/org/apache/aries/rsa/provider/tcp/Activator.java b/provider/tcp/src/main/java/org/apache/aries/rsa/provider/tcp/Activator.java
deleted file mode 100644
index a379383..0000000
--- a/provider/tcp/src/main/java/org/apache/aries/rsa/provider/tcp/Activator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.aries.rsa.provider.tcp;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-import org.apache.aries.rsa.spi.DistributionProvider;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.remoteserviceadmin.RemoteConstants;
-
-public class Activator implements BundleActivator {
-
- @Override
- public void start(BundleContext context) throws Exception {
- DistributionProvider provider = new TCPProvider();
- Dictionary<String, Object> props = new Hashtable<>();
- props.put(RemoteConstants.REMOTE_INTENTS_SUPPORTED, new String[]{ "osgi.basic", "osgi.async" });
- props.put(RemoteConstants.REMOTE_CONFIGS_SUPPORTED, provider.getSupportedTypes());
- context.registerService(DistributionProvider.class, provider, props);
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- // unregister happens automatically
- }
-
-}
diff --git a/provider/tcp/src/main/java/org/apache/aries/rsa/provider/tcp/TCPProvider.java b/provider/tcp/src/main/java/org/apache/aries/rsa/provider/tcp/TCPProvider.java
index 2bc0065..ed764ca 100644
--- a/provider/tcp/src/main/java/org/apache/aries/rsa/provider/tcp/TCPProvider.java
+++ b/provider/tcp/src/main/java/org/apache/aries/rsa/provider/tcp/TCPProvider.java
@@ -42,7 +42,8 @@ import org.slf4j.LoggerFactory;
@SuppressWarnings("rawtypes")
@RSADistributionProvider(configs="aries.tcp")
@Component(property = { //
- RemoteConstants.REMOTE_INTENTS_SUPPORTED + "=osgi.basic,osgi.async",
+ RemoteConstants.REMOTE_INTENTS_SUPPORTED + "=osgi.basic",
+ RemoteConstants.REMOTE_INTENTS_SUPPORTED + "=osgi.async",
RemoteConstants.REMOTE_CONFIGS_SUPPORTED + "=" + TCPProvider.TCP_CONFIG_TYPE //
})
public class TCPProvider implements DistributionProvider {
diff --git a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/ActivatorTest.java b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/ActivatorTest.java
deleted file mode 100644
index 4c3e69e..0000000
--- a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/ActivatorTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.aries.rsa.provider.tcp;
-
-import static org.easymock.EasyMock.expect;
-
-import java.util.Dictionary;
-
-import org.apache.aries.rsa.spi.DistributionProvider;
-import org.easymock.EasyMock;
-import org.easymock.IMocksControl;
-import org.junit.Test;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-
-public class ActivatorTest {
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Test
- public void testStartStop() throws Exception {
- IMocksControl c = EasyMock.createControl();
- BundleContext context = c.createMock(BundleContext.class);
- ServiceRegistration sreg = c.createMock(ServiceRegistration.class);
- expect(context.registerService(EasyMock.eq(DistributionProvider.class), EasyMock.anyObject(DistributionProvider.class), EasyMock.anyObject(Dictionary.class))).andReturn(sreg );
-
- c.replay();
- Activator activator = new Activator();
- activator.start(context);
- activator.stop(context);
- c.verify();
- }
-}