_XAcceptor.java (ef39d40d) | _XAcceptor.java (bb6af6bc) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 39 unchanged lines hidden (view full) --- 48* This test <b>can not</b> be run in multiply threads. 49*/ 50public class _XAcceptor extends MultiMethodTest { 51 52 protected PrintWriter log_ ; 53 54 /** 55 * Calls <code>accept()</code> method in a separate thread. | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 39 unchanged lines hidden (view full) --- 48* This test <b>can not</b> be run in multiply threads. 49*/ 50public class _XAcceptor extends MultiMethodTest { 51 52 protected PrintWriter log_ ; 53 54 /** 55 * Calls <code>accept()</code> method in a separate thread. |
56 * Then stores exception thrown by call if it occured, or | 56 * Then stores exception thrown by call if it occurred, or |
57 * return value. 58 */ 59 protected class AcceptorThread extends Thread { 60 /** | 57 * return value. 58 */ 59 protected class AcceptorThread extends Thread { 60 /** |
61 * If exception occured during method call it is | 61 * If exception occurred during method call it is |
62 * stored in this field. 63 */ 64 public Exception ex = null ; 65 private XAcceptor acc = null ; 66 /** 67 * If method call returns some value it stores in this field. 68 */ 69 public XConnection acceptedCall = null ; --- 104 unchanged lines hidden (view full) --- 174 175 if (acception.acceptedCall == null) 176 log.println("Acceptor returned : null") ; 177 else 178 log.println("Acceptor returned : " + 179 acception.acceptedCall.getDescription()) ; 180 } else { 181 if (acception.ex != null) { | 62 * stored in this field. 63 */ 64 public Exception ex = null ; 65 private XAcceptor acc = null ; 66 /** 67 * If method call returns some value it stores in this field. 68 */ 69 public XConnection acceptedCall = null ; --- 104 unchanged lines hidden (view full) --- 174 175 if (acception.acceptedCall == null) 176 log.println("Acceptor returned : null") ; 177 else 178 log.println("Acceptor returned : " + 179 acception.acceptedCall.getDescription()) ; 180 } else { 181 if (acception.ex != null) { |
182 log.println("Exception occured in accept() thread :") ; | 182 log.println("Exception occurred in accept() thread :") ; |
183 acception.ex.printStackTrace(log) ; 184 } 185 186 if (acception.acceptedCall == null) 187 log.println("Method returned : null") ; 188 else 189 log.println("Method returned : " + 190 acception.acceptedCall.getDescription()) ; --- 103 unchanged lines hidden (view full) --- 294 if (acception.isAlive()) { 295 acception.interrupt() ; 296 297 result = false ; 298 log.println("Method call haven't returned") ; 299 300 } else { 301 if (acception.ex != null) { | 183 acception.ex.printStackTrace(log) ; 184 } 185 186 if (acception.acceptedCall == null) 187 log.println("Method returned : null") ; 188 else 189 log.println("Method returned : " + 190 acception.acceptedCall.getDescription()) ; --- 103 unchanged lines hidden (view full) --- 294 if (acception.isAlive()) { 295 acception.interrupt() ; 296 297 result = false ; 298 log.println("Method call haven't returned") ; 299 300 } else { 301 if (acception.ex != null) { |
302 log.println("Exception occured in accept() thread :") ; | 302 log.println("Exception occurred in accept() thread :") ; |
303 acception.ex.printStackTrace(log) ; 304 result = false ; 305 } else { 306 result = true ; 307 } 308 309 if (acception.acceptedCall == null) 310 log.println("accept() returned : null") ; 311 else 312 log.println("accept() returned : " + 313 acception.acceptedCall.getDescription()) ; 314 } 315 316 tRes.tested("stopAccepting()", result) ; 317 } 318} 319 | 303 acception.ex.printStackTrace(log) ; 304 result = false ; 305 } else { 306 result = true ; 307 } 308 309 if (acception.acceptedCall == null) 310 log.println("accept() returned : null") ; 311 else 312 log.println("accept() returned : " + 313 acception.acceptedCall.getDescription()) ; 314 } 315 316 tRes.tested("stopAccepting()", result) ; 317 } 318} 319 |