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

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


    }

    public void testRemove() throws Exception {
        TenantId tenantId = new TenantId("T12345");

        Product product1 =
                new Product(
                        tenantId,
                        new ProductId("679890"),
                        new ProductOwnerId(tenantId, "thepm"),
                        "My Product 1",
                        "My product 1, which is my product.",
                        DiscussionAvailability.NOT_REQUESTED);

        Product product2 =
                new Product(
                        tenantId,
                        new ProductId("09876"),
                        new ProductOwnerId(tenantId, "thepm"),
                        "My Product 2",
                        "My product 2, which is my product.",
                        DiscussionAvailability.NOT_REQUESTED);

        LevelDBUnitOfWork.start(this.database);
        productRepository.save(product1);
        productRepository.save(product2);
        LevelDBUnitOfWork.current().commit();

        LevelDBUnitOfWork.start(this.database);
        productRepository.remove(product1);
        LevelDBUnitOfWork.current().commit();

        Collection<Product> savedProducts = productRepository.allProductsOfTenant(tenantId);
        assertFalse(savedProducts.isEmpty());
        assertEquals(1, savedProducts.size());
        assertEquals(product2.productId(), savedProducts.iterator().next().productId());

        LevelDBUnitOfWork.start(this.database);
        productRepository.remove(product2);
        LevelDBUnitOfWork.current().commit();
View Full Code Here


    }

    public void testSaveAllRemoveAll() throws Exception {
        TenantId tenantId = new TenantId("T12345");

        Product product1 =
                new Product(
                        tenantId,
                        new ProductId("679890"),
                        new ProductOwnerId(tenantId, "thepm"),
                        "My Product 1",
                        "My product 1, which is my product.",
                        DiscussionAvailability.NOT_REQUESTED);

        Product product2 =
                new Product(
                        tenantId,
                        new ProductId("09876"),
                        new ProductOwnerId(tenantId, "thepm"),
                        "My Product 2",
                        "My product 2, which is my product.",
                        DiscussionAvailability.NOT_REQUESTED);

        Product product3 =
                new Product(
                        tenantId,
                        new ProductId("100200300"),
                        new ProductOwnerId(tenantId, "thepm"),
                        "My Product 3",
                        "My product 3, which is my product.",
View Full Code Here

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

        final TenantId tenantId = new TenantId("T12345");

        Product product1 =
                new Product(
                        tenantId,
                        new ProductId("679890"),
                        new ProductOwnerId(tenantId, "thepm"),
                        "My Product 1",
                        "My product 1, which is my product.",
                        DiscussionAvailability.NOT_REQUESTED);

        LevelDBUnitOfWork.start(database);
        productRepository.save(product1);

        new Thread() {
           @Override
           public void run() {
               Product product2 =
                       new Product(
                               tenantId,
                               new ProductId("09876"),
                               new ProductOwnerId(tenantId, "thepm"),
                               "My Product 2",
                               "My product 2, which is my product.",
View Full Code Here

    public SprintTest() {
        super();
    }

    public void testScheduleSprint() throws Exception {
        Product product = this.productForTest();

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

        Sprint sprint =
                product.scheduleSprint(
                        new SprintId("S-12345"),
                        "Collaboration Integration Sprint",
                        "Make Scrum project collaboration possible.",
                        begins,
                        ends);
View Full Code Here

        assertEquals(changedName, sprint.name());
    }

    public void testReorderFrom() throws Exception {
        Product product = this.productForTest();
        Sprint sprint = this.sprintForTest(product);

        BacklogItem backlogItem1 = this.backlogItem1ForTest(product);
        BacklogItem backlogItem2 = this.backlogItem2ForTest(product);
        BacklogItem backlogItem3 = this.backlogItem3ForTest(product);
View Full Code Here

        assertEquals(2, scheduledBacklogItem1.ordering());
        assertEquals(3, scheduledBacklogItem2.ordering());
    }

    public void testSchedule() throws Exception {
        Product product = this.productForTest();
        Sprint sprint = this.sprintForTest(product);

        BacklogItem backlogItem1 = this.backlogItem1ForTest(product);
        BacklogItem backlogItem2 = this.backlogItem2ForTest(product);
        BacklogItem backlogItem3 = this.backlogItem3ForTest(product);
View Full Code Here

            }
        }
    }

    public void testUnschedule() throws Exception {
        Product product = this.productForTest();
        Sprint sprint = this.sprintForTest(product);

        BacklogItem backlogItem1 = this.backlogItem1ForTest(product);
        BacklogItem backlogItem2 = this.backlogItem2ForTest(product);
        BacklogItem backlogItem3 = this.backlogItem3ForTest(product);
View Full Code Here

    public void initiateDiscussion(InitiateDiscussionCommand aCommand) {
        ApplicationServiceLifeCycle.begin();

        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()
                        + " and product id: "
                        + aCommand.getProductId());
            }

            product.initiateDiscussion(new DiscussionDescriptor(aCommand.getDiscussionId()));

            this.productRepository().save(product);

            ProcessId processId = ProcessId.existingProcessId(product.discussionInitiationId());

            TimeConstrainedProcessTracker tracker =
                    this.processTrackerRepository()
                        .trackerOfProcessId(aCommand.getTenantId(), processId);
View Full Code Here

                aCommand.getDescription(),
                this.requestDiscussionIfAvailable());
    }

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

        ProcessId processId = ProcessId.existingProcessId(aCommand.getProcessId());

        TenantId tenantId = new TenantId(aCommand.getTenantId());

        Product product =
                this.productRepository()
                    .productOfDiscussionInitiationId(
                            tenantId,
                            processId.id());
View Full Code Here

TOP

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

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.