1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 package org.openoffice.comp.test;
24 
25 import com.sun.star.uno.UnoRuntime;
26 
27 
28 /**
29  * Test class for testing the ImageShrink service skeleton.
30  * Note: the image shrink functionality is not implemented
31  */
32 public class Thumbs {
33 
34     /**
35      * @param args the command line arguments
36      */
main(String[] args)37     public static void main(String[] args) {
38         try {
39             // get the remote office component context
40             com.sun.star.uno.XComponentContext xRemoteContext =
41                 com.sun.star.comp.helper.Bootstrap.bootstrap();
42 
43             System.out.println("Connected to a running office ...");
44 
45             // use the generated default create method to instantiate a
46             // new ImageShrink object
47             org.openoffice.test.XImageShrinkFilter xImageShrinkFilter =
48                 org.openoffice.test.ImageShrink.create(xRemoteContext);
49 
50             System.out.println("ImageShrink component succesfully instantiated");
51 
52             java.io.File f = new java.io.File(".");
53             System.out.println("set SourceDrectory ...");
54             xImageShrinkFilter.setSourceDirectory(f.getCanonicalPath());
55 
56             System.out.println("source Directory = "
57                                + xImageShrinkFilter.getSourceDirectory());
58         }
59         catch (java.lang.Exception e){
60             System.err.println("Error: " + e);
61             e.printStackTrace();
62         }
63         finally {
64             System.exit(0);
65         }
66     }
67 }
68 
69