Add missing jar compiles
[aaf/authz.git] / cadi / aaf / src / main / java / org / onap / aaf / cadi / aaf / TestConnectivity.java
index 101fd60..243b3a6 100644 (file)
@@ -70,6 +70,8 @@ public class TestConnectivity {
                                aaflocate = access.getProperty(Config.AAF_LOCATE_URL);
                                if(aaflocate==null) {
                                        print(true,"Properties must contain ",Config.AAF_LOCATE_URL);
+                               } else if (!aaflocate.endsWith("/locate")) {
+                                       aaflocate += "/locate";
                                }
                        }
                        
@@ -107,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<HttpURLConnection> 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<HttpURLConnection> ss : lss) {
+//                                     permTest(locator,ss);
+//                             }
 
                                //////////
                                print(true,"Test essential BasicAuth Service call, driven by AAFLocator");
@@ -223,17 +226,20 @@ public class TestConnectivity {
                        if((uri = dl.get(li)) == null) {
                                System.out.println("Locator Item empty");
                        } else {
+                               socket = new Socket();
                                try {
-                                       socket = new Socket();
-                                       socket.connect(new InetSocketAddress(uri.getHost(),  uri.getPort()),3000);
-                                       System.out.printf("Can Connect a Socket to %s %d\n",uri.getHost(),uri.getPort());
+                                       try {
+                                               socket.connect(new InetSocketAddress(uri.getHost(),  uri.getPort()),3000);
+                                               System.out.printf("Can Connect a Socket to %s %d\n",uri.getHost(),uri.getPort());
+                                       } catch (IOException e) {
+                                               System.out.printf("Cannot Connect a Socket to  %s %d: %s\n",uri.getHost(),uri.getPort(),e.getMessage());
+                                       }
+                               } finally {
                                        try {
                                                socket.close();
                                        } catch (IOException e1) {
                                                System.out.printf("Could not close Socket Connection: %s\n",e1.getMessage());
                                        }
-                               } catch (IOException e) {
-                                       System.out.printf("Cannot Connect a Socket to  %s %d: %s\n",uri.getHost(),uri.getPort(),e.getMessage());
                                }
                        }
                }