You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ace.apache.org by ja...@apache.org on 2016/01/21 12:37:21 UTC
svn commit: r1725909 - in /ace/trunk: org.apache.ace.agent.controller.itest/
org.apache.ace.agent.itest/ org.apache.ace.authentication.itest/
org.apache.ace.authentication/
org.apache.ace.authentication/test/org/apache/ace/authentication/processor/clie...
Author: jawi
Date: Thu Jan 21 11:37:20 2016
New Revision: 1725909
URL: http://svn.apache.org/viewvc?rev=1725909&view=rev
Log:
Fix build/test errors:
- use proper BSNs for libraries referenced in our build;
- no longer use deprecated BC classes in authentication itest;
- some other minor dings and dents fixed causing the itests to fail.
Modified:
ace/trunk/org.apache.ace.agent.controller.itest/bnd.bnd
ace/trunk/org.apache.ace.agent.itest/bnd.bnd
ace/trunk/org.apache.ace.authentication.itest/bnd.bnd
ace/trunk/org.apache.ace.authentication/bnd.bnd
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/clientcert/ClientCertAuthenticationProcessorTest.java
ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/clientcert/MemoryKeyStore.java
ace/trunk/org.apache.ace.client.repository.itest/bnd.bnd
ace/trunk/org.apache.ace.client.repository/bnd.bnd
ace/trunk/org.apache.ace.client.rest.itest/bnd.bnd
ace/trunk/org.apache.ace.client.rest/bnd.bnd
ace/trunk/org.apache.ace.configurator/bnd.bnd
ace/trunk/org.apache.ace.connectionfactory/bnd.bnd
ace/trunk/org.apache.ace.deployment.itest/bnd.bnd
ace/trunk/org.apache.ace.gogo.servlet/bnd.bnd
ace/trunk/org.apache.ace.gogo.servlet/src/org/apache/ace/gogo/servlet/ScriptServlet.java
ace/trunk/org.apache.ace.http.itest/bnd.bnd
ace/trunk/org.apache.ace.log.itest/bnd.bnd
ace/trunk/org.apache.ace.log.server.store.itest/bnd.bnd
ace/trunk/org.apache.ace.log/bnd.bnd
ace/trunk/org.apache.ace.nodelauncher/bnd.bnd
ace/trunk/org.apache.ace.processlauncher/bnd.bnd
ace/trunk/org.apache.ace.repository.itest/bnd.bnd
Modified: ace/trunk/org.apache.ace.agent.controller.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent.controller.itest/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.agent.controller.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.agent.controller.itest/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -5,10 +5,6 @@ Test-Cases: org.apache.ace.agent.itest.C
org.apache.ace.builder;version=latest,\
org.apache.felix.configadmin,\
org.apache.felix.dependencymanager,\
- org.apache.felix.dependencymanager.shell,\
- org.apache.felix.gogo.command,\
- org.apache.felix.gogo.runtime,\
- org.apache.felix.gogo.shell,\
org.apache.felix.http.jetty,\
org.apache.felix.log,\
biz.aQute.bnd,\
Modified: ace/trunk/org.apache.ace.agent.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent.itest/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.agent.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.agent.itest/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -5,10 +5,6 @@ Test-Cases: ${classes;CONCRETE;EXTENDS;j
org.apache.ace.builder;version=latest,\
org.apache.felix.configadmin,\
org.apache.felix.dependencymanager,\
- org.apache.felix.dependencymanager.shell,\
- org.apache.felix.gogo.command,\
- org.apache.felix.gogo.runtime,\
- org.apache.felix.gogo.shell,\
org.apache.felix.http.jetty,\
org.apache.felix.log,\
biz.aQute.bnd,\
Modified: ace/trunk/org.apache.ace.authentication.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.authentication.itest/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.authentication.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.authentication.itest/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -23,16 +23,12 @@ Test-Cases: ${classes;CONCRETE;EXTENDS;o
-runbundles: osgi.cmpn,\
org.apache.felix.log,\
org.apache.felix.dependencymanager,\
- org.apache.felix.dependencymanager.shell,\
org.apache.felix.configadmin,\
org.apache.felix.eventadmin,\
org.apache.felix.prefs,\
org.apache.felix.http.jetty,\
org.apache.felix.useradmin,\
org.apache.felix.useradmin.filestore,\
- org.apache.felix.gogo.command,\
- org.apache.felix.gogo.runtime,\
- org.apache.felix.gogo.shell,\
org.apache.ace.authentication.api;version=latest,\
org.apache.ace.authentication.impl;version=latest,\
org.apache.ace.authentication.processor.basicauth;version=latest,\
Modified: ace/trunk/org.apache.ace.authentication/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.authentication/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.authentication/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.authentication/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -4,7 +4,8 @@
org.mockito.mockito-all,\
org.apache.felix.dependencymanager,\
javax.servlet,\
- bcprov;version=latest,\
- commons-codec;version=1.4,\
+ bcprov,\
+ bcpkix,\
+ org.apache.commons.codec,\
org.apache.ace.test;version=latest
-sub: *.bnd
\ No newline at end of file
Modified: ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/clientcert/ClientCertAuthenticationProcessorTest.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/clientcert/ClientCertAuthenticationProcessorTest.java?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/clientcert/ClientCertAuthenticationProcessorTest.java (original)
+++ ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/clientcert/ClientCertAuthenticationProcessorTest.java Thu Jan 21 11:37:20 2016
@@ -231,7 +231,7 @@ public class ClientCertAuthenticationPro
User user = mock(User.class);
when(user.getName()).thenReturn("bob");
- when(m_userAdmin.getUser(eq(lookupKey), eq("CN=Bob,OU=dev,DC=acme,DC=corp"))).thenReturn(user);
+ when(m_userAdmin.getUser(eq(lookupKey), eq("DC=corp,DC=acme,OU=dev,CN=Bob"))).thenReturn(user);
User result = processor.authenticate(m_userAdmin, m_servletRequest);
assert result != null : "Expected a valid user to be returned!";
@@ -431,7 +431,7 @@ public class ClientCertAuthenticationPro
*/
private X509Certificate createCertificate(String name, final Date notBefore, final Date notAfter) {
KeyPair keypair = m_keystore.generateKeyPair();
- return m_keystore.createCertificate("alias", "cn=" + name, notBefore, notAfter, keypair.getPublic());
+ return m_keystore.createCertificate("cn=" + name, notBefore, notAfter, keypair.getPublic());
}
/**
@@ -449,11 +449,10 @@ public class ClientCertAuthenticationPro
for (int i = 0; i < result.length; i++) {
KeyPair certKeyPair = m_keystore.generateKeyPair();
- String alias = String.format("alias%d", i);
String dn = dns[i];
int idx = result.length - i - 1;
- result[idx] = m_keystore.createCertificate(signerDN, signerKeyPair.getPrivate(), alias, dn, yesterday(), tomorrow(), certKeyPair.getPublic());
+ result[idx] = m_keystore.createCertificate(signerDN, signerKeyPair.getPrivate(), dn, yesterday(), tomorrow(), certKeyPair.getPublic());
signerDN = result[idx].getSubjectX500Principal();
signerKeyPair = certKeyPair;
Modified: ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/clientcert/MemoryKeyStore.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/clientcert/MemoryKeyStore.java?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/clientcert/MemoryKeyStore.java (original)
+++ ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/clientcert/MemoryKeyStore.java Thu Jan 21 11:37:20 2016
@@ -19,6 +19,7 @@
package org.apache.ace.authentication.processor.clientcert;
+import java.io.IOException;
import java.math.BigInteger;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
@@ -26,17 +27,27 @@ import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.cert.X509Certificate;
import java.util.Date;
+import java.util.Random;
import javax.security.auth.x500.X500Principal;
+import org.bouncycastle.asn1.ASN1InputStream;
+import org.bouncycastle.asn1.DEROctetString;
+import org.bouncycastle.asn1.x500.X500Name;
+import org.bouncycastle.asn1.x509.BasicConstraints;
+import org.bouncycastle.asn1.x509.Extension;
+import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
+import org.bouncycastle.cert.X509CertificateHolder;
+import org.bouncycastle.cert.X509v3CertificateBuilder;
+import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
+import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
+
/**
* Provides a memory-only certificate keystore.
*/
-@SuppressWarnings("deprecation")
final class MemoryKeyStore {
- private static final String SIGNATURE_ALGORITHM = "SHA1withRSA";
+ private static final String SIGNATURE_ALGORITHM = "SHA256withRSA";
- private final org.bouncycastle.x509.X509V1CertificateGenerator m_certGen = new org.bouncycastle.x509.X509V1CertificateGenerator();
private final KeyPair m_caKey;
private final X509Certificate m_rootCert;
private int m_serial = 0;
@@ -52,26 +63,48 @@ final class MemoryKeyStore {
m_generator.initialize(1024);
m_caKey = generateKeyPair();
-
m_rootCert = generateRootCertificate(name, notBefore, notAfter);
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
-
+
/**
- * @return the {@link KeyPair} of the CA, never <code>null</code>.
+ * @throws IllegalStateException
+ * if an internal exception occurs.
+ * @throws IllegalArgumentException
+ * if the alias already exists.
*/
- public KeyPair getCA_KeyPair() {
- return m_caKey;
+ public X509Certificate createCertificate(String name, Date before, Date after, PublicKey key) throws IllegalArgumentException {
+ return createCertificate(getCA_DN(), m_caKey.getPrivate(), name, before, after, key);
}
/**
- * @return
+ * @throws IllegalStateException
+ * if an internal exception occurs.
+ * @throws IllegalArgumentException
+ * if the alias already exists.
*/
- public X500Principal getCA_DN() {
- return m_rootCert.getIssuerX500Principal();
+ public X509Certificate createCertificate(X500Principal issuerDN, PrivateKey issuerKey, String name, Date notBefore, Date notAfter, PublicKey key) throws IllegalArgumentException {
+ try {
+ X500Name issuer = new X500Name(issuerDN.getName());
+ X500Name commonName = new X500Name(name);
+ BigInteger serial = BigInteger.valueOf(++m_serial);
+
+ SubjectPublicKeyInfo pubKeyInfo = convertToSubjectPublicKeyInfo(key);
+
+ X509v3CertificateBuilder builder = new X509v3CertificateBuilder(issuer, serial, notBefore, notAfter, commonName, pubKeyInfo);
+
+ X509CertificateHolder certHolder = builder.build(new JcaContentSignerBuilder(SIGNATURE_ALGORITHM).build(issuerKey));
+ return new JcaX509CertificateConverter().getCertificate(certHolder);
+ }
+ catch (IllegalArgumentException e) {
+ throw e;
+ }
+ catch (Exception e) {
+ throw new RuntimeException(e);
+ }
}
/**
@@ -89,50 +122,35 @@ final class MemoryKeyStore {
}
/**
- * @throws IllegalStateException if an internal exception occurs.
- * @throws IllegalArgumentException if the alias already exists.
+ * @return
*/
- public X509Certificate createCertificate(String alias, String name, Date before, Date after, PublicKey key) throws IllegalArgumentException {
- return createCertificate(getCA_DN(), m_caKey.getPrivate(), alias, name, before, after, key);
+ public X500Principal getCA_DN() {
+ return m_rootCert.getIssuerX500Principal();
}
/**
- * @throws IllegalStateException if an internal exception occurs.
- * @throws IllegalArgumentException if the alias already exists.
+ * @return the {@link KeyPair} of the CA, never <code>null</code>.
*/
- public X509Certificate createCertificate(X500Principal issuerDN, PrivateKey issuerKey, String alias, String name, Date notBefore, Date notAfter, PublicKey key) throws IllegalArgumentException {
- try {
- m_certGen.reset();
- m_certGen.setSerialNumber(BigInteger.valueOf(++m_serial));
- m_certGen.setIssuerDN(issuerDN);
- m_certGen.setNotBefore(notBefore);
- m_certGen.setNotAfter(notAfter);
- m_certGen.setSubjectDN(new X500Principal(name));
- m_certGen.setPublicKey(key);
- m_certGen.setSignatureAlgorithm(SIGNATURE_ALGORITHM);
-
- X509Certificate cert = m_certGen.generate(issuerKey);
+ public KeyPair getCA_KeyPair() {
+ return m_caKey;
+ }
- return cert;
- }
- catch (IllegalArgumentException e) {
- throw e;
- }
- catch (Exception e) {
- throw new RuntimeException(e);
+ private SubjectPublicKeyInfo convertToSubjectPublicKeyInfo(PublicKey key) throws IOException {
+ try (ASN1InputStream is = new ASN1InputStream(key.getEncoded())) {
+ return SubjectPublicKeyInfo.getInstance(is.readObject());
}
}
- private X509Certificate generateRootCertificate(String name, Date notBefore, Date notAfter) throws Exception {
- m_certGen.reset();
- m_certGen.setSerialNumber(BigInteger.valueOf(1));
- m_certGen.setIssuerDN(new X500Principal(name));
- m_certGen.setNotBefore(notBefore);
- m_certGen.setNotAfter(notAfter);
- m_certGen.setSubjectDN(new X500Principal(name));
- m_certGen.setPublicKey(m_caKey.getPublic());
- m_certGen.setSignatureAlgorithm(SIGNATURE_ALGORITHM);
+ private X509Certificate generateRootCertificate(String commonName, Date notBefore, Date notAfter) throws Exception {
+ X500Name issuer = new X500Name(commonName);
+ BigInteger serial = BigInteger.probablePrime(16, new Random());
+
+ SubjectPublicKeyInfo pubKeyInfo = convertToSubjectPublicKeyInfo(m_caKey.getPublic());
+
+ X509v3CertificateBuilder builder = new X509v3CertificateBuilder(issuer, serial, notBefore, notAfter, issuer, pubKeyInfo);
+ builder.addExtension(new Extension(Extension.basicConstraints, true, new DEROctetString(new BasicConstraints(true))));
- return m_certGen.generate(m_caKey.getPrivate());
+ X509CertificateHolder certHolder = builder.build(new JcaContentSignerBuilder(SIGNATURE_ALGORITHM).build(m_caKey.getPrivate()));
+ return new JcaX509CertificateConverter().getCertificate(certHolder);
}
}
Modified: ace/trunk/org.apache.ace.client.repository.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository.itest/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.client.repository.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.client.repository.itest/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -28,7 +28,6 @@ Test-Cases: ${classes;CONCRETE;EXTENDS;o
org.apache.felix.configadmin,\
org.apache.felix.eventadmin,\
org.apache.felix.http.jetty,\
- org.apache.felix.dependencymanager.shell,\
org.apache.felix.deploymentadmin,\
org.apache.felix.prefs,\
org.apache.felix.useradmin,\
@@ -69,9 +68,6 @@ Test-Cases: ${classes;CONCRETE;EXTENDS;o
org.apache.ace.client.repository.helper.bundle;version=latest,\
org.apache.ace.client.repository.helper.configuration;version=latest,\
org.apache.ace.client.repository.impl;version=latest,\
- org.apache.felix.gogo.command,\
- org.apache.felix.gogo.runtime,\
- org.apache.felix.gogo.shell,\
org.apache.ace.feedback.common;version=latest
-runproperties: \
org.apache.felix.eventadmin.Timeout=0,\
Modified: ace/trunk/org.apache.ace.client.repository/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.client.repository/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.client.repository/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -5,8 +5,8 @@
xpp3;version=1.1.4,\
xstream;version=1.2.2,\
velocity;version=1.6.2,\
- commons-lang;version=2.4.0,\
- commons-collections;version=3.2.1,\
+ org.apache.commons.lang;version=2.4.0,\
+ org.apache.commons.collections;version=3.2.1,\
org.apache.felix.dependencymanager,\
org.apache.felix.gogo.runtime,\
org.apache.ace.connectionfactory;version=latest,\
Modified: ace/trunk/org.apache.ace.client.rest.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.rest.itest/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.client.rest.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.client.rest.itest/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -7,7 +7,7 @@ Test-Cases: ${classes;CONCRETE;EXTENDS;o
javax.servlet,\
com.sun.jersey.client,\
com.sun.jersey.core,\
- gson,\
+ com.google.gson,\
org.apache.felix.dependencymanager,\
org.apache.ace.test;version=latest,\
org.apache.ace.http.listener;version=latest,\
@@ -36,15 +36,11 @@ Test-Cases: ${classes;CONCRETE;EXTENDS;o
org.apache.felix.configadmin,\
org.apache.felix.eventadmin,\
org.apache.felix.http.jetty,\
- org.apache.felix.dependencymanager.shell,\
org.apache.felix.deploymentadmin,\
org.apache.felix.prefs,\
org.apache.felix.useradmin,\
org.apache.felix.useradmin.filestore,\
org.apache.felix.log,\
- org.apache.felix.gogo.command,\
- org.apache.felix.gogo.runtime,\
- org.apache.felix.gogo.shell,\
org.apache.ace.test;version=latest,\
org.apache.ace.http.listener;version=latest,\
org.apache.ace.authentication.api;version=latest,\
@@ -83,9 +79,9 @@ Test-Cases: ${classes;CONCRETE;EXTENDS;o
-runproperties: org.apache.felix.log.storeDebug=true,\
org.apache.felix.eventadmin.Timeout=0,\
org.apache.felix.log.maxSize=1000
-Private-Package: org.apache.ace.client.rest.itest,\
- com.google.gson,\
- com.google.gson.*,\
+Private-Package: \
+ org.apache.ace.client.rest.itest,\
+ com.google.gson*,\
aQute.*,\
org.osgi.service.bindex
Import-Package: \
Modified: ace/trunk/org.apache.ace.client.rest/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.rest/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.client.rest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.client.rest/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -4,7 +4,7 @@
org.apache.felix.dependencymanager,\
org.apache.ace.client.repository.api;version=latest,\
javax.servlet,\
- gson;version=1.7.1,\
+ com.google.gson;version=1.7.1,\
org.mockito.mockito-all,\
org.apache.felix.gogo.command,\
org.apache.felix.gogo.shell,\
@@ -12,12 +12,9 @@
org.apache.ace.feedback.common;version=latest,\
org.apache.ace.client.workspace;version=latest,\
org.apache.ace.test;version=latest
-Private-Package: org.apache.ace.client.rest,\
- com.google.gson,\
- com.google.gson.annotations,\
- com.google.gson.internal,\
- com.google.gson.reflect,\
- com.google.gson.stream
+Private-Package: \
+ org.apache.ace.client.rest,\
+ com.google.gson*
Bundle-Activator: org.apache.ace.client.rest.Activator
Bundle-Version: 1.0.1
Bundle-Name: Apache ACE Client REST
Modified: ace/trunk/org.apache.ace.configurator/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.configurator/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.configurator/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.configurator/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -7,6 +7,6 @@
org.apache.ace.repository.ext;version=latest,\
org.apache.ace.resourceprocessor.useradmin;version=latest,\
org.apache.ace.test;version=latest,\
- commons-io;version=2.0.1
+ org.apache.commons.io;version=2.0.1
-sub: *.bnd
\ No newline at end of file
Modified: ace/trunk/org.apache.ace.connectionfactory/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.connectionfactory/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.connectionfactory/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.connectionfactory/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -2,7 +2,7 @@
osgi.core,\
osgi.cmpn,\
org.apache.ace.test;version=latest,\
- commons-codec;version=1.4
+ org.apache.commons.codec;version=1.4
Private-Package: org.apache.ace.connectionfactory.impl,\
org.apache.commons.codec,\
org.apache.commons.codec.binary
Modified: ace/trunk/org.apache.ace.deployment.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment.itest/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.deployment.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.deployment.itest/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -26,10 +26,6 @@ Test-Cases: ${classes;CONCRETE;EXTENDS;o
org.apache.felix.configadmin,\
org.apache.felix.eventadmin,\
org.apache.felix.http.jetty,\
- org.apache.felix.gogo.command,\
- org.apache.felix.gogo.runtime,\
- org.apache.felix.gogo.shell,\
- org.apache.felix.dependencymanager.shell,\
org.apache.felix.deploymentadmin,\
org.apache.felix.log,\
org.apache.felix.prefs,\
Modified: ace/trunk/org.apache.ace.gogo.servlet/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.gogo.servlet/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.gogo.servlet/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.gogo.servlet/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -4,7 +4,6 @@
org.apache.felix.dependencymanager,\
javax.servlet,\
org.apache.ace.gogo;version=latest,\
- org.apache.felix.gogo.runtime,\
- org.apache.commons.io
+ org.apache.felix.gogo.runtime
Bundle-Activator: org.apache.ace.gogo.servlet.Activator
Private-Package: org.apache.ace.gogo.servlet
\ No newline at end of file
Modified: ace/trunk/org.apache.ace.gogo.servlet/src/org/apache/ace/gogo/servlet/ScriptServlet.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.gogo.servlet/src/org/apache/ace/gogo/servlet/ScriptServlet.java?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.gogo.servlet/src/org/apache/ace/gogo/servlet/ScriptServlet.java (original)
+++ ace/trunk/org.apache.ace.gogo.servlet/src/org/apache/ace/gogo/servlet/ScriptServlet.java Thu Jan 21 11:37:20 2016
@@ -19,16 +19,17 @@
package org.apache.ace.gogo.servlet;
import java.io.IOException;
+import java.io.InputStream;
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.Map;
+import java.util.Scanner;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.io.IOUtils;
import org.apache.felix.service.command.CommandProcessor;
import org.apache.felix.service.command.CommandSession;
import org.osgi.service.log.LogService;
@@ -50,14 +51,13 @@ public class ScriptServlet extends HttpS
private volatile CommandProcessor m_processor;
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
- @SuppressWarnings("unchecked")
Dictionary<String, String> scriptDefinition = toDictionary(req.getParameterMap());
respondToScriptRequest(resp, scriptDefinition);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
- String script = IOUtils.toString(req.getInputStream(), "UTF-8");
+ String script = getAsString(req.getInputStream());
req.getInputStream();
Dictionary<String, String> scriptDefinition = new Hashtable<String, String>();
scriptDefinition.put(SCRIPT_KEY, script);
@@ -107,4 +107,13 @@ public class ScriptServlet extends HttpS
}
return null;
}
+
+ static String getAsString(InputStream is) throws IOException {
+ // See <weblogs.java.net/blog/pat/archive/2004/10/stupid_scanner_1.html>
+ try (Scanner scanner = new Scanner(is, "UTF-8")) {
+ scanner.useDelimiter("\\A");
+
+ return scanner.hasNext() ? scanner.next() : null;
+ }
+ }
}
Modified: ace/trunk/org.apache.ace.http.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.http.itest/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.http.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.http.itest/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -17,7 +17,6 @@ Test-Cases: ${classes;CONCRETE;EXTENDS;o
-runbundles: osgi.cmpn,\
org.apache.felix.eventadmin,\
org.apache.felix.http.jetty,\
- org.apache.felix.dependencymanager.shell,\
org.apache.felix.dependencymanager,\
org.apache.felix.configadmin,\
org.apache.ace.test;version=latest,\
Modified: ace/trunk/org.apache.ace.log.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.log.itest/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.log.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.log.itest/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -19,7 +19,6 @@ Test-Cases: ${classes;CONCRETE;EXTENDS;o
org.apache.felix.dependencymanager,\
org.apache.felix.configadmin,\
org.apache.felix.http.jetty,\
- org.apache.felix.dependencymanager.shell,\
org.apache.felix.eventadmin,\
org.apache.ace.authentication.api;version=latest,\
org.apache.ace.authentication.processor.basicauth;version=latest,\
Modified: ace/trunk/org.apache.ace.log.server.store.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.log.server.store.itest/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.log.server.store.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.log.server.store.itest/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -1,15 +1,12 @@
Test-Cases: ${classes;CONCRETE;EXTENDS;org.apache.ace.it.IntegrationTestBase}
--runbundles: org.apache.ace.deployment.provider.api;version=latest,\
+-runbundles: \
+ org.apache.ace.deployment.provider.api;version=latest,\
org.apache.felix.dependencymanager,\
- org.apache.felix.gogo.command,\
- org.apache.felix.gogo.runtime,\
- org.apache.felix.gogo.shell,\
org.apache.felix.metatype,\
org.apache.felix.log,\
org.apache.felix.configadmin,\
org.apache.felix.eventadmin,\
- org.apache.felix.dependencymanager.shell,\
- com.mongodb,\
+ org.mongodb.mongo-java-driver,\
org.amdatu.mongo,\
org.apache.ace.log.api;version=latest,\
org.apache.ace.log.server.store.api;version=latest,\
@@ -23,7 +20,7 @@ Private-Package: org.apache.ace.log.serv
-buildpath: osgi.core,\
osgi.cmpn,\
junit.osgi,\
- com.mongodb,\
+ org.mongodb.mongo-java-driver,\
org.amdatu.mongo,\
org.mockito.mockito-all,\
org.apache.felix.dependencymanager,\
Modified: ace/trunk/org.apache.ace.log/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.log/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.log/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.log/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -11,7 +11,7 @@
org.apache.ace.connectionfactory;version=latest,\
org.apache.ace.authentication.api;version=latest,\
org.amdatu.mongo,\
- com.mongodb,\
+ org.mongodb.mongo-java-driver,\
org.apache.ace.feedback.common;version=latest
-sub: *.bnd
\ No newline at end of file
Modified: ace/trunk/org.apache.ace.nodelauncher/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.nodelauncher/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.nodelauncher/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.nodelauncher/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -7,7 +7,7 @@
aws-common;version=1.5.0.beta_6,\
aws-ec2;version=1.5.0.beta_6,\
bcprov;version=1.46.0,\
- commons-io;version=2.0,\
+ org.apache.commons.io;version=2.0,\
ec2;version=1.5.0.beta_6,\
com.google.gson;version=2.2,\
com.google.guava;version=12.0,\
Modified: ace/trunk/org.apache.ace.processlauncher/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.processlauncher/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.processlauncher/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.processlauncher/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -5,15 +5,15 @@
osgi.cmpn,\
junit;version=4.8.2,\
javax.inject;version=1.0.0,\
- pax-exam;version=2.3.0,\
+ org.ops4j.pax.exam;version=2.3.0,\
pax-exam-container-native;version=2.3.0,\
- pax-exam-inject;version=2.3.0,\
+ org.ops4j.pax.exam.inject;version=2.3.0,\
pax-exam-junit4;version=2.3.0,\
pax-exam-link-mvn;version=2.3.0,\
- pax-url-aether;version=1.3.5,\
- pax-url-assembly;version=1.3.5,\
- pax-url-link;version=1.3.5,\
- pax-url-wrap;version=1.3.5,\
+ org.ops4j.pax.url.mvn;version=1.3.5,\
+ org.ops4j.pax.url.assembly;version=1.3.5,\
+ org.ops4j.pax.url.link;version=1.3.5,\
+ org.ops4j.pax.url.wrap;version=1.3.5,\
slf4j.simple,\
org.apache.ace.test;version=latest
Private-Package: org.apache.ace.processlauncher.osgi,\
Modified: ace/trunk/org.apache.ace.repository.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.repository.itest/bnd.bnd?rev=1725909&r1=1725908&r2=1725909&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.repository.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.repository.itest/bnd.bnd Thu Jan 21 11:37:20 2016
@@ -24,11 +24,7 @@ Test-Cases: ${classes;CONCRETE;EXTENDS;o
org.apache.ace.range.api;version=latest,\
org.apache.ace.repository.api;version=latest,\
org.apache.ace.repository.impl;version=latest,\
- org.apache.ace.repository.servlet;version=latest,\
- org.apache.felix.gogo.command,\
- org.apache.felix.gogo.runtime,\
- org.apache.felix.gogo.shell,\
- org.apache.felix.dependencymanager.shell
+ org.apache.ace.repository.servlet;version=latest
Private-Package: org.apache.ace.it.repository
Bundle-Version: 1.0.0
Bundle-Name: Apache ACE Repository itest