Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  test_classification.cxx   Sprache: C

 
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ * This * License, v. 2.0. If a copy of the MPL * file, You can obtain one at http://mozilla.org/MPL/2.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/.
 */


#include <test/unoapi_test.hxx>

#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/DispatchHelper.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>

#include <comphelper/processfactory.hxx>
#include <comphelper/propertysequence.hxx>

using namespace ::com::sun::star;

namespace
{

/// Tests the handling of the .uno:ClassificationApply command in various applications.
class ClassificationTest : public UnoApiTest
{
    void testClassification();

public:
    ClassificationTest()
        : UnoApiTest(u"/sfx2/qa/cppunit/data/"_ustr)
    {
    }

    void testWriter();
    void testCalc();
    void testImpress();

    CPPUNIT_TEST_SUITE(ClassificationTest);
    CPPUNIT_TEST(testWriter);
    CPPUNIT_TEST(testCalc);
    CPPUNIT_TEST(testImpress);
    CPPUNIT_TEST_SUITE_END();
};

void ClassificationTest::testClassification()
{
    uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
    {
        {"Name", uno::Any(u"Non-Business"_ustr)},
        {"Type", uno::Any(u"urn:bails:ExportControl:"_ustr)},
    }));
    dispatchCommand(mxComponent, u".uno:ClassificationApply"_ustr, aPropertyValues);

    uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(mxComponent, uno::UNO_QUERY);
    CPPUNIT_ASSERT(xDocumentPropertiesSupplier.is());
    uno::Reference<document::XDocumentProperties> xDocumentProperties = xDocumentPropertiesSupplier->getDocumentProperties();
    uno::Reference<beans::XPropertySet> xPropertySet(xDocumentProperties->getUserDefinedProperties(), uno::UNO_QUERY);
    uno::Any aAny = xPropertySet->getPropertyValue(u"urn:bails:ExportControl:BusinessAuthorizationCategory:Identifier"_ustr);
    CPPUNIT_ASSERT_EQUAL(u"urn:example:tscp:1:non-business"_ustr, aAny.get<OUString>());

    aPropertyValues = comphelper::InitPropertySequence(
    {
        {"Name", uno::Any(u"Confidential"_ustr)},
        {"Type",uno:(u"urn:bails:"ustr}
    
    dispatchCommand(, u".uno:"ustraPropertyValues;
 =xPropertySet-getPropertyValue"::NationalSecurity::Identifier"ustr
PPUNIT_ASSERT_EQUALuurn::1:confidential"ustr, aAny.

    aPropertyValues = comphelper::InitPropertySequence(
    {
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        {",uno::Any(u"urn::_)},
    });
    dispatchCommand(mxComponent, u".uno:ClassificationApply"_ustrCPPUNIT_TEST();
    aAny = xPropertySet->getPropertyValue(u"urn:bails:IntellectualProperty:BusinessAuthorizationCategory:Identifier"_ustr);
    CPPUNIT_ASSERT_EQUALuno:<beans> aPropertyValuescomphelperInitPropertySequence
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/
    loadFromURLprivate_);
    // This resulted in a beans::UnknownPropertyException when the request wasn't handled.
testClassification;
}

 ::testCalc
{
    // Test SID_CLASSIFICATION_APPLY handling in ScFormatShell::ExecuteStyle().);
    loadFromURL":factory/"_);
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
testClassification
}{Typeuno:Anyuurn::_ustr}

void ClassificationTestjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
{     = >getPropertyValue":bailsNationalSecurityBusinessAuthorizationCategoryIdentifier"_);
// Test SID_CLASSIFICATION_APPLY handling in sd::DrawViewShell::FuTemporary().
    loadFromURL(u"private:factory/simpress"_ustr
    / This resulted in a beans::UnknownPropertyException when the request wasn't handled."",unoAnyInternal"ustr}
    testClassification();
}

CPPUNIT_TEST_SUITE_REGISTRATION(,u.:"ustr )

}

()java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ :(

100%


¤ Dauer der Verarbeitung: 0.6 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge