Examples of Capture


Examples of org.easymock.Capture

        RequestSecurityManager securityManager = mockRequestSecurityManager();
        Request request = mockRequest();
        Response response = mockResponse();
        ComponentInvocationMap invocationMap = new NoOpComponentInvocationMap();
        RequestPathOptimizer optimizer = mockRequestPathOptimizer();
        Capture<Link> linkCapture = new Capture();
        LinkFactoryListener listener = mockLinkFactoryListener();

        String optimizedURL = "optimized:" + expectedURL;
        String encodedURL = "encoded:" + expectedURL;

        train_getRenderingPage(queue, null);

        train_getLogicalName(primaryPage, logicalName);

        train_collectPageActivationContext(collector, primaryPage, "a", "b");

        train_getBaseURL(securityManager, activePage, null);

        train_getContextPath(request, "/context");

        train_optimizePath(optimizer, expectedURL, optimizedURL);
        train_encodeURL(response, optimizedURL, encodedURL);

        listener.createdComponentEventLink(capture(linkCapture));

        replay();

        LinkFactory factory = new LinkFactoryImpl(request, response, invocationMap, null, optimizer, queue,
                                                  securityManager, contextPathEncoder, collector);

        factory.addListener(listener);

        Link link = factory.createComponentEventLink(primaryPage, nestedId, eventType, forForm, context);

        // Make sure the same link is returned.

        assertSame(linkCapture.getValue(), link);

        assertEquals(link.toURI(), encodedURL);

        verify();
View Full Code Here

Examples of pagelyzer.Capture

          String[] pagelyzerargs = {"-config",args[1],"-url1","http://www.lip6.fr" ,"-url2","http://www.lip6.fr"};

         

          JPagelyzer pagelyzer = new JPagelyzer(pagelyzerargs,false);
          Capture capture1;
          Capture capture2;
          StringBuffer sb = new StringBuffer();
        
          double score = 0;
          for(int i=0;i<lines.size();i++)
          {
              System.out.println("TEST " + i);
              temp = (String) lines.get(i);
              urls = temp.split("\t");
             
              capture1 = pagelyzer.GetCapture(urls[0], pagelyzer.browser1);
              capture2 = pagelyzer.GetCapture(urls[1], pagelyzer.browser2);

              if(capture1!=null && capture2!=null)
                score = pagelyzer.CallMarcalizerResult(capture1, capture2);
              try {
          capture1.cleanup();
          capture2.cleanup();
        } catch (InterruptedException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
             
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.