use of java.io.StringBufferInputStream in project webtools.sourceediting by eclipse.
the class TestModelsFromFiles method addContentsAndCreateFile.
private void addContentsAndCreateFile(IFile file) throws CoreException {
StringBufferInputStream stringStream = new StringBufferInputStream("testing testing testing");
file.create(stringStream, false, null);
}
use of java.io.StringBufferInputStream in project groovy-core by groovy.
the class DependencyTest method testTransitiveDep.
public void testTransitiveDep() {
cu.addSource("testTransitiveDep.gtest", new StringBufferInputStream("class A1 {}\n" + "class A2 extends A1{}\n" + "class A3 extends A2{}\n"));
cu.compile(Phases.CLASS_GENERATION);
cache.makeTransitiveHull();
Set<String> dep = cache.get("A1");
assertEquals(dep.size(), 1);
dep = cache.get("A2");
assertEquals(dep.size(), 2);
assertTrue(dep.contains("A1"));
dep = cache.get("A3");
assertEquals(dep.size(), 3);
assertTrue(dep.contains("A1"));
assertTrue(dep.contains("A2"));
}
use of java.io.StringBufferInputStream in project cubrid-manager by CUBRID.
the class CUBRIDPreparedStatementProxyTest method methodSetUnicodeStream.
/**
* Test method for
* {@link com.cubrid.jdbc.proxy.driver.CUBRIDPreparedStatementProxy#setUnicodeStream(int, java.io.InputStream, int)}
* .
*/
public void methodSetUnicodeStream(CUBRIDPreparedStatementProxy pstmt) {
String sql = "select * from " + testTableName + " where url = ?";
CUBRIDPreparedStatementProxy ps = null;
try {
ps = (CUBRIDPreparedStatementProxy) conn.prepareStatement(sql);
ps.setUnicodeStream(30, new StringBufferInputStream("string buffer input stream"), 3);
} catch (SQLException e) {
assertTrue(false);
} catch (UnsupportedOperationException e1) {
assertTrue(true);
} finally {
if (ps != null)
try {
ps.close();
} catch (SQLException e) {
}
}
}
use of java.io.StringBufferInputStream in project pentaho-platform by pentaho.
the class LocaleImportHandlerTest method shouldNotFailAndReturnNullWhenMaliciousXmlIsGiven.
@Test(timeout = 2000, expected = SAXException.class)
public void shouldNotFailAndReturnNullWhenMaliciousXmlIsGiven() throws IOException, ParserConfigurationException, SAXException {
LocaleImportHandler lih = new LocaleImportHandler(Collections.emptyList(), null);
lih.getLocalBundleDocument(new StringBufferInputStream(XmlTestConstants.MALICIOUS_XML));
fail();
}
use of java.io.StringBufferInputStream in project pentaho-platform by pentaho.
the class KettleSystemListenerTest method shouldNotFailAndReturnNullWhenMaliciousXmlIsGiven.
@Test(timeout = 2000, expected = SAXException.class)
public void shouldNotFailAndReturnNullWhenMaliciousXmlIsGiven() throws IOException, ParserConfigurationException, SAXException {
KettleSystemListener ksl = new KettleSystemListener();
ksl.getSlaveServerConfigNode(new StringBufferInputStream(XmlTestConstants.MALICIOUS_XML));
fail();
}
Aggregations