Package com.google.testing.testify.risk.frontend.model

Examples of com.google.testing.testify.risk.frontend.model.Component


    for (int cIndex = 0; cIndex < components.size(); cIndex++) {
      for (int aIndex = 0; aIndex < attributes.size(); aIndex++) {
        int row = cIndex + 1;
        int column = aIndex + 1;

        Component component = components.get(cIndex);
        Attribute attribute = attributes.get(aIndex);
        Integer key = Capability.getCapabilityIntersectionKey(component, attribute);

        grid.getCellFormatter().setStyleName(row, column, "tty-GridCell");
        if (row == highlightedCellRow && column == highlightedCellColumn) {
View Full Code Here


      }
    };
  }

  private void cellClicked(int row, int column) {
    final Component component = components.get(row - 1);
    final Attribute attribute = attributes.get(column - 1);

    if (highlightedCellRow != -1 && highlightedCellColumn != -1) {
      grid.getCellFormatter().removeStyleName(
          highlightedCellRow, highlightedCellColumn, "tty-GridCellSelected");
View Full Code Here

    attributes.add(attr3);

    // Components.
    LOG.info("Creating components.");
    ArrayList<Component> components = Lists.newArrayList();
    Component comp1 = new Component(projectId);
    comp1.setName("Shopping Cart");
    comp1.addLabel("dev lead: miles@example");
    comp1.addLabel("tester: katherine@example");
    comp1.setDescription("Contains items people want to buy.");
    comp1.setComponentId(projectService.createComponent(comp1));
    components.add(comp1);

    Component comp2 = new Component(projectId);
    comp2.setName("Sales Channel");
    comp2.addLabel("dev lead: colin@example");
    comp2.setComponentId(projectService.createComponent(comp2));
    components.add(comp2);

    Component comp3 = new Component(projectId);
    comp3.setName("Social");
    comp3.addLabel("owner: alaska@example");
    comp3.setComponentId(projectService.createComponent(comp3));
    components.add(comp3);

    Component comp4 = new Component(projectId);
    comp4.setName("Search");
    comp4.setComponentId(projectService.createComponent(comp4));
    components.add(comp4);

    // Capabilities.
    LOG.info("Creating capabilities.");
    ArrayList<Capability> capabilities = Lists.newArrayList();
View Full Code Here

   * loaded, so it will not show the panel if all data has not been loaded.
   */
  private void tryToPopulateCapabilitiesPanel() {
    if (selectedIntersection != null && attributes != null && components != null
          && capabilities != null) {
      Component component = selectedIntersection.getFirst();
      Attribute attribute = selectedIntersection.getSecond();

      capabilitiesContainer.setVisible(true);
      capabilitiesContainerTitle.setText(component.getName() + " is " + attribute.getName());

      List<EditCapabilityWidget> widgets = Lists.newArrayList();
      for (final Capability capability : capabilities) {
        // If we're interested in this capability (it matches our current filter).
        if (capability.getComponentId() == component.getComponentId()
            && capability.getAttributeId() == attribute.getAttributeId()) {
          // Create and populate a capability widget for this capability.
          final EditCapabilityWidget widget = new EditCapabilityWidget(capability);
          widget.addValueChangeHandler(new ValueChangeHandler<Capability>() {
              @Override
View Full Code Here

    if (aIndex < 0 || aIndex >= attributes.size() || cIndex < 0 || cIndex >= components.size()) {
      return null;
    }

    Attribute attribute = attributes.get(aIndex);
    Component component = components.get(cIndex);
    Integer key = Capability.getCapabilityIntersectionKey(component, attribute);
    return dataMap.get(key);
  }
View Full Code Here

    for (int cIndex = 0; cIndex < components.size(); cIndex++) {
      for (int aIndex = 0; aIndex < attributes.size(); aIndex++) {
        int row = cIndex + 1;
        int column = aIndex + 1;
        Attribute attribute = attributes.get(aIndex);
        Component component = components.get(cIndex);
        Integer key = Capability.getCapabilityIntersectionKey(component, attribute);
        CapabilityIntersectionData data = dataMap.get(key);

        double risk = 0.0;
        double mitigations = 0.0;
View Full Code Here

    ServletUtils.requireAccess(userService.hasEditAccess(component.getParentProjectId()));

    log.info("Updating Component: " + component.getComponentId().toString());
    PersistenceManager pm = pmf.getPersistenceManager();
    try {
      Component oldComponent = pm.getObjectById(Component.class, component.getComponentId());
      if (oldComponent.getParentProjectId() != component.getParentProjectId()) {
        log.severe("Possible attack -- component sent in and component being overwritten had"
            + " different project IDs.");
        ServletUtils.requireAccess(false);
      }
View Full Code Here

    }

    log.info("Removing Component: " + component.getComponentId().toString());
    PersistenceManager pm = pmf.getPersistenceManager();
    try {
      Component componentToDelete = pm.getObjectById(Component.class, component.getComponentId());
      ServletUtils.requireAccess(userService.hasEditAccess(componentToDelete.getParentProjectId()));

      pm.deletePersistent(componentToDelete);
      deleteLabels(componentToDelete, pm);

      // Delete any child capabilities.
View Full Code Here

      Window.alert("Error: Please enter a Component name.");
      return;
    }

    // Create new Component and attach to UI
    Component newComponent = new Component(presenter.getProjectId());
    newComponent.setName(newComponentName.getText());

    presenter.createComponent(newComponent);
    // Upon creation the presenter will do a full refresh. No need to rebuild the Component list.
    newComponentName.setText("");
  }
View Full Code Here

    ProjectRpcAsync projServiceObserver = EasyMock.createMock(ProjectRpcAsync.class);
    ProjectSettingsView viewObserver = EasyMock.createMock(ProjectSettingsView.class);
    ComponentsView.Presenter mockParent = EasyMock.createMock(ComponentsView.Presenter.class);

    ComponentView mockComponentView = EasyMock.createMock(ComponentView.class);
    Component targetComponent = new Component(0L);
    targetComponent.setName("Target Component");
    targetComponent.setDescription("Test");

    // Verify this initialization sequence
    mockComponentView.setPresenter(EasyMock.isA(Presenter.class));
    mockComponentView.setComponentName(targetComponent.getName());
    mockComponentView.setDescription("Test");
    mockComponentView.setComponentLabels(EasyMock.isA(List.class));

    EasyMock.replay(mockComponentView, mockParent);
View Full Code Here

TOP

Related Classes of com.google.testing.testify.risk.frontend.model.Component

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.