Package org.milyn.container

Examples of org.milyn.container.MockExecutionContext


   */
  protected void setUp() throws Exception {
  }

  public void testSerailize() {
    MockExecutionContext executionContext = new MockExecutionContext();

        // Target a resource at the "document fragment" i.e. the root..

        // Don't write xxx but write its child elements
    SmooksResourceConfiguration configuration = new SmooksResourceConfiguration(SmooksResourceConfiguration.DOCUMENT_FRAGMENT_SELECTOR, "deviceX", "....");
View Full Code Here


 
  @Before
  public void setup() throws IOException
  {
    input = StreamUtils.readStream( getClass().getResourceAsStream( "testxml1.xml") );
    context = new MockExecutionContext();
    context.setContentEncoding( "UTF-8" );
    domFilter = new SmooksDOMFilter( context );
   
  }
View Full Code Here

{
  @Test
  public void getOutputStream () throws IOException
  {
    AbstractOutputStreamResource resource = new MockAbstractOutputStreamResource();
    MockExecutionContext executionContext = new MockExecutionContext();

        assertNull(getResource(resource, executionContext));
        resource.visitBefore( (Element)null, executionContext );
        assertNotNull(getResource(resource, executionContext));
View Full Code Here

    @Test
    public void getOutputWriter () throws IOException
    {
        AbstractOutputStreamResource resource = new MockAbstractOutputStreamResource();
        MockExecutionContext executionContext = new MockExecutionContext();

        assertNull(getResource(resource, executionContext));
        resource.visitBefore( (Element)null, executionContext );
        assertNotNull(getResource(resource, executionContext));
View Full Code Here

  private static final String NL = System.getProperty("line.separator");

  public void test() {

    ExecutionContext context = new MockExecutionContext();

    JavaResult dummyResult = new JavaResult(true);

    FilterResult.setResults(context, dummyResult);

    context.getBeanContext().addBean("string", "blaat", null);
    context.getBeanContext().addBean("emptyMap", Collections.emptyMap(), null);
    context.getBeanContext().addBean("emptyList", Collections.emptyList(), null);
    context.getBeanContext().addBean("emptyArray", new String[0], null);

    Map<String, String> stringMap = new HashMap<String, String>();
    stringMap.put("v1", "some text");
    stringMap.put("v2", "other text");
    stringMap.put("v3", null);

    context.getBeanContext().addBean("stringMap", stringMap, null);

    List<Integer> integerList = new ArrayList<Integer>();
    integerList.add(1);
    integerList.add(2);
    integerList.add(null);

    context.getBeanContext().addBean("integerList", integerList, null);

    context.getBeanContext().addBean("stringArray", new String[] {"a1", "a2", "a3", null}, null);

    Map<String, Object> objectMap = new LinkedHashMap<String, Object>();
    objectMap.put("self", objectMap);

    Map<String, Object> object2Map = new LinkedHashMap<String, Object>();
    object2Map.put("parent", objectMap);

    objectMap.put("map", object2Map);

    List<Object> list = new ArrayList<Object>();

    list.add(list);
    list.add(objectMap);

    object2Map.put("list", list);

    context.getBeanContext().addBean("objectMap", objectMap, null);

    context.getAttributes().put("multiline", "hello\nworld");

    String actual = MultiLineToStringBuilder.toString(context);

    System.out.println(actual);
View Full Code Here

  }

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

  }

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

  }

  public void test_BeanRepository_performance(int beans, int loops, boolean warmup) {
    sleep();

    executionContext = new MockExecutionContext();

    BeanIdRegister beanIdRegister = getBeanIdRegister();

    ArrayList<BeanId> beanIds = new ArrayList<BeanId>();
View Full Code Here

  }

  public void test_BeanContext_performance(int beans, int loops, boolean warmup) {
    sleep();

    executionContext = new MockExecutionContext();

    BeanIdStore beanIdStore = executionContext.getContext().getBeanIdStore();

    ArrayList<BeanId> beanIds = new ArrayList<BeanId>();
View Full Code Here

    Runnable runnable = new Runnable() {

      public void run() {

        try {
          MockExecutionContext execContext = new MockExecutionContext();
          execContext.context = appContext;

          BeanContext beanContext = execContext.getBeanContext();

          barrier.await();
          for(int i = 0; i < 1000; i++) {

            Object bean = new Object();
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.