001: // $Id: AbstractExtensionTest.java,v 1.2 2004/05/12 17:26:50 anicoara Exp $
002: // =====================================================================
003: //
004: // (history at end)
005: //
006:
007: package ch.ethz.prose;
008:
009: // used packages
010: import java.util.List;
011:
012: import junit.framework.*;
013: import ch.ethz.prose.crosscut.*;
014: import ch.ethz.prose.filter.PointCutter;
015:
016: /**
017: * JUnit testcase for class DefaultAspect (Black).
018: *
019: * @version $Revision: 1.2 $
020: * @author Andrei Popovici
021: */
022: public class AbstractExtensionTest extends TestCase {
023:
024: List cross1 = null;
025: List cross2 = null;
026: DefaultAspect exampleExt1 = new DefaultAspect() {
027: };
028:
029: DefaultAspect exampleExt2 = new DefaultAspect() {
030: Crosscut c1 = new MethodCut() {
031: public void METHOD_ARGS() {
032: }
033:
034: protected PointCutter pointCutter() {
035: return null;
036: }
037: };
038:
039: Crosscut c2 = new MethodCut() {
040: void METHOD_ARGS(ANY this Obj, REST params) {
041: }
042:
043: protected PointCutter pointCutter() {
044: return null;
045: }
046: };
047: };
048:
049: /**
050: * Construct test with given name.
051: * @param name test name
052: */
053: public AbstractExtensionTest(String name) {
054: super (name);
055: }
056:
057: /**
058: * Set up fixture.
059: */
060: protected void setUp() {
061: cross1 = exampleExt1.getCrosscuts();
062: cross2 = exampleExt2.getCrosscuts();
063: }
064:
065: protected void tearDown() {
066: }
067:
068: // test whether the extension produces correct crosscuts
069: public void testCrosscuts() {
070: assertNotNull(cross1);
071: assertTrue("crosscut 1 has no elements", cross1.isEmpty());
072:
073: assertNotNull(cross2);
074: assertTrue("crosscut has 2 methods", cross2.size() == 2);
075: }
076:
077: /**
078: * Test suite.
079: * @return test instance
080: */
081: public static Test suite() {
082: return new TestSuite(AbstractExtensionTest.class);
083: }
084: }
085:
086: //======================================================================
087: //
088: // $Log: AbstractExtensionTest.java,v $
089: // Revision 1.2 2004/05/12 17:26:50 anicoara
090: // Adapt Junit tests to 3.8.1 version and the new package structure
091: //
092: // Revision 1.1.1.1 2003/07/02 15:30:42 apopovic
093: // Imported from ETH Zurich
094: //
095: // Revision 1.1 2003/05/05 14:02:33 popovici
096: // renaming from runes to prose
097: //
098: // Revision 1.11 2003/04/27 13:08:41 popovici
099: // Specializers renamed to PointCutter
100: //
101: // Revision 1.10 2003/04/17 15:43:47 popovici
102: // crosscuts renamed to 'getCrosscuts'
103: // createCrosscuts renamed to 'crosscuts'
104: //
105: // Revision 1.9 2003/04/17 15:15:01 popovici
106: // Extension->Aspect renaming
107: //
108: // Revision 1.8 2003/04/17 12:49:38 popovici
109: // Refactoring of the crosscut package
110: // ExceptionCut renamed to ThrowCut
111: // McutSignature is now SignaturePattern
112: //
113: // Revision 1.7 2003/04/17 08:46:42 popovici
114: // Important functionality additions
115: // - Cflow specializers
116: // - Restructuring of the MethodCut, SetCut, ThrowCut, and GetCut (they are much smaller)
117: // - Transactional capabilities
118: // - Total refactoring of Specializer evaluation, which permits fine-grained distinction
119: // between static and dynamic specializers.
120: // - Functionality pulled up in abstract classes
121: // - Uniformization of advice methods patterns and names
122: //
123: // Revision 1.6 2003/03/05 08:31:22 popovici
124: // Bug fix afeer import organization
125: //
126: // Revision 1.5 2003/03/04 18:36:06 popovici
127: // Organization of imprts
128: //
129: // Revision 1.4 2002/06/06 14:39:54 popovici
130: // Renamings: FunctionalCrosscut->MethodCut
131: // AllFields->SetCut
132: // SetCu.fieldModiticationAdvice -> SetCut.setAdvice
133: //
134: // Revision 1.3 2002/06/04 12:36:09 popovici
135: // AllLocations occurences replaced with FunctionalCrosscut
136: //
137: // Revision 1.2 2002/02/05 11:20:02 smarkwal
138: // modifications to test JVMAI-based implementation
139: //
140: // Revision 1.1.1.1 2001/11/29 18:13:30 popovici
141: // Sources from runes
142: //
143: // Revision 1.1.2.1 2000/10/24 17:59:51 popovici
144: // Initial Revision
145: //
|