Search in sources :

Example 1 with GetConfig

use of org.opendaylight.netconf.mdsal.connector.ops.get.GetConfig in project netconf by opendaylight.

the class NetconfMDSalMappingTest method testIncorrectGet.

@Test
public void testIncorrectGet() throws Exception {
    DocumentedException ex = assertThrows(DocumentedException.class, () -> executeOperation(new GetConfig(SESSION_ID_FOR_REPORTING, getCurrentSchemaContext(), getTransactionProvider()), "messages/mapping/bad_getConfig.xml"));
    assertEquals(ErrorSeverity.ERROR, ex.getErrorSeverity());
    assertEquals(ErrorTag.OPERATION_FAILED, ex.getErrorTag());
    assertEquals(ErrorType.APPLICATION, ex.getErrorType());
    ex = assertThrows(DocumentedException.class, () -> executeOperation(new GetConfig(SESSION_ID_FOR_REPORTING, getCurrentSchemaContext(), getTransactionProvider()), "messages/mapping/bad_namespace_getConfig.xml"));
    assertEquals(ErrorSeverity.ERROR, ex.getErrorSeverity());
    assertEquals(ErrorTag.OPERATION_FAILED, ex.getErrorTag());
    assertEquals(ErrorType.APPLICATION, ex.getErrorType());
}
Also used : GetConfig(org.opendaylight.netconf.mdsal.connector.ops.get.GetConfig) DocumentedException(org.opendaylight.netconf.api.DocumentedException) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 DocumentedException (org.opendaylight.netconf.api.DocumentedException)1 GetConfig (org.opendaylight.netconf.mdsal.connector.ops.get.GetConfig)1