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

Examples of com.saasovation.agilepm.domain.model.product.release.Release


    public LevelDBReleaseRepositoryTest() {
        super();
    }

    public void testSave() throws Exception {
        Release release = new Release(
                new TenantId("12345"), new ProductId("p00000"), new ReleaseId("r11111"),
                "release1", "My release 1.", new Date(), new Date());

        LevelDBUnitOfWork.start(this.database);
        releaseRepository.save(release);
        LevelDBUnitOfWork.current().commit();

        Release savedRelease = releaseRepository.releaseOfId(release.tenantId(), release.releaseId());

        assertNotNull(savedRelease);
        assertEquals(release.tenantId(), savedRelease.tenantId());
        assertEquals(release.name(), savedRelease.name());

        Collection<Release> savedReleases =
                this.releaseRepository.allProductReleases(release.tenantId(), release.productId());

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


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

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

        Release release2 = new Release(
                new TenantId("12345"), new ProductId("p00000"), new ReleaseId("r11112"),
                "release2", "My release 2.", new Date(), new Date());

        LevelDBUnitOfWork.start(this.database);
        releaseRepository.save(release1);
        releaseRepository.save(release2);
        LevelDBUnitOfWork.current().commit();

        LevelDBUnitOfWork.start(this.database);
        releaseRepository.remove(release1);
        LevelDBUnitOfWork.current().commit();

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

        Collection<Release> savedReleases = releaseRepository.allProductReleases(tenantId, productId);
        assertFalse(savedReleases.isEmpty());
        assertEquals(1, savedReleases.size());
        assertEquals(release2.name(), savedReleases.iterator().next().name());

        LevelDBUnitOfWork.start(this.database);
        releaseRepository.remove(release2);
        LevelDBUnitOfWork.current().commit();
View Full Code Here

        savedReleases = releaseRepository.allProductReleases(tenantId, productId);
        assertTrue(savedReleases.isEmpty());
    }

    public void testSaveAllRemoveAll() throws Exception {
        Release release1 = new Release(
                new TenantId("12345"), new ProductId("p00000"), new ReleaseId("r11111"),
                "release1", "My release 1.", new Date(), new Date());

        Release release2 = new Release(
                new TenantId("12345"), new ProductId("p00000"), new ReleaseId("r11112"),
                "release2", "My release 2.", new Date(), new Date());

        Release release3 = new Release(
                new TenantId("12345"), new ProductId("p00000"), new ReleaseId("r11113"),
                "release3", "My release 3.", new Date(), new Date());

        LevelDBUnitOfWork.start(this.database);
        releaseRepository.saveAll(Arrays.asList(new Release[] { release1, release2, release3 }));
View Full Code Here

    }

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

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

        LevelDBUnitOfWork.start(database);
        releaseRepository.save(release1);

        new Thread() {
           @Override
           public void run() {
               Release release2 = new Release(
                       new TenantId("12345"), new ProductId("p00000"), new ReleaseId("r11112"),
                       "release2", "My release 2.", new Date(), new Date());

               LevelDBUnitOfWork.start(database);
               releaseRepository.save(release2);
View Full Code Here

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

        Release release =
            new Release(
                    this.tenantId(),
                    this.productId(),
                    aNewReleaseId,
                    aName,
                    aDescription,
                    aBegins,
                    anEnds);

        DomainEventPublisher
            .instance()
            .publish(new ProductReleaseScheduled(
                    release.tenantId(),
                    release.productId(),
                    release.releaseId(),
                    release.name(),
                    release.description(),
                    release.begins(),
                    release.ends()));

        return release;
    }
View Full Code Here

        Product product = this.productForTest();

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

        Release release =
                product.scheduleRelease(
                        new ReleaseId("R-12345"),
                        "Release 1.3",
                        "Enterprise interactive release.",
                        begins,
                        ends);

        assertNotNull(release);
        assertEquals("Release 1.3", release.name());
        assertEquals("Enterprise interactive release.", release.description());

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

        } catch (IllegalStateException e) {
            // good
        }

        Release release = this.releaseForTest(product);

        backlogItem.scheduleFor(release);

        // later...
        backlogItem.commitTo(sprint);
View Full Code Here

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

        BacklogItem backlogItem = this.backlogItemForTest(product);

        Release release = this.releaseForTest(product);

        backlogItem.scheduleFor(release);

        expectedEvents(4);
        expectedEvent(ProductCreated.class);
View Full Code Here

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

        BacklogItem backlogItem = this.backlogItemForTest(product);

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

        Sprint sprint = this.sprintForTest(product);
        backlogItem.commitTo(sprint);
View Full Code Here

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

        BacklogItem backlogItem = this.backlogItemForTest(product);

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

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

TOP

Related Classes of com.saasovation.agilepm.domain.model.product.release.Release

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.