mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetModel.java
@Test
    public void testSetters()
    {
        //create asset model
        AssetModel model = new AssetModel(123, m_Uuid, ASSET_PID, Asset.class.getName(), 
                m_FactoryMgr, m_ConfigWrapper, m_AssetTypesMgr, m_AssetImageInterface);
        
        assertThat(model.isComplete(), is(false));
        
        //update the ASSET_NAME
        model.updateName(ASSET_NAME);
        assertThat(model.getName(), is(ASSET_NAME));
        
        model.setName("test");
        assertThat(model.getWorkingName(), is("test"));
        
        //set active status
        model.setActiveStatus(AssetActiveStatus.ACTIVATING);
        //check that isActive returns false
        assertThat(model.isActive(), is(false));
        //set active status to activated
        model.setActiveStatus(AssetActiveStatus.ACTIVATED);
        assertThat(model.isActive(), is(true));
        
        //set the summary
        model.setSummary(SummaryStatusEnum.OFF);
        assertThat(model.getSummaryStatus(), is(SummaryStatusEnum.OFF));
        
        //set the pid 
        model.setPid("ChangedPid");
        assertThat(model.getPid(), is ("ChangedPid"));
        
        model.setPid(null);
        assertThat(model.getPid(), is(""));
        
        //set coordinates
        HaeMeters haeMeters = HaeMeters.newBuilder().setValue(200d).build();
        LatitudeWgsDegrees lam = LatitudeWgsDegrees.newBuilder().setValue(-85d).build();
        LongitudeWgsDegrees lom = LongitudeWgsDegrees.newBuilder().setValue(40d).build();
        Coordinates c = Coordinates.newBuilder().setLongitude(lom).setAltitude(haeMeters).setLatitude(lam).build();
        
        model.setCoordinates(c);
        assertThat(Double.valueOf(model.getLocation().getLatitude().toString()), is(-85d));
        assertThat(Double.valueOf(model.getLocation().getLongitude().toString()), is(40d));
        assertThat(Double.valueOf(model.getLocation().getAltitude().toString()), is(200d));
        
        //set orientation
        ElevationDegrees em = ElevationDegrees.newBuilder().setValue(400d).build();
        HeadingDegrees hm = HeadingDegrees.newBuilder().setValue(180d).build();
        BankDegrees bank = BankDegrees.newBuilder().setValue(88d).build();
        Orientation o = Orientation.newBuilder().setBank(bank).setElevation(em).setHeading(hm).build();
        
        model.setOrientation(o);
        assertThat(Double.valueOf(model.getLocation().getElevation().toString()), is(400d));
        assertThat(Double.valueOf(model.getLocation().getBank().toString()), is(88d));
        assertThat(Double.valueOf(model.getLocation().getHeading().toString()), is(180d));
    }
/**
     * Test setter methods of the asset model.
     * 
     * Verify that isX methods update appropriately to newly set values.
     */
Test setter methods of the asset model.

Verify that isX methods update appropriately to newly set values.
Test setter methods of the asset model . Verify that isX methods update appropriately to newly set values .
@Test
    public void testSetters()
    {
        AssetModel model = new AssetModel(123, m_Uuid, ASSET_PID, Asset.class.getName(), 
                m_FactoryMgr, m_ConfigWrapper, m_AssetTypesMgr, m_AssetImageInterface);
        assertThat(model.isComplete(), is(false));
        model.updateName(ASSET_NAME);
        assertThat(model.getName(), is(ASSET_NAME));
        model.setName("test");
        assertThat(model.getWorkingName(), is("test"));
        model.setActiveStatus(AssetActiveStatus.ACTIVATING);
        assertThat(model.isActive(), is(false));
         to activated
        model.setActiveStatus(AssetActiveStatus.ACTIVATED);
        assertThat(model.isActive(), is(true));
        model.setSummary(SummaryStatusEnum.OFF);
        assertThat(model.getSummaryStatus(), is(SummaryStatusEnum.OFF));
        model.setPid("ChangedPid");
        assertThat(model.getPid(), is ("ChangedPid"));
        model.setPid(null);
        assertThat(model.getPid(), is(""));
        HaeMeters haeMeters = HaeMeters.newBuilder().setValue(200d).build();
        LatitudeWgsDegrees lam = LatitudeWgsDegrees.newBuilder().setValue(-85d).build();
        LongitudeWgsDegrees lom = LongitudeWgsDegrees.newBuilder().setValue(40d).build();
        Coordinates c = Coordinates.newBuilder().setLongitude(lom).setAltitude(haeMeters).setLatitude(lam).build();
        model.setCoordinates(c);
        assertThat(Double.valueOf(model.getLocation().getLatitude().toString()), is(-85d));
        assertThat(Double.valueOf(model.getLocation().getLongitude().toString()), is(40d));
        assertThat(Double.valueOf(model.getLocation().getAltitude().toString()), is(200d));
        ElevationDegrees em = ElevationDegrees.newBuilder().setValue(400d).build();
        HeadingDegrees hm = HeadingDegrees.newBuilder().setValue(180d).build();
        BankDegrees bank = BankDegrees.newBuilder().setValue(88d).build();
        Orientation o = Orientation.newBuilder().setBank(bank).setElevation(em).setHeading(hm).build();
        model.setOrientation(o);
        assertThat(Double.valueOf(model.getLocation().getElevation().toString()), is(400d));
        assertThat(Double.valueOf(model.getLocation().getBank().toString()), is(88d));
        assertThat(Double.valueOf(model.getLocation().getHeading().toString()), is(180d));
    }
@ Test public void testSetters ( ) { AssetModel model = new AssetModel ( 123 , m_Uuid , ASSET_PID , Asset . class . getName ( ) , m_FactoryMgr , m_ConfigWrapper , m_AssetTypesMgr , m_AssetImageInterface ) ; assertThat ( model . isComplete ( ) , is ( false ) ) ; model . updateName ( ASSET_NAME ) ; assertThat ( model . getName ( ) , is ( ASSET_NAME ) ) ; model . setName ( "test" ) ; assertThat ( model . getWorkingName ( ) , is ( "test" ) ) ; model . setActiveStatus ( AssetActiveStatus . ACTIVATING ) ; assertThat ( model . isActive ( ) , is ( false ) ) ; model . setActiveStatus ( AssetActiveStatus . ACTIVATED ) ; assertThat ( model . isActive ( ) , is ( true ) ) ; model . setSummary ( SummaryStatusEnum . OFF ) ; assertThat ( model . getSummaryStatus ( ) , is ( SummaryStatusEnum . OFF ) ) ; model . setPid ( "ChangedPid" ) ; assertThat ( model . getPid ( ) , is ( "ChangedPid" ) ) ; model . setPid ( null ) ; assertThat ( model . getPid ( ) , is ( "" ) ) ; HaeMeters haeMeters = HaeMeters . newBuilder ( ) . setValue ( 200d ) . build ( ) ; LatitudeWgsDegrees lam = LatitudeWgsDegrees . newBuilder ( ) . setValue ( - 85d ) . build ( ) ; LongitudeWgsDegrees lom = LongitudeWgsDegrees . newBuilder ( ) . setValue ( 40d ) . build ( ) ; Coordinates c = Coordinates . newBuilder ( ) . setLongitude ( lom ) . setAltitude ( haeMeters ) . setLatitude ( lam ) . build ( ) ; model . setCoordinates ( c ) ; assertThat ( Double . valueOf ( model . getLocation ( ) . getLatitude ( ) . toString ( ) ) , is ( - 85d ) ) ; assertThat ( Double . valueOf ( model . getLocation ( ) . getLongitude ( ) . toString ( ) ) , is ( 40d ) ) ; assertThat ( Double . valueOf ( model . getLocation ( ) . getAltitude ( ) . toString ( ) ) , is ( 200d ) ) ; ElevationDegrees em = ElevationDegrees . newBuilder ( ) . setValue ( 400d ) . build ( ) ; HeadingDegrees hm = HeadingDegrees . newBuilder ( ) . setValue ( 180d ) . build ( ) ; BankDegrees bank = BankDegrees . newBuilder ( ) . setValue ( 88d ) . build ( ) ; Orientation o = Orientation . newBuilder ( ) . setBank ( bank ) . setElevation ( em ) . setHeading ( hm ) . build ( ) ; model . setOrientation ( o ) ; assertThat ( Double . valueOf ( model . getLocation ( ) . getElevation ( ) . toString ( ) ) , is ( 400d ) ) ; assertThat ( Double . valueOf ( model . getLocation ( ) . getBank ( ) . toString ( ) ) , is ( 88d ) ) ; assertThat ( Double . valueOf ( model . getLocation ( ) . getHeading ( ) . toString ( ) ) , is ( 180d ) ) ; }
Test setter methods of the asset model.
Test setter methods of the asset model .
//create asset model //update the ASSET_NAME //set active status //check that isActive returns false //set active status to activated //set the summary //set the pid  //set coordinates //set orientation