Examples of MunitSuiteRunner


Examples of org.mule.munit.runner.mule.MunitSuiteRunner

        }
    }

    private MunitSuiteRunner buildRunnerFor(String fileName)
    {
        MunitSuiteRunner runner = new MunitSuiteRunner(fileName);
        NotificationListenerDecorator listener = new NotificationListenerDecorator();
        listener.addNotificationListener(new StreamNotificationListener(System.out));
        listener.addNotificationListener(buildFileNotificationListener(fileName));
        listener.addNotificationListener(buildXmlNotificationListener(fileName));
        runner.setNotificationListener(listener);
        return runner;
    }
View Full Code Here

Examples of org.mule.munit.runner.mule.MunitSuiteRunner

            requestSocket = new Socket("localhost", port);
            System.out.println("Connected to localhost in port " + port);
            out = new ObjectOutputStream(requestSocket.getOutputStream());
            out.flush();

            MunitSuiteRunner runner = new MunitSuiteRunner(resource);

            runner.setNotificationListener(new NotificationListener()
            {

                public void notifyStartOf(MunitTest test)
                {
                    try
                    {
                        out.writeObject("1;" + test.getName());
                        out.flush();
                    }
                    catch (IOException e)
                    {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }


                }

                public void notify(TestResult testResult)
                {
                    try
                    {
                        if (testResult.getError() != null)
                        {
                            out.writeObject("3;" + testResult.getTestName() + ";'" + testResult.getError().getFullMessage() + "'");
                            out.flush();
                        }
                        else if (testResult.getFailure() != null)
                        {
                            out.writeObject("2;" + testResult.getTestName() + ";'" + testResult.getFailure().getFullMessage() + "'");

                            out.flush();
                        }
                        else
                        {
                            out.writeObject("4;" + testResult.getTestName());
                            out.flush();
                        }

                    }
                    catch (IOException e)
                    {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }

                }

                @Override
                public void notifyEnd(SuiteResult result)
                {
                    // DO NOTHING
                    // TODO: FIX THIS
                }
            });
            out.writeObject("0;" + runner.getNumberOfTests());
            out.writeObject("5;" + path);
            runner.run();
        }
        catch (IOException ioException)
        {
            ioException.printStackTrace();
        }
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.