Package java.applet

Examples of java.applet.AppletContext


    driver = new JAppletDriver(robot, target);
  }

  @Test
  public void should_get_applet_context() {
    AppletContext context = mock(AppletContext.class);
    when(target.getAppletContext()).thenReturn(context);
    assertThat(driver.getAppletContext()).isSameAs(context);
  }
View Full Code Here


    assertThat(driver.isActive());
  }

  @Test
  public void should_get_applet() {
    AppletContext context = mock(AppletContext.class);
    Applet applet = mock(Applet.class);
    String name = "applet";
    when(target.getAppletContext()).thenReturn(context);
    when(context.getApplet(name)).thenReturn(applet);
    assertThat(driver.getApplet(name)).isSameAs(applet);
  }
View Full Code Here

  }

  @Test
  @SuppressWarnings("unchecked")
  public void should_get_applets() {
    AppletContext context = mock(AppletContext.class);
    Enumeration<Applet> applets = mock(Enumeration.class);
    when(target.getAppletContext()).thenReturn(context);
    when(context.getApplets()).thenReturn(applets);
    assertThat(driver.getApplets()).isSameAs(applets);
  }
View Full Code Here

* @author Alex Ruiz
*/
public class JAppletDriver_getAppletContext_Test extends JAppletDriver_TestCase {
  @Test
  public void should_return_AppletContext() {
    AppletContext context = singletonAppletContextMock();
    applet().updateAppletContext(context);
    AppletContext result = driver().getAppletContext(applet());
    assertThat(result).isSameAs(context);
    assertThat(applet().wasMethodCalledInEDT("getAppletContext")).isTrue();
  }
View Full Code Here

            sb.append(");");

            this.logger.warning("Trying dirty fallback, calling : " + sb.toString());

            try {
                final AppletContext appletContext = getAppletContext();
                appletContext.showDocument(new URL(sb.toString()));
            } catch (final MalformedURLException e) {
                e.printStackTrace();
            }

            return null;
View Full Code Here

        // if we are running in an application then send the message to the parent application
        if (parentApplication != null) {
            parentApplication.reportStatus(status);
        } else {
            // otherwise get the applet context and send the message to the browser
            AppletContext ctx = this.getAppletContext();
            ctx.showStatus(status);
        }
        waitForNexTick = true;
    }
View Full Code Here

            /*
             *  if this is running as an applet then get the applet context (a handle on
             *  the web browser hosting the applet)
             */
            if (parentApplication == null) {
                AppletContext ctx = getAppletContext();
                ctx.showDocument(url, title);
            } else {
                /*
                 * otherwise the applet is hosted by an application so create a new
                 * web browser process and pass it the URL we want displayed
                 */
 
View Full Code Here

            }
        };
    }

    private static AppletContext getStubAppletContext(final Applet target) {
        return new AppletContext() {
            public AudioClip getAudioClip(URL url) {
                return null;
            }

            public synchronized Image getImage(URL url) {
View Full Code Here

            }
        };
    }

    private static AppletContext getStubAppletContext(final Applet target) {
        return new AppletContext() {
            public AudioClip getAudioClip(URL url) {
                return null;
            }

            public synchronized Image getImage(URL url) {
View Full Code Here

            }
        };
    }

    private static AppletContext getStubAppletContext(final Applet target) {
        return new AppletContext() {
            public AudioClip getAudioClip(URL url) {
                return null;
            }

            public synchronized Image getImage(URL url) {
View Full Code Here

TOP

Related Classes of java.applet.AppletContext

Copyright © 2018 www.massapicom. 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.