public boolean parse()

in mustella/src/main/java/mustella/MustellaResultsParser.java [80:210]


    public boolean parse() {
        boolean passed = true;

		LineNumberReader lnr;
		try {
			lnr = new LineNumberReader(new FileReader(file));
		} catch (FileNotFoundException fnfe) {
	        System.out.println("problem creating reader");
			return false;
		}

		String s;
		boolean scriptComplete = false;
		int numResults = 0;

		try {
			while ((s = lnr.readLine()) != null) {
				if (s.startsWith("RESULT: ")) {
					numResults++;
					int index = s.indexOf("result=") + 7;
					String result = s.substring(index, index + 4);
					if (!result.equals("pass")) {
						passed = false;
						index = s.indexOf("id=") + 3;
						int endIndex = s.indexOf(" ", index);
						result = s.substring(s.indexOf("id=") + 3, endIndex);
						System.out.println("test case " + result + " failed");
					}
				}
				else if (s.startsWith("OK: Root-level SWF loaded"))
				{
				}
				else if (s.startsWith("TestCase Start:"))
				{
				}
				else if (s.startsWith("requesting url:"))
				{
				}
				else if (s.startsWith("testComplete"))
				{
				}
				else if (s.startsWith("ScriptComplete:"))
				{
					scriptComplete = true;
				}
				else if (s.startsWith("Created new test output instance"))
				{
				}
				else if (s.startsWith("Send ScriptComplete"))
				{
				}
				else if (s.startsWith("Paused for"))
				{
				}
				else if (s.startsWith("Warning:"))
				{
				}
				else if (s.startsWith("LengthOfTestcases:"))
				{
				}		
				else if (s.startsWith("Created new test output"))
				{
				}		
				else if (s.startsWith("Send ScriptComplete"))
				{
				}		
				else if (s.startsWith("readPNG:requesting"))
				{
				}
				else if (s.startsWith("runid.properties ERROR handler with: [IOErrorEvent"))
				{
				}
				else if (s.startsWith("[IOErrorEvent type=\"ioError\"") && s.contains("localhost:9999/ScriptComplete"))
				{
				}
                else if (s.startsWith("Connection to http://localhost:9999/step_timeout halted"))
                {
                }
                else if (s.startsWith("Error: Request for resource at http://localhost:9999/step_timeout"))
                {
                }
                else if (s.startsWith("*** Security Sandbox Violation ***"))
                {
                }
                else if (s.startsWith("Warning: HTTP send request error,"))
                {
                }
                else if (s.startsWith("Warning: Failed to load policy file from http://localhost:9999/crossdomain.xml"))
                {
                }
				else if (s.startsWith("Avertissement"))
				{
				}
                else if (s.contains("not implemented"))
                {
                }
                else if (s.contains("runid.properties"))
                {
                }
                else if (s.contains("Security sandbox"))
                {
                }
                else if (s.contains("Security Sandbox"))
                {
                }
				else if (s.trim().equals(""))
				{
				}
				else
				{
					System.out.println("Unexpected Trace: " + s);
					passed = false;
				}
			}
		} catch (IOException e) {
	        System.out.println("ioerror");
		}

		if (numResults == 0)
		{
	        System.out.println("No results.  Is trace output enabled?");
			passed = false;
		}
		else if (!scriptComplete)
		{
	        System.out.println("Script did not complete");
			passed = false;
		}

        return passed;
    }