Examples of PortalPreferenceImpl


Examples of org.apache.rave.portal.model.impl.PortalPreferenceImpl

    @Test
    public void testSaveKeyValue_new() {
        final String key = "foo";
        final String value = "bar";
        PortalPreference fooBar = new PortalPreferenceImpl(key, value);
        PortalPreferenceImpl fooBarSaved = new PortalPreferenceImpl(key, value);

        expect(repository.getByKey(key)).andReturn(null).once();
        expect(repository.save(fooBar)).andReturn(fooBarSaved).once();

        replay(repository);
View Full Code Here

Examples of org.apache.rave.portal.model.impl.PortalPreferenceImpl

    @Test
    public void testSaveKeyValue_existing() {
        final String key = "foo";
        final String value = "bar";
        final String newValue = "baz";
        PortalPreferenceImpl fooBar = new PortalPreferenceImpl(key, value);
        PortalPreferenceImpl fooBarSaved = new PortalPreferenceImpl(key, newValue);
        expect(repository.getByKey(key)).andReturn(fooBar).once();
        expect(repository.save(fooBar)).andReturn(fooBarSaved).once();
        replay(repository);
        service.savePreference(key, value);
        verify(repository);
View Full Code Here

Examples of org.apache.rave.portal.model.impl.PortalPreferenceImpl

    public void testSaveKeyValues_new() {
        final String key = "foo";
        List<String> values = new ArrayList<String>();
        values.add("bar");
        values.add("baz");
        PortalPreference fooBar = new PortalPreferenceImpl(key, values);
        PortalPreferenceImpl fooBarSaved = new PortalPreferenceImpl(key, values);

        expect(repository.getByKey(key)).andReturn(null).once();
        expect(repository.save(fooBar)).andReturn(fooBarSaved).once();
        replay(repository);
        service.savePreference(key, values);
View Full Code Here

Examples of org.apache.rave.portal.model.impl.PortalPreferenceImpl

        values.add("bar");
        values.add("baz");
        List<String> newValues = new ArrayList<String>();
        values.add("bar2");
        values.add("baz2");
        PortalPreferenceImpl fooBar = new PortalPreferenceImpl(key, values);
        PortalPreferenceImpl fooBarSaved = new PortalPreferenceImpl(key, newValues);

        expect(repository.getByKey(key)).andReturn(fooBar).once();
        expect(repository.save(fooBar)).andReturn(fooBarSaved).once();
        replay(repository);
        service.savePreference(key, values);
View Full Code Here

Examples of org.apache.rave.portal.model.impl.PortalPreferenceImpl

    }

    @Test
    public void testSavePreference() {
        PortalPreference title = titlePreference();
        PortalPreferenceImpl savedTitle = new PortalPreferenceImpl("title", "Rave");

        expect(repository.save(title)).andReturn(savedTitle).once();
        replay(repository);

        service.savePreference(title);
View Full Code Here

Examples of org.apache.rave.portal.model.impl.PortalPreferenceImpl

        List<String> colors = new ArrayList<String>();
        colors.add("red");
        colors.add("yellow");
        colors.add("blue");
        PortalPreference colorPref = new PortalPreferenceImpl("colors", colors);

        List<PortalPreference> preferences = new ArrayList<PortalPreference>();
        preferences.add(title);
        preferences.add(colorPref);
View Full Code Here

Examples of org.apache.rave.portal.model.impl.PortalPreferenceImpl

        return preferences;
    }

    private static PortalPreference titlePreference() {
        return new PortalPreferenceImpl("title", "Rave");
    }
View Full Code Here

Examples of org.apache.rave.portal.model.impl.PortalPreferenceImpl

    @Override
    @Transactional
    public void savePreference(String key, List<String> values) {
        PortalPreference preference = getPreference(key);
        if (preference == null) {
            preference = new PortalPreferenceImpl(key, values);
        } else {
            preference.setValues(values);
        }
        this.savePreference(preference);
    }
View Full Code Here

Examples of org.apache.rave.portal.model.impl.PortalPreferenceImpl

    }


    @Test
    public void convertValid() {
        PortalPreference template = new PortalPreferenceImpl();
        template.setKey("KEY");
        template.setValue("VALUE");

        JpaPortalPreference jpaTemplate = converter.convert(template);

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaPortalPreference.class)));
        assertThat(jpaTemplate.getKey(), is(equalTo(template.getKey())));
        assertThat(jpaTemplate.getValue(), is(equalTo(template.getValue())));
    }
View Full Code Here

Examples of org.apache.rave.portal.model.impl.PortalPreferenceImpl

public class PortalPreferenceFormTest {
    private Map<String, PortalPreference> preferenceMap = new HashMap<String, PortalPreference>();

    @Before
    public void setUp() throws Exception {
        PortalPreference titlePref = new PortalPreferenceImpl(TITLE_SUFFIX, "Test portal");
        preferenceMap.put(TITLE_SUFFIX, titlePref);
        PortalPreference pageSizePref = new PortalPreferenceImpl(PAGE_SIZE, "20");
        preferenceMap.put(PAGE_SIZE, pageSizePref);
        PortalPreference javaScriptDebugMode = new PortalPreferenceImpl(JAVASCRIPT_DEBUG_MODE, "0");
        preferenceMap.put(JAVASCRIPT_DEBUG_MODE, javaScriptDebugMode);
        PortalPreference initialWidgetStatus = new PortalPreferenceImpl(INITIAL_WIDGET_STATUS, "PUBLISHED");
        preferenceMap.put(INITIAL_WIDGET_STATUS, initialWidgetStatus);
    }
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.