Kaydet (Commit) 477e19d2 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen Kaydeden (comit) Michael Meeks

targetted make reversion.

üst 764e7e71
......@@ -45,9 +45,7 @@ $(eval $(call gb_CppunitTest_set_include,writerfilter_doctok,\
-I$(SRCDIR)/writerfilter/inc \
))
$(eval $(call gb_CppunitTest_use_api,writerfilter_doctok,\
offapi \
udkapi \
))
$(eval $(call gb_CppunitTest_use_sdk_api,writerfilter_doctok))
$(eval $(call gb_CppunitTest_use_udk_api,writerfilter_doctok))
# vim: set noet sw=4 ts=4:
......@@ -35,12 +35,9 @@ $(eval $(call gb_Module_add_targets,writerfilter,\
))
$(eval $(call gb_Module_add_check_targets,writerfilter,\
CppunitTest_writerfilter_doctok \
CppunitTest_writerfilter_rtftok \
))
$(eval $(call gb_Module_add_subsequentcheck_targets,writerfilter,\
JunitTest_writerfilter_complex \
))
# CppunitTest_writerfilter_doctok \
# vim: set noet sw=4 ts=4:
......@@ -17,17 +17,10 @@
*/
package complex.ooxml;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import complexlib.ComplexTestCase;
import java.io.File;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openoffice.test.Argument;
import org.openoffice.test.OfficeConnection;
import static org.junit.Assert.*;
import com.sun.star.text.XTextDocument;
/*
* To change this template, choose Tools | Templates
......@@ -38,54 +31,38 @@ import static org.junit.Assert.*;
*
* @author hb137859
*/
public class LoadDocuments {
@Test public void test1() {
String testDocumentsPath = Argument.get("tdoc");
System.out.println("Test documents in:" + testDocumentsPath);
public class LoadDocuments extends ComplexTestCase {
private XMultiServiceFactory m_xMSF;
@Override
public String[] getTestMethodNames() {
return new String [] {
"test1"
};
}
public void before() throws Exception {
m_xMSF = (XMultiServiceFactory) param.getMSF();
}
public void test1() {
String testDocumentsPath = util.utils.getFullTestDocName("");
log.println("Test documents in:" + testDocumentsPath);
File dir = new File(testDocumentsPath);
String [] files = dir.list();
try {
if (files != null) {
for (int i = 0; i < files.length; ++i) {
System.out.println(files[i]);
String url = TestDocument.getUrl(files[i]);
System.out.println(url);
if (files != null) {
for (int i = 0; i < files.length; ++i) {
log.println(files[i]);
String url = util.utils.getFullTestURL(files[i]);
log.println(url);
XComponent xDoc = util.DesktopTools.loadDoc(getMSF(), url, null);
System.out.println("loaded.");
util.DesktopTools.closeDoc(xDoc);
System.out.println("done.");
}
} else {
fail("Files not found");
XTextDocument xDoc = util.WriterTools.loadTextDoc(m_xMSF, url);
util.DesktopTools.closeDoc(xDoc);
}
} else {
failed();
}
catch (Exception e) {
System.out.println(e);
fail("failed");
}
}
private XMultiServiceFactory getMSF()
{
final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
return xMSF1;
}
// setup and close connections
@BeforeClass public static void setUpConnection() throws Exception
{
System.out.println("setUpConnection()");
connection.setUp();
}
@AfterClass public static void tearDownConnection()
throws InterruptedException, com.sun.star.uno.Exception
{
System.out.println("tearDownConnection()");
connection.tearDown();
}
private static final OfficeConnection connection = new OfficeConnection();
}
/*
* 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 complex.ooxml;
import java.io.File;
import org.openoffice.test.OfficeFileUrl;
import org.openoffice.test.Argument;
final class TestDocument {
public static String getUrl(String name) {
return OfficeFileUrl.getAbsolute(new File(Argument.get("tdoc"), name));
}
private TestDocument() {}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment