+ @Test
+ public void testDiscard() throws Exception {
+
+ try {
+ discardChanges();
+ fail("Should have failed, need to execute an edit before discard");
+ } catch (NetconfDocumentedException e) {
+ assertTrue(e.getErrorSeverity() == ErrorSeverity.error);
+ assertTrue(e.getErrorTag() == ErrorTag.operation_failed);
+ assertTrue(e.getErrorType() == ErrorType.application);
+ }
+ }
+
+ @Test
+ public void testIncorrectGet() throws Exception {
+
+ try {
+ executeOperation(new GetConfig(sessionIdForReporting, currentSchemaContext, transactionProvider), "messages/mapping/bad_getConfig.xml");
+ fail("Should have failed, this is an incorrect request");
+ } catch (NetconfDocumentedException e) {
+ assertTrue(e.getErrorSeverity() == ErrorSeverity.error);
+ assertTrue(e.getErrorTag() == ErrorTag.operation_failed);
+ assertTrue(e.getErrorType() == ErrorType.application);
+ }
+
+ try {
+ executeOperation(new GetConfig(sessionIdForReporting, currentSchemaContext, transactionProvider), "messages/mapping/bad_namespace_getConfig.xml");
+ fail("Should have failed, this is an incorrect request");
+ } catch (NetconfDocumentedException e) {
+ assertTrue(e.getErrorSeverity() == ErrorSeverity.error);
+ assertTrue(e.getErrorTag() == ErrorTag.operation_failed);
+ assertTrue(e.getErrorType() == ErrorType.application);
+ }
+
+
+ }
+