commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/jelly/jelly-tags/swing/src/test/org/apache/commons/jelly/swing TestSwingTags.java
Date Wed, 08 Sep 2004 06:45:38 GMT
dion        2004/09/07 23:45:38

  Modified:    jelly/jelly-tags/swing/src/test/org/apache/commons/jelly/swing
                        TestSwingTags.java
  Log:
  Handle gump being headless
  
  Revision  Changes    Path
  1.7       +12 -0     jakarta-commons/jelly/jelly-tags/swing/src/test/org/apache/commons/jelly/swing/TestSwingTags.java
  
  Index: TestSwingTags.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/swing/src/test/org/apache/commons/jelly/swing/TestSwingTags.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestSwingTags.java	8 Sep 2004 06:39:00 -0000	1.6
  +++ TestSwingTags.java	8 Sep 2004 06:45:38 -0000	1.7
  @@ -57,6 +57,7 @@
        * @throws Exception
        */
       public void testBasicComponentFunctions() throws Exception {
  +        if (!isAWTAvailable()) return;
           runSwingScript("test.simple");
           JellyContext context = getJellyContext();
           JFrame frame = (JFrame) context.getVariable("frame");
  @@ -74,6 +75,7 @@
        * @throws Exception
        */
       public void testGridBagBasic() throws Exception {
  +        if (!isAWTAvailable()) return;
           runSwingScript("test.gbc");
           JellyContext context = getJellyContext();
           JFrame frame = (JFrame) context.getVariable("frame");
  @@ -104,6 +106,7 @@
       }
       
       public void testGridBag14() throws Exception {
  +        if (!isAWTAvailable()) return;
           if (System.getProperty("java.version").startsWith("1.4")) {
               runSwingScript("test.gbc14");
               JellyContext context = getJellyContext();
  @@ -117,6 +120,7 @@
       }
       
       public void testGridBagFail(){
  +        if (!isAWTAvailable()) return;
           try {
               runSwingScript("test.gbcBad");
           } catch (Exception e) {
  @@ -127,6 +131,7 @@
       }
       
       public void testButtonGroup() throws Exception {
  +        if (!isAWTAvailable()) return;
           runSwingScript("test.buttonGroup");
           JellyContext context = getJellyContext();
           ButtonGroup bg = (ButtonGroup) context.getVariable("bg");
  @@ -161,5 +166,12 @@
           }
           
           throw new Exception("Component " + name + " not found in container " + container);
  +    }
  +    
  +    /**
  +     * @return true if we are running with AWT present
  +     */
  +    private boolean isAWTAvailable() {
  +        return Boolean.getBoolean("java.awt.headless");
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message