From 95d6370de99c444f9f7931eb88a86401bad60068 Mon Sep 17 00:00:00 2001
From: smaguin <smaguin@localhost>
Date: Fri, 06 Jul 2007 08:39:01 +0000
Subject: [PATCH] remove the check with expectedRC in the java code return errorCode

---
 opends/tests/functional-tests/shared/java/addAnEntry.java |   36 ++++++++++++++++++++++++------------
 1 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/opends/tests/functional-tests/shared/java/addAnEntry.java b/opends/tests/functional-tests/shared/java/addAnEntry.java
index 7c6a6d0..788ee82 100644
--- a/opends/tests/functional-tests/shared/java/addAnEntry.java
+++ b/opends/tests/functional-tests/shared/java/addAnEntry.java
@@ -70,7 +70,8 @@
      String credential=null;
      String dnToAdd=null;
      String attributeToAdd=null;
-
+     String errorCode=null;
+     String errorMessage=null;
      
      int ind1;
      String attributeName;
@@ -156,20 +157,31 @@
 
         ctx.close();
         
-
+        
 	} catch (CommunicationException e1) {
-		String error = e1.getMessage();
+		errorMessage = e1.getMessage();
 
-        System.out.println(" Catch exception : " + e1.getMessage());
-        System.exit(1);
 	} catch (NamingException e2) {
-		 // resultCode = ; 
-        System.out.println(" Catch exception : " + e2.getMessage());
-        System.exit(1);
-    } catch (Exception e3) {
+		errorMessage = e2.getMessage();
 
-            System.out.println(" Catch exception : " + e3.getMessage());
-            System.exit(1);
+    } catch (Exception e3) {
+    	errorMessage= e3.getMessage();
 	}
-}
+    // No error, the modify is success 
+    if ( errorMessage == null ) {
+    	errorCode="0";
+    } 
+    else {
+    	System.out.println (errorMessage);
+    	int ind=errorMessage.indexOf("-");
+    	if ( ind > 0 ) {
+    	 errorCode=errorMessage.substring(18, ind-1);
+    	}
+    	else errorCode="0";
+    }
+ 
+    int RC = Integer.parseInt(errorCode);
+    System.exit(RC);
+    }    
+   
 }

--
Gitblit v1.10.0