1 20 package org.openi.analysis; 21 22 import java.io.IOException ; 23 import java.util.Iterator ; 24 import java.util.LinkedList ; 25 import java.util.List ; 26 import java.util.Map ; 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 uri = "http://localhost:8181/xmla/msxisapi.dll"; 39 String catalog= "Foodmart 2000"; 40 String cube = "Sales"; 41 private ProjectContext projectContext; 42 43 public static void main(String [] args) { 44 junit.textui.TestRunner.run(AnalysisGeneratorTest.class); 45 } 46 47 50 protected void setUp() throws Exception { 51 super.setUp(); 52 Util.setupLog4j(); 53 projectContext = Util.createTestProjectContext("projectUser"); 54 } 55 56 59 protected void tearDown() throws Exception { 60 super.tearDown(); 61 } 62 63 67 public AnalysisGeneratorTest(String arg0) { 68 super(arg0); 69 } 70 71 public void testGenerateMdxForDimensions() throws Exception { 72 73 AnalysisGenerator gen = new AnalysisGenerator(); 74 assertTrue(gen.generateMdxForDimensions(uri, catalog, cube).size() > 0); 75 } 76 77 public void testCreateAnalyses() throws OlapException, IOException { 78 String relativeDir = "generated/" + cube; 79 projectContext.autogenerate("projectdefault", cube, relativeDir); 80 } 81 82 83 84 85 86 87 88 89 90 91 } 92 | Popular Tags |