Index: src/ooxml/testcases/org/apache/poi/xssf/strings.txt =================================================================== --- src/ooxml/testcases/org/apache/poi/xssf/strings.txt (revision 0) +++ src/ooxml/testcases/org/apache/poi/xssf/strings.txt (revision 0) @@ -0,0 +1,81 @@ +[IntegrityCheck-ERROR[MALE[50.0 < x < 199.0], FEMALE[50.0 < x < 199.0]], IntegrityCheck-WARNING[MALE[61.0 < x < 126.0], FEMALE[47.0 < x < 119.0]]] +Computing[($1 + $2 + $3)/3,[Instrument[BloodPressure, RES_FIRST_DIASTOLIC_BP], Instrument[BloodPressure, RES_SEC_DIASTOLIC_BP], Instrument[BloodPressure, RES_THIRD_DIASTOLIC_BP]]] +COMPUTED +BloodPressure +BloodPressure +Average Pulse Rate +Moyenne des lectures de pouls +Computing[($1 + $2 + $3)/3,[Instrument[BloodPressure, RES_FIRST_PULSE_RATE], Instrument[BloodPressure, RES_SEC_PULSE_RATE], Instrument[BloodPressure, RES_THIRD_PULSE_RATE]]] +COMPUTED +BloodPressure +BloodPressure +Average Systolic Blood Pressure +Pression artérielle systolique moyenne +Computing[($1 + $2 + $3)/3,[Instrument[BloodPressure, RES_FIRST_SYSTOLIC_BP], Instrument[BloodPressure, RES_SEC_SYSTOLIC_BP], Instrument[BloodPressure, RES_THIRD_SYSTOLIC_BP]]] +COMPUTED +BloodPressure +BloodPressure +BloodPressure +BloodPressure +BloodPressure +BloodPressure +BloodPressure +BloodPressure +BloodPressure +Armband size used +Taille du brassard utilisé +MANUAL +Small +Petit +Medium +Moyen +Large +Grand +Extra Large +Très grand +BloodPressure +BloodPressure +Arm suggested to be used for measurement +Bras suggéré pour la mesure +Variable[Onyx.CIPreliminaryQuestionnaire.BP_ARM_CHOSEN] +AUTOMATIC +false +BloodPressure +BloodPressure +What arm was actually used for the measurements? +Quel bras a été utilisé pour les mesures? +MANUAL +Left +Gauche +Right +Droit +BloodPressure +BloodPressure +Circumference of upper arm at midpoint +Circonférence du haut du bras +[IntegrityCheck-ERROR[MALE[17.0 < x < 50.0], FEMALE[17.0 < x < 50.0]]] +MANUAL +BloodPressure +BloodPressure +Diastolic Blood Pressure reading (1) +Lecture de la pression artérielle diastolique (1) +[IntegrityCheck-ERROR[MALE[30 < x < 200 || ], FEMALE[30 < x < 200 || ]], IntegrityCheck-WARNING[MALE[51 < x < 96 || ], FEMALE[51 < x < 96 || ]], IntegrityCheck-ERROR[x < RES_FIRST_SYSTOLIC_BP]] +MANUAL +BloodPressure +BloodPressure +Pulse Rate reading (1) +Lecture de pouls (1) +[IntegrityCheck-ERROR[MALE[30 < x < 200 || ], FEMALE[30 < x < 200 || ]], IntegrityCheck-WARNING[MALE[40 < x < 100 || ], FEMALE[40 < x < 100 || ]]] +MANUAL +BloodPressure +BloodPressure +Systolic Blood Pressure reading (1) +Lecture de la pression artérielle systolique (1) +[IntegrityCheck-ERROR[MALE[30 < x < 300 || ], FEMALE[30 < x < 300 || ]], IntegrityCheck-WARNING[MALE[77 < x < 192 || ], FEMALE[77 < x < 192 || ]]] +MANUAL +BloodPressure +BloodPressure +Diastolic Blood Pressure reading (2) +Lecture de la pression artérielle diastolique (2) +[IntegrityCheck-ERROR[MALE[30 < x < 200 || ], FEMALE[30 < x < 200 || ]], IntegrityCheck-WARNING[MALE[51 < x < 96 || ], FEMALE[51 < x < 96 || ]], IntegrityCheck-ERROR[x < RES_SEC_SYSTOLIC_BP]] + Property changes on: src/ooxml/testcases/org/apache/poi/xssf/strings.txt ___________________________________________________________________ Added: svn:eol-style + native Index: src/ooxml/testcases/org/apache/poi/xssf/TestBrokenCdata.java =================================================================== --- src/ooxml/testcases/org/apache/poi/xssf/TestBrokenCdata.java (revision 0) +++ src/ooxml/testcases/org/apache/poi/xssf/TestBrokenCdata.java (revision 0) @@ -0,0 +1,69 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.xssf; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; + +import junit.framework.TestCase; + +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +/** + * + * @author Philippe Laflamme + */ +public final class TestBrokenCdata extends TestCase { + + public void testWritingSomeStringsResultsInMalformedCdata() throws IOException { + File tmp = File.createTempFile("test", ".xlsx"); + + Workbook w = new XSSFWorkbook(); + Sheet s = w.createSheet(); + int i = 0; + for (String str : readStrings("strings.txt")) { + s.createRow(i++).createCell(0).setCellValue(str); + } + w.write(new FileOutputStream(tmp)); + + // This throws an exception due to malformed XML in sharedStrings.xml + w = new XSSFWorkbook(new FileInputStream(tmp)); + } + + private List readStrings(String filename) throws IOException { + List strs = new ArrayList(); + BufferedReader br = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream( + filename))); + String s; + while ((s = br.readLine()) != null) { + if (s.trim().length() > 0) { + strs.add(s.trim()); + } + } + br.close(); + return strs; + } +} Property changes on: src/ooxml/testcases/org/apache/poi/xssf/TestBrokenCdata.java ___________________________________________________________________ Added: svn:eol-style + native