Search in sources :

Example 6 with StringBufferInputStream

use of java.io.StringBufferInputStream in project cubrid-manager by CUBRID.

the class CUBRIDPreparedStatementProxyTest method methodSetAsciiStreamIntInputStream.

/**
	 * Test method for
	 * {@link com.cubrid.jdbc.proxy.driver.CUBRIDPreparedStatementProxy#setAsciiStream(int, java.io.InputStream)}
	 * .
	 */
public void methodSetAsciiStreamIntInputStream(CUBRIDPreparedStatementProxy pstmt) {
    String sql = "select * from " + testTableName + " where name = ?";
    CUBRIDPreparedStatementProxy ps = null;
    try {
        ps = (CUBRIDPreparedStatementProxy) conn.prepareStatement(sql);
        ps.setAsciiStream(1, new StringBufferInputStream("string buffer input string"));
    } catch (SQLException e) {
        assertTrue(false);
    }
}
Also used : StringBufferInputStream(java.io.StringBufferInputStream) SQLException(java.sql.SQLException)

Example 7 with StringBufferInputStream

use of java.io.StringBufferInputStream in project cubrid-manager by CUBRID.

the class CUBRIDPreparedStatementProxyTest method methodSetAsciiStreamIntInputStreamInt.

/**
	 * Test method for
	 * {@link com.cubrid.jdbc.proxy.driver.CUBRIDPreparedStatementProxy#setAsciiStream(int, java.io.InputStream, int)}
	 * .
	 */
public void methodSetAsciiStreamIntInputStreamInt(CUBRIDPreparedStatementProxy pstmt) {
    String sql = "select * from " + testTableName + " where name = ?";
    CUBRIDPreparedStatementProxy ps = null;
    try {
        ps = (CUBRIDPreparedStatementProxy) conn.prepareStatement(sql);
        ps.setAsciiStream(1, new StringBufferInputStream("string buffer input string"), 3);
    } catch (SQLException e) {
        assertTrue(false);
    }
}
Also used : StringBufferInputStream(java.io.StringBufferInputStream) SQLException(java.sql.SQLException)

Example 8 with StringBufferInputStream

use of java.io.StringBufferInputStream in project cubrid-manager by CUBRID.

the class CUBRIDPreparedStatementProxyTest method methodSetBinaryStreamIntInputStreamInt.

/**
	 * Test method for
	 * {@link com.cubrid.jdbc.proxy.driver.CUBRIDPreparedStatementProxy#setBinaryStream(int, java.io.InputStream, int)}
	 * .
	 */
public void methodSetBinaryStreamIntInputStreamInt(CUBRIDPreparedStatementProxy pstmt) {
    String sql = "select * from " + testTableName + " where name = ?";
    CUBRIDPreparedStatementProxy ps = null;
    try {
        ps = (CUBRIDPreparedStatementProxy) conn.prepareStatement(sql);
        ps.setBinaryStream(1, new StringBufferInputStream("string buffer input stream"), 2);
    } catch (SQLException e) {
        assertTrue(false);
    }
}
Also used : StringBufferInputStream(java.io.StringBufferInputStream) SQLException(java.sql.SQLException)

Example 9 with StringBufferInputStream

use of java.io.StringBufferInputStream in project pentaho-platform by pentaho.

the class LocaleImportHandlerTest method shouldNotFailAndReturnNotNullWhenLegalXmlIsGiven.

@Test
public void shouldNotFailAndReturnNotNullWhenLegalXmlIsGiven() throws Exception {
    String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<slave_config>" + "</slave_config>";
    LocaleImportHandler lih = new LocaleImportHandler(Collections.emptyList(), null);
    assertNotNull(lih.getLocalBundleDocument(new StringBufferInputStream(xml)));
}
Also used : StringBufferInputStream(java.io.StringBufferInputStream) Matchers.anyString(org.mockito.Matchers.anyString) Test(org.junit.Test)

Example 10 with StringBufferInputStream

use of java.io.StringBufferInputStream in project pentaho-platform by pentaho.

the class KettleSystemListenerTest method shouldNotFailAndReturnNotNullWhenLegalXmlIsGiven.

@Test
public void shouldNotFailAndReturnNotNullWhenLegalXmlIsGiven() throws Exception {
    String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<slave_config>" + "</slave_config>";
    KettleSystemListener ksl = new KettleSystemListener();
    assertNotNull(ksl.getSlaveServerConfigNode(new StringBufferInputStream(xml)));
}
Also used : StringBufferInputStream(java.io.StringBufferInputStream) Matchers.anyString(org.mockito.Matchers.anyString) Test(org.junit.Test)

Aggregations

StringBufferInputStream (java.io.StringBufferInputStream)34 Test (org.junit.Test)10 InputStream (java.io.InputStream)9 SQLException (java.sql.SQLException)6 IModelManager (org.eclipse.wst.sse.core.internal.provisional.IModelManager)5 IStructuredModel (org.eclipse.wst.sse.core.internal.provisional.IStructuredModel)5 BadLocationException (org.eclipse.jface.text.BadLocationException)3 IStructuredDocument (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument)3 InputStreamBuilder (io.vertigo.dynamo.file.model.InputStreamBuilder)2 VFile (io.vertigo.dynamo.file.model.VFile)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 IOException (java.io.IOException)2 Instant (java.time.Instant)2 Matchers.anyString (org.mockito.Matchers.anyString)2 KettleException (org.pentaho.di.core.exception.KettleException)2 RepositoryMeta (org.pentaho.di.repository.RepositoryMeta)2 Element (org.w3c.dom.Element)2 Table (com.mapr.db.Table)1 Description (io.qameta.allure.Description)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1