package org.geomajas.sld.editor.expert.common.server.service;

import junit.framework.Assert;

import org.geomajas.sld.editor.expert.common.client.domain.RawSld;
import org.geomajas.sld.service.SldException;
import org.junit.Test;


public class InMemorySldServiceTest {

	@Test
	public void testFormat() throws SldException {
		InMemorySldServiceImpl service = new InMemorySldServiceImpl();
		RawSld sld = new RawSld();
		sld.setXml("<a att1=\"a1\"  att2=\"a2\"    ><b></b></a>");
		sld = service.format(sld);
		// header + attributes wrapped + indentation !!!
		Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + 
				"<a\n" + 
				"    att1=\"a1\"\n" + 
				"    att2=\"a2\">\n" + 
				"  <b/>\n" + 
				"</a>", sld.getXml());
		
	}
}

@@ -512,17 +512,8 @@
 %09%09//
- header +
  att
@@ -572,57 +572,8 @@
 als(
-%22%3C?xml version=%5C%221.0%5C%22 encoding=%5C%22UTF-8%5C%22?%3E%5Cn%22 + 
 %0A%09%09%09

test fix