diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 16:51:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 16:51:28 +0000 |
commit | 940b4d1848e8c70ab7642901a68594e8016caffc (patch) | |
tree | eb72f344ee6c3d9b80a7ecc079ea79e9fba8676d /stoc/test/javavm/testapplet | |
parent | Initial commit. (diff) | |
download | libreoffice-940b4d1848e8c70ab7642901a68594e8016caffc.tar.xz libreoffice-940b4d1848e8c70ab7642901a68594e8016caffc.zip |
Adding upstream version 1:7.0.4.upstream/1%7.0.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'stoc/test/javavm/testapplet')
-rw-r--r-- | stoc/test/javavm/testapplet/TestApplet.html | 19 | ||||
-rw-r--r-- | stoc/test/javavm/testapplet/TestApplet.java | 53 | ||||
-rw-r--r-- | stoc/test/javavm/testapplet/makefile.mk | 43 |
3 files changed, 115 insertions, 0 deletions
diff --git a/stoc/test/javavm/testapplet/TestApplet.html b/stoc/test/javavm/testapplet/TestApplet.html new file mode 100644 index 000000000..e83d2ffe7 --- /dev/null +++ b/stoc/test/javavm/testapplet/TestApplet.html @@ -0,0 +1,19 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252"> + <TITLE>A Clock (1.1)</TITLE> + <META NAME="GENERATOR" CONTENT="StarOffice 6.0 (Win32)"> + <META NAME="CREATED" CONTENT="20011119;12262427"> + <META NAME="CHANGED" CONTENT="16010101;0"> +</HEAD> +<BODY LANG="de-DE"> +<H1>TestApplet</H1> +<HR> +<P> +<APPLET CODE="TestApplet.class" ALIGN=BOTTOM WIDTH=170 HEIGHT=150> +</APPLET> +</P> + +</BODY> +</HTML>
\ No newline at end of file diff --git a/stoc/test/javavm/testapplet/TestApplet.java b/stoc/test/javavm/testapplet/TestApplet.java new file mode 100644 index 000000000..e271f4dd1 --- /dev/null +++ b/stoc/test/javavm/testapplet/TestApplet.java @@ -0,0 +1,53 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +import java.awt.Color; +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.net.MalformedURLException; + +public class TestApplet extends java.applet.Applet { + + /** Initialization method that will be called after the applet is loaded + * into the browser. + */ + @Override + public void init () { + setBackground( Color.green); + resize( 300, 300); + + // Security tests. + File f= new File("d:\\temp\\javasecurity.txt"); + try { + f.createNewFile(); + + // local connection + URL url= new URL("http://localhost:8080/index.html"); + url.openStream(); + // remote connection + url= new URL("http://www.w3.org/index.html"); + url.openStream(); + }catch( MalformedURLException mue) { + }catch( IOException e) { + String s= e.getMessage(); + System.out.println(s); + } + + } +} diff --git a/stoc/test/javavm/testapplet/makefile.mk b/stoc/test/javavm/testapplet/makefile.mk new file mode 100644 index 000000000..c2b5a2001 --- /dev/null +++ b/stoc/test/javavm/testapplet/makefile.mk @@ -0,0 +1,43 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# + +PRJ=..$/..$/.. + +PRJNAME = testapplet +PACKAGE = +TARGET = TestApplet + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +# Files -------------------------------------------------------- + +JARFILES = ridl.jar jurt.jar unoil.jar + +JAVAFILES= $(subst,$(CLASSDIR)$/$(PACKAGE)$/, $(subst,.class,.java $(JAVACLASSFILES))) + + +JAVACLASSFILES= \ + $(CLASSDIR)$/$(PACKAGE)$/TestApplet.class + +JARCLASSDIRS= . + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk |