mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/mp/TestProgramImpl.java
@Test
    public void testGetSecondaryImages()
    {
        DigitalMedia media1 = new DigitalMedia().withEncoding("encoding");
        DigitalMedia media2 = new DigitalMedia().withEncoding("alsoEncoding");
        List<DigitalMedia> setOfImages = new ArrayList<DigitalMedia>();
        setOfImages.add(media1);
        setOfImages.add(media2);

        ProgramImpl program = new ProgramImpl(m_Manager, m_EventAdmin, new MissionProgramTemplate().
            withSource("Fish").withName("Snake").withSecondaryImages(setOfImages), 
            new MissionProgramParameters().withSchedule(new MissionProgramSchedule().withIndefiniteInterval(false)), 
            UUID.randomUUID());

        //verify the set is 2
        assertThat(program.getSecondaryImages().size(), is(2));
        try
        {
            //attempt to add a new item, expect failure as the list is unmodifiable
            program.getSecondaryImages().add(new DigitalMedia());
            fail("Expected Exception");
        }
        catch (UnsupportedOperationException e)
        {

        }
        //verify that the list of images is still 2
        assertThat(program.getSecondaryImages().size(), is(2));

        List<DigitalMedia> images = program.getSecondaryImages();
        assertThat(images.get(0).getEncoding(), is("encoding"));
        assertThat(images.get(1).getEncoding(), is("alsoEncoding"));
        images.get(0).setEncoding("badEncoding");
        
        //verify that the encoding was NOT changed.
        assertThat(program.getSecondaryImages().size(), is (2));
        assertThat(program.getSecondaryImages().get(0).getEncoding(), is("encoding"));
        assertThat(program.getSecondaryImages().get(1).getEncoding(), is("alsoEncoding"));
    }
/**
     * Verify that secondary images can be retrieved from the program with all information intact. Also verify that the
     * list of secondary images cannot be modified.
     */
Verify that secondary images can be retrieved from the program with all information intact. Also verify that the
list of secondary images cannot be modified.
Verify that secondary images can be retrieved from the program with all information intact . Also verify that the list of secondary images cannot be modified .
@Test
    public void testGetSecondaryImages()
    {
        DigitalMedia media1 = new DigitalMedia().withEncoding("encoding");
        DigitalMedia media2 = new DigitalMedia().withEncoding("alsoEncoding");
        List<DigitalMedia> setOfImages = new ArrayList<DigitalMedia>();
        setOfImages.add(media1);
        setOfImages.add(media2);
        ProgramImpl program = new ProgramImpl(m_Manager, m_EventAdmin, new MissionProgramTemplate().
            withSource("Fish").withName("Snake").withSecondaryImages(setOfImages), 
            new MissionProgramParameters().withSchedule(new MissionProgramSchedule().withIndefiniteInterval(false)), 
            UUID.randomUUID());
        assertThat(program.getSecondaryImages().size(), is(2));
        try
        {
            program.getSecondaryImages().add(new DigitalMedia());
            fail("Expected Exception");
        }
        catch (UnsupportedOperationException e)
        {
        }
        assertThat(program.getSecondaryImages().size(), is(2));
        List<DigitalMedia> images = program.getSecondaryImages();
        assertThat(images.get(0).getEncoding(), is("encoding"));
        assertThat(images.get(1).getEncoding(), is("alsoEncoding"));
        images.get(0).setEncoding("badEncoding");
        assertThat(program.getSecondaryImages().size(), is (2));
        assertThat(program.getSecondaryImages().get(0).getEncoding(), is("encoding"));
        assertThat(program.getSecondaryImages().get(1).getEncoding(), is("alsoEncoding"));
    }
@ Test public void testGetSecondaryImages ( ) { DigitalMedia media1 = new DigitalMedia ( ) . withEncoding ( "encoding" ) ; DigitalMedia media2 = new DigitalMedia ( ) . withEncoding ( "alsoEncoding" ) ; List < DigitalMedia > setOfImages = new ArrayList < DigitalMedia > ( ) ; setOfImages . add ( media1 ) ; setOfImages . add ( media2 ) ; ProgramImpl program = new ProgramImpl ( m_Manager , m_EventAdmin , new MissionProgramTemplate ( ) . withSource ( "Fish" ) . withName ( "Snake" ) . withSecondaryImages ( setOfImages ) , new MissionProgramParameters ( ) . withSchedule ( new MissionProgramSchedule ( ) . withIndefiniteInterval ( false ) ) , UUID . randomUUID ( ) ) ; assertThat ( program . getSecondaryImages ( ) . size ( ) , is ( 2 ) ) ; try { program . getSecondaryImages ( ) . add ( new DigitalMedia ( ) ) ; fail ( "Expected Exception" ) ; } catch ( UnsupportedOperationException e ) { } assertThat ( program . getSecondaryImages ( ) . size ( ) , is ( 2 ) ) ; List < DigitalMedia > images = program . getSecondaryImages ( ) ; assertThat ( images . get ( 0 ) . getEncoding ( ) , is ( "encoding" ) ) ; assertThat ( images . get ( 1 ) . getEncoding ( ) , is ( "alsoEncoding" ) ) ; images . get ( 0 ) . setEncoding ( "badEncoding" ) ; assertThat ( program . getSecondaryImages ( ) . size ( ) , is ( 2 ) ) ; assertThat ( program . getSecondaryImages ( ) . get ( 0 ) . getEncoding ( ) , is ( "encoding" ) ) ; assertThat ( program . getSecondaryImages ( ) . get ( 1 ) . getEncoding ( ) , is ( "alsoEncoding" ) ) ; }
Verify that secondary images can be retrieved from the program with all information intact.
Verify that secondary images can be retrieved from the program with all information intact .
//verify the set is 2 //attempt to add a new item, expect failure as the list is unmodifiable //verify that the list of images is still 2 //verify that the encoding was NOT changed.