Package com.eclipsesource.tabris.tracking.internal.piwik.model.action

Examples of com.eclipsesource.tabris.tracking.internal.piwik.model.action.Action


      .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


public class PiwikRequestTest {

  @Test( expected = IllegalArgumentException.class )
  public void testFailsWithNullConfiguration() {
    new PiwikRequest( null, new Action( "foo" ), new TestRequestable( "baz", "bar" ) );
  }
View Full Code Here

  }

  @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

  }

  @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

  }

  @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 ) );

    assertEquals( 36, clientId.length() );
View Full Code Here

  }

  @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

  @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

  @Override
  public void handleEvent( TrackingEvent event ) {
    TrackingInfo info = event.getInfo();
    AdvancedConfiguration advancedConfiguration = createAdvancedConfiguration( info );
    VisitorInformation visitorInformation = createVisitorInformation( info );
    Action action = createAction( event );
    piwik.track( action, visitorInformation, advancedConfiguration );
  }
View Full Code Here

    Action action = createAction( event );
    piwik.track( action, visitorInformation, advancedConfiguration );
  }

  private Action createAction( TrackingEvent event ) {
    Action action = null;
    if( event.getType() == EventType.PAGE_VIEW ) {
      action = createPageViewAction( event );
    } else if( event.getType() == EventType.ACTION ) {
      action = createActionHitAction( event );
    } else if( event.getType() == EventType.SEARCH ) {
View Full Code Here

    return action;
  }

  private Action createPageViewAction( TrackingEvent event ) {
    String pageId = ( String )event.getDetail();
    return new Action( createHost( event ) + "/page/" + pageId );
  }
View Full Code Here

TOP

Related Classes of com.eclipsesource.tabris.tracking.internal.piwik.model.action.Action

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.