You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Marshall Schor (JIRA)" <de...@uima.apache.org> on 2013/07/08 22:25:48 UTC
[jira] [Resolved] (UIMA-3054) Binary CAS format 6 leaves document
text "null" after deserializing
[ https://issues.apache.org/jira/browse/UIMA-3054?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marshall Schor resolved UIMA-3054.
----------------------------------
Resolution: Fixed
Fix Version/s: 2.4.1SDK
> Binary CAS format 6 leaves document text "null" after deserializing
> -------------------------------------------------------------------
>
> Key: UIMA-3054
> URL: https://issues.apache.org/jira/browse/UIMA-3054
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.4.1SDK
> Reporter: Richard Eckart de Castilho
> Assignee: Marshall Schor
> Fix For: 2.4.1SDK
>
>
> Binary CAS format 6 leaves document text "null" after deserializing.
> On my machine (uimaj 2.4.1-SNAPSHOT) this fails in the last line, claiming that "test" is not equal to null.
> {code}
> import static org.junit.Assert.assertEquals;
> import static org.junit.Assert.assertTrue;
> import java.io.File;
> import java.io.FileInputStream;
> import java.io.FileOutputStream;
> import java.io.InputStream;
> import java.io.OutputStream;
> import org.apache.commons.io.IOUtils;
> import org.apache.uima.cas.CAS;
> import org.apache.uima.cas.impl.Serialization;
> import org.apache.uima.resource.metadata.TypeSystemDescription;
> import org.apache.uima.util.CasCreationUtils;
> import org.junit.Rule;
> import org.junit.Test;
> import org.junit.rules.TemporaryFolder;
> public class MinimalTest
> {
> @Rule
> public TemporaryFolder testFolder = new TemporaryFolder();
> @Test
> public void test6()
> throws Exception
> {
> CAS cas = CasCreationUtils.createCas((TypeSystemDescription) null, null, null);
> cas.setDocumentLanguage("latin");
> cas.setDocumentText("test");
> File file = testFolder.newFile("test.bin");
>
> OutputStream os = new FileOutputStream(file);
> Serialization.serializeWithCompression(cas, os, cas.getTypeSystem());
> IOUtils.closeQuietly(os);
> assertTrue(new File(testFolder.getRoot(), "test.bin").exists());
>
> CAS cas2 = CasCreationUtils.createCas((TypeSystemDescription) null, null, null);
> InputStream is = new FileInputStream(file);
> Serialization.deserializeCAS(cas2, is);
> IOUtils.closeQuietly(is);
> assertEquals("latin", cas2.getDocumentLanguage());
> assertEquals("test", cas2.getDocumentText());
> }
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira