Package org.milyn.container

Examples of org.milyn.container.MockExecutionContext


    BasicFactoryDefinitionParser parser = new BasicFactoryDefinitionParser();

    Factory<?> factory = parser.parse("org.milyn.javabean.TestFactory#newInstance.newLinkedList");

    Object result = factory.create(new MockExecutionContext());

    assertNotNull(result);
    assertTrue(result instanceof LinkedList<?>);

  }
View Full Code Here


    Factory<?> factory = parser.parse("org.milyn.javabean.TestFactory#getNull.newLinkedList");

    NullPointerException exception = null;

    try {
      factory.create(new MockExecutionContext());
    } catch (NullPointerException e) {
      exception = e;
    }

    if(exception == null) {
View Full Code Here

        final String ruleName = "addressing.email";
        final Validator validator = new Validator(ruleName, OnFail.WARN).setAppContext(appContext);
        final ValidationResult result = new ValidationResult();

        MockExecutionContext executionContext = new MockExecutionContext();
        FilterResult.setResults(executionContext, result);
        validator.validate("xyz", executionContext);
        validator.validate("xyz", executionContext);
        validator.validate("xyz", executionContext);
View Full Code Here

        final String ruleName = "addressing.email";
        final Validator validator = new Validator(ruleName, OnFail.OK).setAppContext(appContext);
        final ValidationResult result = new ValidationResult();

        MockExecutionContext executionContext = new MockExecutionContext();
        FilterResult.setResults(executionContext, result);
        validator.validate("xyz", executionContext);
        validator.validate("xyz", executionContext);
        validator.validate("xyz", executionContext);
View Full Code Here

        final String ruleName = "addressing.email";
        final Validator validator = new Validator(ruleName, OnFail.ERROR).setAppContext(appContext);
        final ValidationResult result = new ValidationResult();

        MockExecutionContext executionContext = new MockExecutionContext();
        FilterResult.setResults(executionContext, result);
        validator.validate("xyz", executionContext);
        validator.validate("xyz", executionContext);
        validator.validate("xyz", executionContext);
View Full Code Here

        final String ruleName = "addressing.email";
        final String data = "xyz";
        final Validator validator = new Validator(ruleName, OnFail.FATAL).setAppContext(appContext);

        MockExecutionContext executionContext = new MockExecutionContext();
        try
        {
            validator.validate(data, executionContext);
            fail("A ValidationException should have been thrown");
        }
View Full Code Here

    }

    @Override
  protected void setUp() throws Exception {
    super.setUp();
    executionContext = new MockExecutionContext();
  }
View Full Code Here

    private MockResult result;

    @Before
    public void setup()
    {
        context = new MockExecutionContext();
        result = new MockResult("ruleName", "provider", true);
    }
View Full Code Here

  public static MockExecutionContext createExecutionContext(
      final String beanIdName,
      final Object bean)
  {
        final MockExecutionContext executionContext = new MockExecutionContext();

        BeanId beanId = executionContext.getContext().getBeanIdStore().register(beanIdName);
        executionContext.getBeanContext().addBean(beanId, bean, null);
        return executionContext;
  }
View Full Code Here

TOP

Related Classes of org.milyn.container.MockExecutionContext

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.