~ubuntu-branches/ubuntu/natty/aspectj/natty

« back to all changes in this revision

Viewing changes to org.aspectj/modules/loadtime/testsrc/org/aspectj/weaver/loadtime/test/DocumentParserTest.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2009-10-04 16:37:23 UTC
  • mfrom: (1.1.3 upstream) (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20091004163723-ck4y7j7fhjxskkie
Tags: 1.6.6+dfsg-1
* New upstream release.
  - Update 02_use_gjdoc.diff patch
* Update my email address

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*******************************************************************************
2
 
 * Copyright (c) 2005 Contributors.
3
 
 * All rights reserved.
4
 
 * This program and the accompanying materials are made available
5
 
 * under the terms of the Eclipse Public License v1.0
6
 
 * which accompanies this distribution and is available at
7
 
 * http://eclipse.org/legal/epl-v10.html
8
 
 *
9
 
 * Contributors:
10
 
 *   Alexandre Vasseur         initial implementation
11
 
 *******************************************************************************/
12
 
package org.aspectj.weaver.loadtime.test;
13
 
 
14
 
import junit.framework.TestCase;
15
 
 
16
 
import java.net.URL;
17
 
 
18
 
import org.aspectj.weaver.loadtime.definition.Definition;
19
 
import org.aspectj.weaver.loadtime.definition.DocumentParser;
20
 
 
21
 
/**
22
 
 * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
23
 
 */
24
 
public class DocumentParserTest extends TestCase {
25
 
 
26
 
    public void testSimple() throws Throwable {
27
 
        URL url = DocumentParserTest.class.getResource("simple.xml");
28
 
        Definition def = DocumentParser.parse(url);
29
 
        assertEquals("-showWeaveInfo", def.getWeaverOptions().trim());
30
 
    }
31
 
 
32
 
    public void testSimpleWithDtd() throws Throwable {
33
 
        URL url = DocumentParserTest.class.getResource("simpleWithDtd.xml");
34
 
        Definition def = DocumentParser.parse(url);
35
 
        assertEquals("-showWeaveInfo", def.getWeaverOptions().trim());
36
 
        assertTrue(def.getAspectClassNames().contains("test.Aspect"));
37
 
 
38
 
        assertEquals("foo..bar.Goo+", def.getIncludePatterns().get(0));
39
 
        assertEquals("@Baz", def.getAspectExcludePatterns().get(0));
40
 
        assertEquals("@Whoo", def.getAspectIncludePatterns().get(0));
41
 
        assertEquals("foo..*", def.getDumpPatterns().get(0));
42
 
        assertEquals(true,def.shouldDumpBefore());
43
 
    }
44
 
 
45
 
}