Package gov.nasa.arc.mct.policy

Examples of gov.nasa.arc.mct.policy.ExecutionResult


    } else if (StaticGraphicalView.class.equals(viewInfo.getViewClass())) {
      AbstractComponent targetComponent = context.getProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), AbstractComponent.class);
      result = GraphicalComponent.class.isAssignableFrom(targetComponent.getClass());
    }

    return new ExecutionResult(context, result, null);
  }
View Full Code Here


            // Check if the feed type is String. We don't want to plot or
            // graphicalmatriculatamatize them
            if(provider != null){
              if (provider.getFeedType() == FeedType.STRING) {
                  return new ExecutionResult(context, false, EM_STRING);
              }
            }
        }
    return new ExecutionResult(context, true, EM_STRING);
  }
View Full Code Here

      // Check if the feed type is String. We don't want to plot or
      // graphicalmatize them
      if (provider != null) {
        if (provider.getFeedType() == FeedType.STRING) {
          return new ExecutionResult(context, false, EM_STRING);
        }
      }
    }
    return new ExecutionResult(context, true, EM_STRING);
  }
View Full Code Here

    if (viewInfo.getViewClass().equals(PlotViewManifestation.class)) {
      AbstractComponent targetComponent = context.getProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), AbstractComponent.class);
     
      if (targetComponent.isLeaf() && !hasFeed(targetComponent)) {
        String message = "Leaf is not a feed.";
        return new ExecutionResult(context, false, message);
      }
     
      result = !rejectCanvasView(context,targetComponent);
    }
   
    String message;
    if (result) {
           message = "Requested Plot View has children with data feeds.";
    } else {
       message = "Requested Plot View did not have children with data feeds.";
    }
    return new ExecutionResult(context, result, message);
  }
View Full Code Here

                 Collections.<AbstractComponent> emptyList());
   
    access = new PolicyManagerAccess();
    access.setPolicyManager(policyManager);
    PolicyContext context = new PolicyContext();
        result = new ExecutionResult(context, true, "");
        Mockito.when(policyManager.execute(Mockito.anyString(), Mockito.any(PolicyContext.class))).thenReturn(result)
        mockComponent = new DummyComponent();
        new PlatformAccess().setPlatform(mockPlatform);
    Mockito.when(mockPlatform.getPersistenceProvider()).thenReturn(mockProvider);
  }
View Full Code Here

    Mockito.when(mockPlatform.getPolicyManager()).thenReturn(mockPolicyManager);
    Mockito.when(mockPlatform.getPersistenceProvider()).thenReturn(mockPersistenceProvider);
    Mockito.when(mockPlatform.getComponentRegistry()).thenReturn(mockComponentRegistry);
    Mockito.when(mockComponentRegistry.getViewInfos(Mockito.anyString(), Mockito.any(ViewType.class)))
      .thenReturn(Collections.singleton(new ViewInfo(TableViewManifestation.class,"","",ViewType.EMBEDDED)));
    Mockito.when(mockPolicyManager.execute(Mockito.anyString(), Mockito.any(PolicyContext.class))).thenReturn(new ExecutionResult(null, true, ""));
        Mockito.when(mockPersistenceProvider.getReferencedComponents(Mockito.any(AbstractComponent.class))).thenReturn(Collections.<AbstractComponent>emptyList());

    (new PlatformAccess()).setPlatform(mockPlatform);
   
    a0 = new MockFeedComponent();
View Full Code Here

   
    String message = null;
    if (!result) {
       message = "Evaluator View only valid for components with evalutors";
    }
    return new ExecutionResult(context, result, message);
  }
View Full Code Here

          }
        }
      }
    }
    if (canExecute) {
      return new ExecutionResult(context, true, "");
    } else {
      return new ExecutionResult(context, false, "One or more objects could not be removed because it is being used");
    }
  }
View Full Code Here

   
    String message = null;
    if (!result) {
       message = "Expression View only valid for enumerators";
    }
    return new ExecutionResult(context, result, message);
  }
View Full Code Here

//            OptionBox.showMessageDialog(
//                            null,
//                            "Only objects that provide data can be added\nto a new multi",
//                            "Error",
//                            OptionBox.ERROR_MESSAGE);
            return new ExecutionResult(context, false, "Only objects that provide data can be added to a multi");
          }
        }
      }
    }
    return new ExecutionResult(context, true, "");
  }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.policy.ExecutionResult

Copyright © 2018 www.massapicom. 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.