Examples of AlwaysLockedVaadinSession


Examples of com.vaadin.tests.util.AlwaysLockedVaadinSession

        assertEquals(1982739187239L, tf.getConvertedValue());
        assertEquals(1982739187239L, tf.getPropertyDataSource().getValue());
    }

    public void testDefaultNumberConversion() {
        VaadinSession app = new AlwaysLockedVaadinSession(null);
        VaadinSession.setCurrent(app);
        TextField tf = new TextField();
        tf.setLocale(new Locale("en", "US"));
        tf.setPropertyDataSource(new MethodProperty<Integer>(paulaBean,
                "salary"));
View Full Code Here

Examples of com.vaadin.tests.util.AlwaysLockedVaadinSession

        assertEquals("abc", tf.getPropertyDataSource().getValue());
        assertEquals("abc", paulaBean.getFirstName());
    }

    public void testNonmodifiedBufferedFieldConversion() {
        VaadinSession.setCurrent(new AlwaysLockedVaadinSession(null));
        TextField tf = new TextField("salary");
        tf.setBuffered(true);
        tf.setLocale(new Locale("en", "US"));
        ObjectProperty<Integer> ds = new ObjectProperty<Integer>(123456789);
        tf.setPropertyDataSource(ds);
View Full Code Here

Examples of com.vaadin.tests.util.AlwaysLockedVaadinSession

                tf.getValue());

    }

    public void testModifiedBufferedFieldConversion() {
        VaadinSession.setCurrent(new AlwaysLockedVaadinSession(null));
        TextField tf = new TextField("salary");
        tf.setBuffered(true);
        tf.setLocale(new Locale("en", "US"));
        ObjectProperty<Integer> ds = new ObjectProperty<Integer>(123456789);
        tf.setPropertyDataSource(ds);
View Full Code Here

Examples of com.vaadin.tests.util.AlwaysLockedVaadinSession

        assertEquals(42, tf.getPropertyDataSource().getValue());
        assertEquals("42", tf.getValue());
    }

    public void testChangeReadOnlyFieldLocale() {
        VaadinSession.setCurrent(new AlwaysLockedVaadinSession(null));

        TextField tf = new TextField("salary");
        tf.setLocale(new Locale("en", "US"));
        ObjectProperty<Integer> ds = new ObjectProperty<Integer>(123456789);
        ds.setReadOnly(true);
View Full Code Here

Examples of com.vaadin.tests.util.AlwaysLockedVaadinSession

        }

    }

    public void testNumberDoubleConverterChange() {
        final VaadinSession a = new AlwaysLockedVaadinSession(null);
        VaadinSession.setCurrent(a);
        TextField tf = new TextField() {
            @Override
            public VaadinSession getSession() {
                return a;
View Full Code Here

Examples of com.vaadin.tests.util.AlwaysLockedVaadinSession

    @Before
    public void setUp() {
        control = EasyMock.createStrictControl();

        session = new AlwaysLockedVaadinSession(
                control.createMock(VaadinService.class));

        ui = new UI() {
            @Override
            protected void init(VaadinRequest request) {
View Full Code Here

Examples of com.vaadin.tests.util.AlwaysLockedVaadinSession

        }
    }

    public void testApplicationConverterFactoryInBackgroundThread() {
        VaadinSession.setCurrent(null);
        final VaadinSession appWithCustomIntegerConverter = new AlwaysLockedVaadinSession(
                null);
        appWithCustomIntegerConverter
                .setConverterFactory(new ConverterFactory42());

        TextField tf = new TextField("", "123") {
            @Override
            public VaadinSession getSession() {
View Full Code Here

Examples of com.vaadin.tests.util.AlwaysLockedVaadinSession

        // null
        assertEquals(42, tf.getConvertedValue());
    }

    public void testApplicationConverterFactoryForDetachedComponent() {
        final VaadinSession appWithCustomIntegerConverter = new AlwaysLockedVaadinSession(
                null);
        appWithCustomIntegerConverter
                .setConverterFactory(new ConverterFactory42());
        VaadinSession.setCurrent(appWithCustomIntegerConverter);

        TextField tf = new TextField("", "123");
        tf.setConverter(Integer.class);
View Full Code Here

Examples of com.vaadin.tests.util.AlwaysLockedVaadinSession

        // null
        assertEquals(42, tf.getConvertedValue());
    }

    public void testApplicationConverterFactoryForDifferentThanCurrentApplication() {
        final VaadinSession fieldAppWithCustomIntegerConverter = new AlwaysLockedVaadinSession(
                null);
        fieldAppWithCustomIntegerConverter
                .setConverterFactory(new ConverterFactory42());
        VaadinSession.setCurrent(new AlwaysLockedVaadinSession(null));

        TextField tf = new TextField("", "123") {
            @Override
            public VaadinSession getSession() {
                return fieldAppWithCustomIntegerConverter;
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.