doTest(xml);
}
private void doTest(String xml) throws Throwable {
final CfmlProjectConfiguration def = CfmlProjectConfiguration.getInstance(getProject());
final CfmlProjectConfiguration.State defaultState = CfmlProjectConfiguration.getInstance(getProject()).getState();
String result = "<State>\n" +
" <language_level>cf10_tags.xml</language_level>\n" +
" <mapps>\n" +
" <mapping logical_path=\"/cal\" directory=\"C:\\ColdFusion9\\wwwroot\\Sandbox\\calendar\" />\n" +
" </mapps>\n" +
"</State>";
CfmlProjectConfiguration.State configState =
XmlSerializer.deserialize(JDOMUtil.loadDocument(xml).getRootElement().getChild("component"), CfmlProjectConfiguration.State.class);
try {
def.loadState(configState);
Element resSer = XmlSerializer.serialize(def.getState());
String resxml = JDOMUtil.writeElement(resSer, "\n");
assertEquals(result, resxml);
}
finally {
CfmlProjectConfiguration.getInstance(getProject()).loadState(defaultState);