Examples of PiwikConfiguration


Examples of com.eclipsesource.tabris.tracking.internal.piwik.model.PiwikConfiguration

  @Rule
  public ClientDriverRule driver = new ClientDriverRule();

  @Test( expected = IllegalArgumentException.class )
  public void testFailsWithNullPiwikUrl() {
    new Piwik( null, new PiwikConfiguration( "piwikUrl", 2 ) );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.tracking.internal.piwik.model.PiwikConfiguration

    new Piwik( null, new PiwikConfiguration( "piwikUrl", 2 ) );
  }

  @Test( expected = IllegalArgumentException.class )
  public void testFailsWithEmptyPiwikUrl() {
    new Piwik( "", new PiwikConfiguration( "piwikUrl", 2 ) );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.tracking.internal.piwik.model.PiwikConfiguration

      .withParam( "rand", RANDOM )
      .withParam( "url", "actionUrl" )
      .withParam( "token_auth", FAKE_TOKEN )
      .withParam( "res", "1280x1024" ), giveEmptyResponse().withStatus( 200 ) );

    Piwik piwik = new Piwik( driver.getBaseUrl(), new PiwikConfiguration( "apiVersion", 2 ) );

    piwik.track( new Action( "actionUrl" ),
                 new VisitorInformation().setScreenResolution( "1280x1024" ),
                 new AdvancedConfiguration( FAKE_TOKEN ) );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.tracking.internal.piwik.model.PiwikConfiguration

    new PiwikRequest( null, new Action( "foo" ), new TestRequestable( "baz", "bar" ) );
  }

  @Test
  public void testAddsParametersFromConfiguration() {
    PiwikRequest request = new PiwikRequest( new PiwikConfiguration( "apiVersion", 2 ),
                                             new Action( "actionUrl" ),
                                             new TestRequestable( "baz", "bac" ) );

    assertEquals( "apiVersion", request.assemble().get( getRequestKey( API_VERSION ) ) );
    assertEquals( Integer.valueOf( 2 ), request.assemble().get( getRequestKey( SITE_ID ) ) );
View Full Code Here

Examples of com.eclipsesource.tabris.tracking.internal.piwik.model.PiwikConfiguration

    assertEquals( Integer.valueOf( 2 ), request.assemble().get( getRequestKey( SITE_ID ) ) );
  }

  @Test( expected = IllegalArgumentException.class )
  public void testFailsWithNullAction() {
    new PiwikRequest( new PiwikConfiguration( "apiVersion", 2 ),
                      null,
                      new TestRequestable( "foo", "bar" ) );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.tracking.internal.piwik.model.PiwikConfiguration

                      new TestRequestable( "foo", "bar" ) );
  }

  @Test
  public void testSetsActionAsParameter() {
    PiwikRequest request = new PiwikRequest( new PiwikConfiguration( "apiVersion", 2 ),
                                             new Action( "actionUrl" ),
                                             new TestRequestable( "foo", "bar" ) );

    assertEquals( "actionUrl", request.assemble().get( getRequestKey( ACTION_URL ) ) );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.tracking.internal.piwik.model.PiwikConfiguration

    assertEquals( "actionUrl", request.assemble().get( getRequestKey( ACTION_URL ) ) );
  }

  @Test
  public void testSetsUuidForRandAsParameter() {
    PiwikRequest request = new PiwikRequest( new PiwikConfiguration( "apiVersion", 2 ),
                                             new Action( "actionUrl" ),
                                             new TestRequestable( "foo", "bar" ) );

    String clientId = ( String )request.assemble().get( getRequestKey( RANDOM ) );
View Full Code Here

Examples of com.eclipsesource.tabris.tracking.internal.piwik.model.PiwikConfiguration

    assertEquals( 36, clientId.length() );
  }

  @Test
  public void testSetsRecAsParameter() {
    PiwikRequest request = new PiwikRequest( new PiwikConfiguration( "apiVersion", 2 ),
                                             new Action( "actionUrl" ),
                                             new TestRequestable( "foo", "bar" ) );

    assertEquals( Integer.valueOf( 1 ), request.assemble().get( getRequestKey( REC ) ) );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.tracking.internal.piwik.model.PiwikConfiguration

  @Test
  public void testAddsParameterFromRequestables() {
    TestRequestable requestable1 = new TestRequestable( "foo", "bar" );
    TestRequestable requestable2 = new TestRequestable( "foo2", "bar2" );
    PiwikRequest request = new PiwikRequest( new PiwikConfiguration( "apiVersion", 2 ),
                                             new Action( "actionUrl" ),
                                             requestable1,
                                             requestable2 );

    Map<String, Object> parameter = request.assemble();
View Full Code Here

Examples of com.eclipsesource.tabris.tracking.internal.piwik.model.PiwikConfiguration

   * @param piwikUrl the url of the Piwik installation. Must not be <code>null</code> or empty.
   * @param tokenAuth the token to validate a request. Must not be <code>null</code> or empty.
   * @param siteId the id of the Piwik site configuration to use. Must be > 0.
   */
  public PiwikTracker( String piwikUrl, String tokenAuth, int siteId ) {
    this( new Piwik( piwikUrl, new PiwikConfiguration( "1", siteId ) ), tokenAuth );
  }
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.