Package com.saasovation.agilepm.domain.model.tenant

Examples of com.saasovation.agilepm.domain.model.tenant.TenantId


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


        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());
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

TOP

Related Classes of com.saasovation.agilepm.domain.model.tenant.TenantId

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.