Package org.pentaho.platform.util.web

Examples of org.pentaho.platform.util.web.SimpleUrlFactory


      HashMap<String, IParameterProvider> parameterProviderMap = new HashMap<String, IParameterProvider>();
      parameterProviderMap.put( IParameterProvider.SCOPE_REQUEST, parameterProvider );

      IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext();
      IPentahoUrlFactory urlFactory = new SimpleUrlFactory( requestContext.getContextPath() ); //$NON-NLS-1$

      String processName = description;
      boolean persisted = false;
      List messages = new ArrayList();
View Full Code Here


    parameterProviders.put( "path", createPathParamProvider() ); //$NON-NLS-1$

    String pluginId = contentGeneratorDescriptor.getPluginId();

    IPentahoUrlFactory urlFactory =
        new SimpleUrlFactory( PentahoRequestContextHolder.getRequestContext().getContextPath()
            + "api/repos/" + pluginId + "/" + contentGeneratorID + "?" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    // set the classloader of the current thread to the class loader of
    // the plugin so that it can load its libraries
    // Note: we cannot ask the contentGenerator class for it's classloader,
View Full Code Here

    String xactionStr = ServiceTestHelper.getXAction( SOLUTION_PATH, "services/MultiOutputTest.xaction" );
    IRuntimeContext runtimeContext =
        solutionEngine
            .execute(
                xactionStr,
                "test1a.xaction", "empty action sequence test", false, true, null, false, new HashMap(), null, null, new SimpleUrlFactory( "" ), new ArrayList() ); //$NON-NLS-1$ //$NON-NLS-2$
    finishTest();

  }
View Full Code Here

    IPentahoSession session = new StandaloneSession( "system" );
    ISolutionEngine solutionEngine = PentahoSystem.get( ISolutionEngine.class, session );
    solutionEngine.setLoggingLevel( ILogger.ERROR );
    solutionEngine.init( session );
    Map<Object, Object> parameterProviderMap = new HashMap<Object, Object>();
    IPentahoUrlFactory urlFactory = new SimpleUrlFactory( "" );
    Reader reader = null;
    try {
      File file = new File( SOLUTION_PATH + "/services_layer/test1.xaction" );
      StringBuilder str = new StringBuilder();
      reader = new FileReader( file );
View Full Code Here

public class SimpleUrlTest extends TestCase {

  public void testSimpleUrl() {

    String baseUrl = "http://localhost:8080/pentaho"; //$NON-NLS-1$
    SimpleUrlFactory urlFactory = new SimpleUrlFactory( "/testurl?" ); //$NON-NLS-1$
    urlFactory.getActionUrlBuilder();
    SimpleUrl url = new SimpleUrl( baseUrl );
    Assert.assertEquals( url.getUrl(), baseUrl );
    url.setParameter( "action", "doSomething" ); //$NON-NLS-1$  //$NON-NLS-2$
    Assert.assertEquals( url.getUrl(), baseUrl + "&action=doSomething" ); //$NON-NLS-1$
View Full Code Here

    IRuntimeContext runtimeContext =
        solutionEngine
            .execute(
                xactionStr,
                xactionName,
                "simple output test", false, true, null, false, new HashMap(), null, null, new SimpleUrlFactory( "" ), new ArrayList() ); //$NON-NLS-1$ //$NON-NLS-2$
    IParameterManager paramManager = runtimeContext.getParameterManager();
    Assert.assertEquals( outParameters.size(), paramManager.getCurrentOutputNames().size() );
    for ( Object key : paramManager.getCurrentOutputNames() ) {
      Assert.assertTrue( "output parameter not found in definition", outParameters.contains( key ) );
      Assert.assertFalse( "non-output parameter in output", nonOutParameters.contains( key ) );
View Full Code Here

      providers.put( IParameterProvider.SCOPE_REQUEST, inputs );
      IRuntimeContext runtimeContext =
          solutionEngine
              .execute(
                  xactionStr,
                  "test1a.xaction", "empty action sequence test", false, true, null, false, providers, null, null, new SimpleUrlFactory( "" ), new ArrayList() ); //$NON-NLS-1$ //$NON-NLS-2$
      assertNotNull( "RuntimeContext is null", runtimeContext );
      IActionParameter param = runtimeContext.getOutputParameter( "output1" );
      assertNotNull( "param is null", param );
      assertEquals( "setting is wrong", "value1", TestPojo1.setting1 );
      assertEquals( "setting is wrong", "value2", TestPojo1.setting2 );
View Full Code Here

      providers.put( IParameterProvider.SCOPE_REQUEST, inputs );
      IRuntimeContext runtimeContext =
          solutionEngine
              .execute(
                  xactionStr,
                  "test1a.xaction", "empty action sequence test", false, true, null, false, providers, null, null, new SimpleUrlFactory( "" ), new ArrayList() ); //$NON-NLS-1$ //$NON-NLS-2$
      assertNotNull( "RuntimeContext is null", runtimeContext );
      IActionParameter param = runtimeContext.getOutputParameter( "output1" );
      assertNotNull( "param is null", param );
      assertEquals( "setting is wrong", "value1", TestPojo1.setting1 );
      assertEquals( "setting is wrong", "value2", TestPojo1.setting2 );
View Full Code Here

      PojoComponentTest.doneCalled = false;
      IRuntimeContext runtimeContext =
          solutionEngine
              .execute(
                  xactionStr,
                  "pojo1b.xaction", "empty action sequence test", false, true, null, false, new HashMap(), null, null, new SimpleUrlFactory( "" ), new ArrayList() ); //$NON-NLS-1$ //$NON-NLS-2$
      IActionParameter param = runtimeContext.getOutputParameter( "output1" );
      assertNotNull( "RuntimeContext is null", runtimeContext );
      assertTrue( "done() was not called", PojoComponentTest.doneCalled );
      assertEquals( "setInt1 failed", 11, TestPojo1.int1 );
      assertEquals( "setInt2 failed", new Integer( 22 ), TestPojo1.int2 );
View Full Code Here

      PojoComponentTest.doneCalled = false;
      IRuntimeContext runtimeContext =
          solutionEngine
              .execute(
                  xactionStr,
                  "pojo4.xaction", "empty action sequence test", false, true, null, false, new HashMap(), null, null, new SimpleUrlFactory( "" ), new ArrayList() ); //$NON-NLS-1$ //$NON-NLS-2$
      IActionParameter param = runtimeContext.getOutputParameter( "output1" );
      assertNotNull( "RuntimeContext is null", runtimeContext );
      assertNotNull( "param is null", param );
      assertEquals( "abcdeabcde", param.getValue().toString() );
      assertEquals( "done() was called", false, PojoComponentTest.doneCalled );
View Full Code Here

TOP

Related Classes of org.pentaho.platform.util.web.SimpleUrlFactory

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.