Package org.graylog2.plugin.database.validators

Examples of org.graylog2.plugin.database.validators.Validator.validate()


        assertFalse(v.validate(9001).passed());
        assertFalse(v.validate("").passed());
        assertFalse(v.validate(new java.util.Date()).passed());

        // Only joda datetime.
        assertTrue(v.validate(new org.joda.time.DateTime(DateTimeZone.UTC)).passed());

        // Only accepts UTC.
        assertFalse(v.validate(new org.joda.time.DateTime(DateTimeZone.forID("+09:00"))).passed());
    }
}
View Full Code Here


        // Only joda datetime.
        assertTrue(v.validate(new org.joda.time.DateTime(DateTimeZone.UTC)).passed());

        // Only accepts UTC.
        assertFalse(v.validate(new org.joda.time.DateTime(DateTimeZone.forID("+09:00"))).passed());
    }
}
View Full Code Here

    @Test
    public void testValidate() throws Exception {
        Validator v = new MapValidator();

        assertFalse(v.validate(null).passed());
        assertFalse(v.validate(new LinkedList<Integer>()).passed());
        assertFalse(v.validate(9001).passed());
        assertFalse(v.validate("foo").passed());

        Map<String, String> actuallyFilledMap = new TreeMap<String, String>();
View Full Code Here

    @Test
    public void testValidate() throws Exception {
        Validator v = new MapValidator();

        assertFalse(v.validate(null).passed());
        assertFalse(v.validate(new LinkedList<Integer>()).passed());
        assertFalse(v.validate(9001).passed());
        assertFalse(v.validate("foo").passed());

        Map<String, String> actuallyFilledMap = new TreeMap<String, String>();
        actuallyFilledMap.put("foo", "bar");
View Full Code Here

    public void testValidate() throws Exception {
        Validator v = new MapValidator();

        assertFalse(v.validate(null).passed());
        assertFalse(v.validate(new LinkedList<Integer>()).passed());
        assertFalse(v.validate(9001).passed());
        assertFalse(v.validate("foo").passed());

        Map<String, String> actuallyFilledMap = new TreeMap<String, String>();
        actuallyFilledMap.put("foo", "bar");
        actuallyFilledMap.put("lol", "wut");
View Full Code Here

        Validator v = new MapValidator();

        assertFalse(v.validate(null).passed());
        assertFalse(v.validate(new LinkedList<Integer>()).passed());
        assertFalse(v.validate(9001).passed());
        assertFalse(v.validate("foo").passed());

        Map<String, String> actuallyFilledMap = new TreeMap<String, String>();
        actuallyFilledMap.put("foo", "bar");
        actuallyFilledMap.put("lol", "wut");
View Full Code Here

        Map<String, String> actuallyFilledMap = new TreeMap<String, String>();
        actuallyFilledMap.put("foo", "bar");
        actuallyFilledMap.put("lol", "wut");

        assertTrue(v.validate(actuallyFilledMap).passed());
        assertTrue(v.validate(new HashMap<String, String>()).passed());
    }

}
View Full Code Here

        Map<String, String> actuallyFilledMap = new TreeMap<String, String>();
        actuallyFilledMap.put("foo", "bar");
        actuallyFilledMap.put("lol", "wut");

        assertTrue(v.validate(actuallyFilledMap).passed());
        assertTrue(v.validate(new HashMap<String, String>()).passed());
    }

}
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.