Package org.apache.torque.generator.configuration.mergepoint

Examples of org.apache.torque.generator.configuration.mergepoint.MergepointMapping


     *          for the given name already exists.
     */
    public void addMergepointMapping(MergepointMapping mergepointMapping)
        throws ConfigurationException
    {
        MergepointMapping oldMapping
                = mergepointMappings.get(mergepointMapping.getName());
        if (oldMapping != null)
        {
            throw new ConfigurationException(
                    "Attempted to add another mergepoint mapping for the name "
                        + mergepointMapping.getName()
                        + " : New mapping mapped to Actions "
                        + mergepointMapping.getActions()
                        + ", old mapping mapped to Actions "
                        + oldMapping.getActions());
        }
        mergepointMappings.put(mergepointMapping.getName(), mergepointMapping);
    }
View Full Code Here


    {
        if (log.isDebugEnabled())
        {
            log.debug("mergepoint() : Start for mergepoint " + mergepointName);
        }
        MergepointMapping mergepointMapping
                = getMergepointMapping(mergepointName);
        if (mergepointMapping == null)
        {
            if (log.isInfoEnabled())
            {
                log.info("mergepoint() : End. Mapping "
                        + mergepointName
                        + " not found in outlet "
                        + getName()
                        + ", returning the empty String");
            }
            return "";
        }
        List<MergepointAction> actions = mergepointMapping.getActions();
        if (actions.isEmpty())
        {
            log.debug("No actions specified for action mapping with name "
                    + mergepointName
                    + " in outlet "
View Full Code Here

                assertEquals("Bar2", outlet.getBar());
                Map<String, MergepointMapping> mergepointMappings
                        = outlet.getMergepointMappings();
                assertEquals(3, mergepointMappings.size());
                {
                    MergepointMapping mergepointMapping
                            = mergepointMappings.get("properties");
                    assertEquals(1, mergepointMapping.getActions().size());
                    MergepointAction action
                            = mergepointMapping.getActions().get(0);
                    assertEquals(
                            new TraverseAllAction(
                                    "entry",
                                    "org.apache.torque.generator.velocity.propertyCopy",
                                    true),
                            action);
                    assertEquals("inputElement", outlet.getInputElementName());
                }
                {
                    // mergepoint from the separate mapping
                    MergepointMapping mergepointMapping
                            = mergepointMappings.get("mergepointName");
                    assertEquals(1, mergepointMapping.getActions().size());
                    MergepointAction action
                            = mergepointMapping.getActions().get(0);
                    assertEquals(
                            new ApplyAction(
                                    null,
                                    "someOutletAction",
                                    false),
                            action);
                    assertEquals("inputElement", outlet.getInputElementName());
                }
                {
                    // other mergepoint from the separate mapping
                    MergepointMapping mergepointMapping
                            = mergepointMappings.get("mergepointFromParent");
                    assertEquals(1, mergepointMapping.getActions().size());
                    MergepointAction action
                            = mergepointMapping.getActions().get(0);
                    assertEquals(
                            new ApplyAction(
                                    null,
                                    "newOutletAction",
                                    true),
View Full Code Here

                assertEquals("Bar2", outlet.getBar());
                Map<String, MergepointMapping> mergepointMappings
                        = outlet.getMergepointMappings();
                assertEquals(3, mergepointMappings.size());
                {
                    MergepointMapping mergepointMapping
                            = mergepointMappings.get("properties");
                    assertEquals(1, mergepointMapping.getActions().size());
                    MergepointAction action
                            = mergepointMapping.getActions().get(0);
                    assertEquals(
                            new TraverseAllAction(
                                    "entry",
                                    "org.apache.torque.generator.velocity.propertyCopy",
                                    true),
                            action);
                    assertEquals("inputElement", outlet.getInputElementName());
                }
                {
                    // mergepoint from the separate mapping in child
                    MergepointMapping mergepointMapping
                            = mergepointMappings.get("mergepointName");
                    assertEquals(1, mergepointMapping.getActions().size());
                    MergepointAction action
                            = mergepointMapping.getActions().get(0);
                    assertEquals(
                            new ApplyAction(
                                    null,
                                    "someOutletAction",
                                    false),
                            action);
                    assertEquals("inputElement", outlet.getInputElementName());
                }
                {
                    // other mergepoint from the separate mapping in child
                    MergepointMapping mergepointMapping
                            = mergepointMappings.get("mergepointFromParent");
                    assertEquals(1, mergepointMapping.getActions().size());
                    MergepointAction action
                            = mergepointMapping.getActions().get(0);
                    assertEquals(
                            new ApplyAction(
                                    null,
                                    "newOutletAction",
                                    true),
View Full Code Here

        else if (mergepointHandler != null)
        {
            mergepointHandler.endElement(uri, localName, rawName);
            if (mergepointHandler.isFinished())
            {
                MergepointMapping mergepointMapping
                        = mergepointHandler.getMergepointMapping();
                mergepointMappings.add(mergepointMapping);
                if (log.isDebugEnabled())
                {
                    log.debug("Parsed configuration for the mergepoint "
                            + mergepointMapping.getName());
                }
                mergepointHandler = null;
            }
        }
    }
View Full Code Here

                        + "exists (required by the isolated mergepoint mapping"
                        + " with the name "
                        + name
                        + ")");
            }
            MergepointMapping originalMergepointMapping = entry.getValue();
            MergepointMapping resolvedMergepointMapping
                    = new MergepointMapping(
                            qualifiedMergepointName.getName(),
                            originalMergepointMapping.getActions());
            outlet.setMergepointMapping(resolvedMergepointMapping);
        }
        mergepointMappingsResolved = true;
View Full Code Here

    {
        List<MergepointAction> mergepointActions
                = new ArrayList<MergepointAction>();
        mergepointActions.add(new OutputAction("Test-body for.a,javadoc"));
        javadocOutlet.setMergepointMapping(
                new MergepointMapping(
                        "body",
                        mergepointActions));
        mergepointActions = new ArrayList<MergepointAction>();
        mergepointActions.add(
                new OutputAction("@param param1 description,of param1"));
        javadocOutlet.setMergepointMapping(
                new MergepointMapping(
                        "attributes",
                        mergepointActions));
        OutletResult result = javadocOutlet.execute(new ControllerState());
        assertTrue(result.isStringResult());
        assertEquals(
View Full Code Here

        outlets.add(new PackageToPathOutlet(
                new QualifiedName("test.outlet.2")));
        List<MergepointMapping> mergepointMappings
                = new ArrayList<MergepointMapping>();
        mergepointMappings.add(
                new MergepointMapping("test.outlet.testMergepoint"));
        mergepointMappings.get(0).addAction(
                new ApplyAction(".", "test.outlet.2", false));

        OutletConfiguration outletConfiguration = new OutletConfiguration(
                outlets,
View Full Code Here

        outlets.add(new JavaOutlet(
                new QualifiedName("test.outlet")));
        List<MergepointMapping> mergepointMappings
                = new ArrayList<MergepointMapping>();
        mergepointMappings.add(
                new MergepointMapping("not.existing.outlet.testMergepoint"));

        OutletConfiguration outletConfiguration = new OutletConfiguration(
                outlets,
                mergepointMappings,
                unitDescriptor);
View Full Code Here

        outlets.add(new JavaOutlet(
                new QualifiedName("test.outlet")));
        List<MergepointMapping> mergepointMappings
                = new ArrayList<MergepointMapping>();
        mergepointMappings.add(
                new MergepointMapping("testMergepoint"));

        OutletConfiguration outletConfiguration = new OutletConfiguration(
                outlets,
                mergepointMappings,
                unitDescriptor);
View Full Code Here

TOP

Related Classes of org.apache.torque.generator.configuration.mergepoint.MergepointMapping

Copyright © 2018 www.massapicom. 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.