KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openi > analysis > AnalysisGeneratorTest


1 /*********************************************************************************
2  * The contents of this file are subject to the OpenI Public License Version 1.0
3  * ("License"); You may not use this file except in compliance with the
4  * License. You may obtain a copy of the License at
5  * http://www.openi.org/docs/LICENSE.txt
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is: OpenI Open Source
12  *
13  * The Initial Developer of the Original Code is Loyalty Matrix, Inc.
14  * Portions created by Loyalty Matrix, Inc. are
15  * Copyright (C) 2005 - 2006 Loyalty Matrix, Inc.; All Rights Reserved.
16  *
17  * Contributor(s): ______________________________________.
18  *
19  ********************************************************************************/

20 package org.openi.analysis;
21
22 import java.io.IOException JavaDoc;
23 import java.util.Iterator JavaDoc;
24 import java.util.LinkedList JavaDoc;
25 import java.util.List JavaDoc;
26 import java.util.Map JavaDoc;
27
28 import junit.framework.TestCase;
29
30 import org.apache.log4j.Logger;
31 import org.openi.project.ProjectContext;
32 import org.openi.test.Util;
33
34 import com.tonbeller.jpivot.olap.model.OlapException;
35
36 public class AnalysisGeneratorTest extends TestCase {
37     private static Logger logger = Logger.getLogger(AnalysisGeneratorTest.class);
38     String JavaDoc uri = "http://localhost:8181/xmla/msxisapi.dll";
39     String JavaDoc catalog= "Foodmart 2000";
40     String JavaDoc cube = "Sales";
41     private ProjectContext projectContext;
42     
43     public static void main(String JavaDoc[] args) {
44         junit.textui.TestRunner.run(AnalysisGeneratorTest.class);
45     }
46
47     /*
48      * @see TestCase#setUp()
49      */

50     protected void setUp() throws Exception JavaDoc {
51         super.setUp();
52         Util.setupLog4j();
53         projectContext = Util.createTestProjectContext("projectUser");
54     }
55
56     /*
57      * @see TestCase#tearDown()
58      */

59     protected void tearDown() throws Exception JavaDoc {
60         super.tearDown();
61     }
62
63     /**
64      * Constructor for AnalysisGeneratorTest.
65      * @param arg0
66      */

67     public AnalysisGeneratorTest(String JavaDoc arg0) {
68         super(arg0);
69     }
70     
71     public void testGenerateMdxForDimensions() throws Exception JavaDoc{
72         
73         AnalysisGenerator gen = new AnalysisGenerator();
74         assertTrue(gen.generateMdxForDimensions(uri, catalog, cube).size() > 0);
75     }
76     
77     public void testCreateAnalyses() throws OlapException, IOException JavaDoc{
78         String JavaDoc relativeDir = "generated/" + cube;
79         projectContext.autogenerate("projectdefault", cube, relativeDir);
80     }
81     
82
83     
84     
85         
86      
87     
88     
89     
90
91 }
92
Popular Tags