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

Examples of com.saasovation.agilepm.domain.model.product.ProductId


        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());
View Full Code Here


        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 }));
        LevelDBUnitOfWork.current().commit();

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

        Collection<Sprint> savedSprints = sprintRepository.allProductSprints(tenantId, productId);
        assertFalse(savedSprints.isEmpty());
        assertEquals(3, savedSprints.size());
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);
               LevelDBUnitOfWork.current().commit();
View Full Code Here

        try {
            Product product =
                    this.productRepository()
                        .productOfId(
                                new TenantId(aCommand.getTenantId()),
                                new ProductId(aCommand.getProductId()));

            if (product == null) {
                throw new IllegalStateException(
                        "Unknown product of tenant id: "
                        + aCommand.getTenantId()
View Full Code Here

    public void requestProductDiscussion(RequestProductDiscussionCommand aCommand) {
        Product product =
                this.productRepository()
                    .productOfId(
                            new TenantId(aCommand.getTenantId()),
                            new ProductId(aCommand.getProductId()));

        if (product == null) {
            throw new IllegalStateException(
                    "Unknown product of tenant id: "
                    + aCommand.getTenantId()
View Full Code Here

        try {
            Product product =
                    this.productRepository()
                        .productOfId(
                                new TenantId(aCommand.getTenantId()),
                                new ProductId(aCommand.getProductId()));

            if (product == null) {
                throw new IllegalStateException(
                        "Unknown product of tenant id: "
                        + aCommand.getTenantId()
View Full Code Here

            String aName,
            String aDescription,
            DiscussionAvailability aDiscussionAvailability) {

        TenantId tenantId = new TenantId(aTenantId);
        ProductId productId = null;

        ApplicationServiceLifeCycle.begin();

        try {
            productId = this.productRepository().nextIdentity();

            ProductOwner productOwner =
                    this.productOwnerRepository()
                        .productOwnerOfIdentity(
                                tenantId,
                                aProductOwnerId);

            Product product =
                    new Product(
                            tenantId,
                            productId,
                            productOwner.productOwnerId(),
                            aName,
                            aDescription,
                            aDiscussionAvailability);

            this.productRepository().save(product);

            ApplicationServiceLifeCycle.success();

        } catch (RuntimeException e) {
            ApplicationServiceLifeCycle.fail(e);
        }

        return productId.id();
    }
View Full Code Here

        return products;
    }

    @Override
    public ProductId nextIdentity() {
        return new ProductId(UUID.randomUUID().toString().toUpperCase());
    }
View Full Code Here

    public void testSaveWithTypes() throws Exception {
        BacklogItem backlogItem1 =
                new BacklogItem(
                        new TenantId("12345"),
                        new ProductId("67890"),
                        new BacklogItemId("bli1"),
                        "My backlog item 1.",
                        "Domain Model",
                        BacklogItemType.FEATURE,
                        BacklogItemStatus.PLANNED,
                        StoryPoints.EIGHT);

        LevelDBUnitOfWork.start(this.database);
        backlogItemRepository.save(backlogItem1);
        LevelDBUnitOfWork.current().commit();

        BacklogItem savedBacklogItem =
                backlogItemRepository
                    .backlogItemOfId(
                            backlogItem1.tenantId(),
                            backlogItem1.backlogItemId());

        assertNotNull(savedBacklogItem);
        assertEquals(backlogItem1.tenantId(), savedBacklogItem.tenantId());
        assertEquals(backlogItem1.productId(), savedBacklogItem.productId());
        assertEquals(backlogItem1.summary(), savedBacklogItem.summary());
        assertEquals(backlogItem1.category(), savedBacklogItem.category());
        assertEquals(backlogItem1.type(), savedBacklogItem.type());
        assertEquals(backlogItem1.storyPoints(), savedBacklogItem.storyPoints());

        Collection<BacklogItem> savedBacklogItems =
                backlogItemRepository
                    .allProductBacklogItems(backlogItem1.tenantId(), backlogItem1.productId());

        assertFalse(savedBacklogItems.isEmpty());
        assertEquals(1, savedBacklogItems.size());

        BacklogItem backlogItem2 =
                new BacklogItem(
                        new TenantId("12345"),
                        new ProductId("67890"),
                        new BacklogItemId("bli2"),
                        "My backlog item 1.",
                        "Domain Model",
                        BacklogItemType.FEATURE,
                        BacklogItemStatus.DONE,
View Full Code Here

    public void testScheduledAndCommittedBacklogItems() throws Exception {
        BacklogItem backlogItem1 =
                new BacklogItem(
                        new TenantId("12345"),
                        new ProductId("p00000"),
                        new BacklogItemId("bli1"),
                        "My backlog item 1.",
                        "Domain Model",
                        BacklogItemType.FEATURE,
                        BacklogItemStatus.PLANNED,
                        StoryPoints.EIGHT);

        BacklogItem backlogItem2 =
                new BacklogItem(
                        new TenantId("12345"),
                        new ProductId("p00000"),
                        new BacklogItemId("bli2"),
                        "My backlog item 1.",
                        "Domain Model",
                        BacklogItemType.FEATURE,
                        BacklogItemStatus.PLANNED,
                        StoryPoints.EIGHT);

        BacklogItem backlogItem3 =
                new BacklogItem(
                        new TenantId("12345"),
                        new ProductId("p00000"),
                        new BacklogItemId("bli3"),
                        "My backlog item 1.",
                        "Domain Model",
                        BacklogItemType.FEATURE,
                        BacklogItemStatus.PLANNED,
                        StoryPoints.EIGHT);

        Release release = new Release(
                new TenantId("12345"), new ProductId("p00000"), new ReleaseId("r11111"),
                "release1", "My release 1.", new Date(), new Date());

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

        backlogItem2.scheduleFor(release);
        backlogItem2.commitTo(sprint);
View Full Code Here

TOP

Related Classes of com.saasovation.agilepm.domain.model.product.ProductId

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.