Package gov.nasa.arc.mct.policy

Examples of gov.nasa.arc.mct.policy.Policy.execute()


    context = new PolicyContext();
    context.setProperty(PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(),
        plotViewInfo);
    context.setProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(),
        leafWithAFeedComponent);   
    Assert.assertTrue(policy.execute(context).getStatus());

    // ...but not without a feed
    context = new PolicyContext();
    context.setProperty(PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(),
        plotViewInfo);
View Full Code Here


    context = new PolicyContext();
    context.setProperty(PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(),
        plotViewInfo);
    context.setProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(),
        leafWithOutAFeedComponent);   
    Assert.assertFalse(policy.execute(context).getStatus());
   
    // Plot view policy should not reject non-plot, ever
    for (AbstractComponent ac : new AbstractComponent[] { leafWithAFeedComponent, leafWithOutAFeedComponent, nonLeafComponent} ) {
      for (ViewType vt : ViewType.values()) {
        ViewInfo someViewInfo = new ViewInfo(NonPlotView.class, "NonPlot", vt);
View Full Code Here

        context = new PolicyContext();
        context.setProperty(PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(),
            someViewInfo);
        context.setProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(),
            ac);   
        Assert.assertTrue(policy.execute(context).getStatus());
      }
    }
  }
 
  private static class NonPlotView extends View
View Full Code Here

    context.setProperty(PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(), graphicalViewInfo);
   
    Policy policy = new GraphicalStringPolicy();
   
    Mockito.when(mockFeedProvider.getFeedType()).thenReturn(FeedType.STRING);
    Assert.assertFalse(policy.execute(context).getStatus());
   
    Mockito.when(mockFeedProvider.getFeedType()).thenReturn(FeedType.INTEGER);
    Assert.assertTrue(policy.execute(context).getStatus());
   
    Mockito.when(mockFeedProvider.getFeedType()).thenReturn(FeedType.FLOATING_POINT);
View Full Code Here

   
    Mockito.when(mockFeedProvider.getFeedType()).thenReturn(FeedType.STRING);
    Assert.assertFalse(policy.execute(context).getStatus());
   
    Mockito.when(mockFeedProvider.getFeedType()).thenReturn(FeedType.INTEGER);
    Assert.assertTrue(policy.execute(context).getStatus());
   
    Mockito.when(mockFeedProvider.getFeedType()).thenReturn(FeedType.FLOATING_POINT);
    Assert.assertTrue(policy.execute(context).getStatus());
  }
}
View Full Code Here

   
    Mockito.when(mockFeedProvider.getFeedType()).thenReturn(FeedType.INTEGER);
    Assert.assertTrue(policy.execute(context).getStatus());
   
    Mockito.when(mockFeedProvider.getFeedType()).thenReturn(FeedType.FLOATING_POINT);
    Assert.assertTrue(policy.execute(context).getStatus());
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.