コード例 #1
0
        public virtual void testQueryByDeploymentId()
        {
            DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentId(deploymentOneId);

            assertNotNull(query.singleResult());
            assertEquals(1, query.list().size());
            assertEquals(1, query.count());
        }
コード例 #2
0
        public virtual void testQueryByName()
        {
            DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentName("org/camunda/bpm/engine/test/repository/two_.bpmn20.xml");

            assertNotNull(query.singleResult());
            assertEquals(1, query.list().size());
            assertEquals(1, query.count());
        }
コード例 #3
0
        private void createDeploymentMock()
        {
            Deployment mockDeployment = MockProvider.createMockDeployment();

            DeploymentQuery deploymentQueryMock = mock(typeof(DeploymentQuery));

            when(deploymentQueryMock.deploymentId(anyString())).thenReturn(deploymentQueryMock);
            when(deploymentQueryMock.singleResult()).thenReturn(mockDeployment);

            when(mockRepoService.createDeploymentQuery()).thenReturn(deploymentQueryMock);
        }
コード例 #4
0
        public virtual void testQueryNoCriteria()
        {
            DeploymentQuery query = repositoryService.createDeploymentQuery();

            assertEquals(2, query.list().size());
            assertEquals(2, query.count());

            try
            {
                query.singleResult();
                fail();
            }
            catch (ProcessEngineException)
            {
            }
        }
コード例 #5
0
        public virtual void testQueryByInvalidDeploymentId()
        {
            DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentId("invalid");

            assertNull(query.singleResult());
            assertEquals(0, query.list().size());
            assertEquals(0, query.count());

            try
            {
                repositoryService.createDeploymentQuery().deploymentId(null);
                fail();
            }
            catch (ProcessEngineException)
            {
            }
        }