我想我已經看到了一個優雅的方式來使用文件作爲apache單元測試的輸入駱駝,但我的谷歌技能讓我失望。使用一個文件作爲輸入到單元測試
我要的是不是:
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
<snip>...long real life xml that quickly fills up test files.</snip>";
template.sendBody("direct:create", xml);
我覺得我看到的是像
template.sendBody("direct:create", someCamelMetod("/src/data/someXmlFile.xml"));
任何人都知道在哪裏/如果這是記錄?
編輯:
- 跨張貼到http://camel.465427.n5.nabble.com/Use-a-file-as-input-to-unit-tests-td5722069.html
我落得這樣做只是創建
私人無效READFILE(字符串文件名)拋出什麼...功能
如果有人知道更好的方式,仍然感興趣。