@@ -134,19 +134,25 @@ public static List<String> getPatchesFor(String category, String version, List<S
134
134
return results ;
135
135
}
136
136
137
- /**
137
+ /** Validate patches conflicts by passing a list of patches
138
138
*
139
139
* @param patches A list of patches number
140
140
* @param category wls or fmw
141
141
* @param version version of the prduct
142
142
* @param userId userid for support account
143
143
* @param password password for support account
144
+ * @return validationResult validation result object
144
145
* @throws IOException when failed to access the aru api
145
146
*/
146
147
147
- public static boolean validatePatches (List <String > patches , String category , String version , String userId , String
148
+ public static ValidationResult validatePatches (List <String > patches , String category , String version , String userId , String
148
149
password ) throws IOException {
149
150
151
+
152
+ ValidationResult validationResult = new ValidationResult ();
153
+ validationResult .setSuccess (true );
154
+ validationResult .setResults (null );
155
+
150
156
StringBuffer payload = new StringBuffer
151
157
("<conflict_check_request><platform>2000</platform><target_patch_list/>" );
152
158
String releaseNumber = getReleaseNumber (category , version , userId , password );
@@ -161,7 +167,7 @@ public static boolean validatePatches(List<String> patches, String category, Str
161
167
162
168
try {
163
169
NodeList conflictSets = XPathUtil .applyXPathReturnNodeList (result , "/conflict_sets" );
164
- if (conflictSets .getLength () == 0 ) {
170
+ if (conflictSets .getLength () > 0 ) {
165
171
166
172
167
173
try {
@@ -189,7 +195,7 @@ public static boolean validatePatches(List<String> patches, String category, Str
189
195
System .out .println ("" );
190
196
XPathUtil .prettyPrint (doc );
191
197
192
- return true ;
198
+ validationResult . setResults ( doc ) ;
193
199
194
200
195
201
} catch (XPathExpressionException | ParserConfigurationException xpe ) {
@@ -202,7 +208,7 @@ public static boolean validatePatches(List<String> patches, String category, Str
202
208
throw new IOException (xpe );
203
209
204
210
}
205
- return false ;
211
+ return validationResult ;
206
212
}
207
213
208
214
/**
0 commit comments