@Test public void testToXML() throws Exception { LeoRemoteAEDescriptor lrae = new LeoRemoteAEDescriptor(); lrae.setName("myRemoteTestDescriptor"); lrae.addParameterSetting(LeoRemoteAEDescriptor.Param.ENDPOINT.getName(), "TestInputQueueName"); lrae.addParameterSetting(LeoRemoteAEDescriptor.Param.BROKER_URL.getName(), "tcp: File descDir = new File(rootDirectory + "src/test/resources/results"); lrae.setDescriptorLocator(descDir.toURI()); lrae.toXML("myRemoteTestFile"); String lraeXmlPath = lrae.getDescriptorLocator(); assertTrue(lraeXmlPath.contains(descDir.getAbsolutePath())); assertFalse(StringUtils.isBlank(lraeXmlPath)); lrae.setIsDeleteOnExit(true); assertTrue(lrae.isDeleteOnExit()); LeoRemoteAEDescriptor importLRAE = new LeoRemoteAEDescriptor(lraeXmlPath, false); assertNotNull(importLRAE); assertTrue(importLRAE.getName().startsWith("myRemoteTestDescriptor")); assertTrue(importLRAE .getParameterValue(LeoRemoteAEDescriptor.Param.ENDPOINT.getName()) .equals("TestInputQueueName")); assertTrue(importLRAE .getParameterValue(LeoRemoteAEDescriptor.Param.BROKER_URL.getName()) .equals("tcp: }
@Override public void toXML() throws Exception { File outFile = (mDescriptorLocator == null) ? File.createTempFile("LeoRemoteAEDescriptor", ".xml") : new File(mDescriptorLocator); if(deleteOnExit) { outFile.deleteOnExit(); } mDescriptorLocator = outFile.toURI(); FileOutputStream fos=null; try { fos = new FileOutputStream(outFile); mRemoteDescriptor.toXML(fos); } finally { if ( fos!=null ) fos.close(); } }
LeoRemoteAEDescriptor implements LeoDelegate { @Override public void toXML() throws Exception { File outFile = (mDescriptorLocator == null) ? File.createTempFile("LeoRemoteAEDescriptor", ".xml") : new File(mDescriptorLocator); if(deleteOnExit) { outFile.deleteOnExit(); } mDescriptorLocator = outFile.toURI(); FileOutputStream fos=null; try { fos = new FileOutputStream(outFile); mRemoteDescriptor.toXML(fos); } finally { if ( fos!=null ) fos.close(); } } }
LeoRemoteAEDescriptor implements LeoDelegate { @Override public void toXML() throws Exception { File outFile = (mDescriptorLocator == null) ? File.createTempFile("LeoRemoteAEDescriptor", ".xml") : new File(mDescriptorLocator); if(deleteOnExit) { outFile.deleteOnExit(); } mDescriptorLocator = outFile.toURI(); FileOutputStream fos=null; try { fos = new FileOutputStream(outFile); mRemoteDescriptor.toXML(fos); } finally { if ( fos!=null ) fos.close(); } } LeoRemoteAEDescriptor();  LeoRemoteAEDescriptor(CustomResourceSpecifier crs);  LeoRemoteAEDescriptor(String descriptor, boolean byName, NameValue... paramValues);  LeoRemoteAEDescriptor(String brokerURL, String endPoint); }
LeoRemoteAEDescriptor implements LeoDelegate { @Override public void toXML() throws Exception { File outFile = (mDescriptorLocator == null) ? File.createTempFile("LeoRemoteAEDescriptor", ".xml") : new File(mDescriptorLocator); if(deleteOnExit) { outFile.deleteOnExit(); } mDescriptorLocator = outFile.toURI(); FileOutputStream fos=null; try { fos = new FileOutputStream(outFile); mRemoteDescriptor.toXML(fos); } finally { if ( fos!=null ) fos.close(); } } LeoRemoteAEDescriptor();  LeoRemoteAEDescriptor(CustomResourceSpecifier crs);  LeoRemoteAEDescriptor(String descriptor, boolean byName, NameValue... paramValues);  LeoRemoteAEDescriptor(String brokerURL, String endPoint); CustomResourceSpecifier getRemoteDescriptor(); @Override ResourceSpecifier getResourceSpecifier(); @Override LeoRemoteAEDescriptor setDescriptorLocator(URI descriptorLocator); String getDescriptorLocator(); @Override String getName(); @Override LeoRemoteAEDescriptor setName(String name); @Override boolean isDeleteOnExit(); @Override LeoRemoteAEDescriptor setIsDeleteOnExit(boolean deleteOnExit); LeoRemoteAEDescriptor setParameterSetting(String name, String value); LeoRemoteAEDescriptor setParameterSetting(NameValue nameValue); LeoRemoteAEDescriptor setParameterSetting(Parameter p); LeoRemoteAEDescriptor addParameterSetting(String name, String value); @Override void toXML(); @Override void toXML(String filename); @Override LeoRemoteAEDescriptor analysisEngineSection(TransformerHandler thd, boolean isTopDescriptor); }
LeoRemoteAEDescriptor implements LeoDelegate { @Override public void toXML() throws Exception { File outFile = (mDescriptorLocator == null) ? File.createTempFile("LeoRemoteAEDescriptor", ".xml") : new File(mDescriptorLocator); if(deleteOnExit) { outFile.deleteOnExit(); } mDescriptorLocator = outFile.toURI(); FileOutputStream fos=null; try { fos = new FileOutputStream(outFile); mRemoteDescriptor.toXML(fos); } finally { if ( fos!=null ) fos.close(); } } LeoRemoteAEDescriptor();  LeoRemoteAEDescriptor(CustomResourceSpecifier crs);  LeoRemoteAEDescriptor(String descriptor, boolean byName, NameValue... paramValues);  LeoRemoteAEDescriptor(String brokerURL, String endPoint); CustomResourceSpecifier getRemoteDescriptor(); @Override ResourceSpecifier getResourceSpecifier(); @Override LeoRemoteAEDescriptor setDescriptorLocator(URI descriptorLocator); String getDescriptorLocator(); @Override String getName(); @Override LeoRemoteAEDescriptor setName(String name); @Override boolean isDeleteOnExit(); @Override LeoRemoteAEDescriptor setIsDeleteOnExit(boolean deleteOnExit); LeoRemoteAEDescriptor setParameterSetting(String name, String value); LeoRemoteAEDescriptor setParameterSetting(NameValue nameValue); LeoRemoteAEDescriptor setParameterSetting(Parameter p); LeoRemoteAEDescriptor addParameterSetting(String name, String value); @Override void toXML(); @Override void toXML(String filename); @Override LeoRemoteAEDescriptor analysisEngineSection(TransformerHandler thd, boolean isTopDescriptor);  }