Examples of Change


Examples of com.amazonaws.services.route53.model.Change

    public void changeRecords(String hostedZoneId, List<ResourceRecordSet> create, List<ResourceRecordSet> remove) {
        List<Change> changes = Lists.newArrayList();

        for (ResourceRecordSet r : remove) {
            Change change = new Change(ChangeAction.DELETE, r);
            changes.add(change);
        }

        for (ResourceRecordSet r : create) {
            Change change = new Change(ChangeAction.CREATE, r);
            changes.add(change);
        }

        if (changes.isEmpty()) {
            log.info("No DNS record changes");
View Full Code Here

Examples of com.cumulocity.me.model.audit.Change

        json.putOpt(PROP_NEW_VALUE, (getConversionService().toJson(((Change)representation).getNewValue())));
        return json;
    }

    public Object fromJson(JSONObject json) {
        Change change = new Change();
        change.setAttribute(getString(json, PROP_ATTRIBUTE));
        change.setType(getString(json, PROP_TYPE));
        change.setPreviousValue(getObject(json, PROP_PREVIOUS_VALUE, Change.class));
        change.setNewValue(getObject(json, PROP_NEW_VALUE, Change.class));
        return change;
    }
View Full Code Here

Examples of com.gitblit.models.TicketModel.Change

    // query non-existent ticket
    TicketModel nonExistent = service.getTicket(getRepository(), 0);
    assertNull(nonExistent);
   
    // create and insert a ticket
    Change c1 = newChange("testCreation() " + Long.toHexString(System.currentTimeMillis()));
    TicketModel ticket = service.createTicket(getRepository(), c1);
    assertTrue(ticket.number > 0);

    // retrieve ticket and compare
    TicketModel constructed = service.getTicket(getRepository(), ticket.number);
    compare(ticket, constructed);

    assertEquals(1, constructed.changes.size());

    // C1: create the ticket
    int changeCount = 0;
    c1 = newChange("testUpdates() " + Long.toHexString(System.currentTimeMillis()));
    ticket = service.createTicket(getRepository(), c1);
    assertTrue(ticket.number > 0);
    changeCount++;

    constructed = service.getTicket(getRepository(), ticket.number);
    compare(ticket, constructed);
    assertEquals(1, constructed.changes.size());

    // C2: set owner
    Change c2 = new Change("C2");
    c2.comment("I'll fix this");
    c2.setField(Field.responsible, c2.author);
    constructed = service.updateTicket(getRepository(), ticket.number, c2);
    assertNotNull(constructed);
    assertEquals(2, constructed.changes.size());
    assertEquals(c2.author, constructed.responsible);
    changeCount++;

    // C3: add a note
    Change c3 = new Change("C3");
    c3.comment("yeah, this is working");
    constructed = service.updateTicket(getRepository(), ticket.number, c3);
    assertNotNull(constructed);
    assertEquals(3, constructed.changes.size());
    changeCount++;

    if (service.supportsAttachments()) {
      // C4: add attachment
      Change c4 = new Change("C4");
      Attachment a = newAttachment();
      c4.addAttachment(a);
      constructed = service.updateTicket(getRepository(), ticket.number, c4);
      assertNotNull(constructed);
      assertTrue(constructed.hasAttachments());
      Attachment a1 = service.getAttachment(getRepository(), ticket.number, a.name);
      assertEquals(a.content.length, a1.content.length);
      assertTrue(Arrays.areEqual(a.content, a1.content));
      changeCount++;
    }

    // C5: close the issue
    Change c5 = new Change("C5");
    c5.comment("closing issue");
    c5.setField(Field.status, Status.Resolved);
    constructed = service.updateTicket(getRepository(), ticket.number, c5);
    assertNotNull(constructed);
    changeCount++;
    assertTrue(constructed.isClosed());
    assertEquals(changeCount, constructed.changes.size());

    List<TicketModel> allTickets = service.getTickets(getRepository());
    List<TicketModel> openTickets = service.getTickets(getRepository(), new TicketFilter() {
      @Override
      public boolean accept(TicketModel ticket) {
        return ticket.isOpen();
      }
    });
    List<TicketModel> closedTickets = service.getTickets(getRepository(), new TicketFilter() {
      @Override
      public boolean accept(TicketModel ticket) {
        return ticket.isClosed();
      }
    });
    assertTrue(allTickets.size() > 0);
    assertEquals(1, openTickets.size());
    assertEquals(1, closedTickets.size());

    // build a new Lucene index
    service.reindex(getRepository());
    List<QueryResult> hits = service.searchFor(getRepository(), "working", 1, 10);
    assertEquals(1, hits.size());

    // reindex a ticket
    ticket = allTickets.get(0);
    Change change = new Change("reindex");
    change.comment("this is a test of reindexing a ticket");
    service.updateTicket(getRepository(), ticket.number, change);
    ticket = service.getTicket(getRepository(), ticket.number);

    hits = service.searchFor(getRepository(), "reindexing", 1, 10);
    assertEquals(1, hits.size());
View Full Code Here

Examples of com.google.api.services.drive.model.Change

    int size = before.size();
    assertThat(size, greaterThan(1));

    int changeNumber = 3;
    Change change = before.get(changeNumber);
    ChangeId changeId = ChangeId.of(change.getId());

    List<Change> res = listChanges(changes, changeId);
    assertThat(res.size(), equalTo(size - changeNumber));
  }
View Full Code Here

Examples of com.google.enterprise.connector.util.diffing.Change

  }

  public void testCheckpointAndChange_internal() throws Exception {
    DiffingConnectorCheckpoint fccp = DiffingConnectorCheckpoint.newFirst();
    DeleteDocumentHandle ddh = new DeleteDocumentHandle("abc");
    Change c = new Change(Change.FactoryType.INTERNAL, ddh, MCP);
    CheckpointAndChange checkpointAndChange = new CheckpointAndChange(fccp, c);
    String stringForm = checkpointAndChange.getJson().toString();
    JSONObject json = new JSONObject(stringForm);
    CheckpointAndChange copy = new CheckpointAndChange(json, internalFactory,
        clientFactory);
    assertEquals(fccp, copy.getCheckpoint());
    assertEquals(c.getMonitorCheckpoint(),
        copy.getChange().getMonitorCheckpoint());
    assertEquals(c.getDocumentHandle().getDocumentId(),
        copy.getChange().getDocumentHandle().getDocumentId());
  }
View Full Code Here

Examples of com.google.gerrit.reviewdb.client.Change

        e.printStackTrace();
        return;
      }
      try {
        for (;;) {
          Change change = next();
          if (change == null) {
            break;
          }
          scan(db, change);
          synchronized (monitor) {
View Full Code Here

Examples of com.google.refine.history.Change

                    stats.nonBlanks,
                    stats.newTopics + newChange,
                    stats.matchedTopics + matchChange);
            }

            Change change = new ReconChange(
                new CellChange(rowIndex, cellIndex, cell, newCell),
                column.getName(),
                column.getReconConfig(),
                stats
            );
View Full Code Here

Examples of com.intellij.openapi.vcs.changes.Change

    }

    private void addedFiles() throws VcsException {
        Sets.SetView<String> addedFiles = Sets.difference(changes.keySet(), baseChanges.keySet());
        for (String addedFile : addedFiles) {
            Change change = changes.get(addedFile);
            ContentRevision beforeRevision = null;
            if (change.getType().equals(Change.Type.MODIFICATION)) {
                ContentRevision changeBeforeRevision = change.getBeforeRevision();
                assert changeBeforeRevision != null;
                beforeRevision = new SimpleContentRevision(
                        changeBeforeRevision.getContent(),
                        changeBeforeRevision.getFile(),
                        baseHash);
            }
            diff.add(new Change(beforeRevision, change.getAfterRevision()));
        }
    }
View Full Code Here

Examples of com.sencha.gxt.data.shared.Store.Change

        {
          final AbstractDkModifiableBeanWithId modifiableBean = (AbstractDkModifiableBeanWithId) model;
          dirtyBeanAndAncestors(editor.getStore(), modifiableBean);
          for (final Object changeObject : record.getChanges())
          {
            final Change change = (Change) changeObject;
            final String path = ((ValueProvider) change.getChangeTag()).getPath();
            if (DkStringUtils.hasText(path))
            {
              modifiableBean.getDirtyPaths().add(path.indexOf(".") == -1 ? path : path.substring(0, path.indexOf(".")));
            }
          }
View Full Code Here

Examples of com.sk89q.worldedit.history.change.Change

    }

    @Override
    public Operation resume(RunContext run) throws WorldEditException {
        while (iterator.hasNext()) {
            Change change = iterator.next();
            if (type == Type.UNDO) {
                change.undo(context);
            } else {
                change.redo(context);
            }
        }

        return null;
    }
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.