1*cdf0e10cSrcweir#*************************************************************************
2*cdf0e10cSrcweir#
3*cdf0e10cSrcweir#  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir#
5*cdf0e10cSrcweir#  Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir#
7*cdf0e10cSrcweir#  OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir#
9*cdf0e10cSrcweir#  This file is part of OpenOffice.org.
10*cdf0e10cSrcweir#
11*cdf0e10cSrcweir#  OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir#  it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir#  only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir#
15*cdf0e10cSrcweir#  OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir#  but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir#  GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir#  (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir#
21*cdf0e10cSrcweir#  You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir#  version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir#  <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir#  for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir#
26*cdf0e10cSrcweir# ************************************************************************/
27*cdf0e10cSrcweir
28*cdf0e10cSrcweir
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir
31*cdf0e10cSrcweirWINDOWS ONLY, no other platforms
32*cdf0e10cSrcweir
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir
35*cdf0e10cSrcweir
36*cdf0e10cSrcweirThis test checks if the cli assemblies and their policy files are installed in the
37*cdf0e10cSrcweirGAC and if the policy files are correct. The office must be installed with complete
38*cdf0e10cSrcweirsystem integration. That is, one does not use setup /a for starting the
39*cdf0e10cSrcweirinstallation.
40*cdf0e10cSrcweir
41*cdf0e10cSrcweirIn OOo 3.0 there was a breanking change so that the test created for previous
42*cdf0e10cSrcweirversion do not work anymore. To use these old tests one needs to install a
43*cdf0e10cSrcweirversion of OOo less than v 3.0. Then one needs to check out the cli_ure module
44*cdf0e10cSrcweirfor that version. The tests are contained in cli_ure/qa/versioning.
45*cdf0e10cSrcweir
46*cdf0e10cSrcweirIn the sub directory version_libs are libraries which are linked with (referencing)
47*cdf0e10cSrcweircli_cppuhelper
48*cdf0e10cSrcweircli_basetypes
49*cdf0e10cSrcweircli_ure
50*cdf0e10cSrcweircli_uretypes
51*cdf0e10cSrcweircli_oootypes
52*cdf0e10cSrcweir
53*cdf0e10cSrcweirThey are named version_3_0_0 etc, where the name indicates the version of the
54*cdf0e10cSrcweiroffice for which they were initially build. If there are only the assemblies
55*cdf0e10cSrcweirfor example OOo2.0.2 installed and a client was build with the assemblies from
56*cdf0e10cSrcweirOOo2 then the policy assemblies must make the correct redirection.
57*cdf0e10cSrcweir
58*cdf0e10cSrcweirWhen calling dmake then the executable runtest.exe and version_current.dll are
59*cdf0e10cSrcweirbuild. When runtest runs then it loads all dlls, which names start with
60*cdf0e10cSrcweir"version", from the same directory and tries to run a particular test code
61*cdf0e10cSrcweirwhich is only available in the version_xxx.dll s. The code in the
62*cdf0e10cSrcweirversion_xxx.dlls uses the cli default bootstrap mechanism to find the office
63*cdf0e10cSrcweirinstallation and start the office. When running runtest in a build environment
64*cdf0e10cSrcweirthen it may use the wrong libraries for bootstrapping in which case the test
65*cdf0e10cSrcweirfails. Then one has to set PATH which must point to the program directory of
66*cdf0e10cSrcweirthe office installation. For example:
67*cdf0e10cSrcweir
68*cdf0e10cSrcweirset PATH=d:\office\program
69*cdf0e10cSrcweir
70*cdf0e10cSrcweirruntest stops when a test failed to run. It writes error information to the
71*cdf0e10cSrcweirconsole which shows which version_xxx.dll failed to run and if this was due to
72*cdf0e10cSrcweira referenced assembly that could not be loaded. This would be the case if such
73*cdf0e10cSrcweiran assembly or the policy assembly is not properly installed or the redirection
74*cdf0e10cSrcweirin the policy assembly is wrong.
75*cdf0e10cSrcweir
76*cdf0e10cSrcweirThe version_current.dll references the assemblies in the current build
77*cdf0e10cSrcweirenvironment. version_current.dll is also executed when runtest is started.
78*cdf0e10cSrcweir
79*cdf0e10cSrcweirTo run the whole test one can either
80*cdf0e10cSrcweir1. start testools/wntmsci11.pro/bin/runtests.exe in a console where no
81*cdf0e10cSrcweirenvironment is set.
82*cdf0e10cSrcweir2. Call dmake run in testools/qa/cliversions
83*cdf0e10cSrcweir
84*cdf0e10cSrcweirFor a limited test one can call in this directory
85*cdf0e10cSrcweirdmake run office=d:\office
86*cdf0e10cSrcweirThere must not be an office installed in the system (the assemblies from the GAC
87*cdf0e10cSrcweirwould then be used). Only the test with the version_current.dll will succeed
88*cdf0e10cSrcweirbecause there are no policy files installed. This test requires that all
89*cdf0e10cSrcweirassemblies are copied next to runtests.exe - the makefile will do that.
90*cdf0e10cSrcweir
91*cdf0e10cSrcweirThe parameter office must be a system path to the office installation
92*cdf0e10cSrcweirdirectory. The java code calls runtest and also sets PATH so that the test
93*cdf0e10cSrcweirworks in the build environment. It also sets UNO_PATH so that the office will be
94*cdf0e10cSrcweirfound. If the test says that it failed, then one should run runtest directly
95*cdf0e10cSrcweirbecause it puts out more information.
96*cdf0e10cSrcweir
97*cdf0e10cSrcweir
98*cdf0e10cSrcweir
99*cdf0e10cSrcweirCreating a new version_xxx.dll
100*cdf0e10cSrcweir==============================
101*cdf0e10cSrcweirWhen a version of our assemblies changes then one should provide a new version dll which test exactly the assemblies with the changed version. This is easily done:
102*cdf0e10cSrcweir1. set the build environment in which the new versions are effectiv.
103*cdf0e10cSrcweir2  call: dmake name=version_xxx.dll
104*cdf0e10cSrcweir3. copy the new version dll from the output tree into qa/versioning/version_libs
105*cdf0e10cSrcweir4. commit the new version.dll using the -kb switch (only when creating the new file : cvs new -kb version_3_1_0.dll)
106*cdf0e10cSrcweir
107