Author: liliny Date: Fri Sep 28 05:38:05 2012 New Revision: 1391307 URL: http://svn.apache.org/viewvc?rev=1391307&view=rev Log: Add limitation check file: limit_cfg.ini
Added: incubator/ooo/trunk/test/testuno/data/limit_cfg.ini Modified: incubator/ooo/trunk/test/testuno/source/pvt/uno/Conversion.java incubator/ooo/trunk/test/testuno/source/testcase/uno/sd/textbox/FillProperties.java incubator/ooo/trunk/test/testuno/source/testcase/uno/sd/textbox/LineProperties.java Added: incubator/ooo/trunk/test/testuno/data/limit_cfg.ini URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testuno/data/limit_cfg.ini?rev=1391307&view=auto ============================================================================== --- incubator/ooo/trunk/test/testuno/data/limit_cfg.ini (added) +++ incubator/ooo/trunk/test/testuno/data/limit_cfg.ini Fri Sep 28 05:38:05 2012 @@ -0,0 +1,23 @@ +/*the record rule: <level info>.<SettingsName>=<SettingsValue>*/ +/*Level info: starts from 1, 0 means no need for limitation check*/ +/*SettingsName: should not contain "."*/ +/*SettingsValue: the type should be int*/ +/*All the notes or comments in this configure file should be in /**/ in each line*/ + +[TEXT] +/*Max pages in the file*/ +1.MAXPAGE=100 +2.MAXPAGE=500 + +[PRES] +/*Max pages in the file, including master/layout/normal/notes*/ +1.MAXPAGE=75 +2.MAXPAGE=1500 +/*Max objects in the file, including all editable object on master/layout/normal/notes*/ +1.MAXOBJECT=500 +2.MAXOBJECT=500 + +[SHEET] +/*Max row in worksheet*/ +1.MAXROW=5000 +2.MAXROW=5000 \ No newline at end of file Modified: incubator/ooo/trunk/test/testuno/source/pvt/uno/Conversion.java URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testuno/source/pvt/uno/Conversion.java?rev=1391307&r1=1391306&r2=1391307&view=diff ============================================================================== --- incubator/ooo/trunk/test/testuno/source/pvt/uno/Conversion.java (original) +++ incubator/ooo/trunk/test/testuno/source/pvt/uno/Conversion.java Fri Sep 28 05:38:05 2012 @@ -35,6 +35,7 @@ import org.junit.runner.RunWith; import org.openoffice.test.OpenOffice; import org.openoffice.test.common.DataSheet; import org.openoffice.test.common.FileProvider; +import org.openoffice.test.common.Testspace; import org.openoffice.test.common.FileProvider.FileFilter; import org.openoffice.test.common.FileProvider.FileRepeat; import org.openoffice.test.common.FileProvider.FileRepos; @@ -73,6 +74,8 @@ public class Conversion { public static int repeat = Integer.parseInt(System.getProperty("conversion.repeat", "8")); public static String clean = System.getProperty("conversion.clean", "file"); + + public static int nLevelInfo = Integer.parseInt(System.getProperty("conversion.limitationcheck", "0")); // Level info: starts from 1, 0 means no need for limitation check private static OpenOffice aoo = new OpenOffice(); @@ -87,6 +90,7 @@ public class Conversion { aoo.setUnoUrl(OpenOffice.DEFAULT_UNO_URL); aoo.addArgs("-invisible", "-conversionmode", "-hidemenu"); app = new UnoApp(aoo); + Testspace.prepareDataFile("limit_cfg.ini", aoo.getHome().toString()+"/program"); // Move limitation check file to installation dir result = new DataSheet(getFile("output/pvt_uno_conversion.xml")); result.addRow("data", "File","Scenario","File Size","Time Consumed After Closing","Time Consumed After Saving","Time Consumed After Loading"); } @@ -154,9 +158,6 @@ public class Conversion { @Test(timeout=10 * 60000) public void testConversion() throws Exception { - - int nLevelInfo = Integer.parseInt(System.getProperty("conversion.limitationcheck", "0")); // Level info: starts from 1, 0 means no need for limitation check - // convert long start = System.currentTimeMillis(); XComponent doc = app.loadDocumentFromURL(sourceFileUrl, Modified: incubator/ooo/trunk/test/testuno/source/testcase/uno/sd/textbox/FillProperties.java URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testuno/source/testcase/uno/sd/textbox/FillProperties.java?rev=1391307&r1=1391306&r2=1391307&view=diff ============================================================================== --- incubator/ooo/trunk/test/testuno/source/testcase/uno/sd/textbox/FillProperties.java (original) +++ incubator/ooo/trunk/test/testuno/source/testcase/uno/sd/textbox/FillProperties.java Fri Sep 28 05:38:05 2012 @@ -256,7 +256,7 @@ public class FillProperties { XStorable.class, presentationDocument); xStorable.storeToURL(FileUtil.getUrl(filePath), aStoreProperties); - return UnoRuntime.queryInterface(XComponent.class, + return (XComponent) UnoRuntime.queryInterface(XComponent.class, unoApp.loadDocument(filePath)); } } Modified: incubator/ooo/trunk/test/testuno/source/testcase/uno/sd/textbox/LineProperties.java URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testuno/source/testcase/uno/sd/textbox/LineProperties.java?rev=1391307&r1=1391306&r2=1391307&view=diff ============================================================================== --- incubator/ooo/trunk/test/testuno/source/testcase/uno/sd/textbox/LineProperties.java (original) +++ incubator/ooo/trunk/test/testuno/source/testcase/uno/sd/textbox/LineProperties.java Fri Sep 28 05:38:05 2012 @@ -190,7 +190,7 @@ public class LineProperties { XStorable.class, presentationDocument); xStorable.storeToURL(FileUtil.getUrl(filePath), aStoreProperties); - return UnoRuntime.queryInterface(XComponent.class, + return (XComponent) UnoRuntime.queryInterface(XComponent.class, unoApp.loadDocument(filePath)); } }