Search in sources :

Example 21 with BinaryType

use of org.teiid.core.types.BinaryType in project teiid by teiid.

the class TestSQLXMLProcessing method testXmlSerializeBinary2.

@Test
public void testXmlSerializeBinary2() throws Exception {
    // $NON-NLS-1$
    String sql = "SELECT cast(xmlserialize(document xmlelement(other) as blob encoding \"UTF-16\" version '1.2' including xmldeclaration) as varbinary)";
    List<?>[] expected = new List<?>[] { Arrays.asList(new BinaryType("<?xml version=\"1.2\" encoding=\"UTF-16\"?><other></other>".getBytes(Charset.forName("UTF-16")))) };
    process(sql, expected);
}
Also used : BinaryType(org.teiid.core.types.BinaryType) List(java.util.List) Test(org.junit.Test)

Aggregations

BinaryType (org.teiid.core.types.BinaryType)21 Test (org.junit.Test)12 Blob (java.sql.Blob)6 List (java.util.List)6 IOException (java.io.IOException)4 BigInteger (java.math.BigInteger)4 SQLException (java.sql.SQLException)4 SQLXML (java.sql.SQLXML)4 InputStream (java.io.InputStream)3 BigDecimal (java.math.BigDecimal)3 Clob (java.sql.Clob)3 ArrayList (java.util.ArrayList)3 BlobImpl (org.teiid.core.types.BlobImpl)3 GeometryType (org.teiid.core.types.GeometryType)3 BasicDBList (com.mongodb.BasicDBList)2 BasicDBObject (com.mongodb.BasicDBObject)2 GridFS (com.mongodb.gridfs.GridFS)2 Coordinate (com.vividsolutions.jts.geom.Coordinate)2 GeometryFactory (com.vividsolutions.jts.geom.GeometryFactory)2 Point (com.vividsolutions.jts.geom.Point)2