diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-05-15 21:06:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-05-16 09:51:55 +0200 |
commit | 6170d7c6063da89929577702189e4e4bfe564cc7 (patch) | |
tree | 6b049fbe8958a43a6ddace7512cc1dfe0f050d18 | |
parent | d39717a6d6e6b3f507423a5da6d338de2541e43a (diff) |
drop unused qa OfficeResourceLoader test
Change-Id: I3c8486781cff4d2b1ad8dc41c0ad2648f42e94e2
Reviewed-on: https://gerrit.libreoffice.org/37656
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | extensions/qa/complex/extensions/OfficeResourceLoader.java | 127 | ||||
-rw-r--r-- | extensions/qa/complex/extensions/extensions_all.sce | 1 | ||||
-rw-r--r-- | extensions/qa/complex/extensions/makefile.mk | 89 | ||||
-rw-r--r-- | extensions/qa/complex/extensions/orl_de.src | 25 | ||||
-rw-r--r-- | extensions/qa/complex/extensions/orl_en-US.src | 25 |
5 files changed, 0 insertions, 267 deletions
diff --git a/extensions/qa/complex/extensions/OfficeResourceLoader.java b/extensions/qa/complex/extensions/OfficeResourceLoader.java deleted file mode 100644 index 7114ecf5ec39..000000000000 --- a/extensions/qa/complex/extensions/OfficeResourceLoader.java +++ /dev/null @@ -1,127 +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 complex.extensions; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.UnoRuntime; - -import com.sun.star.resource.XResourceBundle; -import com.sun.star.resource.XResourceBundleLoader; -import com.sun.star.beans.XPropertySet; -import com.sun.star.uno.XComponentContext; -import com.sun.star.lang.Locale; - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.openoffice.test.OfficeConnection; -import static org.junit.Assert.*; - -public class OfficeResourceLoader -{ - XResourceBundleLoader m_loader; - XResourceBundle m_bundle; - - /* ------------------------------------------------------------------ */ - @Before public void before() throws com.sun.star.uno.Exception, java.lang.Exception - { - XPropertySet orb = UnoRuntime.queryInterface(XPropertySet.class, getMSF()); - XComponentContext context = UnoRuntime.queryInterface(XComponentContext.class, orb.getPropertyValue("DefaultContext")); - - m_loader = com.sun.star.resource.OfficeResourceLoader.get( context ); - } - - /* ------------------------------------------------------------------ */ - @After public void after() throws java.lang.Exception - { - } - - /* ------------------------------------------------------------------ */ - @Test public void checkSimpleStringAccess() throws com.sun.star.uno.Exception, java.lang.Exception - { - // default bundle (UI locale) - m_bundle = m_loader.loadBundle_Default( "orl" ); - - Locale resourceLocale = m_bundle.getLocale(); - - String testString = (String)m_bundle.getByName( "string:1000" ); - - if ( resourceLocale.Language.equals( "en" ) - && resourceLocale.Country.equals( "US" ) - && resourceLocale.Variant.equals( "" ) - ) - { - assertTrue( "invalid 'en-US' string", testString.equals( "Dummy String" ) ); - } - - if ( resourceLocale.Language.equals( "de" ) - && resourceLocale.Country.equals( "" ) - && resourceLocale.Variant.equals( "" ) - ) - { - assertTrue( "invalid 'de' string", testString.equals( "Attrappen-Zeichenkette" ) ); - } - - if ( resourceLocale.Language.equals( "" ) - && resourceLocale.Country.equals( "" ) - && resourceLocale.Variant.equals( "" ) - ) - { - assertTrue( "invalid unlocalized string", testString.equals( "unlocalized string" ) ); - } - } - - /* ------------------------------------------------------------------ */ - @Test public void checkLocales() throws java.lang.Exception - { - // en-US bundle (should always be built and thus present and thus found) - m_bundle = m_loader.loadBundle( "orl", new Locale( "en", "US", "" ) ); - Locale resourceLocale = m_bundle.getLocale(); - assertTrue( "'en-US' could not be loaded", - resourceLocale.Language.equals( "en" ) && resourceLocale.Country.equals( "US" ) && resourceLocale.Variant.equals( "" ) ); - - // some (invalid) locale which is usually no built, and should thus fallback to en-US - m_bundle = m_loader.loadBundle( "orl", new Locale( "inv", "al", "id" ) ); - resourceLocale = m_bundle.getLocale(); - assertTrue( "non-existing locale request does not fallback to en-US", - resourceLocale.Language.equals( "en" ) && resourceLocale.Country.equals( "US" ) && resourceLocale.Variant.equals( "" ) ); - } - - - private XMultiServiceFactory getMSF() - { - return UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); - } - - // 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(); -} diff --git a/extensions/qa/complex/extensions/extensions_all.sce b/extensions/qa/complex/extensions/extensions_all.sce deleted file mode 100644 index 2d23dd7a1c92..000000000000 --- a/extensions/qa/complex/extensions/extensions_all.sce +++ /dev/null @@ -1 +0,0 @@ --o complex.extensions.OfficeResourceLoader diff --git a/extensions/qa/complex/extensions/makefile.mk b/extensions/qa/complex/extensions/makefile.mk deleted file mode 100644 index 312a7caae482..000000000000 --- a/extensions/qa/complex/extensions/makefile.mk +++ /dev/null @@ -1,89 +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 . -# - -.IF "$(OOO_SUBSEQUENT_TESTS)" == "" -nothing .PHONY: -.ELSE - -PRJ = ../../.. -PRJNAME = extensions -TARGET = qa_complex_extensions - -.IF "$(OOO_JUNIT_JAR)" != "" -PACKAGE = complex/extensions -JAVATESTFILES = \ - OfficeResourceLoader.java - -JAVAFILES = $(JAVATESTFILES) - -JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar jurt.jar ConnectivityTools.jar -EXTRAJARFILES = $(OOO_JUNIT_JAR) -.END - - - -.IF "$(OS)"=="WNT" -command_separator=&& -.ELSE -command_separator=; -.ENDIF - - -.INCLUDE: settings.mk - -#----- resource files for the OfficeResourceLoader test ------------ -RES_TARGET = orl - -SRS1NAME=$(RES_TARGET)_A_ -SRC1FILES= \ - $(RES_TARGET)_en-US.src - -RES1FILELIST=\ - $(SRS)$/$(RES_TARGET)_A_.srs - -RESLIB1NAME=$(RES_TARGET)_A_ -RESLIB1SRSFILES=$(RES1FILELIST) - - - -SRS2NAME=$(RES_TARGET)_B_ -SRC2FILES= \ - $(RES_TARGET)_de.src - -RES2FILELIST=\ - $(SRS)$/$(RES_TARGET)_B_.srs - -RESLIB2NAME=$(RES_TARGET)_B_ -RESLIB2SRSFILES=$(RES2FILELIST) - -.INCLUDE: target.mk -.INCLUDE: installationtest.mk - - -#----- resource files for the OfficeResourceLoader test ------------ - - -ALLTAR : copy_resources javatest - -copy_resources: $(RESLIB1TARGETN) $(RESLIB2TARGETN) - $(foreach,i,$(RESLIB1TARGETN) $(COPY) $i $(i:s/de/invalid/:s/_A_//) $(command_separator)) echo - $(foreach,i,$(RESLIB2TARGETN) $(COPY) $i $(i:s/en-US/invalid/:s/_B_//) $(command_separator)) echo - - -.END - diff --git a/extensions/qa/complex/extensions/orl_de.src b/extensions/qa/complex/extensions/orl_de.src deleted file mode 100644 index 43f638c64f65..000000000000 --- a/extensions/qa/complex/extensions/orl_de.src +++ /dev/null @@ -1,25 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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 . - */ - -String 1000 -{ - Text = "Attrappen-Zeichenkette"; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/qa/complex/extensions/orl_en-US.src b/extensions/qa/complex/extensions/orl_en-US.src deleted file mode 100644 index 418a90136a18..000000000000 --- a/extensions/qa/complex/extensions/orl_en-US.src +++ /dev/null @@ -1,25 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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 . - */ - -String 1000 -{ - Text = "Dummy String"; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |