import com.google.common.collect.Iterables;
import java.io.InputStream;
-import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
-import javax.xml.parsers.DocumentBuilderFactory;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.controller.config.util.xml.XmlUtil;
NetconfMessage userNotification;
- @SuppressWarnings("deprecation")
@Before
public void setup() throws Exception {
- final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
InputStream notifyPayloadStream = getClass().getResourceAsStream("/notification-payload.xml");
assertNotNull(notifyPayloadStream);
userNotification = new NetconfMessage(doc);
}
- static SchemaContext getNotificationSchemaContext(Class<?> loadClass, boolean getExceptionTest) throws Exception {
+ static SchemaContext getNotificationSchemaContext(final Class<?> loadClass, final boolean getExceptionTest) throws Exception {
final List<InputStream> modelsToParse = new ArrayList<>();
if (getExceptionTest) {
assertNotNull(root);
assertEquals(6, Iterables.size(root.getValue()));
assertEquals("user-visited-page", root.getNodeType().getLocalName());
- assertEquals(new SimpleDateFormat(NetconfNotification.RFC3339_DATE_FORMAT_WITH_MILLIS_BLUEPRINT).parse("2015-10-23T09:42:27.67175+00:00"),
+ assertEquals(NetconfNotification.RFC3339_DATE_PARSER.apply("2015-10-23T09:42:27.67175+00:00"),
((DOMEvent) domNotification).getEventTime());
}
}