Changeset 1994 for trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/eventcore/SimpleSOAPEventType.java
- Timestamp:
- 07/09/15 13:50:59 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/eventcore/SimpleSOAPEventType.java
r1993 r1994 17 17 import java.io.ByteArrayInputStream; 18 18 import java.io.IOException; 19 import java.io.InvalidObjectException; 20 import java.io.ObjectInputStream; 21 import java.io.ObjectOutputStream; 19 22 20 23 import javax.xml.parsers.DocumentBuilderFactory; … … 91 94 * reference to the {@link EqualSOAPDataMap} associated with the sequence this event belongs to. 92 95 */ 93 private final EqualSOAPDataMap equalBodyMap; 94 95 /** 96 * <p> 97 * Constructor. Creates a new SimpleSOAPEventType. 98 * </p> 99 * 100 */ 101 public SimpleSOAPEventType(String calledMethod, 102 String serviceName, 103 String clientName, 104 Element soapMsgBody) 105 { 106 this(calledMethod, serviceName, clientName, soapMsgBody, null, CallType.REQUEST); 107 } 108 109 /** 110 * <p> 111 * Constructor. Creates a new SimpleSOAPEventType with a EqualSOAPDATAMap. 112 * </p> 113 * 114 */ 115 public SimpleSOAPEventType(String calledMethod, 116 String serviceName, 117 String clientName, 118 Element soapMsgBody, 119 EqualSOAPDataMap equalRequestsMap) 120 { 121 this(calledMethod, serviceName, clientName, soapMsgBody, equalRequestsMap, 122 CallType.REQUEST); 123 } 124 125 /** 126 * <p> 127 * Constructor. Creates a new SimpleSOAPEventType with a EqualSOAPDATAMap. 96 private transient EqualSOAPDataMap equalBodyMap; 97 98 /** 99 * <p> 100 * Constructor. Creates a new SimpleSOAPEventType with a EqualSOAPDATAMap. Should always call 101 * initEqualBodyMap afterwards. 128 102 * </p> 129 103 * … … 151 125 this.soapMsgBody = SOAPUtils.getSerialization(soapMsgBody); 152 126 this.callType = callType; 153 154 // this must be the last part of the constructor and only be called after all variables are 155 // initialized 156 if (equalRequestsMap != null) { 157 equalRequestsMap.add(this, this.soapMsgBody); 127 128 if (equalBodyMap != null) { 129 equalBodyMap.add(this, this.soapMsgBody); 158 130 } 159 131 } … … 256 228 } 257 229 else if (obj instanceof SimpleSOAPEventType) { 258 return callType.equals(((SimpleSOAPEventType) obj).callType) && 230 boolean callTypesEqual = true; 231 if (callType == null) { 232 if (((SimpleSOAPEventType) obj).callType == null) { 233 callTypesEqual = true; 234 } 235 else { 236 callTypesEqual = false; 237 } 238 } 239 else { 240 callTypesEqual = callType.equals(((SimpleSOAPEventType) obj).callType); 241 } 242 return callTypesEqual && 259 243 HTTPUtils.equals(calledMethod, ((SimpleSOAPEventType) obj).calledMethod) && 260 244 HTTPUtils.equals(serviceName, ((SimpleSOAPEventType) obj).serviceName) && … … 273 257 @Override 274 258 public int hashCode() { 275 return callType.hashCode() + calledMethod.hashCode() + serviceName.hashCode() + 276 clientName.hashCode(); 259 int hashCode = 13; 260 if (callType != null) { 261 hashCode += callType.hashCode(); 262 } 263 if (calledMethod == null || serviceName == null || clientName == null) { 264 System.out.print("fu!"); 265 } 266 return hashCode + calledMethod.hashCode() + serviceName.hashCode() + clientName.hashCode(); 277 267 } 278 268 … … 296 286 } 297 287 } 288 289 private void writeObject(ObjectOutputStream out) throws IOException { 290 out.defaultWriteObject(); 291 out.writeObject(equalBodyMap); 292 } 293 294 private void readObject(ObjectInputStream in) 295 throws ClassNotFoundException, IOException 296 { 297 in.defaultReadObject(); 298 equalBodyMap = (EqualSOAPDataMap) in.readObject(); 299 if ( equalBodyMap == null) { 300 throw new InvalidObjectException("null"); 301 } 302 } 298 303 }
Note: See TracChangeset
for help on using the changeset viewer.