Examples of Infrastructure


Examples of gld.infra.Infrastructure

    loadAll(loader,getSimModel());
    newInfrastructure(model.getInfrastructure());
    loader.close();
   
    //GASTON: AGREGUE ESTE CODIGO PARA CARGAR TODOS LOS NODOS DISPONIBLES CUANDO CARGA LA RED EL GLDSIM
    Infrastructure infra = model.getInfrastructure();
    Node[] nodos = infra.getAllNodes();
    for (int i=0;i<nodos.length;i++){
      if (nodos[i] instanceof Junction){
        ((Junction)nodos[i]).updateAllAvailableRoads();
      }
    }
View Full Code Here

Examples of org.apache.tapestry.services.Infrastructure

    }

    public void testSuccessfulInfrastructureLookup()
    {
        MockControl ifrControl = newControl(Infrastructure.class);
        Infrastructure ifr = (Infrastructure) ifrControl.getMock();

        ResetEventCoordinator coord = (ResetEventCoordinator) newMock(ResetEventCoordinator.class);

        ifr.getResetEventCoordinator();
        ifrControl.setReturnValue(coord);

        replayControls();

        InfrastructureObjectProvider p = new InfrastructureObjectProvider();
View Full Code Here

Examples of org.apache.tapestry.services.Infrastructure

    }

    private Infrastructure newInfrastructure(PageSource source)
    {
        MockControl control = newControl(Infrastructure.class);
        Infrastructure infrastructure = (Infrastructure) control.getMock();

        infrastructure.getPageSource();
        control.setReturnValue(source);

        return infrastructure;
    }
View Full Code Here

Examples of org.apache.tapestry.services.Infrastructure

    }

    public void testGetters()
    {
        RequestContext context = new RequestContext(null, null);
        Infrastructure infrastructure = newInfrastructure();
        RequestCycleEnvironment env = new RequestCycleEnvironment(newErrorHandler(),
                infrastructure, context, newStrategySource(), newBuilder());
        IEngine engine = newEngine();
        IEngineService service = newService();
        IMonitor monitor = newMonitor();
View Full Code Here

Examples of org.apache.tapestry.services.Infrastructure

    }

    public void testForgetPage()
    {
        RequestContext context = new RequestContext(null, null);
        Infrastructure infrastructure = newInfrastructure();
        PropertyPersistenceStrategySource source = newStrategySource();
        RequestCycleEnvironment env = new RequestCycleEnvironment(newErrorHandler(),
                infrastructure, context, source, newBuilder());
        IEngine engine = newEngine();
        IEngineService service = newService();
View Full Code Here

Examples of org.apache.tapestry.services.Infrastructure

        IComponent comp1 = newMock(IComponent.class);
        IRequestCycle cycle = newMock(IRequestCycle.class);
        IMarkupWriter writer = newMock(IMarkupWriter.class);
        NestedMarkupWriter nested = newMock(NestedMarkupWriter.class);

        Infrastructure infra = newMock(Infrastructure.class);

        List parts = new ArrayList();
        parts.add("id1");

        DojoAjaxResponseBuilder builder = new DojoAjaxResponseBuilder(cycle, writer, parts);

        render.render(NullWriter.getSharedInstance(), cycle);

        expect(comp1.getClientId()).andReturn("id1").anyTimes();
        expect(comp1.peekClientId()).andReturn("id1").anyTimes();
        expect(cycle.getInfrastructure()).andReturn(infra);
        expect(infra.getOutputEncoding()).andReturn("UTF-8");

        writer.printRaw("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        writer.printRaw("<!DOCTYPE html "
                        + "PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" "
                        + "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" [" + NEWLINE
View Full Code Here

Examples of org.apache.tapestry.services.Infrastructure

      throws IOException
    {
        IPage page = newMock(IPage.class);
        checkOrder(page, false);
        IRequestCycle cycle = newMock(IRequestCycle.class);
        Infrastructure infra = newMock(Infrastructure.class);
        IMarkupWriter writer = newBufferWriter();
        NestedMarkupWriter nwriter = newNestedWriter();

        ILink link = newMock(ILink.class);
        Location l = newLocation();

        RequestLocaleManager rlm = newMock(RequestLocaleManager.class);
        MarkupWriterSource mrs = newMock(MarkupWriterSource.class);
        WebResponse resp = newMock(WebResponse.class);
        AssetFactory assetFactory = newMock(AssetFactory.class);
        IEngineService pageService = newEngineService();

        List errorPages = new ArrayList();

        List parts = new ArrayList();
        parts.add("id1");

        DojoAjaxResponseBuilder builder =  new DojoAjaxResponseBuilder(cycle, rlm, mrs, resp, errorPages, assetFactory, "", pageService);

        PrintWriter pw = newPrintWriter();

        rlm.persistLocale();
        expect(cycle.getInfrastructure()).andReturn(infra).anyTimes();
        expect(infra.getOutputEncoding()).andReturn(("UTF-8")).anyTimes();
        expect(cycle.getParameters("updateParts")).andReturn((String[])parts.toArray(new String[parts.size()]));
        expect(resp.getPrintWriter(isA(ContentType.class))).andReturn(pw);
        expect(mrs.newMarkupWriter(eq(pw), isA(ContentType.class))).andReturn(writer);

        expect(cycle.getPage()).andReturn(page);
View Full Code Here

Examples of org.apache.tapestry.services.Infrastructure

    public void test_Write_Body_Script()
    {
        MarkupFilter filter = new UTFMarkupFilter();
        PrintWriter writer = newPrintWriter();
        IRequestCycle cycle = newMock(IRequestCycle.class);
        Infrastructure inf = newMock(Infrastructure.class);

        replay();

        IMarkupWriter mw = new MarkupWriterImpl("text/html", writer, filter);
        DojoAjaxResponseBuilder builder = new DojoAjaxResponseBuilder(cycle, mw, null);

        String bscript = "var e=4;";
        String imageInit = "image initializations";
        String preload = "preloadedvarname";

        verify();

        expect(cycle.getInfrastructure()).andReturn(inf);
        expect(inf.getOutputEncoding()).andReturn("UTF-8");

        replay();

        builder.beginResponse();
        builder.beginBodyScript(mw, cycle);
View Full Code Here

Examples of org.apache.tapestry.services.Infrastructure

    public void test_Write_External_Scripts()
    {
        MarkupFilter filter = new UTFMarkupFilter();
        PrintWriter writer = newPrintWriter();
        IRequestCycle cycle = newMock(IRequestCycle.class);
        Infrastructure inf = newMock(Infrastructure.class);

        replay();

        IMarkupWriter mw = new MarkupWriterImpl("text/html", writer, filter);
        DojoAjaxResponseBuilder builder = new DojoAjaxResponseBuilder(cycle, mw, null);

        String script1 = "http://noname/js/package.js";
        String script2 = "http://noname/js/package2.js";

        verify();

        expect(cycle.getInfrastructure()).andReturn(inf);
        expect(inf.getOutputEncoding()).andReturn("UTF-8");

        replay();

        builder.beginResponse();
        builder.writeExternalScript(mw, script1, cycle);
View Full Code Here

Examples of org.apache.tapestry.services.Infrastructure

    public void test_Write_Initialization_Script()
    {
        IRequestCycle cycle = newMock(IRequestCycle.class);
        MarkupFilter filter = new UTFMarkupFilter();
        PrintWriter writer = newPrintWriter();
        Infrastructure inf = newMock(Infrastructure.class);

        replay();

        IMarkupWriter mw = new MarkupWriterImpl("text/html", writer, filter);
        DojoAjaxResponseBuilder builder = new DojoAjaxResponseBuilder(cycle, mw, null);

        String script = "doThisInInit();";

        verify();

        expect(cycle.getInfrastructure()).andReturn(inf);
        expect(inf.getOutputEncoding()).andReturn("UTF-8");

        replay();

        builder.beginResponse();
        builder.writeInitializationScript(mw, script);
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.