1
/*******************************************************************************
2
* Copyright (c) 2005 Contributors.
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
10
* Alexandre Vasseur initial implementation
11
*******************************************************************************/
12
package org.aspectj.weaver.loadtime.test;
14
import junit.framework.TestCase;
18
import org.aspectj.weaver.loadtime.definition.Definition;
19
import org.aspectj.weaver.loadtime.definition.DocumentParser;
22
* @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
24
public class DocumentParserTest extends TestCase {
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());
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"));
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());