X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-hello%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fhello%2Ftest%2FHelloTester.java;h=2ed4efb1d7d9882955937bdf79681ff192e2d3da;hb=1296352d8eafee57f982a4342ad79ada4aa56d28;hp=8462528101bc0443b130ef29e7658393556765ea;hpb=ceda6e8bc270202bcb24340b86617110289c902e;p=aaf%2Fauthz.git diff --git a/auth/auth-hello/src/test/java/org/onap/aaf/auth/hello/test/HelloTester.java b/auth/auth-hello/src/test/java/org/onap/aaf/auth/hello/test/HelloTester.java index 84625281..2ed4efb1 100644 --- a/auth/auth-hello/src/test/java/org/onap/aaf/auth/hello/test/HelloTester.java +++ b/auth/auth-hello/src/test/java/org/onap/aaf/auth/hello/test/HelloTester.java @@ -7,9 +7,9 @@ * 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. @@ -40,42 +40,42 @@ import org.onap.aaf.misc.env.APIException; public class HelloTester { - public static void main(String[] args) { - // Do Once and ONLY once - PropAccess access = new PropAccess(args); - try { - Define.set(access); - String uriPrefix = access.getProperty("locatorURI","https://aaftest.test.att.com"); - - SecurityInfoC si = SecurityInfoC.instance(access, HttpURLConnection.class); - AAFLocator loc = new AAFLocator(si,new URI(uriPrefix+"/locate/"+Define.ROOT_NS()+".hello:1.0")); - AAFConHttp aafcon = new AAFConHttp(access,loc,si); - - // - String pathinfo = "/hello"; - final int iterations = Integer.parseInt(access.getProperty("iterations","5")); - System.out.println("Calling " + loc + " with Path " + pathinfo + ' ' + iterations + " time" + (iterations==1?"":"s")); - for(int i=0;i () { - @Override - public Void code(Rcli client) throws CadiException, ConnectException, APIException { - Future fs = client.read("/hello","text/plain"); - if(fs.get(5000)) { - System.out.print(fs.body()); - } else { - System.err.println("Ooops, missed one: " + fs.code() + ": " + fs.body()); - } - return null; + public static void main(String[] args) { + // Do Once and ONLY once + PropAccess access = new PropAccess(args); + try { + Define.set(access); + String uriPrefix = access.getProperty("locatorURI",null); + if (uriPrefix==null) { + System.out.println("You must add \"locatorURI=\" to the command line or VM_Args"); + } else { + SecurityInfoC si = SecurityInfoC.instance(access, HttpURLConnection.class); + AAFLocator loc = new AAFLocator(si,new URI(uriPrefix+"/locate/"+Define.ROOT_NS()+".hello:1.0")); + AAFConHttp aafcon = new AAFConHttp(access,loc,si); - } - }); - Thread.sleep(500L); - } - } catch (CadiException | LocatorException | URISyntaxException | APIException | InterruptedException e) { - e.printStackTrace(); - } - - - } + // + String pathinfo = "/hello"; + final int iterations = Integer.parseInt(access.getProperty("iterations","5")); + System.out.println("Calling " + loc + " with Path " + pathinfo + ' ' + iterations + " time" + (iterations==1?"":"s")); + for (int i=0;i () { + @Override + public Void code(Rcli client) throws CadiException, ConnectException, APIException { + Future fs = client.read("/hello","text/plain"); + if (fs.get(5000)) { + System.out.print(fs.body()); + } else { + System.err.println("Ooops, missed one: " + fs.code() + ": " + fs.body()); + } + return null; + } + }); + Thread.sleep(500L); + } + } + } catch (CadiException | LocatorException | URISyntaxException | APIException | InterruptedException e) { + e.printStackTrace(); + } + } }