Package org.graylog2.plugin.inputs

Examples of org.graylog2.plugin.inputs.Converter.convert()


    @Test
    public void testConvert() throws Exception {
        Converter hc = new NumericConverter(new HashMap<String, Object>());

        assertNull(hc.convert(null));
        assertEquals("", hc.convert(""));
        assertEquals("lol no number", hc.convert("lol no number"));
        assertEquals(9001, hc.convert("9001"));
        assertEquals(2147483648L, hc.convert("2147483648"));
        assertEquals(10.4D, hc.convert("10.4"));
View Full Code Here


    @Test
    public void testConvert() throws Exception {
        Converter hc = new NumericConverter(new HashMap<String, Object>());

        assertNull(hc.convert(null));
        assertEquals("", hc.convert(""));
        assertEquals("lol no number", hc.convert("lol no number"));
        assertEquals(9001, hc.convert("9001"));
        assertEquals(2147483648L, hc.convert("2147483648"));
        assertEquals(10.4D, hc.convert("10.4"));
        assertEquals(Integer.class, hc.convert("4").getClass());
View Full Code Here

    public void testConvert() throws Exception {
        Converter hc = new NumericConverter(new HashMap<String, Object>());

        assertNull(hc.convert(null));
        assertEquals("", hc.convert(""));
        assertEquals("lol no number", hc.convert("lol no number"));
        assertEquals(9001, hc.convert("9001"));
        assertEquals(2147483648L, hc.convert("2147483648"));
        assertEquals(10.4D, hc.convert("10.4"));
        assertEquals(Integer.class, hc.convert("4").getClass());
    }
View Full Code Here

        Converter hc = new NumericConverter(new HashMap<String, Object>());

        assertNull(hc.convert(null));
        assertEquals("", hc.convert(""));
        assertEquals("lol no number", hc.convert("lol no number"));
        assertEquals(9001, hc.convert("9001"));
        assertEquals(2147483648L, hc.convert("2147483648"));
        assertEquals(10.4D, hc.convert("10.4"));
        assertEquals(Integer.class, hc.convert("4").getClass());
    }
View Full Code Here

        assertNull(hc.convert(null));
        assertEquals("", hc.convert(""));
        assertEquals("lol no number", hc.convert("lol no number"));
        assertEquals(9001, hc.convert("9001"));
        assertEquals(2147483648L, hc.convert("2147483648"));
        assertEquals(10.4D, hc.convert("10.4"));
        assertEquals(Integer.class, hc.convert("4").getClass());
    }

}
View Full Code Here

        assertNull(hc.convert(null));
        assertEquals("", hc.convert(""));
        assertEquals("lol no number", hc.convert("lol no number"));
        assertEquals(9001, hc.convert("9001"));
        assertEquals(2147483648L, hc.convert("2147483648"));
        assertEquals(10.4D, hc.convert("10.4"));
        assertEquals(Integer.class, hc.convert("4").getClass());
    }

}
View Full Code Here

        assertEquals("", hc.convert(""));
        assertEquals("lol no number", hc.convert("lol no number"));
        assertEquals(9001, hc.convert("9001"));
        assertEquals(2147483648L, hc.convert("2147483648"));
        assertEquals(10.4D, hc.convert("10.4"));
        assertEquals(Integer.class, hc.convert("4").getClass());
    }

}
View Full Code Here

    @Test
    public void testConvert() throws Exception {
        Converter c = new FlexibleDateConverter(new HashMap<String, Object>());

        assertNull(c.convert(null));
        assertEquals(null, c.convert(""));
        assertEquals(null, c.convert("foo"));

        // Using startsWith here to avoid time zone problems in tests.
        assertTrue(c.convert("2014-3-12").toString().startsWith("2014-03-12T"));
View Full Code Here

    @Test
    public void testConvert() throws Exception {
        Converter c = new FlexibleDateConverter(new HashMap<String, Object>());

        assertNull(c.convert(null));
        assertEquals(null, c.convert(""));
        assertEquals(null, c.convert("foo"));

        // Using startsWith here to avoid time zone problems in tests.
        assertTrue(c.convert("2014-3-12").toString().startsWith("2014-03-12T"));
        assertTrue(c.convert("2014-3-12 12:27").toString().startsWith("2014-03-12T12:27:00.000"));
View Full Code Here

    public void testConvert() throws Exception {
        Converter c = new FlexibleDateConverter(new HashMap<String, Object>());

        assertNull(c.convert(null));
        assertEquals(null, c.convert(""));
        assertEquals(null, c.convert("foo"));

        // Using startsWith here to avoid time zone problems in tests.
        assertTrue(c.convert("2014-3-12").toString().startsWith("2014-03-12T"));
        assertTrue(c.convert("2014-3-12 12:27").toString().startsWith("2014-03-12T12:27:00.000"));
        assertTrue(c.convert("Mar 12").toString().startsWith("2014-03-12T"));
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.