Author: adietish
Date: 2012-02-03 09:53:22 -0500 (Fri, 03 Feb 2012)
New Revision: 38414
Modified:
trunk/usage/plugins/org.jboss.tools.usage/.settings/org.eclipse.jdt.core.prefs
trunk/usage/plugins/org.jboss.tools.usage/.settings/org.eclipse.jdt.ui.prefs
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsCookie.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsUrlStrategy.java
trunk/usage/tests/org.jboss.tools.usage.test/.settings/org.eclipse.jdt.core.prefs
trunk/usage/tests/org.jboss.tools.usage.test/.settings/org.eclipse.jdt.ui.prefs
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GoogleAnalyticsUrlStrategyTest.java
Log:
[JBIDE-10782] corrected cookies building algorythm (especially cookie termination with
';'). improved test to cover that.
Modified: trunk/usage/plugins/org.jboss.tools.usage/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/.settings/org.eclipse.jdt.core.prefs 2012-02-03
14:50:46 UTC (rev 38413)
+++
trunk/usage/plugins/org.jboss.tools.usage/.settings/org.eclipse.jdt.core.prefs 2012-02-03
14:53:22 UTC (rev 38414)
@@ -1,4 +1,4 @@
-#Tue Sep 14 16:15:24 CEST 2010
+#Tue Jan 31 17:16:35 CET 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
@@ -8,6 +8,7 @@
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
@@ -18,15 +19,18 @@
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
@@ -51,7 +55,7 @@
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
@@ -62,10 +66,16 @@
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
org.eclipse.jdt.core.formatter.compact_else_if=true
org.eclipse.jdt.core.formatter.continuation_indentation=2
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
@@ -77,9 +87,14 @@
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not
insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do
not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not
insert
@@ -146,12 +161,14 @@
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do
not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
@@ -175,6 +192,7 @@
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do
not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
@@ -230,6 +248,7 @@
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do
not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
@@ -239,6 +258,7 @@
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not
insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do
not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do
not insert
@@ -262,5 +282,8 @@
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
Modified: trunk/usage/plugins/org.jboss.tools.usage/.settings/org.eclipse.jdt.ui.prefs
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/.settings/org.eclipse.jdt.ui.prefs 2012-02-03
14:50:46 UTC (rev 38413)
+++
trunk/usage/plugins/org.jboss.tools.usage/.settings/org.eclipse.jdt.ui.prefs 2012-02-03
14:53:22 UTC (rev 38414)
@@ -1,6 +1,6 @@
-#Wed Jul 28 11:02:07 CEST 2010
+#Tue Jan 31 17:16:35 CET 2012
eclipse.preferences.version=1
formatter_profile=_Eclipse [built-in] extended
-formatter_settings_version=11
+formatter_settings_version=12
org.eclipse.jdt.ui.javadoc=false
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0"
encoding\="UTF-8" standalone\="no"?><templates><template
autoinsert\="true" context\="gettercomment_context"
deleted\="false" description\="Comment for getter method"
enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment"
name\="gettercomment">/**\n * @return the ${bare_field_name}\n
*/</template><template autoinsert\="true"
context\="settercomment_context" deleted\="false"
description\="Comment for setter method" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.settercomment"
name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n
*/</template><template autoinsert\="true"
context\="constructorcomment_context" deleted\="false"
description\="Comment for created constructors" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment"
name\="constructorcomment">/**\n * ${tags}\n */</template><template
autoinsert\="false" context\="filecommen!
t_context" deleted\="false" description\="Comment for created Java
files" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.filecomment"
name\="filecomment">/*******************************************************************************\n
* Copyright (c) 2010 Red Hat, Inc.\n * Distributed under license by Red Hat, Inc. All
rights reserved.\n * This program is made available under the terms of the\n * Eclipse
Public License v1.0 which accompanies this distribution,\n * and is available at
http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * Red Hat, Inc. -
initial API and implementation\n
******************************************************************************/</template><template
autoinsert\="true" context\="typecomment_context"
deleted\="false" description\="Comment for created types"
enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.typecomment"
name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n
*/</template><templa!
te autoinsert\="true" context\="fieldcomment_context" deleted\!
="false"
description\="Comment for fields" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment"
name\="fieldcomment">/**\n * \n */</template><template
autoinsert\="true" context\="methodcomment_context"
deleted\="false" description\="Comment for non-overriding methods"
enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment"
name\="methodcomment">/**\n * ${tags}\n */</template><template
autoinsert\="true" context\="overridecomment_context"
deleted\="false" description\="Comment for overriding methods"
enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment"
name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n
*/</template><template autoinsert\="true"
context\="delegatecomment_context" deleted\="false"
description\="Comment for delegate methods" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment"
name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n
*/</template><template autoinser!
t\="true" context\="newtype_context" deleted\="false"
description\="Newly created files" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.newtype"
name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template
autoinsert\="true" context\="classbody_context"
deleted\="false" description\="Code in new class type bodies"
enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody"
name\="classbody">\n</template><template
autoinsert\="true" context\="interfacebody_context"
deleted\="false" description\="Code in new interface type bodies"
enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody"
name\="interfacebody">\n</template><template
autoinsert\="true" context\="enumbody_context"
deleted\="false" description\="Code in new enum type bodies"
enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody"
name\="enumbody">\n</template><template autoinsert\="true"
context\="annotationbod!
y_context" deleted\="false" description\="Code in new annotati!
on type
bodies" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody"
name\="annotationbody">\n</template><template
autoinsert\="true" context\="catchblock_context"
deleted\="false" description\="Code in new catch blocks"
enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock"
name\="catchblock">// ${todo} Auto-generated catch
block\n${exception_var}.printStackTrace();</template><template
autoinsert\="true" context\="methodbody_context"
deleted\="false" description\="Code in created method stubs"
enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody"
name\="methodbody">// ${todo} Auto-generated method
stub\n${body_statement}</template><template autoinsert\="true"
context\="constructorbody_context" deleted\="false"
description\="Code in created constructor stubs" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody"
name\="constructorbody">${body_statement}\n// ${todo} Auto-generated
constructor stub</template>!
<template autoinsert\="true" context\="getterbody_context"
deleted\="false" description\="Code in created getters"
enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody"
name\="getterbody">return ${field};</template><template
autoinsert\="true" context\="setterbody_context"
deleted\="false" description\="Code in created setters"
enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody"
name\="setterbody">${field} \= ${param};</template><template
autoinsert\="true" context\="gettercomment_context"
deleted\="false" description\="Comment for getter function"
enabled\="true"
id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment"
name\="gettercomment">/**\n * @return the ${bare_field_name}\n
*/</template><template autoinsert\="true"
context\="settercomment_context" deleted\="false"
description\="Comment for setter function" enabled\="true"
id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment"
name\="settercomment">/**\n * @param ${pa!
ram} the ${bare_field_name} to set\n */</template><template au!
toinsert
\="true" context\="constructorcomment_context"
deleted\="false" description\="Comment for created constructors"
enabled\="true"
id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment"
name\="constructorcomment">/**\n * ${tags}\n */</template><template
autoinsert\="true" context\="filecomment_context"
deleted\="false" description\="Comment for created JavaScript files"
enabled\="true"
id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment"
name\="filecomment">/**\n * \n */</template><template
autoinsert\="true" context\="typecomment_context"
deleted\="false" description\="Comment for created types"
enabled\="true"
id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment"
name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n
*/</template><template autoinsert\="true"
context\="fieldcomment_context" deleted\="false"
description\="Comment for vars" enabled\="true"
id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment"
name\="fieldcomment">/**\n !
* \n */</template><template autoinsert\="true"
context\="methodcomment_context" deleted\="false"
description\="Comment for non-overriding function" enabled\="true"
id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment"
name\="methodcomment">/**\n * ${tags}\n */</template><template
autoinsert\="true" context\="overridecomment_context"
deleted\="false" description\="Comment for overriding functions"
enabled\="true"
id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment"
name\="overridecomment">/* (non-JSDoc)\n * ${see_to_overridden}\n
*/</template><template autoinsert\="true"
context\="delegatecomment_context" deleted\="false"
description\="Comment for delegate functions" enabled\="true"
id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment"
name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n
*/</template><template autoinsert\="true"
context\="newtype_context" deleted\="false" description\="Newly
created files" enabled\="true" id\="org.ec!
lipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">!
${fileco
mment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template
autoinsert\="true" context\="classbody_context"
deleted\="false" description\="Code in new class type bodies"
enabled\="true"
id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody"
name\="classbody">\n</template><template
autoinsert\="true" context\="catchblock_context"
deleted\="false" description\="Code in new catch blocks"
enabled\="true"
id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock"
name\="catchblock">// ${todo} Auto-generated catch
block\n${exception_var}.printStackTrace();</template><template
autoinsert\="true" context\="methodbody_context"
deleted\="false" description\="Code in created function stubs"
enabled\="true"
id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody"
name\="methodbody">// ${todo} Auto-generated function
stub\n${body_statement}</template><template autoinsert\="true"
context\="constructorbody_context" deleted\="false"
description\="Code i!
n created constructor stubs" enabled\="true"
id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody"
name\="constructorbody">${body_statement}\n// ${todo} Auto-generated
constructor stub</template><template autoinsert\="true"
context\="getterbody_context" deleted\="false" description\="Code
in created getters" enabled\="true"
id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody"
name\="getterbody">return ${field};</template><template
autoinsert\="true" context\="setterbody_context"
deleted\="false" description\="Code in created setters"
enabled\="true"
id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody"
name\="setterbody">${field} \= ${param};</template></templates>
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsCookie.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsCookie.java 2012-02-03
14:50:46 UTC (rev 38413)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsCookie.java 2012-02-03
14:53:22 UTC (rev 38414)
@@ -26,7 +26,7 @@
}
public GoogleAnalyticsCookie(String identifier, CharSequence value) {
- this(identifier, value, (char) -1);
+ this(identifier, value, new char[0]);
}
/**
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsUrlStrategy.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsUrlStrategy.java 2012-02-03
14:50:46 UTC (rev 38413)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsUrlStrategy.java 2012-02-03
14:53:22 UTC (rev 38414)
@@ -28,10 +28,40 @@
/**
* Class that builds an URL that passes given parameters to google analytics
*
+ * example:
+ * <p>
+ * <code>
+ *
http://www.google-analytics.com/__utm.gif?
+ * utmwv=5.2.4
+ * &utms=10
+ * &utmn=583355747
+ * &utmhn=devstudio.jboss.com
+ * &utmcs=UTF-8
+ * &utmsr=2560x1440
+ * &utmvp=1265x393
+ * &utmsc=24-bit
+ * &utmul=en-us
+ * &utmje=1
+ * &utmfl=10.1 r102
+ * &utmdt=JBoss Developer Studio - Early Access
+ * &utmhid=1589877876
+ * &utmr=-
+ * &utmp=/earlyaccess/
+ * &utmac=UA-xxxxxx-x
+ * &utmcc=
+ * __utma=136910373.1786599479.1328002257.1328002257.1328216095.2;
+ * +__utmz=136910373.1328002257.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);
+ * +__utmv=136910373.wonka;
+ * &utmu=rAAQ~
+ * </code>
+ *
* @author Andre Dietisheim
* @author Siddique Hameed
- * @see based on <a
href="http://jgoogleAnalytics.googlecode.com">http://jgoogleAnalytics.googlecode.com</a>
- *
+ *
+ * @see based on <a
+ *
href="http://jgoogleAnalytics.googlecode.com">http://jgoogleAnalytics
+ * .googlecode.com</a>
+ *
* @see <a
*
href="http://code.google.com/apis/analytics/docs/tracking/gaTracking...
* Request Parameters</a>
@@ -116,11 +146,12 @@
.append(googleParameters.getFirstVisit()).append(IGoogleAnalyticsParameters.DOT)
.append(googleParameters.getLastVisit()).append(IGoogleAnalyticsParameters.DOT)
.append(googleParameters.getCurrentVisit()).append(IGoogleAnalyticsParameters.DOT)
- .append(googleParameters.getVisitCount())
- .append(IGoogleAnalyticsParameters.SEMICOLON),
- IGoogleAnalyticsParameters.PLUS_SIGN)
+ .append(googleParameters.getVisitCount()))
.appendTo(builder);
+ builder.append(IGoogleAnalyticsParameters.SEMICOLON)
+ .append(IGoogleAnalyticsParameters.PLUS_SIGN);
+
new GoogleAnalyticsCookie(IGoogleAnalyticsParameters.PARAM_COOKIES_REFERRAL_TYPE,
new StringBuilder()
.append("999.")
@@ -161,10 +192,12 @@
.appendTo(builder);
new GoogleAnalyticsCookie(IGoogleAnalyticsParameters.PARAM_COOKIES_KEYWORD,
- googleParameters.getKeyword(),
- IGoogleAnalyticsParameters.PIPE)
+ googleParameters.getKeyword())
.appendTo(builder);
+ builder.append(IGoogleAnalyticsParameters.SEMICOLON)
+ .append(IGoogleAnalyticsParameters.PLUS_SIGN);
+
/**
* <tt>User defined Value<tt> cookie format: (domain hash).(setvar value)
*
@@ -176,11 +209,9 @@
getRandomNumber()
+ IGoogleAnalyticsParameters.DOT
+ googleParameters.getUserDefined(),
- ' ')
+ IGoogleAnalyticsParameters.SEMICOLON)
.appendTo(builder);
- builder.append(IGoogleAnalyticsParameters.SEMICOLON);
-
return HttpEncodingUtils.checkedEncodeUtf8(builder.toString());
}
Modified:
trunk/usage/tests/org.jboss.tools.usage.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/usage/tests/org.jboss.tools.usage.test/.settings/org.eclipse.jdt.core.prefs 2012-02-03
14:50:46 UTC (rev 38413)
+++
trunk/usage/tests/org.jboss.tools.usage.test/.settings/org.eclipse.jdt.core.prefs 2012-02-03
14:53:22 UTC (rev 38414)
@@ -1,4 +1,4 @@
-#Wed Sep 15 16:01:41 CEST 2010
+#Tue Jan 31 17:16:35 CET 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
@@ -17,12 +17,14 @@
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
@@ -47,7 +49,7 @@
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
@@ -60,6 +62,7 @@
org.eclipse.jdt.core.formatter.comment.line_length=80
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
org.eclipse.jdt.core.formatter.compact_else_if=true
org.eclipse.jdt.core.formatter.continuation_indentation=2
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
@@ -78,9 +81,13 @@
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not
insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do
not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
@@ -148,12 +155,14 @@
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do
not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
@@ -177,6 +186,7 @@
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do
not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
@@ -232,6 +242,7 @@
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do
not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
@@ -241,6 +252,7 @@
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not
insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do
not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do
not insert
@@ -267,4 +279,5 @@
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
Modified: trunk/usage/tests/org.jboss.tools.usage.test/.settings/org.eclipse.jdt.ui.prefs
===================================================================
---
trunk/usage/tests/org.jboss.tools.usage.test/.settings/org.eclipse.jdt.ui.prefs 2012-02-03
14:50:46 UTC (rev 38413)
+++
trunk/usage/tests/org.jboss.tools.usage.test/.settings/org.eclipse.jdt.ui.prefs 2012-02-03
14:53:22 UTC (rev 38414)
@@ -1,4 +1,4 @@
-#Fri Jul 30 15:03:59 CEST 2010
+#Tue Jan 31 17:16:35 CET 2012
eclipse.preferences.version=1
formatter_profile=_Eclipse [built-in] extended
-formatter_settings_version=11
+formatter_settings_version=12
Modified:
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GoogleAnalyticsUrlStrategyTest.java
===================================================================
---
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GoogleAnalyticsUrlStrategyTest.java 2012-02-03
14:50:46 UTC (rev 38413)
+++
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GoogleAnalyticsUrlStrategyTest.java 2012-02-03
14:53:22 UTC (rev 38414)
@@ -16,11 +16,14 @@
import java.io.IOException;
import java.io.UnsupportedEncodingException;
+import org.eclipse.core.runtime.IBundleGroupProvider;
import org.jboss.tools.usage.googleanalytics.GoogleAnalyticsUrlStrategy;
import org.jboss.tools.usage.googleanalytics.IGoogleAnalyticsParameters;
+import org.jboss.tools.usage.test.fakes.BundleGroupProviderFake;
import org.jboss.tools.usage.test.fakes.ReportingEclipseEnvironmentFake;
import org.jboss.tools.usage.tracker.IFocusPoint;
import org.jboss.tools.usage.tracker.internal.FocusPoint;
+import org.jboss.tools.usage.util.HttpEncodingUtils;
import org.junit.Before;
import org.junit.Test;
@@ -29,18 +32,31 @@
*/
public class GoogleAnalyticsUrlStrategyTest {
+ private static final String URLENCODED_SEMICOLON =
+ HttpEncodingUtils.checkedEncodeUtf8(String.valueOf(IGoogleAnalyticsParameters.SEMICOLON));
+ private static final String URLENCODED_EQUALS_SIGN =
+ HttpEncodingUtils.checkedEncodeUtf8(String.valueOf(IGoogleAnalyticsParameters.EQUALS_SIGN));
private GoogleAnalyticsUrlStrategy urlStrategy;
@Before
public void setUp() {
- this.urlStrategy = new GoogleAnalyticsUrlStrategy(new
ReportingEclipseEnvironmentFake());
+ this.urlStrategy = new GoogleAnalyticsUrlStrategy(new ReportingEclipseEnvironmentFake()
{
+ protected IBundleGroupProvider[] getBundleGroupProviders() {
+ return new IBundleGroupProvider[] {
+ new BundleGroupProviderFake(
+ "org.jboss.tools.gwt.feature",
+ "org.jboss.tools.seam.feature",
+ "org.jboss.tools.smooks.feature")
+ };
+ }
+ });
}
@Test
public void createsCorrectUrl() throws UnsupportedEncodingException {
IFocusPoint focusPoint = new FocusPoint("testing").setChild(new
FocusPoint("strategy"));
String url = urlStrategy.build(focusPoint);
-
+
String targetUrl = "http://www.google-analytics.com/__utm.gif?"
+ "utmwv=4.7.2"
+ "&utmn=33832126513"
@@ -52,15 +68,15 @@
+ "&utmdt=testing-strategy"
+ "&utmhid=1087431432"
+ "&utmr="
- + IGoogleAnalyticsParameters.VALUE_NO_REFERRAL
+ + IGoogleAnalyticsParameters.VALUE_NO_REFERRAL
+ "&utmp=%2Ftesting%2Fstrategy"
+ "&utmfl="
- + ReportingEclipseEnvironmentFake.JAVA_VERSION
+ + ReportingEclipseEnvironmentFake.JAVA_VERSION
+ "&utmac=UA-17645367-1"
+
"&utmcc=__utma%3D156030503.195542053.1281528584.1281528584.1281528584.1%3B%2B__utmz%3D156030500.1281528584.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B"
- + "__utmv=Fedora13"
+ + "__utmv=404606403.Fedora+13"
+ "&gaq=1";
-
+
assertTrue(areEqualParameterValues(IGoogleAnalyticsParameters.PARAM_TRACKING_CODE_VERSION,
url, targetUrl));
assertTrue(areEqualParameterValues(IGoogleAnalyticsParameters.PARAM_HOST_NAME, url,
targetUrl));
assertTrue(areEqualParameterValues(IGoogleAnalyticsParameters.PARAM_LANGUAGE_ENCODING,
url, targetUrl));
@@ -77,7 +93,8 @@
assertTrue(hasCookieValue("utmcsr", url));
assertTrue(hasCookieValue("utmccn", url));
assertTrue(hasCookieValue("utmcmd", url));
- assertTrue(hasCookieValue("__utmv", url));
+ assertEquals("GWT-SEAM-SMOOKS-", getCookieValue("utmctr", url));
+ assertTrue(getCookieValue("__utmv",
url).contains(HttpEncodingUtils.checkedEncodeUtf8("Fedora 13")));
assertTrue(areEqualParameterValues(IGoogleAnalyticsParameters.PARAM_GAQ, url,
targetUrl));
}
@@ -91,20 +108,20 @@
eclipseEnvironment.visit();
assertEquals(3, eclipseEnvironment.getVisitCount());
}
-
+
@Test
public void verifyCentralIsStarted() throws IOException {
IFocusPoint focusPoint = new FocusPoint("testing").setChild(new
FocusPoint("strategy"));
String url = urlStrategy.build(focusPoint);
-
+
String centralEnabled = new
ReportingEclipseEnvironmentFake().getCentralEnabledValue();
-
+
assertTrue(areEqualParameterValues(
IGoogleAnalyticsParameters.PARAM_EVENT_TRACKING
, url
, IGoogleAnalyticsParameters.PARAM_EVENT_TRACKING +
"=5(central*showOnStartup*" + centralEnabled + ")&"));
}
-
+
private boolean areEqualParameterValues(String paramName, String url, String targetUrl)
{
return areEqualParameterValues(paramName, url, targetUrl,
String.valueOf(IGoogleAnalyticsParameters.AMPERSAND));
}
@@ -116,9 +133,32 @@
}
private boolean hasCookieValue(String cookieName, String url) {
+ return getCookieValue(cookieName, url) != null;
+ }
+
+ private String getCookieValue(String cookieName, String url) {
String cookieValues = getParameterValue(IGoogleAnalyticsParameters.PARAM_COOKIES, url,
String.valueOf(IGoogleAnalyticsParameters.AMPERSAND));
- return cookieValues != null && cookieValues.indexOf(cookieName) >= 0;
+ if (cookieValues == null) {
+ return null;
+ }
+ int cookieNameStart = cookieValues.indexOf(cookieName);
+ if (cookieNameStart < 0) {
+ return null;
+ }
+ int cookieNameStop = cookieValues.substring(cookieNameStart)
+ .indexOf(URLENCODED_EQUALS_SIGN);
+ if (cookieNameStop < 0) {
+ return null;
+ }
+ int cookieValueStart = cookieNameStart + cookieNameStop +
URLENCODED_EQUALS_SIGN.length();
+ // cookie must be terminated by ';'
+ int cookieValueStop =
+ cookieValues.substring(cookieValueStart).indexOf(URLENCODED_SEMICOLON);
+ if (cookieValueStop < 0) {
+ return null;
+ }
+ return cookieValues.substring(cookieValueStart, cookieValueStart + cookieValueStop);
}
private String getParameterValue(String parameterName, String url, String delimiters) {