@@ -0,0 +1,1905 @@
+package org.grobid.service.parser;%0A%0Aimport static org.junit.Assert.*;%0A%0Aimport java.io.IOException;%0A%0Aimport javax.xml.parsers.ParserConfigurationException;%0A%0Aimport org.junit.Test;%0Aimport org.xml.sax.SAXException;%0A%0A/**%0A * %0A * @author Damien%0A * %0A */%0Apublic class ChangePropertyParserTest %7B%0A%0A%09@Test%0A%09public void testGetPassword() throws ParserConfigurationException,%0A%09%09%09SAXException, IOException %7B%0A%09%09ChangePropertyParser parser = new ChangePropertyParser(generateXml(%0A%09%09%09%09%22pass%22, %22key%22, %22val%22, %22type%22));%0A%09%09assertEquals(%22Returned value not the one expected.%22, %22pass%22,%0A%09%09%09%09parser.getPassword());%0A%09%7D%0A%0A%09@Test%0A%09public void testGetKey() throws ParserConfigurationException, SAXException,%0A%09%09%09IOException %7B%0A%09%09ChangePropertyParser parser = new ChangePropertyParser(generateXml(%0A%09%09%09%09%22pass%22, %22key%22, %22val%22, %22type%22));%0A%09%09assertEquals(%22Returned value not the one expected.%22, %22key%22,%0A%09%09%09%09parser.getKey());%0A%09%7D%0A%0A%09@Test%0A%09public void testGetValue() throws ParserConfigurationException,%0A%09%09%09SAXException, IOException %7B%0A%09%09ChangePropertyParser parser = new ChangePropertyParser(generateXml(%0A%09%09%09%09%22pass%22, %22key%22, %22val%22, %22type%22));%0A%09%09assertEquals(%22Returned value not the one expected.%22, %22val%22,%0A%09%09%09%09parser.getValue());%0A%09%7D%0A%0A%09@Test%0A%09public void testGetType() throws ParserConfigurationException,%0A%09%09%09SAXException, IOException %7B%0A%09%09ChangePropertyParser parser = new ChangePropertyParser(generateXml(%0A%09%09%09%09%22pass%22, %22key%22, %22val%22, %22type%22));%0A%09%09assertEquals(%22Returned value not the one expected.%22, %22type%22,%0A%09%09%09%09parser.getType());%0A%09%7D%0A%0A%09private String generateXml(String pwd, String key, String value, String type) %7B%0A%09%09StringBuffer xml = new StringBuffer(%22%3CchangeProperty%3E%3Cpassword%3E%22);%0A%09%09xml.append(pwd);%0A%09%09xml.append(%22%3C/password%3E%3Cproperty%3E%3Ckey%3E%22);%0A%09%09xml.append(key);%0A%09%09xml.append(%22%3C/key%3E%3Cvalue%3E%22);%0A%09%09xml.append(value);%0A%09%09xml.append(%22%3C/value%3E%3Ctype%3E%22);%0A%09%09xml.append(type);%0A%09%09xml.append(%22%3C/type%3E%3C/property%3E%3C/changeProperty%3E%22);%0A%09%09return xml.toString();%0A%09%7D%0A%7D%0A

Test class for ChangePropertyParserTest.