01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tctest;
06:
07: import com.tc.object.config.ConfigVisitor;
08: import com.tc.object.config.DSOClientConfigHelper;
09: import com.tc.simulator.app.ApplicationConfig;
10: import com.tc.simulator.listener.ListenerProvider;
11: import com.tc.test.proxyconnect.ProxyConnectManager;
12: import com.tc.util.concurrent.ThreadUtil;
13: import com.tctest.runner.AbstractErrorCatchingTransparentApp;
14: import com.tctest.runner.TransparentAppConfig;
15:
16: public class IllegalReconnectTest extends TransparentTestBase {
17:
18: private static final int NODE_COUNT = 1;
19:
20: public void doSetUp(TransparentTestIface t) throws Exception {
21: t.getTransparentAppConfig().setClientCount(NODE_COUNT);
22: t.initializeTestRunner();
23: }
24:
25: protected void tearDown() throws Exception {
26: getProxyConnectManager().close();
27: super .tearDown();
28: }
29:
30: protected Class getApplicationClass() {
31: return App.class;
32: }
33:
34: protected boolean canRunProxyConnect() {
35: return true;
36: }
37:
38: protected boolean enableL1Reconnect() {
39: return false;
40: }
41:
42: protected boolean canSkipL1ReconnectCheck() {
43: return true;
44: }
45:
46: protected boolean enableManualProxyConnectControl() {
47: return true;
48: }
49:
50: public static class App extends AbstractErrorCatchingTransparentApp {
51:
52: private final ProxyConnectManager proxyMgr;
53:
54: public App(String appId, ApplicationConfig cfg,
55: ListenerProvider listenerProvider) {
56: super (appId, cfg, listenerProvider);
57: assertEquals(1, cfg.getGlobalParticipantCount());
58: this .proxyMgr = (ProxyConnectManager) cfg
59: .getAttributeObject(TransparentAppConfig.PROXY_CONNECT_MGR);
60: }
61:
62: protected void runTest() throws Throwable {
63: proxyMgr.closeClientConnections();
64: ThreadUtil.reallySleep(10000);
65: }
66:
67: public static void visitL1DSOConfig(ConfigVisitor visitor,
68: DSOClientConfigHelper config) {
69: //
70: }
71:
72: }
73:
74: }
|