use of com.adaptris.util.URLString in project interlok by adaptris.
the class AdapterRegistryTest method testProxy_GetConfigurationURL.
@Test
public void testProxy_GetConfigurationURL() throws Exception {
AdapterRegistry myAdapterRegistry = (AdapterRegistry) AdapterRegistry.findInstance(new JunitBootstrapProperties(new Properties()));
AdapterRegistryMBean registry = JMX.newMBeanProxy(mBeanServer, myAdapterRegistry.createObjectName(), AdapterRegistryMBean.class);
String adapterName = this.getClass().getSimpleName() + "." + getName();
Adapter adapter = createAdapter(adapterName, 2, 2);
File filename = deleteLater(adapter);
DefaultMarshaller.getDefaultMarshaller().marshal(adapter, filename);
URLString expectedURL = new URLString(filename);
ObjectName objName = registry.createAdapter(expectedURL);
assertNotNull(objName);
assertTrue(mBeanServer.isRegistered(objName));
assertEquals(expectedURL, registry.getConfigurationURL(objName));
}
use of com.adaptris.util.URLString in project interlok by adaptris.
the class FileDataInputParameter method load.
protected String load(URLString loc, String encoding) throws IOException {
String content = null;
try (InputStream inputStream = connect(loc)) {
StringWriter writer = new StringWriter();
IOUtils.copy(inputStream, writer, encoding);
content = writer.toString();
}
return content;
}
Aggregations