01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tctest.transparency;
05:
06: import com.tc.object.bytecode.TransparentAccess;
07: import com.tc.simulator.app.ApplicationConfig;
08: import com.tc.simulator.listener.ListenerProvider;
09: import com.tctest.TestConfigurator;
10: import com.tctest.TransparentTestBase;
11: import com.tctest.TransparentTestIface;
12: import com.tctest.runner.AbstractTransparentApp;
13:
14: public class InstrumentNothingTest extends TransparentTestBase
15: implements TestConfigurator {
16:
17: protected Class getApplicationClass() {
18: return InstrumentNothingTestApp.class;
19: }
20:
21: public void doSetUp(TransparentTestIface t) throws Exception {
22: t.getTransparentAppConfig().setClientCount(1).setIntensity(1);
23: t.initializeTestRunner();
24: }
25:
26: public static final class InstrumentNothingTestApp extends
27: AbstractTransparentApp {
28:
29: public InstrumentNothingTestApp(String appId,
30: ApplicationConfig cfg, ListenerProvider listenerProvider) {
31: super (appId, cfg, listenerProvider);
32: }
33:
34: public void run() {
35: Class[] interfaces = getClass().getInterfaces();
36: for (int i = 0; i < interfaces.length; i++) {
37: if (TransparentAccess.class.getName().equals(
38: interfaces[i].getName())) {
39: throw new AssertionError(
40: "I shouldn't have been instrumented, but I was!");
41: }
42: }
43: }
44: }
45:
46: }
|