Package org.apache.rave.portal.web.model

Examples of org.apache.rave.portal.web.model.RegionWidgetPreferenceListWrapper


        regionWidgetApi = new RegionWidgetApi(regionWidgetService);
    }

    @Test
    public void replaceAllRegionWidgetPreferences_validParams() {
        RegionWidgetPreferenceListWrapper LIST_WRAPPER = new RegionWidgetPreferenceListWrapper(Arrays.asList( (RegionWidgetPreference)
                new RegionWidgetPreferenceImpl(), new RegionWidgetPreferenceImpl()
        ));

        expect(regionWidgetService.saveRegionWidgetPreferences(VALID_REGION_WIDGET_ID, LIST_WRAPPER.getPreferences())).
                andReturn(LIST_WRAPPER.getPreferences());
        replay(regionWidgetService);

        RegionWidgetPreferenceListWrapper result = regionWidgetApi.replaceAllRegionWidgetPreferences(VALID_REGION_WIDGET_ID,
                LIST_WRAPPER);

        verify(regionWidgetService);
        assertThat(result.getPreferences(), sameInstance(LIST_WRAPPER.getPreferences()));
    }
View Full Code Here


        assertThat(result.getPreferences(), sameInstance(LIST_WRAPPER.getPreferences()));
    }

    @Test(expected = IllegalArgumentException.class)
    public void replaceAllRegionWidgetPreferences_invalidParams() {
        RegionWidgetPreferenceListWrapper LIST_WRAPPER = new RegionWidgetPreferenceListWrapper(Arrays.asList( (RegionWidgetPreference)
                new RegionWidgetPreferenceImpl(), new RegionWidgetPreferenceImpl()
        ));

        expect(regionWidgetService.saveRegionWidgetPreferences(INVALID_REGION_WIDGET_ID, LIST_WRAPPER.getPreferences())).
                andThrow(new IllegalArgumentException());
        replay(regionWidgetService);

        regionWidgetApi.replaceAllRegionWidgetPreferences(INVALID_REGION_WIDGET_ID, LIST_WRAPPER);
    }
View Full Code Here

                    regionWidgetPreferenceListWrapper);
        }

        List<RegionWidgetPreference> regionWidgetPreferences = regionWidgetService.saveRegionWidgetPreferences(
                regionWidgetId, regionWidgetPreferenceListWrapper.getPreferences());
        return new RegionWidgetPreferenceListWrapper(regionWidgetPreferences);
    }
View Full Code Here

                    regionWidgetPreferenceListWrapper);
        }

        List<RegionWidgetPreference> regionWidgetPreferences = regionWidgetService.saveRegionWidgetPreferences(
                regionWidgetId, regionWidgetPreferenceListWrapper.getPreferences());
        return new RegionWidgetPreferenceListWrapper(regionWidgetPreferences);
    }
View Full Code Here

        regionWidgetApi = new RegionWidgetApi(regionWidgetService);
    }

    @Test
    public void replaceAllRegionWidgetPreferences_validParams() {
        RegionWidgetPreferenceListWrapper LIST_WRAPPER = new RegionWidgetPreferenceListWrapper(Arrays.asList( (RegionWidgetPreference)
                new RegionWidgetPreferenceImpl(), new RegionWidgetPreferenceImpl()
        ));

        expect(regionWidgetService.saveRegionWidgetPreferences(VALID_REGION_WIDGET_ID, LIST_WRAPPER.getPreferences())).
                andReturn(LIST_WRAPPER.getPreferences());
        replay(regionWidgetService);

        RegionWidgetPreferenceListWrapper result = regionWidgetApi.replaceAllRegionWidgetPreferences(VALID_REGION_WIDGET_ID,
                LIST_WRAPPER);

        verify(regionWidgetService);
        assertThat(result.getPreferences(), sameInstance(LIST_WRAPPER.getPreferences()));
    }
View Full Code Here

        assertThat(result.getPreferences(), sameInstance(LIST_WRAPPER.getPreferences()));
    }

    @Test(expected = IllegalArgumentException.class)
    public void replaceAllRegionWidgetPreferences_invalidParams() {
        RegionWidgetPreferenceListWrapper LIST_WRAPPER = new RegionWidgetPreferenceListWrapper(Arrays.asList( (RegionWidgetPreference)
                new RegionWidgetPreferenceImpl(), new RegionWidgetPreferenceImpl()
        ));

        expect(regionWidgetService.saveRegionWidgetPreferences(INVALID_REGION_WIDGET_ID, LIST_WRAPPER.getPreferences())).
                andThrow(new IllegalArgumentException());
        replay(regionWidgetService);

        regionWidgetApi.replaceAllRegionWidgetPreferences(INVALID_REGION_WIDGET_ID, LIST_WRAPPER);
    }
View Full Code Here

        regionWidgetApi = new RegionWidgetApi(regionWidgetService);
    }

    @Test
    public void replaceAllRegionWidgetPreferences_validParams() {
        RegionWidgetPreferenceListWrapper LIST_WRAPPER = new RegionWidgetPreferenceListWrapper(Arrays.asList( (RegionWidgetPreference)
                new RegionWidgetPreferenceImpl(), new RegionWidgetPreferenceImpl()
        ));

        expect(regionWidgetService.saveRegionWidgetPreferences(VALID_REGION_WIDGET_ID, LIST_WRAPPER.getPreferences())).
                andReturn(LIST_WRAPPER.getPreferences());
        replay(regionWidgetService);

        RegionWidgetPreferenceListWrapper result = regionWidgetApi.replaceAllRegionWidgetPreferences(VALID_REGION_WIDGET_ID,
                LIST_WRAPPER);

        verify(regionWidgetService);
        assertThat(result.getPreferences(), sameInstance(LIST_WRAPPER.getPreferences()));
    }
View Full Code Here

        assertThat(result.getPreferences(), sameInstance(LIST_WRAPPER.getPreferences()));
    }

    @Test(expected = IllegalArgumentException.class)
    public void replaceAllRegionWidgetPreferences_invalidParams() {
        RegionWidgetPreferenceListWrapper LIST_WRAPPER = new RegionWidgetPreferenceListWrapper(Arrays.asList( (RegionWidgetPreference)
                new RegionWidgetPreferenceImpl(), new RegionWidgetPreferenceImpl()
        ));

        expect(regionWidgetService.saveRegionWidgetPreferences(INVALID_REGION_WIDGET_ID, LIST_WRAPPER.getPreferences())).
                andThrow(new IllegalArgumentException());
        replay(regionWidgetService);

        regionWidgetApi.replaceAllRegionWidgetPreferences(INVALID_REGION_WIDGET_ID, LIST_WRAPPER);
    }
View Full Code Here

                    regionWidgetPreferenceListWrapper);
        }

        List<RegionWidgetPreference> regionWidgetPreferences = regionWidgetService.saveRegionWidgetPreferences(
                regionWidgetId, regionWidgetPreferenceListWrapper.getPreferences());
        return new RegionWidgetPreferenceListWrapper(regionWidgetPreferences);
    }
View Full Code Here

        regionWidgetApi = new RegionWidgetApi(regionWidgetService);
    }

    @Test
    public void replaceAllRegionWidgetPreferences_validParams() {
        RegionWidgetPreferenceListWrapper LIST_WRAPPER = new RegionWidgetPreferenceListWrapper(Arrays.asList(
                new RegionWidgetPreference(), new RegionWidgetPreference()
        ));

        expect(regionWidgetService.saveRegionWidgetPreferences(VALID_REGION_WIDGET_ID, LIST_WRAPPER.getPreferences())).
                andReturn(LIST_WRAPPER.getPreferences());
        replay(regionWidgetService);

        RegionWidgetPreferenceListWrapper result = regionWidgetApi.replaceAllRegionWidgetPreferences(VALID_REGION_WIDGET_ID,
                LIST_WRAPPER);

        verify(regionWidgetService);
        assertThat(result.getPreferences(), CoreMatchers.sameInstance(LIST_WRAPPER.getPreferences()));
    }
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.web.model.RegionWidgetPreferenceListWrapper

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.