summaryrefslogtreecommitdiff
path: root/scripting/workben/mod
diff options
context:
space:
mode:
Diffstat (limited to 'scripting/workben/mod')
-rw-r--r--scripting/workben/mod/_scripting/Dispatch.java100
-rw-r--r--scripting/workben/mod/_scripting/Function.java88
-rw-r--r--scripting/workben/mod/_scripting/FunctionProvider.java79
-rw-r--r--scripting/workben/mod/_scripting/ScriptInfo.java108
-rw-r--r--scripting/workben/mod/_scripting/ScriptRuntimeManager.java61
-rw-r--r--scripting/workben/mod/_scripting/ScriptStorage.java101
-rw-r--r--scripting/workben/mod/_scripting/ScriptStorageManager.java76
-rw-r--r--scripting/workben/mod/_scripting/TestDataLoader.java116
-rw-r--r--scripting/workben/mod/_scripting/makefile.mk31
9 files changed, 0 insertions, 760 deletions
diff --git a/scripting/workben/mod/_scripting/Dispatch.java b/scripting/workben/mod/_scripting/Dispatch.java
deleted file mode 100644
index 20542cf02d10..000000000000
--- a/scripting/workben/mod/_scripting/Dispatch.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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 .
- */
-
-package mod._scripting;
-
-import java.io.PrintWriter;
-
-import lib.StatusException;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-import util.SOfficeFactory;
-
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XComponent;
-
-import com.sun.star.uno.XInterface;
-import com.sun.star.uno.UnoRuntime;
-
-import com.sun.star.frame.XModel;
-import com.sun.star.frame.XFrame;
-import com.sun.star.util.URL;
-import com.sun.star.util.XURLTransformer;
-
-
-
-public class Dispatch extends TestCase {
- private String scriptURL = "script://HighlightText.showForm";
- @Override
- public void initialize(TestParameters tParam, PrintWriter log) {
- }
-
- @Override
-
- public synchronized TestEnvironment createTestEnvironment(
- TestParameters tParam, PrintWriter log) throws StatusException {
- log.println("creating test environment");
- XInterface oObj = null;
- URL dispatchURL = null;
-
- try {
-
- XMultiServiceFactory xMSF = tParam.getMSF();
- SOfficeFactory SOF = null;
- SOF = SOfficeFactory.getFactory(xMSF);
- String docPath = util.utils.getFullTestURL("ExampleSpreadSheetLatest.sxc");
- XComponent doc = SOF.loadDocument(docPath);
- XModel model = UnoRuntime.queryInterface(XModel.class,
- doc);
- XFrame frame = model.getCurrentController().getFrame();
- oObj = (XInterface)
- xMSF.createInstanceWithArguments("com.sun.star.comp.ScriptProtocolHandler",
- new Object[] { frame });
-
- XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class,
- tParam.getMSF().createInstance
- ("com.sun.star.util.URLTransformer"));
- // Because it's an in/out parameter we must use an array of
- // URL objects.
- URL[] aParseURL = new URL[1];
- aParseURL[0] = new URL();
- aParseURL[0].Complete = scriptURL;
- xParser.parseStrict(aParseURL);
- dispatchURL = aParseURL[0];
-
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- throw new StatusException("Can't create object environment", e) ;
- }
-
- TestEnvironment tEnv = new TestEnvironment(oObj) ;
- tEnv.addObjRelation("XDispatchProvider.URL", scriptURL);
- tEnv.addObjRelation("XDispatch.URL", dispatchURL);
- return tEnv ;
- }
-
- @Override
-
- public synchronized void disposeTestEnvironment(TestEnvironment tEnv,
- TestParameters tParam) {
- }
-}
-
-
diff --git a/scripting/workben/mod/_scripting/Function.java b/scripting/workben/mod/_scripting/Function.java
deleted file mode 100644
index 9a2d8b273144..000000000000
--- a/scripting/workben/mod/_scripting/Function.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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 .
- */
-
-package mod._scripting;
-
-import com.sun.star.uno.XInterface;
-import java.io.PrintWriter;
-import lib.StatusException;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-
-import com.sun.star.frame.XModel;
-import com.sun.star.lang.XComponent;
-import util.SOfficeFactory;
-
-import drafts.com.sun.star.script.framework.provider.XFunctionProvider;
-
-public class Function extends TestCase {
- private String script = "script://returns-Integer";
- private String doc = "doc_with_beanshell_scripts.sxw";
-
- @Override
- public void initialize(TestParameters tParam, PrintWriter log) {
- }
-
- @Override
-
- public synchronized TestEnvironment createTestEnvironment(
- TestParameters tParam, PrintWriter log) throws StatusException {
- XInterface oObj = null;
- XFunctionProvider provider = null;
-
- log.println("creating test environment");
-
- try {
-
- XMultiServiceFactory xMSF = tParam.getMSF();
- SOfficeFactory SOF = null;
- SOF = SOfficeFactory.getFactory(xMSF);
- String docPath = util.utils.getFullTestURL(doc);
- XComponent doc = SOF.loadDocument(docPath);
- XModel model = UnoRuntime.queryInterface(XModel.class,
- doc);
- oObj =
- (XInterface)
- xMSF.createInstanceWithArguments("drafts.com.sun.star.script.framework.provider.FunctionProvider",
- new Object[] { model });
- provider = UnoRuntime.queryInterface(XFunctionProvider.class, oObj);
- oObj = provider.getFunction(script);
-
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- throw new StatusException("Can't create object environment", e) ;
- }
-
- TestEnvironment tEnv = new TestEnvironment(oObj) ;
- tEnv.addObjRelation("provider", provider);
- TestDataLoader.setupData(tEnv, "Function");
-
- return tEnv ;
- }
-
- @Override
-
- public synchronized void disposeTestEnvironment(TestEnvironment tEnv,
- TestParameters tParam) {
- }
-}
-
-
diff --git a/scripting/workben/mod/_scripting/FunctionProvider.java b/scripting/workben/mod/_scripting/FunctionProvider.java
deleted file mode 100644
index 8cbedee9935e..000000000000
--- a/scripting/workben/mod/_scripting/FunctionProvider.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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 .
- */
-
-package mod._scripting;
-
-import com.sun.star.uno.XInterface;
-import java.io.PrintWriter;
-import lib.StatusException;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-
-import com.sun.star.frame.XModel;
-import com.sun.star.frame.XDesktop;
-
-public class FunctionProvider extends TestCase {
-
- String docPath = null;
- @Override
- public void initialize(TestParameters tParam, PrintWriter log) {
- }
-
- @Override
-
- public synchronized TestEnvironment createTestEnvironment(
- TestParameters tParam, PrintWriter log) throws StatusException {
- XInterface oObj = null;
- log.println("creating test environment");
-
- try {
-
- XMultiServiceFactory xMSF = tParam.getMSF();
-
- Object xInterface = xMSF.createInstance("com.sun.star.frame.Desktop");
- XDesktop dtop = UnoRuntime.queryInterface(XDesktop.class,
- xInterface);
-
- XModel model = dtop.getCurrentFrame().getController().getModel();
- oObj =
- (XInterface)
- xMSF.createInstanceWithArguments("drafts.com.sun.star.script.framework.provider.FunctionProvider",
- new Object[] { model });
-
-
- } catch (com.sun.star.uno.Exception e) {
- throw new StatusException("Can't create object environment", e) ;
- }
-
- TestEnvironment tEnv = new TestEnvironment(oObj) ;
- TestDataLoader.setupData(tEnv, "FunctionProvider");
-
- return tEnv ;
- }
-
- @Override
-
- public synchronized void disposeTestEnvironment(TestEnvironment tEnv,
- TestParameters tParam) {
- }
-}
-
-
diff --git a/scripting/workben/mod/_scripting/ScriptInfo.java b/scripting/workben/mod/_scripting/ScriptInfo.java
deleted file mode 100644
index 05b7b3d0c80e..000000000000
--- a/scripting/workben/mod/_scripting/ScriptInfo.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * 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 .
- */
-
-package mod._scripting;
-
-import com.sun.star.uno.XInterface;
-import java.io.PrintWriter;
-import lib.StatusException;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import java.net.URLEncoder;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.ucb.XSimpleFileAccess;
-import com.sun.star.uno.UnoRuntime;
-
-import drafts.com.sun.star.script.framework.storage.XScriptInfoAccess;
-import drafts.com.sun.star.script.framework.storage.XScriptInfo;
-
-public class ScriptInfo extends TestCase {
-
- String docPath = null;
- @Override
- public void initialize(TestParameters tParam, PrintWriter log) {
- // Get path to test documents
- String rootDocPath = (String)tParam.get("TEST_DOCUMENT_PATH");
- System.out.println("TEST_DOCUMENT_PATH is " + rootDocPath);
- rootDocPath = util.utils.getFullTestURL("ExampleSpreadSheetLatest.sxc");
-
- if (rootDocPath != null && rootDocPath.length() > 1) {
- // convert all "\\" to "/", necessary for UCB
- if (rootDocPath.indexOf("\\") > 0) {
- rootDocPath = rootDocPath.replace('\\', '/');
- }
-
- System.out.println("After processing the path is " + rootDocPath);
- // encode the ulr (for UCB)
- String encodedPath = URLEncoder.encode(rootDocPath);
- System.out.println("The encoded path is " + encodedPath);
- docPath = "vnd.sun.star.pkg://" + encodedPath;
- System.out.println("docPath path is " + docPath);
- }
-
- }
-
- @Override
-
- public synchronized TestEnvironment createTestEnvironment(
- TestParameters tParam, PrintWriter log) throws StatusException {
-
- log.println("creating test environment");
-
- if (docPath == null) {
- log.println("Testdata not set up, docPath is null");
- throw new StatusException(
- "Can't create object environment, no test document available",
- new Exception()) ;
- }
-
- XInterface oObj = null;
- XSimpleFileAccess access = null;
-
- try {
- XMultiServiceFactory xMSF = tParam.getMSF();
- Object xInterface =
- xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess");
- access = UnoRuntime.queryInterface(XSimpleFileAccess.class, xInterface);
- Object storageObj = xMSF.createInstanceWithArguments(
- "drafts.com.sun.star.script.framework.storage.ScriptStorage",
- new Object[] { access, Integer.valueOf(99), docPath });
- XScriptInfoAccess infoAccess = UnoRuntime.queryInterface(
- XScriptInfoAccess.class, storageObj);
- XScriptInfo[] infos =
- infoAccess.getImplementations("script://MemoryUtils.MemUsage?location=document");
- oObj = infos[0];
- } catch (com.sun.star.uno.Exception e) {
- throw new StatusException("Can't create object environment", e) ;
- }
-
- TestEnvironment tEnv = new TestEnvironment(oObj) ;
- TestDataLoader.setupData(tEnv, "ScriptInfo");
-
- return tEnv ;
- }
-
- @Override
-
- public synchronized void disposeTestEnvironment(TestEnvironment tEnv,
- TestParameters tParam) {
- }
-}
-
-
diff --git a/scripting/workben/mod/_scripting/ScriptRuntimeManager.java b/scripting/workben/mod/_scripting/ScriptRuntimeManager.java
deleted file mode 100644
index 6051adb1ae70..000000000000
--- a/scripting/workben/mod/_scripting/ScriptRuntimeManager.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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 .
- */
-
-package mod._scripting;
-
-import com.sun.star.uno.XInterface;
-import java.io.PrintWriter;
-import lib.StatusException;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-public class ScriptRuntimeManager extends TestCase {
-
- @Override
- public void initialize(TestParameters tParam, PrintWriter log) {
- }
-
- @Override
-
- public synchronized TestEnvironment createTestEnvironment(
- TestParameters Param, PrintWriter log) throws StatusException {
-
- log.println("creating test environment");
-
- XInterface oObj = null;
-
- try {
- oObj = (XInterface) Param.getMSF().createInstance
- ("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeManager");
- } catch (com.sun.star.uno.Exception e) {
- throw new StatusException("Can't create object environment", e) ;
- }
-
- TestEnvironment tEnv = new TestEnvironment(oObj) ;
- TestDataLoader.setupData(tEnv, "ScriptRuntimeManager");
-
- return tEnv ;
- }
-
- @Override
-
- public synchronized void disposeTestEnvironment(TestEnvironment tEnv,
- TestParameters tParam) {
- }
-}
diff --git a/scripting/workben/mod/_scripting/ScriptStorage.java b/scripting/workben/mod/_scripting/ScriptStorage.java
deleted file mode 100644
index c09f24c083fd..000000000000
--- a/scripting/workben/mod/_scripting/ScriptStorage.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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 .
- */
-
-package mod._scripting;
-
-import com.sun.star.uno.XInterface;
-import java.io.PrintWriter;
-import lib.StatusException;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import java.net.URLEncoder;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.ucb.XSimpleFileAccess;
-import com.sun.star.uno.UnoRuntime;
-
-public class ScriptStorage extends TestCase {
-
- String docPath = null;
- @Override
- public void initialize(TestParameters tParam, PrintWriter log) {
- // Get path to test documents
- String rootDocPath = (String)tParam.get("TEST_DOCUMENT_PATH");
- System.out.println("TEST_DOCUMENT_PATH is " + rootDocPath);
- rootDocPath = util.utils.getFullTestURL("ExampleSpreadSheetLatest.sxc");
-
- if (rootDocPath != null && rootDocPath.length() > 1) {
- // convert all "\\" to "/", necessary for UCB
- if (rootDocPath.indexOf("\\") > 0) {
- rootDocPath = rootDocPath.replace('\\', '/');
- }
-
- System.out.println("After processing the path is " + rootDocPath);
- // encode the ulr (for UCB)
- String encodedPath = URLEncoder.encode(rootDocPath);
- System.out.println("The encoded path is " + encodedPath);
- docPath = "vnd.sun.star.pkg://" + encodedPath;
- System.out.println("docPath path is " + docPath);
- }
-
- }
-
- @Override
-
- public synchronized TestEnvironment createTestEnvironment(
- TestParameters tParam, PrintWriter log) throws StatusException {
-
- log.println("creating test environment");
-
- if (docPath == null) {
- log.println("Testdata not set up, docPath is null");
- throw new StatusException(
- "Can't create object environment, no test document available",
- new Exception()) ;
- }
-
- XInterface oObj = null;
- XSimpleFileAccess access = null;
-
- try {
- XMultiServiceFactory xMSF = tParam.getMSF();
- Object xInterface =
- xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess");
- access = UnoRuntime.queryInterface(XSimpleFileAccess.class, xInterface);
- oObj = (XInterface)xMSF.createInstanceWithArguments(
- "drafts.com.sun.star.script.framework.storage.ScriptStorage",
- new Object[] { access, Integer.valueOf(99), docPath });
-
- } catch (com.sun.star.uno.Exception e) {
- throw new StatusException("Can't create object environment", e) ;
- }
-
- TestEnvironment tEnv = new TestEnvironment(oObj) ;
- TestDataLoader.setupData(tEnv, "ScriptStorage");
-
- return tEnv ;
- }
-
- @Override
-
- public synchronized void disposeTestEnvironment(TestEnvironment tEnv,
- TestParameters tParam) {
- }
-}
-
-
diff --git a/scripting/workben/mod/_scripting/ScriptStorageManager.java b/scripting/workben/mod/_scripting/ScriptStorageManager.java
deleted file mode 100644
index b18c613f59e8..000000000000
--- a/scripting/workben/mod/_scripting/ScriptStorageManager.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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 .
- */
-
-package mod._scripting;
-
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.beans.XPropertySet;
-import com.sun.star.uno.XInterface;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XComponentContext;
-import java.io.PrintWriter;
-import lib.StatusException;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-public class ScriptStorageManager extends TestCase {
-
- @Override
- public void initialize(TestParameters tParam, PrintWriter log) {
- }
-
- @Override
-
- public synchronized TestEnvironment createTestEnvironment(
- TestParameters Param, PrintWriter log) throws StatusException {
-
- XInterface oObj = null;
- Object oInterface = null;
-
- try {
- XMultiServiceFactory xMSF = Param.getMSF();
- XPropertySet xProp = UnoRuntime.queryInterface(
- XPropertySet.class, xMSF);
- // get context
- XComponentContext xContext = UnoRuntime.queryInterface(XComponentContext.class,
- xProp.getPropertyValue("DefaultContext"));
- // get the script storage manager from context
- oInterface = xContext.getValueByName("/singletons/" +
- "drafts.com.sun.star.script.framework.storage.theScriptStorageManager");
- } catch (Exception e) {
- log.println("ScriptStorageManager singleton service not available");
- e.printStackTrace();
- }
-
- oObj = (XInterface) oInterface;
-
- TestEnvironment tEnv = new TestEnvironment(oObj) ;
- TestDataLoader.setupData(tEnv, "ScriptStorageManager");
-
- return tEnv ;
- }
-
- @Override
-
- public synchronized void disposeTestEnvironment(TestEnvironment tEnv,
- TestParameters tParam) {
- }
-}
-
-
diff --git a/scripting/workben/mod/_scripting/TestDataLoader.java b/scripting/workben/mod/_scripting/TestDataLoader.java
deleted file mode 100644
index 6f8078656058..000000000000
--- a/scripting/workben/mod/_scripting/TestDataLoader.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * 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 .
- */
-
-package mod._scripting;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.BufferedReader;
-import java.io.IOException;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.StringTokenizer;
-
-import lib.TestEnvironment;
-import lib.Parameters;
-
-public class TestDataLoader {
-
- private TestDataLoader() {
- }
-
- public static void setupData(TestEnvironment tEnv, String name) {
- String filename =
- util.utils.getFullTestDocName("testdata");
- File testdatadir = new File(filename);
- File f = new File(testdatadir, name + ".csv");
-
- if (!f.exists())
- return;
-
-
- try {
- BufferedReader in = new BufferedReader(new FileReader(f));
-
- String s, previous, current;
- ArrayList<Parameters> list = new ArrayList<Parameters>(11);
-
- if ((s = in.readLine()) != null) {
- StringTokenizer st = new StringTokenizer(s, ";");
-
- current = previous = st.nextToken();
- list.add(getParameters(st));
- } else {
- in.close();
- return;
- }
-
- while ((s = in.readLine()) != null) {
- StringTokenizer st = new StringTokenizer(s, ";");
-
- current = st.nextToken();
-
- if (!current.equals(previous)) {
- tEnv.addObjRelation(previous, list);
- previous = current;
- list = new ArrayList<Parameters>(11);
- }
-
- list.add(getParameters(st));
- }
-
- tEnv.addObjRelation(previous, list);
- in.close();
- } catch (IOException ioe) {
- }
- }
-
- private static Parameters getParameters(StringTokenizer st) {
- String separator = "=";
- HashMap<String, Object> map = new HashMap<String, Object>(5);
-
- while (st.hasMoreTokens()) {
- String pair = st.nextToken();
- StringTokenizer tokens = new StringTokenizer(pair, separator);
-
- String name;
- String value;
-
- if (tokens.countTokens() < 2)
- continue;
-
- name = tokens.nextToken();
-
- if (tokens.countTokens() == 1)
- value = tokens.nextToken();
- else {
- StringBuffer buf = new StringBuffer(tokens.nextToken());
-
- while (tokens.hasMoreTokens())
- buf.append(separator).append(tokens.nextToken());
-
- value = buf.toString();
- }
-
- map.put(name, value);
- }
-
- return new Parameters(map);
- }
-}
diff --git a/scripting/workben/mod/_scripting/makefile.mk b/scripting/workben/mod/_scripting/makefile.mk
deleted file mode 100644
index 0519fc57a953..000000000000
--- a/scripting/workben/mod/_scripting/makefile.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# 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 = testcase
-TARGET = testcase
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar $(CLASSPATH)
-JAVAFILES = $(foreach,j,$(shell @ls | grep java) $j)
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk