Examples of AspectWerkzDefinition


Examples of org.codehaus.aspectwerkz.definition.AspectWerkzDefinition

    private File m_input = new File("src/test/newdef.xml");

    public void testIntroductionTag() {
        try {
            AspectWerkzDefinition aspectwerkz = XmlDefinitionParser.parseNoCache(m_input.toURL());
            Iterator it = aspectwerkz.getIntroductionDefinitions().iterator();
            IntroductionDefinition introduction2 = (IntroductionDefinition)it.next();
            assertEquals("mixin", introduction2.getName());
            assertEquals("mixins.Mixin", introduction2.getInterface());
            assertEquals("mixins.MixinImpl", introduction2.getImplementation());
            assertEquals("perInstance", introduction2.getDeploymentModel());
View Full Code Here

Examples of org.codehaus.aspectwerkz.definition.AspectWerkzDefinition

        }
    }

    public void testAdviceTag() {
        try {
            AspectWerkzDefinition aspectwerkz = XmlDefinitionParser.parseNoCache(m_input.toURL());
            Iterator it = aspectwerkz.getAdviceDefinitions().iterator();
            AdviceDefinition advice1 = (AdviceDefinition)it.next();
            assertEquals("logging", advice1.getName());
            assertEquals("examples.logging.LoggingAdvice", advice1.getAdviceClassName());
            assertEquals("perClass", advice1.getDeploymentModel());
            assertEquals("log", advice1.getAttribute());
View Full Code Here

Examples of org.codehaus.aspectwerkz.definition.AspectWerkzDefinition

        }
    }

    public void testAspectTag() {
        try {
            AspectWerkzDefinition aspectwerkz = XmlDefinitionParser.parseNoCache(m_input.toURL());
            Iterator it1 = aspectwerkz.getAspectDefinitions().iterator();
            AspectDefinition aspect = (AspectDefinition)it1.next();
            assertEquals("Logger", aspect.getName());
            assertEquals("Service", aspect.getExtends());
            assertEquals("services.*", ((IntroductionWeavingRule)aspect.getIntroductionWeavingRules().get(0)).getClassPattern());
            assertEquals("loggable", (String)((IntroductionWeavingRule)aspect.getIntroductionWeavingRules().get(0)).getIntroductionRefs().get(0));
View Full Code Here

Examples of org.codehaus.aspectwerkz.definition.AspectWerkzDefinition

        }
    }

    public void testPointcutTag() {
        try {
            final AspectWerkzDefinition aspectwerkz = XmlDefinitionParser.parseNoCache(m_input.toURL());
            Iterator it = ((AspectDefinition)aspectwerkz.getAspectDefinitions().iterator().
                    next()).getPointcutDefs().iterator();
            PointcutDefinition pointcut2 = (PointcutDefinition)it.next();
            assertEquals("method", pointcut2.getType());
            assertEquals("stop", pointcut2.getName());
            assertEquals("services.*", pointcut2.getClassPattern());
View Full Code Here

Examples of org.codehaus.aspectwerkz.definition.AspectWerkzDefinition

                               final String definitionFileToMerge,
                               String uuid) {
        if (sourcePath == null) throw new IllegalArgumentException("source path can not be null");
        if (fileName == null) throw new IllegalArgumentException("file name can not be null");

        AspectWerkzDefinition definition = getDefinition(definitionFileToMerge);

        parseRuntimeAttributes(definition, sourcePath);

        validate(definition);
View Full Code Here

Examples of org.codehaus.aspectwerkz.definition.AspectWerkzDefinition

     * @param fileName the name of the definition file
     * @param append the append flag
     * @return the aspectwerkz definition
     */
    private static AspectWerkzDefinition getDefinition(final String fileName) {
        AspectWerkzDefinition definition;
        if (fileName != null) {
            File definitionFile = new File(fileName);
            if (definitionFile.exists()) {
                definition = AspectWerkzDefinition.loadDefinitionAsFile(fileName);
            }
            else {
                definition = new AspectWerkzDefinition();
            }
        }
        else {
            definition = new AspectWerkzDefinition();
        }
        return definition;
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.definition.AspectWerkzDefinition

            return; // the repository have already been loaded by this class loader
        }
        Set repository = new HashSet();
        m_metaDataRepository.put(loader, repository); // add the loader here already to prevent recursive calls

        AspectWerkzDefinition def = AspectWerkzDefinition.getDefinitionForTransformation();
        for (Iterator it = def.getIntroductionDefinitions().iterator(); it.hasNext();) {
            String className = ((IntroductionDefinition)it.next()).getImplementation();
            if (className != null) {
                try {
                    Class mixin = loader.loadClass(className);
                    ClassMetaData metaData = ReflectionMetaDataMaker.createClassMetaData(mixin);
View Full Code Here

Examples of org.codehaus.aspectwerkz.definition.AspectWerkzDefinition

    private File m_input = new File("src/test/newdef.xml");

    public void testIntroductionTag() {
        try {
            AspectWerkzDefinition aspectwerkz = (AspectWerkzDefinition)XmlParser.parseNoCache(m_input.toURL()).get(0);
            Iterator it = aspectwerkz.getIntroductionDefinitions().iterator();
            it.next();//skip "loggable"
            IntroductionDefinition introduction2 = (IntroductionDefinition)it.next();
            assertEquals("mixin", introduction2.getName());
            assertEquals("mixins.Mixin", introduction2.getInterface());
            assertEquals("mixins.MixinImpl", introduction2.getImplementation());
View Full Code Here

Examples of org.codehaus.aspectwerkz.definition.AspectWerkzDefinition

        }
    }

    public void testAdviceTag() {
        try {
            AspectWerkzDefinition aspectwerkz = (AspectWerkzDefinition)XmlParser.parseNoCache(m_input.toURL()).get(0);
            Iterator it = aspectwerkz.getAdviceDefinitions().iterator();
            AdviceDefinition advice1 = (AdviceDefinition)it.next();
            assertEquals("logging", advice1.getName());
            assertEquals("examples.logging.LoggingAdvice", advice1.getAdviceClassName());
            assertEquals("perClass", advice1.getDeploymentModel());
            assertEquals("log", advice1.getAttribute());
View Full Code Here

Examples of org.codehaus.aspectwerkz.definition.AspectWerkzDefinition

        }
    }

    public void testAspectTag() {
        try {
            AspectWerkzDefinition aspectwerkz = (AspectWerkzDefinition)XmlParser.parseNoCache(m_input.toURL()).get(0);
            Iterator it1 = aspectwerkz.getAspectDefinitions().iterator();
            it1.next();// SystemAspect @todo check this with Jonas (side effect of precedence fix)
            AspectDefinition aspect = (AspectDefinition)it1.next();
            assertEquals("Logger", aspect.getName());
            assertEquals("Service", aspect.getExtends());
            assertEquals("services.*", ((BindIntroductionRule)aspect.getBindIntroductionRules().get(0)).getExpression().getExpression());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.