Package org.fao.geonet.domain

Examples of org.fao.geonet.domain.Operation


    EntityManager _entityManager;

    @Test
    public void test_Save_Count_FindOnly_DeleteAll() throws Exception {
        assertEquals(0, _repo.count());
        Operation savedOp = _repo.save(newOperation());

        _repo.flush();
        _entityManager.flush();
        _entityManager.clear();

        assertEquals(1, _repo.count());
        assertSameContents(savedOp, _repo.findOne(savedOp.getId()));

        _repo.deleteAll();
        assertEquals(0, _repo.count());
    }
View Full Code Here


            _entityManager.clear();
            assertEquals(1, _repo.count());
            List<Operation> all = _repo.findAll();
            assertEquals(1, all.size());

            Operation loadedOp = _repo.findOne(ReservedOperation.view.getId());
            assertTrue(loadedOp.isReserved());
            assertTrue(loadedOp.is(ReservedOperation.view));
        } finally {
            setId(ReservedOperation.view, normalId);
        }
    }
View Full Code Here

    @Test
    public void testUpdate() throws Exception {
        assertEquals(0, _repo.count());

        Operation operation = _repo.save(newOperation());

        _repo.flush();
        _entityManager.flush();
        _entityManager.clear();

        assertEquals(1, _repo.count());
        assertSameContents(operation, _repo.findOne(operation.getId()));

        operation.setName("New Name");
        Operation updatedOperation = _repo.save(operation);

        _repo.flush();
        _entityManager.flush();
        _entityManager.clear();
View Full Code Here

        assertSameContents(updatedOperation, _repo.findOne(operation.getId()));
    }

    @Test
    public void testFindByName() throws Exception {
        Operation savedOp = _repo.save(newOperation());

        _repo.flush();
        _entityManager.flush();
        _entityManager.clear();

        assertSameContents(savedOp, _repo.findByName(savedOp.getName()));
        assertNull(_repo.findByName("some wrong name"));
    }
View Full Code Here

        int id = inc.incrementAndGet();
        return newOperation(id, "name " + id);
    }

    private static Operation newOperation(int id, String name) {
        return new Operation().setName(name);
    }
View Full Code Here

        metadataStatus.getId().setMetadataId(metadata.getId());
        _metadataStatusRepo.saveAndFlush(metadataStatus);
        assertEquals(3, _metadataValidationRepo.count());
        _metadataValidationRepo.saveAndFlush(MetadataValidationRepositoryTest.newValidation(_inc, _mdRepo));
        assertEquals(6, _operationRepo.count());
        Operation operation = _operationRepo.saveAndFlush(OperationRepositoryTest.newOperation(_inc));
        assertEquals(72, _opAllowedRepo.count());
        _opAllowedRepo.saveAndFlush(new OperationAllowed(new OperationAllowedId(metadata.getId(), group.getId(), operation.getId())));
        assertEquals(2, _ratingRepo.count());
        final MetadataRatingByIp ratingByIp = MetadataRatingByIpRepositoryTest.newMetadataRatingByIp(_inc);
        ratingByIp.getId().setMetadataId(metadata.getId());
        _ratingRepo.saveAndFlush(ratingByIp);
        assertEquals(0, _relationRepo.count());
View Full Code Here

TOP

Related Classes of org.fao.geonet.domain.Operation

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.