From 4094dee63ac8324fdc47a8b8b04d99a0227b7ba6 Mon Sep 17 00:00:00 2001 From: Instrumental Date: Fri, 20 Apr 2018 10:38:26 -0500 Subject: Add missing jar compiles Issue-ID: AAF-256 Change-Id: Iafdfb11fca2455a0b062447a4a4bbf6b13cf11e0 Signed-off-by: Instrumental --- auth/auth-cass/docker/dinstall.sh | 2 +- auth/auth-core/pom.xml | 6 ---- cadi/aaf/pom.xml | 42 +++++++++++++++------- cadi/aaf/src/assemble/cadi-aaf.xml | 31 ++++++++++++++++ .../org/onap/aaf/cadi/aaf/TestConnectivity.java | 11 +++--- .../java/org/onap/aaf/cadi/cm/test/JU_Factory.java | 29 +++++++++++---- cadi/core/pom.xml | 1 - cadi/shiro-osgi-bundle/.gitignore | 5 +++ cadi/shiro-osgi-bundle/pom.xml | 2 -- 9 files changed, 94 insertions(+), 35 deletions(-) create mode 100644 cadi/aaf/src/assemble/cadi-aaf.xml create mode 100644 cadi/shiro-osgi-bundle/.gitignore diff --git a/auth/auth-cass/docker/dinstall.sh b/auth/auth-cass/docker/dinstall.sh index 3726b6d2..7a3009db 100644 --- a/auth/auth-cass/docker/dinstall.sh +++ b/auth/auth-cass/docker/dinstall.sh @@ -1,4 +1,4 @@ -if ["`docker ps -a | grep aaf_cass`" == ""]; then +if [ "`docker ps -a | grep aaf_cass`" == "" ]; then docker run --name aaf_cass -d cassandra:3.11 echo "Check for running Docker Container aaf_cass, then run again." exit diff --git a/auth/auth-core/pom.xml b/auth/auth-core/pom.xml index 9b09fc43..426a3069 100644 --- a/auth/auth-core/pom.xml +++ b/auth/auth-core/pom.xml @@ -92,12 +92,10 @@ org.onap.aaf.authz aaf-misc-env - ${project.version} org.onap.aaf.authz aaf-cadi-aaf - ${project.version} @@ -108,13 +106,11 @@ org.onap.aaf.authz aaf-misc-log4j - ${project.version} org.onap.aaf.authz aaf-cadi-core - ${project.version} @@ -141,7 +137,6 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.7 true ${nexusproxy} @@ -152,7 +147,6 @@ org.jacoco jacoco-maven-plugin - ${jacoco.version} **/gen/** diff --git a/cadi/aaf/pom.xml b/cadi/aaf/pom.xml index 4ba6dd68..b61e6313 100644 --- a/cadi/aaf/pom.xml +++ b/cadi/aaf/pom.xml @@ -91,25 +91,21 @@ org.onap.aaf.authz aaf-auth-client - ${project.version} org.onap.aaf.authz aaf-cadi-client - ${project.version} org.onap.aaf.authz aaf-misc-env - ${project.version} org.onap.aaf.authz aaf-cadi-core - ${project.version} @@ -137,7 +133,6 @@ org.jacoco jacoco-maven-plugin - ${jacoco.version} **/gen/** @@ -192,14 +187,35 @@ - + + + maven-assembly-plugin + + tests + + + com.att.cadi.cm.CmAgent + + + true + + + + + + full + package + + single + + + + src/assemble/cadi-aaf.xml + + + + + diff --git a/cadi/aaf/src/assemble/cadi-aaf.xml b/cadi/aaf/src/assemble/cadi-aaf.xml new file mode 100644 index 00000000..ef4bdf99 --- /dev/null +++ b/cadi/aaf/src/assemble/cadi-aaf.xml @@ -0,0 +1,31 @@ + + + + full + + jar + + + false + + + true + compile + + com.att.authz:authz-client + com.att.cadi:cadi-aaf + com.att.cadi:cadi-core + com.att.cadi:cadi-client + com.att.inno:env + com.att.inno:rosetta + + + + + + + src/main/xsd + + + \ No newline at end of file diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/TestConnectivity.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/TestConnectivity.java index 34371940..243b3a6a 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/TestConnectivity.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/TestConnectivity.java @@ -109,11 +109,12 @@ public class TestConnectivity { } ///////// - print(true,"Test Proxy Access driven by AAFLocator"); - locator = new AAFLocator(si, new URI(aaflocate+"/AAF_NS.gw:2.0/proxy")); - for(SecuritySetter ss : lss) { - permTest(locator,ss); - } + // Removed for ONAP +// print(true,"Test Proxy Access driven by AAFLocator"); +// locator = new AAFLocator(si, new URI(aaflocate+"/AAF_NS.gw:2.0/proxy")); +// for(SecuritySetter ss : lss) { +// permTest(locator,ss); +// } ////////// print(true,"Test essential BasicAuth Service call, driven by AAFLocator"); diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_Factory.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_Factory.java index 3c72d8ff..6f039747 100644 --- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_Factory.java +++ b/cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_Factory.java @@ -28,15 +28,11 @@ import org.junit.*; import org.mockito.*; import java.io.BufferedReader; -import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; -import java.io.InputStream; import java.io.PrintWriter; -import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.security.cert.Certificate; import java.security.cert.CertificateEncodingException; @@ -55,7 +51,7 @@ import javax.crypto.Cipher; import org.onap.aaf.cadi.cm.CertException; import org.onap.aaf.cadi.cm.Factory; import org.onap.aaf.cadi.cm.Factory.StripperInputStream; -import org.onap.aaf.cadi.cm.Factory.Base64InputStream; + import org.onap.aaf.misc.env.Env; import org.onap.aaf.misc.env.LogTarget; import org.onap.aaf.misc.env.TimeTaken; @@ -248,7 +244,7 @@ public class JU_Factory { output = Factory.toString(transMock, certs.toArray(new Certificate[0])[0]); assertThat(output, is(certString)); - List certStrings = new ArrayList(); + List certStrings = new ArrayList(); certStrings.add(certString); certStrings.add(certString); certs = Factory.toX509Certificate(certStrings); @@ -325,12 +321,31 @@ public class JU_Factory { for (int i = 0; i < lines.length - 2; i++) { rawLines.add(lines[i + 1]); } - return String.join("", rawLines); + return join("", rawLines); } + /** + * Note: String.join is not part of JDK 7, which is what we compile to for CADI + */ + private String join(String delim, List rawLines) { + StringBuilder sb = new StringBuilder(); + boolean first = true; + for(String s : rawLines) { + if(first) { + first = false; + } else { + sb.append(delim); + } + sb.append(s); + } + return sb.toString(); + } + + /* Not used locally private void writeToFile(File file, String contents) throws Exception { writeToFile(file, contents, null); } + */ private void writeToFile(File file, String contents, String header) throws Exception { PrintWriter writer = new PrintWriter(file, "UTF-8"); diff --git a/cadi/core/pom.xml b/cadi/core/pom.xml index 19e71bde..59513118 100644 --- a/cadi/core/pom.xml +++ b/cadi/core/pom.xml @@ -128,7 +128,6 @@ org.jacoco jacoco-maven-plugin - ${jacoco.version} **/gen/** diff --git a/cadi/shiro-osgi-bundle/.gitignore b/cadi/shiro-osgi-bundle/.gitignore new file mode 100644 index 00000000..f4b8361c --- /dev/null +++ b/cadi/shiro-osgi-bundle/.gitignore @@ -0,0 +1,5 @@ +/target +/bin/ +/.classpath +/.settings +/.project diff --git a/cadi/shiro-osgi-bundle/pom.xml b/cadi/shiro-osgi-bundle/pom.xml index 95b8589e..578a1b66 100644 --- a/cadi/shiro-osgi-bundle/pom.xml +++ b/cadi/shiro-osgi-bundle/pom.xml @@ -30,9 +30,7 @@ 4.0.0 - org.onap.aaf.authz aaf-shiro-aafrealm-osgi-bundle - 2.1.0-SNAPSHOT bundle -- cgit 1.2.3-korg