@Test
public void testCreateNTv2Grid() {

    
    // Try to create a null grid
    boolean factoryExceptionThrown = false;
    try {
        factory.createNTv2Grid(null);
    } catch (FactoryException e) {
        factoryExceptionThrown = true;
    }
    assertTrue(factoryExceptionThrown);
    // Try to create a grid from an inexistent resource
    factoryExceptionThrown = false;
    try {
        factory.createNTv2Grid(INEXISTENT_GRID); // Will log a FINEST message
    } catch (FactoryException e) {
        factoryExceptionThrown = true;
    }
    assertTrue(factoryExceptionThrown);
    
    // Try to create a grid from a corrupt NTv2 grid file
    factoryExceptionThrown = false;
    try {
        factory.createNTv2Grid(MALFORMED_GRID);  // Will log a SEVERE message
    } catch (FactoryException e) {
        factoryExceptionThrown = true;
    }
    assertTrue(factoryExceptionThrown);

    // Create a grid from the test file
    factoryExceptionThrown = false;
    GridShiftFile grid = null;
    try {
        grid = factory.createNTv2Grid(TEST_GRID);
    } catch (FactoryException e) {
        factoryExceptionThrown = true;
    }
    assertFalse(factoryExceptionThrown);
    assertNotNull(grid);
    assertTrue(grid.isLoaded());
}