diff options
author | Björn Milcke <bm@openoffice.org> | 2003-10-22 06:24:54 +0000 |
---|---|---|
committer | Björn Milcke <bm@openoffice.org> | 2003-10-22 06:24:54 +0000 |
commit | b3fa4b87554a9af4b2cdbfcabdcdb14e355ee28f (patch) | |
tree | 64c217cb9ec620fb1c40978f7070d7c41a3542dd | |
parent | INTEGRATION: CWS formcelllinkage (1.8.268); FILE MERGED (diff) | |
download | core-b3fa4b87554a9af4b2cdbfcabdcdb14e355ee28f.tar.gz core-b3fa4b87554a9af4b2cdbfcabdcdb14e355ee28f.zip |
+testChartType
-rw-r--r-- | chart2/qa/TestCaseOldAPI.java | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/chart2/qa/TestCaseOldAPI.java b/chart2/qa/TestCaseOldAPI.java index aba39cdb7a7d..763e8d61bf2e 100644 --- a/chart2/qa/TestCaseOldAPI.java +++ b/chart2/qa/TestCaseOldAPI.java @@ -62,7 +62,8 @@ public class TestCaseOldAPI extends ComplexTestCase { "testDiagram", "testAxis", "testLegend", - "testArea" + "testArea", + "testChartType" }; } @@ -346,6 +347,45 @@ public class TestCaseOldAPI extends ComplexTestCase { } } + // ------------ + + public void testChartType() + { + XMultiServiceFactory xFact = (XMultiServiceFactory) UnoRuntime.queryInterface( + XMultiServiceFactory.class, mxOldDoc ); + assure( "document is no factory", xFact != null ); + + try + { + String aMyServiceName = new String( "com.sun.star.chart.AreaDiagram" ); + String aServices[] = xFact.getAvailableServiceNames(); + boolean bServiceFound = false; + for( int i = 0; i < aServices.length; ++i ) + { + if( aServices[ i ].equals( aMyServiceName )) + { + bServiceFound = true; + break; + } + } + assure( "getAvailableServiceNames did not return " + aMyServiceName, bServiceFound ); + + if( bServiceFound ) + { + XDiagram xDia = (XDiagram) UnoRuntime.queryInterface( + XDiagram.class, xFact.createInstance( aMyServiceName )); + assure( "AreaDiagram could not be created", xDia != null ); + + mxOldDoc.setDiagram( xDia ); + } + } + catch( Exception ex ) + { + failed( ex.getMessage() ); + ex.printStackTrace( (PrintWriter)log ); + } + } + // ================================================================================ private XModel mxChartModel; |