Package com.saasovation.agilepm.domain.model.product.sprint

Examples of com.saasovation.agilepm.domain.model.product.sprint.Sprint


    public LevelDBSprintRepositoryTest() {
        super();
    }

    public void testSave() throws Exception {
        Sprint sprint = new Sprint(
                new TenantId("12345"), new ProductId("p00000"), new SprintId("s11111"),
                "sprint1", "My sprint 1.", new Date(), new Date());

        LevelDBUnitOfWork.start(this.database);
        sprintRepository.save(sprint);
        LevelDBUnitOfWork.current().commit();

        Sprint savedSprint = sprintRepository.sprintOfId(sprint.tenantId(), sprint.sprintId());

        assertNotNull(savedSprint);
        assertEquals(sprint.tenantId(), savedSprint.tenantId());
        assertEquals(sprint.name(), savedSprint.name());

        Collection<Sprint> savedSprints =
                this.sprintRepository.allProductSprints(sprint.tenantId(), sprint.productId());

        assertFalse(savedSprints.isEmpty());
View Full Code Here


        assertFalse(savedSprints.isEmpty());
        assertEquals(1, savedSprints.size());
    }

    public void testRemove() {
        Sprint sprint1 = new Sprint(
                new TenantId("12345"), new ProductId("p00000"), new SprintId("s11111"),
                "sprint1", "My sprint 1.", new Date(), new Date());

        Sprint sprint2 = new Sprint(
                new TenantId("12345"), new ProductId("p00000"), new SprintId("s11112"),
                "sprint2", "My sprint 2.", new Date(), new Date());

        LevelDBUnitOfWork.start(this.database);
        sprintRepository.save(sprint1);
        sprintRepository.save(sprint2);
        LevelDBUnitOfWork.current().commit();

        LevelDBUnitOfWork.start(this.database);
        sprintRepository.remove(sprint1);
        LevelDBUnitOfWork.current().commit();

        TenantId tenantId = sprint2.tenantId();
        ProductId productId = sprint2.productId();

        Collection<Sprint> savedSprints = sprintRepository.allProductSprints(tenantId, productId);
        assertFalse(savedSprints.isEmpty());
        assertEquals(1, savedSprints.size());
        assertEquals(sprint2.name(), savedSprints.iterator().next().name());

        LevelDBUnitOfWork.start(this.database);
        sprintRepository.remove(sprint2);
        LevelDBUnitOfWork.current().commit();
View Full Code Here

        savedSprints = sprintRepository.allProductSprints(tenantId, productId);
        assertTrue(savedSprints.isEmpty());
    }

    public void testSaveAllRemoveAll() throws Exception {
        Sprint sprint1 = new Sprint(
                new TenantId("12345"), new ProductId("p00000"), new SprintId("s11111"),
                "sprint1", "My sprint 1.", new Date(), new Date());

        Sprint sprint2 = new Sprint(
                new TenantId("12345"), new ProductId("p00000"), new SprintId("s11112"),
                "sprint2", "My sprint 2.", new Date(), new Date());

        Sprint sprint3 = new Sprint(
                new TenantId("12345"), new ProductId("p00000"), new SprintId("s11113"),
                "sprint3", "My sprint 3.", new Date(), new Date());

        LevelDBUnitOfWork.start(this.database);
        sprintRepository.saveAll(Arrays.asList(new Sprint[] { sprint1, sprint2, sprint3 }));
View Full Code Here

    }

    public void testConcurrentTransactions() throws Exception {
        final List<Integer> orderOfCommits = new ArrayList<Integer>();

        Sprint sprint1 = new Sprint(
                new TenantId("12345"), new ProductId("p00000"), new SprintId("s11111"),
                "sprint1", "My sprint 1.", new Date(), new Date());

        LevelDBUnitOfWork.start(database);
        sprintRepository.save(sprint1);

        new Thread() {
           @Override
           public void run() {
               Sprint sprint2 = new Sprint(
                       new TenantId("12345"), new ProductId("p00000"), new SprintId("s11112"),
                       "sprint2", "My sprint 2.", new Date(), new Date());

               LevelDBUnitOfWork.start(database);
               sprintRepository.save(sprint2);
View Full Code Here

            String aName,
            String aGoals,
            Date aBegins,
            Date anEnds) {

        Sprint sprint =
            new Sprint(
                    this.tenantId(),
                    this.productId(),
                    aNewSprintId,
                    aName,
                    aGoals,
                    aBegins,
                    anEnds);

        DomainEventPublisher
            .instance()
            .publish(new ProductSprintScheduled(
                    sprint.tenantId(),
                    sprint.productId(),
                    sprint.sprintId(),
                    sprint.name(),
                    sprint.goals(),
                    sprint.begins(),
                    sprint.ends()));

        return sprint;
    }
View Full Code Here

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.readOnly(this.database());

        List<Object> keys = uow.readKeys(productSprints);

        for (Object sprintId : keys) {
            Sprint sprint = uow.readObject(sprintId.toString().getBytes(), Sprint.class);

            if (sprint != null) {
                sprints.add(sprint);
            }
        }
View Full Code Here

    @Override
    public Sprint sprintOfId(TenantId aTenantId, SprintId aSprintId) {
        LevelDBKey primaryKey = new LevelDBKey(PRIMARY, aTenantId.id(), aSprintId.id());

        Sprint sprint =
                LevelDBUnitOfWork.readOnly(this.database())
                    .readObject(primaryKey.key().getBytes(), Sprint.class);

        return sprint;
    }
View Full Code Here

        Product product = this.productForTest();

        Date begins = new Date();
        Date ends = new Date(begins.getTime() + (86400000L * 30L));

        Sprint sprint =
                product.scheduleSprint(
                        new SprintId("S12345"),
                        "Collaboration Integration Sprint",
                        "Make Scrum project collaboration possible.",
                        begins,
                        ends);

        assertNotNull(sprint);
        assertEquals("Collaboration Integration Sprint", sprint.name());
        assertEquals("Make Scrum project collaboration possible.", sprint.goals());

        expectedEvents(2);
        expectedEvent(ProductCreated.class);
        expectedEvent(ProductSprintScheduled.class);
    }
View Full Code Here

    public void testCommitTo() {
        Product product = this.productForTest();

        BacklogItem backlogItem = this.backlogItemForTest(product);

        Sprint sprint = this.sprintForTest(product);

        try {
            backlogItem.commitTo(sprint);

            fail("Must be scheduled for release before committing to sprint.");
View Full Code Here

        BacklogItem backlogItem = this.backlogItemForTest(product);

        Release release = this.releaseForTest(product);
        backlogItem.scheduleFor(release);

        Sprint sprint = this.sprintForTest(product);
        backlogItem.commitTo(sprint);

        // later...
        backlogItem.uncommitFromSprint();
View Full Code Here

TOP

Related Classes of com.saasovation.agilepm.domain.model.product.sprint.Sprint

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.