Example #1
0
 private bool testCdiSetup()
 {
     try
     {
         ProgrammaticBeanLookup.lookup(typeof(ProcessEngine));
     }
     catch (Exception)
     {
         LOGGER.fine("CDI was not setup correctly");
         return(false);
     }
     return(true);
 }
Example #2
0
        public virtual T getArtifact <T>(Type clazz)
        {
            clazz = typeof(T);
            T instance = ProgrammaticBeanLookup.lookup(clazz, true);

            if (instance == null)
            {
                // fall back to using newInstance()
                instance = defaultArtifactFactory.getArtifact(clazz);
            }

            return(instance);
        }
Example #3
0
 public override object getValue(ELContext context, object @base, object property)
 {
     //we need to resolve a bean only for the first "member" of expression, e.g. bean.property1.property2
     if (@base == null)
     {
         object result = ProgrammaticBeanLookup.lookup(property.ToString(), BeanManager);
         if (result != null)
         {
             context.PropertyResolved = true;
         }
         return(result);
     }
     else
     {
         return(null);
     }
 }
Example #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test @OperateOnDeployment("clientDeployment") public void testResolveBean()
        public virtual void testResolveBean()
        {
            try
            {
                // assert that we cannot resolve the bean here:
                ProgrammaticBeanLookup.lookup("exampleDelegateBean");
                Assert.fail("exception expected");
            }
            catch (Exception)
            {
                // expected
            }

            Assert.assertEquals(0, runtimeService.createProcessInstanceQuery().processDefinitionKey("testResolveBean").count());
            // but the process engine can:
            runtimeService.startProcessInstanceByKey("testResolveBean");

            Assert.assertEquals(0, runtimeService.createProcessInstanceQuery().processDefinitionKey("testResolveBean").count());
        }
Example #5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public static void assertDiagramIsDeployed(boolean deployed, Class clazz, String expectedDiagramResource, String processDefinitionKey) throws java.io.IOException
        public static void assertDiagramIsDeployed(bool deployed, Type clazz, string expectedDiagramResource, string processDefinitionKey)
        {
            ProcessEngine processEngine = ProgrammaticBeanLookup.lookup(typeof(ProcessEngine));

            Assert.assertNotNull(processEngine);
            RepositoryService repositoryService = processEngine.RepositoryService;
            ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey(processDefinitionKey).singleResult();

            assertNotNull(processDefinition);

            Stream actualStream   = null;
            Stream expectedStream = null;

            try
            {
                actualStream = repositoryService.getProcessDiagram(processDefinition.Id);

                if (deployed)
                {
                    sbyte[] actualDiagram = IoUtil.readInputStream(actualStream, "actualStream");
                    assertNotNull(actualDiagram);
                    assertTrue(actualDiagram.Length > 0);

                    expectedStream = clazz.getResourceAsStream(expectedDiagramResource);
                    sbyte[] expectedDiagram = IoUtil.readInputStream(expectedStream, "expectedSteam");
                    assertNotNull(expectedDiagram);

                    assertTrue(isEqual(expectedStream, actualStream));
                }
                else
                {
                    assertNull(actualStream);
                }
            }
            finally
            {
                IoUtil.closeSilently(actualStream);
                IoUtil.closeSilently(expectedStream);
            }
        }
Example #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setUpCdiProcessEngineTestCase() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void setUpCdiProcessEngineTestCase()
        {
            if (BpmPlatform.ProcessEngineService.DefaultProcessEngine == null)
            {
                org.camunda.bpm.container.RuntimeContainerDelegate_Fields.INSTANCE.get().registerProcessEngine(processEngineRule.ProcessEngine);
            }

            beanManager   = ProgrammaticBeanLookup.lookup(typeof(BeanManager));
            processEngine = processEngineRule.ProcessEngine;
            processEngineConfiguration = (ProcessEngineConfigurationImpl)processEngineRule.ProcessEngine.ProcessEngineConfiguration;
            formService          = processEngine.FormService;
            historyService       = processEngine.HistoryService;
            identityService      = processEngine.IdentityService;
            managementService    = processEngine.ManagementService;
            repositoryService    = processEngine.RepositoryService;
            runtimeService       = processEngine.RuntimeService;
            taskService          = processEngine.TaskService;
            authorizationService = processEngine.AuthorizationService;
            filterService        = processEngine.FilterService;
            externalTaskService  = processEngine.ExternalTaskService;
            caseService          = processEngine.CaseService;
            decisionService      = processEngine.DecisionService;
        }
Example #7
0
 protected internal virtual object getBeanInstance(string name)
 {
     return(ProgrammaticBeanLookup.lookup(name));
 }
Example #8
0
 protected internal virtual T getBeanInstance <T>(Type clazz)
 {
     clazz = typeof(T);
     return(ProgrammaticBeanLookup.lookup(clazz));
 }