< prev index next >

test/jdk/javax/swing/text/View/8080972/TestObjectView.java

Print this page




  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 import java.awt.Color;
  24 import java.awt.Component;
  25 import java.util.Enumeration;
  26 import javax.swing.JComponent;
  27 import javax.swing.SwingUtilities;
  28 import javax.swing.text.AttributeSet;
  29 import javax.swing.text.Document;
  30 import javax.swing.text.Element;
  31 import javax.swing.text.html.HTML;
  32 import javax.swing.text.html.ObjectView;
  33 /*
  34  * @test
  35  * @bug 8080972 8169887
  36  * @summary Audit Core Reflection in module java.desktop for places that will
  37  *          require changes to work with modules
  38  * @author Alexander Scherbatiy

  39  */
  40 
  41 public class TestObjectView {
  42 
  43     public static void main(String[] args) throws Exception {
  44         SwingUtilities.invokeAndWait(TestObjectView::testObjectView);
  45         System.setSecurityManager(new SecurityManager());
  46         SwingUtilities.invokeAndWait(TestObjectView::testObjectView);
  47     }
  48 
  49     private static void testObjectView() {
  50 
  51         UserObjectView objectView = new UserObjectView(new UserElement());
  52 
  53         Component comp = objectView.createComponent();
  54 
  55         if (!(comp instanceof UserJComponent)) {
  56             throw new RuntimeException("Component is not UserJComponent!");
  57         }
  58     }




  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 import java.awt.Color;
  24 import java.awt.Component;
  25 import java.util.Enumeration;
  26 import javax.swing.JComponent;
  27 import javax.swing.SwingUtilities;
  28 import javax.swing.text.AttributeSet;
  29 import javax.swing.text.Document;
  30 import javax.swing.text.Element;
  31 import javax.swing.text.html.HTML;
  32 import javax.swing.text.html.ObjectView;
  33 /*
  34  * @test
  35  * @bug 8080972 8169887
  36  * @summary Audit Core Reflection in module java.desktop for places that will
  37  *          require changes to work with modules
  38  * @author Alexander Scherbatiy
  39  * @run main/othervm TestObjectView
  40  */
  41 
  42 public class TestObjectView {
  43 
  44     public static void main(String[] args) throws Exception {
  45         SwingUtilities.invokeAndWait(TestObjectView::testObjectView);
  46         System.setSecurityManager(new SecurityManager());
  47         SwingUtilities.invokeAndWait(TestObjectView::testObjectView);
  48     }
  49 
  50     private static void testObjectView() {
  51 
  52         UserObjectView objectView = new UserObjectView(new UserElement());
  53 
  54         Component comp = objectView.createComponent();
  55 
  56         if (!(comp instanceof UserJComponent)) {
  57             throw new RuntimeException("Component is not UserJComponent!");
  58         }
  59     }


< prev index next >