Examples of Bar


Examples of com.google.gwt.uibinder.test.client.UiRendererUi.Bar

    assertEquals("four", fooReceiver.secondExtraParam);

    Element nameSpan = UiRendererUi.getRenderer().getNameSpan(uiRoot);
    NativeEvent eventAtNameSpan = createMockNativeEvent(nameSpan, "click");
    fooReceiver = new MockFooReceiver();
    UiRendererUi.getRenderer().onBrowserEvent(barReceiver, eventAtNameSpan, uiRoot, new Bar(5), 6);

    assertEquals(1, barReceiver.handlerCalled);
    assertEquals("click", barReceiver.event.getAssociatedType().getName());
    assertEquals(uiRoot, barReceiver.root);
    assertEquals(5, barReceiver.firstExtraParam.baz.intValue());
View Full Code Here

Examples of com.j256.ormlite.stmt.QueryBuilderTest.Bar

  @Test
  public void testSimpleJoin() throws Exception {
    Dao<Bar, Integer> barDao = createDao(Bar.class, true);
    Dao<Baz, Integer> bazDao = createDao(Baz.class, true);

    Bar bar1 = new Bar();
    bar1.val = 2234;
    assertEquals(1, barDao.create(bar1));
    Bar bar2 = new Bar();
    bar2.val = 324322234;
    assertEquals(1, barDao.create(bar2));

    Baz baz1 = new Baz();
    baz1.bar = bar1;
View Full Code Here

Examples of com.netflix.astyanax.entitystore.SampleEntity.Bar

    Foo foo = new Foo(prng.nextInt(), RandomStringUtils.randomAlphanumeric(4));
    entity.setFoo(foo);
    BarBar barbar = new BarBar();
    barbar.i = prng.nextInt();
    barbar.s = RandomStringUtils.randomAlphanumeric(4);
    Bar bar = new Bar();
    bar.i = prng.nextInt();
    bar.s = RandomStringUtils.randomAlphanumeric(4);
    bar.barbar = barbar;
    entity.setBar(bar);
    return entity;
View Full Code Here

Examples of com.opensymphony.xwork2.util.Bar

        String value = "asdf:123";
        Object o = converter.convertValue(ognlStackContext, action.getModel(), null, "barObj", value, Bar.class);
        assertNotNull(o);
        assertTrue("class is: " + o.getClass(), o instanceof Bar);

        Bar b = (Bar) o;
        assertEquals(value, b.getTitle() + ":" + b.getSomethingElse());
    }
View Full Code Here

Examples of com.opensymphony.xwork2.util.Bar

        // the converter needs to be registered as the Bar.class converter
        // it won't be detected from the Foo-conversion.properties
        // because the Foo-conversion.properties file is only used when converting a property of Foo
        converter.registerConverter(Bar.class.getName(), new FooBarConverter());

        Bar bar = (Bar) converter.convertValue(null, null, null, null, "blah:123", Bar.class);
        assertNotNull("conversion failed", bar);
        assertEquals(123, bar.getSomethingElse());
        assertEquals("blah", bar.getTitle());
    }
View Full Code Here

Examples of com.opensymphony.xwork2.util.Bar

public class FooBarConverter extends DefaultTypeConverter {

    @Override
    public Object convertValue(Map<String, Object> context, Object value, Class toType) {
        if (toType == String.class) {
            Bar bar = (Bar) value;

            return bar.getTitle() + ":" + bar.getSomethingElse();
        } else if (toType == Bar.class) {
            String valueStr = (String) value;
            int loc = valueStr.indexOf(":");
            String title = valueStr.substring(0, loc);
            String rest = valueStr.substring(loc + 1);

            Bar bar = new Bar();
            bar.setTitle(title);
            bar.setSomethingElse(Integer.parseInt(rest));

            return bar;
        } else if (toType == Cat.class) {
            Cat cat = new Cat();
            cat.setName((String) value);
View Full Code Here

Examples of com.opensymphony.xwork2.util.Bar

        String value = "asdf:123";
        Object o = converter.convertValue(ognlStackContext, action.getModel(), null, "barObj", value, Bar.class);
        assertNotNull(o);
        assertTrue(o instanceof Bar);

        Bar b = (Bar) o;
        assertEquals(value, b.getTitle() + ":" + b.getSomethingElse());
    }
View Full Code Here

Examples of com.opensymphony.xwork2.util.Bar

        // the converter needs to be registered as the Bar.class converter
        // it won't be detected from the Foo-conversion.properties
        // because the Foo-conversion.properties file is only used when converting a property of Foo
        converter.registerConverter(Bar.class.getName(), new FooBarConverter());

        Bar bar = (Bar) converter.convertValue(null, null, null, null, "blah:123", Bar.class);
        assertNotNull("conversion failed", bar);
        assertEquals(123, bar.getSomethingElse());
        assertEquals("blah", bar.getTitle());
    }
View Full Code Here

Examples of com.opensymphony.xwork2.util.Bar

            });
            setUp();
        } finally {
            Thread.currentThread().setContextClassLoader(cl);
        }
        Bar bar = (Bar) converter.convertValue(null, null, null, null, "blah:123", Bar.class);
        assertNotNull("conversion failed", bar);
        assertEquals(123, bar.getSomethingElse());
        assertEquals("blah", bar.getTitle());
    }
View Full Code Here

Examples of com.opensymphony.xwork2.util.Bar

        Class clazz2 = (Class) converter.convertValue(context, "com.opensymphony.xwork2.util.Bar", Class.class);
        assertEquals(Bar.class.getName(), clazz2.getName());

        assertEquals(OgnlRuntime.NoConversionPossible, converter.convertValue(context, "com.opensymphony.xwork2.util.IDoNotExist", Class.class));

        assertEquals(OgnlRuntime.NoConversionPossible, converter.convertValue(context, new Bar(), Class.class)); // only supports string values
    }
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.