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.tc.object.config;
05:
06: import com.tc.aspectwerkz.reflect.ClassInfo;
07: import com.tc.object.bytecode.aspectwerkz.ClassInfoFactory;
08: import com.tc.object.config.schema.InstrumentedClass;
09: import com.tc.object.config.schema.TestInstrumentedClass;
10:
11: import junit.framework.TestCase;
12:
13: public class InstrumentationDescriptorImplTest extends TestCase {
14:
15: public void testBasics() {
16: InstrumentedClass ic = new TestInstrumentedClass();
17: TestClassExpressionMatcher em = new TestClassExpressionMatcher();
18: InstrumentationDescriptor idi = new InstrumentationDescriptorImpl(
19: ic, em);
20:
21: String expression = "classExpression";
22: ClassInfoFactory classInfoFactory = new ClassInfoFactory();
23: ClassInfo classInfo = classInfoFactory.getClassInfo(expression);
24:
25: em.shouldMatch = false;
26: assertFalse(idi.matches(classInfo));
27: em.shouldMatch = true;
28: assertTrue(idi.matches(classInfo));
29: }
30:
31: }
|