Examples of Variety


Examples of com.asakusafw.testdriver.testing.model.Variety

     * Test method for {@link DefaultDataModelDefinition#toReflection(java.lang.Object)}.
     */
    @Test
    public void toReflection() {
        DefaultDataModelDefinition<Variety> def = new DefaultDataModelDefinition<Variety>(Variety.class);
        Variety object = new Variety();
        object.setPInt(100);
        object.setPLong(200);
        object.setPByte((byte) 127);
        object.setPShort((short) 300);
        object.setPFloat(1.5f);
        object.setPDouble(2.5d);
        object.setPDecimal(new BigDecimal("3.141592"));
        object.setPTextAsString("Hello, world!");
        object.setPBoolean(true);
        object.setPDate(new Date(2011, 5, 2));
        object.setPDatetime(new DateTime(2011, 12, 31, 23, 59, 59));

        DataModelReflection ref = def.toReflection(object);
        assertThat(ref.getValue(p("p_int")), is((Object) 100));
        assertThat(ref.getValue(p("p_long")), is((Object) 200L));
        assertThat(ref.getValue(p("p_byte")), is((Object) (byte) 127));
View Full Code Here

Examples of com.asakusafw.testdriver.testing.model.Variety

     * Test method for {@link DefaultDataModelDefinition#toObject(com.asakusafw.testdriver.core.DataModelReflection)}.
     */
    @Test
    public void toObject() {
        DefaultDataModelDefinition<Variety> def = new DefaultDataModelDefinition<Variety>(Variety.class);
        Variety object = new Variety();
        object.setPInt(100);
        object.setPLong(200);
        object.setPByte((byte) 127);
        object.setPShort((short) 300);
        object.setPFloat(1.5f);
        object.setPDouble(2.5d);
        object.setPByte((byte) 127);
        object.setPDecimal(new BigDecimal("3.141592"));
        object.setPTextAsString("Hello, world!");
        object.setPBoolean(true);
        object.setPDate(new Date(2011, 5, 2));
        object.setPDatetime(new DateTime(2011, 12, 31, 23, 59, 59));

        DataModelReflection ref = def.toReflection(object);
        Variety restored = def.toObject(ref);
        assertThat(restored, not(sameInstance(object)));
        assertThat(restored, equalTo(object));
    }
View Full Code Here

Examples of com.github.variety.Variety

    private Variety variety;

    @Before
    public void setUp() throws Exception {
        this.variety = new Variety("test", "users");
        variety.getSourceCollection().insert(SampleData.getDocuments());
    }
View Full Code Here

Examples of com.github.variety.Variety

    /**
     * Verify, that variety recognizes unknown or empty collection and exists. In stdout should be recorded reason.
     */
    @Test
    public void testUnknownCollectionResponse() throws Exception {
        this.variety = new Variety("test", "--unknown--");
        try {
            variety.runAnalysis();
            Assert.fail("It should throw exception");
        } catch (final RuntimeException e) {
            Assert.assertTrue(e.getMessage().contains("does not exist or is empty"));
View Full Code Here

Examples of com.github.variety.Variety

    private static final double EXPECTED_PERCENTS = 100;
    private Variety variety;

    @Before
    public void setUp() throws Exception {
        variety = new Variety("test", "users");
        variety.getSourceCollection().insert((DBObject) JSON.parse("{name:'Walter', someNestedObject:{a:{b:{c:{d:{e:1}}}}}})"));

    }
View Full Code Here

Examples of com.github.variety.Variety

    private Variety variety;

    @Before
    public void setUp() throws Exception {
        this.variety = new Variety("test", "users");
        variety.getSourceCollection().insert(SampleData.getDocuments());
    }
View Full Code Here

Examples of com.github.variety.Variety

    private Variety variety;

    @Before
    public void setUp() throws Exception {
        variety = new Variety("test", "users");
        variety.getSourceCollection().insert(SampleData.getDocuments());
    }
View Full Code Here

Examples of com.github.variety.Variety

public class QueryLimitedAnalysisTest {
    private Variety variety;

    @Before
    public void setUp() throws Exception {
        variety = new Variety("test", "users");
        variety.getSourceCollection().insert(SampleData.getDocuments());
    }
View Full Code Here

Examples of com.github.variety.Variety

    private Variety variety;

    @Before
    public void setUp() throws Exception {
        this.variety = new Variety("test", "users");
        variety.getSourceCollection().insert(new BasicDBObject()
            .append("key_string", "Just plain String")
            .append("key_boolean", true)
            .append("key_number", 1)
            .append("key_date", new Date())
View Full Code Here

Examples of com.github.variety.Variety

    private Variety variety;

    @Before
    public void setUp() throws Exception {
        this.variety = new Variety("test", "users");
        variety.getSourceCollection().insert(SampleData.getDocuments());
    }
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.