Package com.saasovation.agilepm.domain.model.team

Examples of com.saasovation.agilepm.domain.model.team.ProductOwner


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

        ApplicationServiceLifeCycle.begin();

        try {
            ProductOwner productOwner =
                    this.productOwnerRepository.productOwnerOfIdentity(
                            tenantId,
                            aCommand.getUsername());

            if (productOwner != null) {
                productOwner.enable(aCommand.getOccurredOn());
            } else {
                productOwner =
                        new ProductOwner(
                                tenantId,
                                aCommand.getUsername(),
                                aCommand.getFirstName(),
                                aCommand.getLastName(),
                                aCommand.getEmailAddress(),
View Full Code Here


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

        ApplicationServiceLifeCycle.begin();

        try {
            ProductOwner productOwner =
                    this.productOwnerRepository.productOwnerOfIdentity(
                            tenantId,
                            aCommand.getUsername());

            if (productOwner != null) {
                productOwner
                    .changeEmailAddress(
                        aCommand.getEmailAddress(),
                        aCommand.getOccurredOn());

                this.productOwnerRepository().save(productOwner);
View Full Code Here

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

        ApplicationServiceLifeCycle.begin();

        try {
            ProductOwner productOwner =
                    this.productOwnerRepository.productOwnerOfIdentity(
                            tenantId,
                            aCommand.getUsername());

            if (productOwner != null) {
                productOwner
                    .changeName(
                            aCommand.getFirstName(),
                            aCommand.getLastName(),
                            aCommand.getOccurredOn());
View Full Code Here

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

        ApplicationServiceLifeCycle.begin();

        try {
            ProductOwner productOwner =
                    this.productOwnerRepository.productOwnerOfIdentity(
                            tenantId,
                            aCommand.getUsername());

            if (productOwner != null) {
                productOwner.disable(aCommand.getOccurredOn());

                this.productOwnerRepository().save(productOwner);
            }

            ApplicationServiceLifeCycle.success();
View Full Code Here

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

        return product;
    }

    protected ProductOwner persistedProductOwnerForTest() {
        ProductOwner productOwner =
                new ProductOwner(
                        new TenantId("T-12345"),
                        "zoe",
                        "Zoe",
                        "Doe",
                        "zoe@saasovation.com",
View Full Code Here

    public LevelDBProductOwnerRepositoryTest() {
        super();
    }

    public void testSave() throws Exception {
        ProductOwner productOwner =
                new ProductOwner(
                        new TenantId("12345"),
                        "jdoe",
                        "John",
                        "Doe",
                        "jdoe@saasovation.com",
                        new Date());

        LevelDBUnitOfWork.start(this.database);
        productOwnerRepository.save(productOwner);
        LevelDBUnitOfWork.current().commit();

        ProductOwner savedProductOwner =
                productOwnerRepository.productOwnerOfIdentity(
                        productOwner.tenantId(),
                        productOwner.username());

        assertNotNull(savedProductOwner);
        assertEquals(productOwner.tenantId(), savedProductOwner.tenantId());
        assertEquals(productOwner.username(), savedProductOwner.username());
        assertEquals(productOwner.firstName(), savedProductOwner.firstName());
        assertEquals(productOwner.lastName(), savedProductOwner.lastName());
        assertEquals(productOwner.emailAddress(), savedProductOwner.emailAddress());

        Collection<ProductOwner> savedProductOwners =
                this.productOwnerRepository.allProductOwnersOfTenant(productOwner.tenantId());

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

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

    public void testRemove() {
        ProductOwner productOwner1 =
                new ProductOwner(
                        new TenantId("12345"),
                        "jdoe",
                        "John",
                        "Doe",
                        "jdoe@saasovation.com",
                        new Date());

        ProductOwner productOwner2 =
                new ProductOwner(
                        new TenantId("12345"),
                        "zdoe",
                        "Zoe",
                        "Doe",
                        "zoe@saasovation.com",
                        new Date());

        LevelDBUnitOfWork.start(this.database);
        productOwnerRepository.save(productOwner1);
        productOwnerRepository.save(productOwner2);
        LevelDBUnitOfWork.current().commit();

        LevelDBUnitOfWork.start(this.database);
        productOwnerRepository.remove(productOwner1);
        LevelDBUnitOfWork.current().commit();

        TenantId tenantId = productOwner2.tenantId();

        Collection<ProductOwner> savedProductOwners = productOwnerRepository.allProductOwnersOfTenant(tenantId);
        assertFalse(savedProductOwners.isEmpty());
        assertEquals(1, savedProductOwners.size());
        assertEquals(productOwner2.username(), savedProductOwners.iterator().next().username());

        LevelDBUnitOfWork.start(this.database);
        productOwnerRepository.remove(productOwner2);
        LevelDBUnitOfWork.current().commit();
View Full Code Here

        savedProductOwners = productOwnerRepository.allProductOwnersOfTenant(tenantId);
        assertTrue(savedProductOwners.isEmpty());
    }

    public void testSaveAllRemoveAll() throws Exception {
        ProductOwner productOwner1 =
                new ProductOwner(
                        new TenantId("12345"),
                        "jdoe",
                        "John",
                        "Doe",
                        "jdoe@saasovation.com",
                        new Date());

        ProductOwner productOwner2 =
                new ProductOwner(
                        new TenantId("12345"),
                        "zdoe",
                        "Zoe",
                        "Doe",
                        "zoe@saasovation.com",
                        new Date());

        ProductOwner productOwner3 =
                new ProductOwner(
                        new TenantId("12345"),
                        "jsmith",
                        "John",
                        "Smith",
                        "jsmith@saasovation.com",
View Full Code Here

    }

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

        ProductOwner productOwner1 =
                new ProductOwner(
                        new TenantId("12345"),
                        "jdoe",
                        "John",
                        "Doe",
                        "jdoe@saasovation.com",
                        new Date());

        LevelDBUnitOfWork.start(database);
        productOwnerRepository.save(productOwner1);

        new Thread() {
           @Override
           public void run() {
               ProductOwner productOwner2 =
                       new ProductOwner(
                               new TenantId("12345"),
                               "zdoe",
                               "Zoe",
                               "Doe",
                               "zoe@saasovation.com",
View Full Code Here

TOP

Related Classes of com.saasovation.agilepm.domain.model.team.ProductOwner

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.