Examples of printError()


Examples of org.apache.webbeans.test.component.specializes.logger.ISomeLogger.printError()

       
        ISomeLogger logger = injector.logger();
       
        Assert.assertTrue(logger instanceof MockSpecializedLogger);
       
        logger.printError("Hello World");
       
        MockSpecializedLogger sysLogger = (MockSpecializedLogger)logger;
       
        Assert.assertEquals("Hello World", sysLogger.getMessage());
       
View Full Code Here

Examples of org.apache.webbeans.test.component.specializes.logger.ISomeLogger.printError()

       
        ISomeLogger logger = injector.logger();
       
        Assert.assertTrue(logger instanceof SystemLogger);
       
        logger.printError("Hello World");
       
        SystemLogger sysLogger = (SystemLogger)logger;
       
        Assert.assertEquals("Hello World", sysLogger.getMessage());
       
View Full Code Here

Examples of org.apache.webbeans.test.component.specializes.logger.ISomeLogger.printError()

       
        ISomeLogger logger = injector.logger();
       
        Assert.assertTrue(logger instanceof MockSpecializedLogger);
       
        logger.printError("Hello World");
       
        MockSpecializedLogger sysLogger = (MockSpecializedLogger)logger;
       
        Assert.assertEquals("Hello World", sysLogger.getMessage());
       
View Full Code Here

Examples of org.bukkit.entity.Player.printError()

            if(sign.hasChanged())
                sign.update(false);
        } else {
            event.getPlayer().setFireTicks(getMultiplier(sign)+40);
            LocalPlayer player = CraftBookPlugin.inst().wrapPlayer(event.getPlayer());
            player.printError("mech.cook.ouch");
        }
    }

    @EventHandler(priority = EventPriority.HIGH)
    public void onBlockDestroy(BlockBreakEvent event) {
View Full Code Here

Examples of org.jruby.IRuby.printError()

                    if (status != null) {
                        System.exit(RubyNumeric.fix2int(status));
                    }
                } else {
                    runtime.printError(raisedException);
                    System.exit(1);
                }
            } else if (je.getJumpType() == JumpException.JumpType.ThrowJump) {
                runtime.printError((RubyException)je.getTertiaryData());
                System.exit(1);
View Full Code Here

Examples of org.jruby.Ruby.printError()

            RubyString.newString(ruby, "Line 1"),
            RubyString.newString(ruby, "Line 2"),
        };
        RubyArray backtrace = RubyArray.newArray(ruby, Arrays.asList(lines));
        exception.set_backtrace(backtrace);
        ruby.printError(exception);
        assertEquals("Line 1: A message (NameError)\n\tfrom Line 2\n", err.toString());
    }
   
    public void testPrintErrorShouldOnlyPrintErrorMessageWhenBacktraceIsNil() {
        final ByteArrayOutputStream err = new ByteArrayOutputStream();
View Full Code Here

Examples of org.jruby.Ruby.printError()

        RubyInstanceConfig config = new RubyInstanceConfig() {{
            setInput(System.in); setOutput(System.out); setError(new PrintStream(err)); setObjectSpaceEnabled(false);
        }};
        Ruby ruby = Ruby.newInstance(config);
        RubyException exception = (RubyException)runtime.getClass("NameError").newInstance(ruby.getCurrentContext(), new IRubyObject[]{ruby.newString("A message")},  Block.NULL_BLOCK);
        ruby.printError(exception);
        //        assertEquals(":[0,0]:[0,7]: A message (NameError)\n", err.toString());
    }
}
View Full Code Here

Examples of org.jruby.Ruby.printError()

            RubyString.newString(ruby, "Line 1"),
            RubyString.newString(ruby, "Line 2"),
        };
        RubyArray backtrace = RubyArray.newArray(ruby, Arrays.<IRubyObject>asList(lines));
        exception.set_backtrace(backtrace);
        ruby.printError(exception);
        assertEquals("Line 1: A message (NameError)\n\tfrom Line 2\n", err.toString());
    }
   
    public void testPrintErrorShouldOnlyPrintErrorMessageWhenBacktraceIsNil() {
        final ByteArrayOutputStream err = new ByteArrayOutputStream();
View Full Code Here

Examples of org.jruby.Ruby.printError()

            setInput(System.in); setOutput(System.out); setError(new PrintStream(err)); setObjectSpaceEnabled(false);
            setTraceType(TraceType.traceTypeFor("mri"));
        }};
        Ruby ruby = Ruby.newInstance(config);
        RubyException exception = (RubyException)runtime.getClass("NameError").newInstance(ruby.getCurrentContext(), new IRubyObject[]{ruby.newString("A message")},  Block.NULL_BLOCK);
        ruby.printError(exception);
        //        assertEquals(":[0,0]:[0,7]: A message (NameError)\n", err.toString());
    }
}
View Full Code Here

Examples of org.jruby.Ruby.printError()

                    return new EmbedEvalUnitImpl(container, node, scope);
                }
            }
            return new EmbedEvalUnitImpl(container, node, scope);
        } catch (RaiseException e) {
            runtime.printError(e.getException());
            throw new ParseFailedException(e.getMessage(), e);
        } catch (Throwable e) {
            Writer w = container.getErrorWriter();
            if (w instanceof PrintWriter) {
                e.printStackTrace((PrintWriter)w);
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.