|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.test.gui.web.util; import org.netbeans.jemmy.TimeoutExpiredException; import org.netbeans.jemmy.Waiter; import org.netbeans.web.test.util.StatusWaitable; import org.netbeans.jellytools.OutputWindowOperator; import java.util.HashSet; import java.io.File; public class CompilationUtils { private static String fSep = System.getProperty("file.separator"); private static String iSep = "|"; public CompilationUtils() { } public static String checkResultOfAppletCompilation(String node, String name) { String file = node.replace(iSep.charAt(0),fSep.charAt(0)) + fSep + name+".class"; String[] variants = {"Finished " + name + ".","Errors compiling " + name + ".", "Breakpoint reached"}; StatusWaitable csw = new StatusWaitable(variants, false); Waiter w = new Waiter(csw); try { w.waitAction(csw); } catch (InterruptedException e) { e.printStackTrace(); return("Exception while waiting compilation results:" + e); } catch (TimeoutExpiredException e1) { e1.printStackTrace(); return("Exception while waiting compilation results:" + e1); } (new OutputWindowOperator()).selectCompilerPage(); String text = (new OutputWindowOperator()).getText(); System.out.println("Current status is: " + csw.getStatus()); System.out.println("Current compiler text is : \"" + text + "\""); if(csw.getStatus().indexOf("Error")!=-1 | text.indexOf("WARNING:")!=-1) { return("ST: " + csw.getStatus()+ " OUT: " + text); } if(!(new File(file).exists())) { return("File " + file + " is NOT appears after compilation "); } return null; } } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.