Examples of PersistentFieldStrategy


Examples of org.apache.tapestry.services.PersistentFieldStrategy

    public void gather_changes()
    {
        Object value1 = new Object();
        Object value2 = new Object();

        PersistentFieldStrategy strat1 = newPersistentFieldStrategy();

        Collection<PersistentFieldChange> changes1 = newList();
        changes1.add(new PersistentFieldChangeImpl("component", "field1", value1));

        PersistentFieldStrategy strat2 = newPersistentFieldStrategy();

        Collection<PersistentFieldChange> changes2 = newList();
        changes2.add(new PersistentFieldChangeImpl("component", "field2", value2));

        // We don't know the exact order the strategies will be ordered in the map,
        // so we can't guarantee the order the strategies will be invoked.

        getMocksControl().checkOrder(false);

        expect(strat1.gatherFieldChanges("foo.Bar")).andReturn(changes1);

        expect(strat2.gatherFieldChanges("foo.Bar")).andReturn(changes2);

        replay();

        Map<String, PersistentFieldStrategy> strategies = newMap();
View Full Code Here

Examples of org.apache.tapestry.services.PersistentFieldStrategy

    @Test
    public void post_change_with_unknown_strategy()
    {
        String fieldName = "field";

        PersistentFieldStrategy strat1 = newPersistentFieldStrategy();
        PersistentFieldStrategy strat2 = newPersistentFieldStrategy();
        ComponentResources resources = mockComponentResources();
        ComponentModel model = mockComponentModel();

        Map<String, PersistentFieldStrategy> strategies = newMap();
        strategies.put("foo", strat1);
View Full Code Here

Examples of org.apache.tapestry.services.PersistentFieldStrategy

        String fieldName = "field";
        String strategyName = "foo";

        ComponentResources resources = mockComponentResources();
        ComponentModel model = mockComponentModel();
        PersistentFieldStrategy strat = newPersistentFieldStrategy();
        Object value = new Object();

        Map<String, PersistentFieldStrategy> strategies = newMap();
        strategies.put(strategyName, strat);

        train_getComponentModel(resources, model);

        train_getFieldPersistenceStrategy(model, fieldName, strategyName);

        train_getNestedId(resources, nestedId);

        strat.postChange(pageName, nestedId, fieldName, value);

        replay();

        PersistentFieldManager manager = new PersistentFieldManagerImpl(null, strategies);
View Full Code Here

Examples of org.apache.tapestry.services.PersistentFieldStrategy

        String fieldName = "field";
        String strategyName = "FOO";

        ComponentResources resources = mockComponentResources();
        ComponentModel model = mockComponentModel();
        PersistentFieldStrategy strat = newPersistentFieldStrategy();
        Object value = new Object();

        Map<String, PersistentFieldStrategy> strategies = newMap();
        strategies.put("foo", strat);

        train_getComponentModel(resources, model);

        train_getFieldPersistenceStrategy(model, fieldName, strategyName);

        train_getNestedId(resources, nestedId);

        strat.postChange(pageName, nestedId, fieldName, value);

        replay();

        PersistentFieldManager manager = new PersistentFieldManagerImpl(null, strategies);
View Full Code Here

Examples of org.apache.tapestry.services.PersistentFieldStrategy

        String fieldName = "field";
        String strategyName = "foo";

        ComponentResources resources = mockComponentResources();
        ComponentModel model = mockComponentModel();
        PersistentFieldStrategy strat = newPersistentFieldStrategy();
        MetaDataLocator locator = newMetaDataLocator();

        Object value = new Object();

        Map<String, PersistentFieldStrategy> strategies = newMap();
        strategies.put(strategyName, strat);

        train_getComponentModel(resources, model);

        train_getFieldPersistenceStrategy(model, fieldName, "");

        train_findMeta(locator, PersistentFieldManagerImpl.META_KEY, resources, strategyName);

        train_getNestedId(resources, nestedId);

        strat.postChange(pageName, nestedId, fieldName, value);

        replay();

        PersistentFieldManager manager = new PersistentFieldManagerImpl(locator, strategies);
View Full Code Here

Examples of org.apache.tapestry.services.PersistentFieldStrategy

        ComponentResources resources = mockComponentResources();
        ComponentModel model = mockComponentModel();
        MetaDataLocator locator = newMetaDataLocator();

        PersistentFieldStrategy strat = newPersistentFieldStrategy();
        Object value = new Object();

        Map<String, PersistentFieldStrategy> strategies = newMap();
        strategies.put(PersistentFieldManagerImpl.DEFAULT_STRATEGY, strat);

        train_getComponentModel(resources, model);

        train_getFieldPersistenceStrategy(model, fieldName, "");

        train_findMeta(
                locator,
                PersistentFieldManagerImpl.META_KEY,
                resources,
                PersistentFieldManagerImpl.DEFAULT_STRATEGY);

        train_getNestedId(resources, nestedId);

        strat.postChange(pageName, nestedId, fieldName, value);

        replay();

        PersistentFieldManager manager = new PersistentFieldManagerImpl(locator, strategies);
View Full Code Here

Examples of org.apache.tapestry.services.PersistentFieldStrategy

    @Test
    public void post_change_with_unknown_strategy()
    {
        String fieldName = "field";

        PersistentFieldStrategy strat1 = newPersistentFieldStrategy();
        PersistentFieldStrategy strat2 = newPersistentFieldStrategy();
        ComponentResources resources = mockComponentResources();
        ComponentModel model = mockComponentModel();

        Map<String, PersistentFieldStrategy> strategies = newMap();
        strategies.put("foo", strat1);
View Full Code Here

Examples of org.apache.tapestry.services.PersistentFieldStrategy

        String fieldName = "field";
        String strategyName = "foo";

        ComponentResources resources = mockComponentResources();
        ComponentModel model = mockComponentModel();
        PersistentFieldStrategy strat = newPersistentFieldStrategy();
        Object value = new Object();

        Map<String, PersistentFieldStrategy> strategies = newMap();
        strategies.put(strategyName, strat);

        train_getComponentModel(resources, model);

        train_getFieldPersistenceStrategy(model, fieldName, strategyName);

        train_getNestedId(resources, nestedId);

        strat.postChange(pageName, nestedId, fieldName, value);

        replay();

        PersistentFieldManager manager = new PersistentFieldManagerImpl(null, strategies);
View Full Code Here

Examples of org.apache.tapestry.services.PersistentFieldStrategy

        String fieldName = "field";
        String strategyName = "FOO";

        ComponentResources resources = mockComponentResources();
        ComponentModel model = mockComponentModel();
        PersistentFieldStrategy strat = newPersistentFieldStrategy();
        Object value = new Object();

        Map<String, PersistentFieldStrategy> strategies = newMap();
        strategies.put("foo", strat);

        train_getComponentModel(resources, model);

        train_getFieldPersistenceStrategy(model, fieldName, strategyName);

        train_getNestedId(resources, nestedId);

        strat.postChange(pageName, nestedId, fieldName, value);

        replay();

        PersistentFieldManager manager = new PersistentFieldManagerImpl(null, strategies);
View Full Code Here

Examples of org.apache.tapestry.services.PersistentFieldStrategy

        String fieldName = "field";
        String strategyName = "foo";

        ComponentResources resources = mockComponentResources();
        ComponentModel model = mockComponentModel();
        PersistentFieldStrategy strat = newPersistentFieldStrategy();
        MetaDataLocator locator = newMetaDataLocator();

        Object value = new Object();

        Map<String, PersistentFieldStrategy> strategies = newMap();
        strategies.put(strategyName, strat);

        train_getComponentModel(resources, model);

        train_getFieldPersistenceStrategy(model, fieldName, "");

        train_findMeta(locator, PersistentFieldManagerImpl.META_KEY, resources, strategyName);

        train_getNestedId(resources, nestedId);

        strat.postChange(pageName, nestedId, fieldName, value);

        replay();

        PersistentFieldManager manager = new PersistentFieldManagerImpl(locator, strategies);
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.