Package org.jpos.util

Examples of org.jpos.util.LogEvent


    }

    @Test
    public void testDefaultAbort() throws Throwable {
        BSHTransactionParticipant bSHTransactionParticipant = new BSHTransactionParticipant();
        bSHTransactionParticipant.defaultAbort(100L, new File("testBSHTransactionParticipantParam1"), new LogEvent());
        assertTrue("Test completed without Exception", true);
    }
View Full Code Here


    }

    @Test
    public void testDefaultCommit() throws Throwable {
        BSHTransactionParticipant bSHTransactionParticipant = new BSHTransactionParticipant();
        bSHTransactionParticipant.defaultCommit(100L, Long.valueOf(65L), new LogEvent("testBSHTransactionParticipantTag"));
        assertTrue("Test completed without Exception", true);
    }
View Full Code Here

    }

    @Test
    public void testDefaultPrepare() throws Throwable {
        BSHTransactionParticipant bSHTransactionParticipant = new BSHTransactionParticipant();
        int result = bSHTransactionParticipant.defaultPrepare(100L, new CharConversionException(), new LogEvent());
        assertEquals("result", 129, result);
    }
View Full Code Here

    @Test
    public void testExecuteMethod() throws Throwable {
        BSHTransactionParticipant bSHTransactionParticipant = new BSHTransactionParticipant();
        Object result = bSHTransactionParticipant.executeMethod(new BSHMethod("testBSHTransactionParticipantBshData", false), 100L,
                new StringBuffer(), new LogEvent("testBSHTransactionParticipantTag", Integer.valueOf(0)),
                "testBSHTransactionParticipantResultName");
        assertNull("result", result);
    }
View Full Code Here

    @Test
    public void testExecuteMethod2() throws Throwable {
        BSHTransactionParticipant bSHGroupSelector = new BSHGroupSelector();
        Boolean result = (Boolean) bSHGroupSelector.executeMethod(new BSHMethod("testBSHTransactionParticipantBshData", false),
                100L, new UnsupportedEncodingException(), new LogEvent("testBSHTransactionParticipantTag"), "bsh.evalOnly");
        assertTrue("result", result.booleanValue());
    }
View Full Code Here

    @Test
    public void testExecuteMethodThrowsEvalError() throws Throwable {
        BSHTransactionParticipant bSHGroupSelector = new BSHGroupSelector();
        try {
            bSHGroupSelector.executeMethod(new BSHMethod("testBSHTransactionParticipantBshData", false), 100L,
                    new CharConversionException(), new LogEvent(), "sh.evalOnly");
            fail("Expected EvalError to be thrown");
        } catch (EvalError ex) {
            assertEquals("ex.getMessage()", "Class or variable not found: sh.evalOnly", ex.getMessage());
            assertEquals("ex.getMessage()", "Class or variable not found: sh.evalOnly", ex.getMessage());
        }
View Full Code Here

    @Test
    public void testExecuteMethodThrowsFileNotFoundException() throws Throwable {
        BSHTransactionParticipant source = new BSHTransactionParticipant();
        try {
            source.executeMethod(new BSHMethod("testBSHTransactionParticipantBshData", true), 100L, new CharConversionException(),
                    new LogEvent(source, "testBSHTransactionParticipantTag"), "testBSHTransactionParticipantResultName");
            fail("Expected FileNotFoundException to be thrown");
        } catch (FileNotFoundException ex) {
            assertEquals("ex.getClass()", FileNotFoundException.class, ex.getClass());
        }
    }
View Full Code Here

    @Test
    public void testExecuteMethodThrowsNullPointerException() throws Throwable {
        BSHTransactionParticipant bSHTransactionParticipant = new BSHTransactionParticipant();
        try {
            bSHTransactionParticipant.executeMethod(null, 100L, new StringBuffer(), new LogEvent("testBSHTransactionParticipantTag",
                    Integer.valueOf(0)), "testBSHTransactionParticipantResultName");
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
        }
View Full Code Here

    @Test
    public void testExecuteMethodThrowsParseException() throws Throwable {
        BSHTransactionParticipant bSHTransactionParticipant = new BSHTransactionParticipant();
        try {
            bSHTransactionParticipant.executeMethod(new BSHMethod("\u000E\u0019\u0003/\u0008Tz<|p", false), 100L,
                    new CharConversionException(), new LogEvent("testBSHTransactionParticipantTag", new Object()),
                    "testBSHTransactionParticipantResultName");
            fail("Expected ParseException to be thrown");
        } catch (ParseException ex) {
            assertThat(ex.getMessage(), allOf(notNullValue(), containsString("line 1, column 4")));
        }
View Full Code Here

    @Test
    public void testLog() throws Throwable {
        BSHLogListener bSHLogListener = new BSHLogListener();
        Configuration cfg = new SimpleConfiguration(new Properties());
        bSHLogListener.setConfiguration(cfg);
        LogEvent ev = new LogEvent("testBSHLogListenerTag");
        ev.setSource(new LogChannel());
        LogEvent result = bSHLogListener.log(ev);
        assertSame("result", ev, result);
        assertSame("bSHLogListener.cfg", cfg, bSHLogListener.cfg);
    }
View Full Code Here

TOP

Related Classes of org.jpos.util.LogEvent

Copyright © 2018 www.massapicom. 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.