mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/persistence/TestAbstractDataStore.java
@Test
    public final void testRemoveUUID()
    {
        //verify that a null uuid throws an exception
        Throwable e = null;
        try { m_SUT.remove((UUID)null); }
        catch (Throwable ex) { e = ex; }
        assertThat(e, instanceOf(IllegalArgumentException.class));
        
        //verify that an invalid uuid throws an exception
        UUID uuid = UUID.randomUUID();
        e = null;
        try { m_SUT.remove(uuid); }
        catch (Throwable ex) { e = ex; }
        assertThat(e, instanceOf(IllegalArgumentException.class));
        
        //verify that the object associated with a valid uuid is removed
        doAnswer(new Answer<Object>()
        {
            @Override
            public Object answer(InvocationOnMock invocation) throws Throwable
            {
                when(m_Query.execute()).thenReturn(Arrays.asList(new Long[] {5L}));
                return null;
            }
        }).when(m_Query).setFilter("uuid == '" + uuid.toString() + "'");
        
        m_SUT.remove(uuid);
        verify(m_PersistenceManager).deletePersistent(5L);
        verify(m_FetchPlan, times(2)).removeGroup("extendedDataGroup");
        verify(m_FetchPlan, times(2)).addGroup("extendedDataGroup");
        verify(m_WakeLock, times(3)).activate();
        verify(m_WakeLock, times(3)).cancel();
    }
/**
     * Verify that a null uuid and an invalid uuid throw exceptions, and that the object associated with a valid 
     * uuid is removed.
     */
Verify that a null uuid and an invalid uuid throw exceptions, and that the object associated with a valid
uuid is removed.
Verify that a null uuid and an invalid uuid throw exceptions and that the object associated with a valid uuid is removed .
@Test
    public final void testRemoveUUID()
    {
        Throwable e = null;
        try { m_SUT.remove((UUID)null); }
        catch (Throwable ex) { e = ex; }
        assertThat(e, instanceOf(IllegalArgumentException.class));
        UUID uuid = UUID.randomUUID();
        e = null;
        try { m_SUT.remove(uuid); }
        catch (Throwable ex) { e = ex; }
        assertThat(e, instanceOf(IllegalArgumentException.class));
        doAnswer(new Answer<Object>()
        {
            @Override
            public Object answer(InvocationOnMock invocation) throws Throwable
            {
                when(m_Query.execute()).thenReturn(Arrays.asList(new Long[] {5L}));
                return null;
            }
        }).when(m_Query).setFilter("uuid == '" + uuid.toString() + "'");
        m_SUT.remove(uuid);
        verify(m_PersistenceManager).deletePersistent(5L);
        verify(m_FetchPlan, times(2)).removeGroup("extendedDataGroup");
        verify(m_FetchPlan, times(2)).addGroup("extendedDataGroup");
        verify(m_WakeLock, times(3)).activate();
        verify(m_WakeLock, times(3)).cancel();
    }
@ Test public final void testRemoveUUID ( ) { Throwable e = null ; try { m_SUT . remove ( ( UUID ) null ) ; } catch ( Throwable ex ) { e = ex ; } assertThat ( e , instanceOf ( IllegalArgumentException . class ) ) ; UUID uuid = UUID . randomUUID ( ) ; e = null ; try { m_SUT . remove ( uuid ) ; } catch ( Throwable ex ) { e = ex ; } assertThat ( e , instanceOf ( IllegalArgumentException . class ) ) ; doAnswer ( new Answer < Object > ( ) { @ Override public Object answer ( InvocationOnMock invocation ) throws Throwable { when ( m_Query . execute ( ) ) . thenReturn ( Arrays . asList ( new Long [ ] { 5L } ) ) ; return null ; } } ) . when ( m_Query ) . setFilter ( "uuid == '" + uuid . toString ( ) + "'" ) ; m_SUT . remove ( uuid ) ; verify ( m_PersistenceManager ) . deletePersistent ( 5L ) ; verify ( m_FetchPlan , times ( 2 ) ) . removeGroup ( "extendedDataGroup" ) ; verify ( m_FetchPlan , times ( 2 ) ) . addGroup ( "extendedDataGroup" ) ; verify ( m_WakeLock , times ( 3 ) ) . activate ( ) ; verify ( m_WakeLock , times ( 3 ) ) . cancel ( ) ; }
Verify that a null uuid and an invalid uuid throw exceptions, and that the object associated with a valid
 uuid is removed.
Verify that a null uuid and an invalid uuid throw exceptions and that the object associated with a valid uuid is removed .
//verify that a null uuid throws an exception //verify that an invalid uuid throws an exception //verify that the object associated with a valid uuid is removed