From 75df9bd58933d4f8b0610f30edf67a778decb972 Mon Sep 17 00:00:00 2001 From: Vincent Perot Date: Wed, 23 Jul 2014 11:47:33 -0400 Subject: pcap: add unit tests to tmf.pcap Change-Id: I81c12a8d75f99a61931a330e9d80896a77659002 Signed-off-by: Vincent Perot Reviewed-on: https://git.eclipse.org/r/30533 Tested-by: Hudson CI Reviewed-by: Bernd Hufmann Tested-by: Bernd Hufmann Tested-by: Matthew Khouzam Reviewed-by: Matthew Khouzam --- .../META-INF/MANIFEST.MF | 3 +- .../linuxtools/lttng/alltests/RunAllTests.java | 3 +- .../.classpath | 9 + .../.project | 34 ++ .../.settings/org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.core.runtime.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 393 +++++++++++++++++++++ .../.settings/org.eclipse.jdt.ui.prefs | 56 +++ .../.settings/org.eclipse.pde.api.tools.prefs | 97 +++++ .../.settings/org.eclipse.pde.prefs | 32 ++ .../META-INF/MANIFEST.MF | 19 + .../about.html | 28 ++ .../build.properties | 22 ++ .../plugin.properties | 15 + .../pom.xml | 64 ++++ .../pcap/core/tests/shared/PcapTmfTestTrace.java | 121 +++++++ .../tmf/pcap/core/tests/AllTmfPcapCoreTests.java | 32 ++ .../tmf/pcap/core/tests/analysis/AllTests.java | 27 ++ .../tests/analysis/StreamListAnalysisTest.java | 126 +++++++ .../tmf/pcap/core/tests/event/AllTests.java | 28 ++ .../pcap/core/tests/event/PcapEventFieldTest.java | 244 +++++++++++++ .../tmf/pcap/core/tests/event/PcapEventTest.java | 154 ++++++++ .../tmf/pcap/core/tests/trace/AllTests.java | 27 ++ .../tmf/pcap/core/tests/trace/PcapTraceTest.java | 307 ++++++++++++++++ .../pcap/core/tests/stubs/PcapTmfTraceStub.java | 41 +++ 25 files changed, 1884 insertions(+), 2 deletions(-) create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.classpath create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.project create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.core.resources.prefs create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.core.runtime.prefs create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.jdt.core.prefs create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.pde.api.tools.prefs create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.pde.prefs create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/META-INF/MANIFEST.MF create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/about.html create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/build.properties create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/plugin.properties create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/pom.xml create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/shared/org/eclipse/linuxtools/tmf/pcap/core/tests/shared/PcapTmfTestTrace.java create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/AllTmfPcapCoreTests.java create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/analysis/AllTests.java create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/analysis/StreamListAnalysisTest.java create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/event/AllTests.java create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/event/PcapEventFieldTest.java create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/event/PcapEventTest.java create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/trace/AllTests.java create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/trace/PcapTraceTest.java create mode 100644 lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/stubs/org/eclipse/linuxtools/tmf/pcap/core/tests/stubs/PcapTmfTraceStub.java diff --git a/lttng/org.eclipse.linuxtools.lttng.alltests/META-INF/MANIFEST.MF b/lttng/org.eclipse.linuxtools.lttng.alltests/META-INF/MANIFEST.MF index 6335eab262..01096e189c 100644 --- a/lttng/org.eclipse.linuxtools.lttng.alltests/META-INF/MANIFEST.MF +++ b/lttng/org.eclipse.linuxtools.lttng.alltests/META-INF/MANIFEST.MF @@ -30,7 +30,8 @@ Require-Bundle: org.junit;bundle-version="4.0.0", org.eclipse.linuxtools.btf.core.tests;bundle-version="3.0.0", org.eclipse.linuxtools.tmf.analysis.xml.core.tests;bundle-version="1.0.0", org.eclipse.linuxtools.tmf.analysis.xml.ui.tests;bundle-version="1.0.0", - org.eclipse.linuxtools.pcap.core.tests;bundle-version="3.0.0" + org.eclipse.linuxtools.pcap.core.tests;bundle-version="3.1.0", + org.eclipse.linuxtools.tmf.pcap.core.tests;bundle-version="3.1.0" Export-Package: org.eclipse.linuxtools.lttng.alltests;x-internal:=true Import-Package: org.apache.derby.jdbc, org.json diff --git a/lttng/org.eclipse.linuxtools.lttng.alltests/src/org/eclipse/linuxtools/lttng/alltests/RunAllTests.java b/lttng/org.eclipse.linuxtools.lttng.alltests/src/org/eclipse/linuxtools/lttng/alltests/RunAllTests.java index 894dd9fb26..46201533b4 100644 --- a/lttng/org.eclipse.linuxtools.lttng.alltests/src/org/eclipse/linuxtools/lttng/alltests/RunAllTests.java +++ b/lttng/org.eclipse.linuxtools.lttng.alltests/src/org/eclipse/linuxtools/lttng/alltests/RunAllTests.java @@ -37,7 +37,8 @@ import org.junit.runners.Suite; org.eclipse.linuxtools.tmf.analysis.xml.ui.tests.AllAnalysisXmlUiTests.class, org.eclipse.linuxtools.tmf.core.tests.AllTmfCoreTests.class, org.eclipse.linuxtools.tmf.ui.tests.AllTmfUITests.class, - org.eclipse.linuxtools.tmf.ctf.core.tests.AllTests.class + org.eclipse.linuxtools.tmf.ctf.core.tests.AllTests.class, + org.eclipse.linuxtools.tmf.pcap.core.tests.AllTmfPcapCoreTests.class }) public class RunAllTests { diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.classpath b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.classpath new file mode 100644 index 0000000000..68143fe727 --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.project b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.project new file mode 100644 index 0000000000..1e532da855 --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.project @@ -0,0 +1,34 @@ + + + org.eclipse.linuxtools.tmf.pcap.core.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.core.resources.prefs b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.core.runtime.prefs b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..5a0ad22d2a --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.jdt.core.prefs b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..8cf4cd486e --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,393 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=error +org.eclipse.jdt.core.compiler.problem.deadCode=error +org.eclipse.jdt.core.compiler.problem.deprecation=error +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=error +org.eclipse.jdt.core.compiler.problem.emptyStatement=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=error +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=error +org.eclipse.jdt.core.compiler.problem.finalParameterBound=error +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.localVariableHiding=error +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=error +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=enabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=error +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning +org.eclipse.jdt.core.compiler.problem.nullReference=error +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error +org.eclipse.jdt.core.compiler.problem.parameterAssignment=error +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error +org.eclipse.jdt.core.compiler.problem.potentialNullReference=error +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.rawTypeReference=error +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=error +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=error +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=error +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=error +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=error +org.eclipse.jdt.core.compiler.problem.unusedLabel=error +org.eclipse.jdt.core.compiler.problem.unusedLocal=error +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=error +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error +org.eclipse.jdt.core.compiler.source=1.7 +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 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +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=0 +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 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +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=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 +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +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 +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +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_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 +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +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 +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +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 +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +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 +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +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 +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=250 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +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 diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.jdt.ui.prefs b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..4fd0c7006a --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,56 @@ +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_tmf-style +formatter_settings_version=12 +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=false +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=false +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=false +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=false +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=true +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.pde.api.tools.prefs b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000000..acc3abd47c --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,97 @@ +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error +API_USE_SCAN_FIELD_SEVERITY=Error +API_USE_SCAN_METHOD_SEVERITY=Error +API_USE_SCAN_TYPE_SEVERITY=Error +CLASS_ELEMENT_TYPE_ADDED_METHOD=Error +CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error +CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error +CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error +CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error +ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error +ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error +ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +FIELD_ELEMENT_TYPE_ADDED_VALUE=Error +FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error +FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error +FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error +ILLEGAL_EXTEND=Warning +ILLEGAL_IMPLEMENT=Warning +ILLEGAL_INSTANTIATE=Warning +ILLEGAL_OVERRIDE=Warning +ILLEGAL_REFERENCE=Warning +INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error +INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +INVALID_JAVADOC_TAG=Warning +INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning +LEAK_EXTEND=Warning +LEAK_FIELD_DECL=Warning +LEAK_IMPLEMENT=Warning +LEAK_METHOD_PARAM=Warning +LEAK_METHOD_RETURN_TYPE=Warning +METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +MISSING_EE_DESCRIPTIONS=Ignore +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +UNUSED_PROBLEM_FILTERS=Warning +automatically_removed_unused_problem_filters=false +eclipse.preferences.version=1 +incompatible_api_component_version=Error +incompatible_api_component_version_include_major_without_breaking_change=Disabled +incompatible_api_component_version_include_minor_without_api_change=Disabled +invalid_since_tag_version=Error +malformed_since_tag=Error +missing_since_tag=Error +report_api_breakage_when_major_version_incremented=Disabled +report_resolution_errors_api_component=Warning diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.pde.prefs b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.pde.prefs new file mode 100644 index 0000000000..62cfa90dee --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/.settings/org.eclipse.pde.prefs @@ -0,0 +1,32 @@ +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=1 +compilers.p.build.encodings=2 +compilers.p.build.java.compiler=2 +compilers.p.build.java.compliance=1 +compilers.p.build.missing.output=2 +compilers.p.build.output.library=1 +compilers.p.build.source.library=1 +compilers.p.build.src.includes=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.missing-version-export-package=2 +compilers.p.missing-version-import-package=2 +compilers.p.missing-version-require-bundle=2 +compilers.p.no-required-att=0 +compilers.p.not-externalized-att=2 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +eclipse.preferences.version=1 diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/META-INF/MANIFEST.MF b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..e2aafd6a54 --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/META-INF/MANIFEST.MF @@ -0,0 +1,19 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-Vendor: %Bundle-Vendor +Bundle-Version: 3.1.0.qualifier +Bundle-Localization: plugin +Bundle-SymbolicName: org.eclipse.linuxtools.tmf.pcap.core.tests;singleton:=true +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Require-Bundle: org.junit;bundle-version="4.0.0", + org.eclipse.core.runtime, + org.eclipse.core.resources, + org.eclipse.linuxtools.pcap.core, + org.eclipse.linuxtools.pcap.core.tests, + org.eclipse.linuxtools.tmf.core, + org.eclipse.linuxtools.tmf.core.tests, + org.eclipse.linuxtools.tmf.pcap.core +Import-Package: com.google.common.collect +Export-Package: org.eclipse.linuxtools.tmf.pcap.core.tests diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/about.html b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/about.html new file mode 100644 index 0000000000..28737f60b7 --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

June 5, 2006

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/build.properties b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/build.properties new file mode 100644 index 0000000000..05c0115474 --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/build.properties @@ -0,0 +1,22 @@ +############################################################################### +# Copyright (c) 2014 Ericsson +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Ericsson - Initial API and implementation +############################################################################### + +source.. = src/,\ + shared/,\ + stubs +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties +src.includes = about.html +additional.bundles = org.eclipse.jdt.annotation +jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/plugin.properties b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/plugin.properties new file mode 100644 index 0000000000..ea9015e1cb --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/plugin.properties @@ -0,0 +1,15 @@ +############################################################################### +# Copyright (c) 2014 Ericsson +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Ericsson - Initial API and implementation +############################################################################### + +#Properties file for org.eclipse.linuxtools.tmf.pcap.core.tests +Bundle-Vendor = Eclipse Linux Tools +Bundle-Name = Pcap support for TMF Core Tests Plug-in diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/pom.xml b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/pom.xml new file mode 100644 index 0000000000..bb5d086229 --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/pom.xml @@ -0,0 +1,64 @@ + + + + 4.0.0 + + + linuxtools-lttng-parent + org.eclipse.linuxtools.lttng + 3.1.0-SNAPSHOT + + + org.eclipse.linuxtools.tmf.pcap.core.tests + 3.1.0-SNAPSHOT + eclipse-test-plugin + + Pcap Support for TMF Core Tests Plug-in + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.7 + + + prepare + validate + + + + + + + run + + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + + **/AllTests.* + + false + false + org.eclipse.platform.ide + + + + + + org.eclipse.linuxtools.tmf + diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/shared/org/eclipse/linuxtools/tmf/pcap/core/tests/shared/PcapTmfTestTrace.java b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/shared/org/eclipse/linuxtools/tmf/pcap/core/tests/shared/PcapTmfTestTrace.java new file mode 100644 index 0000000000..56c20d7310 --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/shared/org/eclipse/linuxtools/tmf/pcap/core/tests/shared/PcapTmfTestTrace.java @@ -0,0 +1,121 @@ +/******************************************************************************* + * Copyright (c) 2014 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Perot - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.tmf.pcap.core.tests.shared; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.linuxtools.pcap.core.tests.shared.PcapTestTrace; +import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException; +import org.eclipse.linuxtools.tmf.pcap.core.event.PcapEvent; +import org.eclipse.linuxtools.tmf.pcap.core.tests.stubs.PcapTmfTraceStub; +import org.eclipse.linuxtools.tmf.pcap.core.trace.PcapTrace; + +/** + * Available Pcap TMF test traces. Kind-of-extends {@link PcapTestTrace}. + * + * To run tests using these, you first need to run the "get-traces.[xml|sh]" + * script located under lttng/org.eclipse.linuxtools.pcap.core.tests/rsc/ . + * + * @author Vincent Perot + */ +@NonNullByDefault +public enum PcapTmfTestTrace { + /** A bad pcap file. */ + BAD_PCAPFILE, + + /** A Valid Pcap that is empty. */ + EMPTY_PCAP, + + /** A Pcap that mostly contains TCP packets. */ + MOSTLY_TCP, + + /** A Pcap that mostly contains UDP packets. */ + MOSTLY_UDP, + + /** A big-endian trace that contains two packets. */ + SHORT_BIG_ENDIAN, + + /** A little-endian trace that contains two packets. */ + SHORT_LITTLE_ENDIAN, + + /** A trace used for benchmarking. */ + BENCHMARK_TRACE, + + /** A Kernel trace directory. */ + KERNEL_DIRECTORY, + + /** A Kernel trace file. */ + KERNEL_TRACE; + + private final String fPath; + private @Nullable PcapTmfTraceStub fTrace = null; + + private PcapTmfTestTrace() { + @NonNull String path = PcapTestTrace.valueOf(this.name()).getPath(); + fPath = path; + } + + /** + * @return The path of this trace + */ + public String getPath() { + return fPath; + } + + /** + * Return a PcapTmfTraceStub object of this test trace. It will be already + * initTrace()'ed. + * + * Make sure you call {@link #exists()} before calling this! + * + * After being used by unit tests, traces must be properly disposed of by + * calling the {@link PcapTmfTestTrace#dispose()} method. + * + * @return A PcapTmfTrace reference to this trace + */ + public synchronized PcapTrace getTrace() { + PcapTmfTraceStub trace = fTrace; + if (trace != null) { + trace.dispose(); + } + trace = new PcapTmfTraceStub(); + try { + trace.initTrace(null, fPath, PcapEvent.class); + } catch (TmfTraceException e) { + /* Should not happen if tracesExist() passed */ + throw new RuntimeException(e); + } + fTrace = trace; + return trace; + } + + /** + * Check if the trace actually exists on disk or not. + * + * @return If the trace is present + */ + public boolean exists() { + return PcapTestTrace.valueOf(this.name()).exists(); + } + + /** + * Dispose of the trace + */ + public void dispose() { + if (fTrace != null) { + fTrace.dispose(); + fTrace = null; + } + } +} diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/AllTmfPcapCoreTests.java b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/AllTmfPcapCoreTests.java new file mode 100644 index 0000000000..ca551a0208 --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/AllTmfPcapCoreTests.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2014 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Perot - Initial generation with CodePro tools + *******************************************************************************/ + +package org.eclipse.linuxtools.tmf.pcap.core.tests; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * The class AllTmfPcapCoreTests builds a suite to run all the + * tests. + * + * @author Vincent Perot + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + org.eclipse.linuxtools.tmf.pcap.core.tests.analysis.AllTests.class, + org.eclipse.linuxtools.tmf.pcap.core.tests.event.AllTests.class, + org.eclipse.linuxtools.tmf.pcap.core.tests.trace.AllTests.class +}) +public class AllTmfPcapCoreTests { + +} diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/analysis/AllTests.java b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/analysis/AllTests.java new file mode 100644 index 0000000000..99aa8010a5 --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/analysis/AllTests.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2014 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Perot - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.tmf.pcap.core.tests.analysis; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Analysis test suite + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + StreamListAnalysisTest.class +}) +public class AllTests { + +} diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/analysis/StreamListAnalysisTest.java b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/analysis/StreamListAnalysisTest.java new file mode 100644 index 0000000000..dc0819cfce --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/analysis/StreamListAnalysisTest.java @@ -0,0 +1,126 @@ +/******************************************************************************* + * Copyright (c) 2014 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Perot - Initial API and implementation + ******************************************************************************/ + +package org.eclipse.linuxtools.tmf.pcap.core.tests.analysis; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.junit.Assume.assumeTrue; + +import org.eclipse.linuxtools.pcap.core.tests.shared.PcapTestTrace; +import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException; +import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException; +import org.eclipse.linuxtools.tmf.pcap.core.analysis.StreamListAnalysis; +import org.eclipse.linuxtools.tmf.pcap.core.event.TmfPacketStreamBuilder; +import org.eclipse.linuxtools.tmf.pcap.core.protocol.TmfProtocol; +import org.eclipse.linuxtools.tmf.pcap.core.trace.PcapTrace; +import org.junit.Test; + +/** + * JUnit that test the StreamListAnalysis class. + * + * @author Vincent Perot + */ +public class StreamListAnalysisTest { + + /** + * Method that tests the constructor. + */ + @Test + public void constructorTest() { + try (StreamListAnalysis analysis = new StreamListAnalysis();) { + analysis.setId(StreamListAnalysis.ID); + for (TmfProtocol protocol : TmfProtocol.getAllProtocols()) { + if (protocol.supportsStream()) { + assertNotNull(analysis.getBuilder(protocol)); + } + } + assertFalse(analysis.isFinished()); + } + } + + /** + * Method that tests canExecute(). + * + * @throws TmfTraceException + * Thrown when the trace cannot be initialized. Fails the test. + */ + @Test + public void canExecuteTest() throws TmfTraceException { + PcapTestTrace trace = PcapTestTrace.MOSTLY_TCP; + assumeTrue(trace.exists()); + String path = trace.getPath(); + try (PcapTrace pcapTrace = new PcapTrace(); + StreamListAnalysis analysis = new StreamListAnalysis();) { + analysis.setId(StreamListAnalysis.ID); + pcapTrace.initTrace(null, path, null); + assertTrue(analysis.canExecute(pcapTrace)); + } + } + + /** + * Method that execute the analysis and verify the results. + * + * @throws TmfAnalysisException + * Thrown when an analysis error occurs during the setup or + * execution. Fails the test. + * @throws TmfTraceException + * Thrown when the trace cannot be initialized. Fails the test. + */ + @Test + public void executeAnalysisTest() throws TmfAnalysisException, TmfTraceException { + PcapTestTrace trace = PcapTestTrace.MOSTLY_TCP; + assumeTrue(trace.exists()); + String path = trace.getPath(); + try (PcapTrace pcapTrace = new PcapTrace(); + StreamListAnalysis analysis = new StreamListAnalysis();) { + pcapTrace.initTrace(null, path, null); + analysis.setId(StreamListAnalysis.ID); + analysis.setTrace(pcapTrace); + analysis.schedule(); + analysis.waitForCompletion(); + + // Verify that builders are not empty. + TmfPacketStreamBuilder builder = analysis.getBuilder(TmfProtocol.ETHERNET_II); + if (builder == null) { + fail("The PacketStreamBuilder is null!"); + return; + } + assertEquals(1, builder.getNbStreams()); + + builder = analysis.getBuilder(TmfProtocol.IPV4); + if (builder == null) { + fail("The PacketStreamBuilder is null!"); + return; + } + assertEquals(3, builder.getNbStreams()); + + builder = analysis.getBuilder(TmfProtocol.TCP); + if (builder == null) { + fail("The PacketStreamBuilder is null!"); + return; + } + assertEquals(2, builder.getNbStreams()); + + builder = analysis.getBuilder(TmfProtocol.UDP); + if (builder == null) { + fail("The PacketStreamBuilder is null!"); + return; + } + assertEquals(1, builder.getNbStreams()); + } + } + +} diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/event/AllTests.java b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/event/AllTests.java new file mode 100644 index 0000000000..90768d05fe --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/event/AllTests.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2014 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Perot - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.tmf.pcap.core.tests.event; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Event and Event Field test suite + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + PcapEventTest.class, + PcapEventFieldTest.class +}) +public class AllTests { + +} diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/event/PcapEventFieldTest.java b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/event/PcapEventFieldTest.java new file mode 100644 index 0000000000..dbd08a95f1 --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/event/PcapEventFieldTest.java @@ -0,0 +1,244 @@ +/******************************************************************************* + * Copyright (c) 2014 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Perot - Initial API and implementation + ******************************************************************************/ + +package org.eclipse.linuxtools.tmf.pcap.core.tests.event; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; +import static org.junit.Assume.assumeTrue; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.linuxtools.pcap.core.packet.BadPacketException; +import org.eclipse.linuxtools.pcap.core.packet.Packet; +import org.eclipse.linuxtools.pcap.core.protocol.ipv4.IPv4Packet; +import org.eclipse.linuxtools.pcap.core.tests.shared.PcapTestTrace; +import org.eclipse.linuxtools.pcap.core.trace.BadPcapFileException; +import org.eclipse.linuxtools.pcap.core.trace.PcapFile; +import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; +import org.eclipse.linuxtools.tmf.core.event.TmfEventField; +import org.eclipse.linuxtools.tmf.pcap.core.event.PcapEventField; +import org.eclipse.linuxtools.tmf.pcap.core.event.PcapRootEventField; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * JUnit that test the PcapEventField class. + * + * @author Vincent Perot + */ +public class PcapEventFieldTest { + + private static final @NonNull String EMPTY_STRING = ""; + private static PcapEventField fRegularField; + private static PcapRootEventField fRootField; + + /** + * Initialize the Packet and the Event. + * + * @throws BadPcapFileException + * Thrown when the pcap file is erroneous. + * @throws IOException + * Thrown when an IO error occurs. + * @throws BadPacketException + * Thrown when the packet is erroneous. + */ + @BeforeClass + public static void setUp() throws IOException, BadPcapFileException, BadPacketException { + ByteBuffer bb = ByteBuffer.allocate(25); + bb.order(ByteOrder.BIG_ENDIAN); + + // Version + IHL + bb.put((byte) 0x46); + + // DSCP + ECN + bb.put((byte) 0x9A); + + // Total length - this is randomly chosen so that we verify that the + // packet handles wrong total length. + bb.put((byte) 0x00); + bb.put((byte) 0xFF); + + // Identification + bb.put((byte) 0x0F); + bb.put((byte) 0xF0); + + // Flags + Fragment Offset + bb.put((byte) 0x1E); + bb.put((byte) 0xE1); + + // Time to live + bb.put((byte) 0xA0); + + // Protocol - Unknown + bb.put((byte) 0xFE); + + // Header checksum - chosen randomly + bb.put((byte) 0x33); + bb.put((byte) 0x44); + + // Source IP - 4 bytes + bb.put((byte) 192); + bb.put((byte) 168); + bb.put((byte) 1); + bb.put((byte) 0); + + // Destination IP - 4 bytes + bb.put((byte) 193); + bb.put((byte) 169); + bb.put((byte) 2); + bb.put((byte) 1); + + // Options - 4 bytes + bb.put((byte) 0xA2); + bb.put((byte) 0x56); + bb.put((byte) 0xA2); + bb.put((byte) 0x56); + + // Payload - 1 byte + bb.put((byte) 0xA6); + + bb.flip(); + + PcapTestTrace trace = PcapTestTrace.MOSTLY_TCP; + assumeTrue(trace.exists()); + String file = trace.getPath(); + try (PcapFile dummy = new PcapFile(file)) { + IPv4Packet packet = new IPv4Packet(dummy, null, bb); + ITmfEventField[] fieldArray = generatePacketFields(packet); + fRegularField = new PcapEventField("Regular Field", EMPTY_STRING, fieldArray, packet); + fRootField = new PcapRootEventField(EMPTY_STRING, fieldArray, packet); + } + + } + + /** + * Method that tests the copy constructor. + */ + @Test + public void copyConstructorTest() { + PcapEventField oldField = fRegularField; + if (oldField == null) { + fail("The field has not been initialized!"); + return; + } + PcapEventField newField = new PcapEventField(oldField); + assertEquals(fRegularField.hashCode(), newField.hashCode()); + assertEquals(fRegularField, newField); + } + + /** + * Method that tests a standard field value request. + */ + @Test + public void regularFieldValueRequestTest() { + ITmfEventField field = fRootField.getField("Internet Protocol Version 4"); + if (field == null) { + fail("The field is null!"); + return; + } + + ITmfEventField subfield = field.getField("Source IP Address"); + if (subfield == null) { + fail("The subfield is null!"); + return; + } + + String string = subfield.getValue().toString(); + assertEquals("192.168.1.0", string); + } + + /** + * Method that tests a custom field value request. + */ + @Test + public void customFieldValueRequestTest() { + ITmfEventField field = fRootField.getField(":protocol:"); + if (field == null) { + fail("The field is null!"); + return; + } + String string = field.getValue().toString(); + assertEquals("IPV4", string); + + field = fRootField.getField(":packetsource:"); + if (field == null) { + fail("The field is null!"); + return; + } + string = field.getValue().toString(); + assertEquals("192.168.1.0", string); + + field = fRootField.getField(":packetdestination:"); + if (field == null) { + fail("The field is null!"); + return; + } + string = field.getValue().toString(); + assertEquals("193.169.2.1", string); + + } + + /** + * Method that teststhe toString() method for a non-root field. + */ + @Test + public void regularToStringTest() { + assertEquals("Src: 192.168.1.0 , Dst: 193.169.2.1", fRegularField.toString()); + } + + /** + * Method that teststhe toString() method for a root field. + */ + @Test + public void rootToStringTest() { + assertEquals("192.168.1.0 > 193.169.2.1 Id=4080 Len=1", fRootField.toString()); + } + + // Convenience method + private static ITmfEventField[] generatePacketFields(Packet packet) { + List fieldList = new ArrayList<>(); + List subfieldList = new ArrayList<>(); + Packet localPacket = packet; + + while (localPacket != null) { + subfieldList.clear(); + for (Map.Entry entry : localPacket.getFields().entrySet()) { + + @SuppressWarnings("null") + @NonNull + String key = entry.getKey(); + + @SuppressWarnings("null") + @NonNull + String value = entry.getValue(); + subfieldList.add(new TmfEventField(key, value, null)); + } + ITmfEventField[] subfieldArray = subfieldList.toArray(new ITmfEventField[subfieldList.size()]); + fieldList.add(new PcapEventField(localPacket.getProtocol().getName(), EMPTY_STRING, subfieldArray, localPacket)); + localPacket = localPacket.getChildPacket(); + } + + ITmfEventField[] fieldArray = fieldList.toArray(new ITmfEventField[fieldList.size()]); + if (fieldArray == null) { + return new ITmfEventField[0]; + } + return fieldArray; + } + +} diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/event/PcapEventTest.java b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/event/PcapEventTest.java new file mode 100644 index 0000000000..65d523932d --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/event/PcapEventTest.java @@ -0,0 +1,154 @@ +/******************************************************************************* + * Copyright (c) 2014 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Perot - Initial API and implementation + ******************************************************************************/ + +package org.eclipse.linuxtools.tmf.pcap.core.tests.event; + +import static org.junit.Assert.*; +import static org.junit.Assume.assumeTrue; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.eclipse.linuxtools.pcap.core.tests.shared.PcapTestTrace; +import org.eclipse.linuxtools.pcap.core.trace.BadPcapFileException; +import org.eclipse.linuxtools.pcap.core.trace.PcapFile; +import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException; +import org.eclipse.linuxtools.tmf.core.trace.TmfContext; +import org.eclipse.linuxtools.tmf.core.trace.location.TmfLongLocation; +import org.eclipse.linuxtools.tmf.pcap.core.event.PcapEvent; +import org.eclipse.linuxtools.tmf.pcap.core.protocol.TmfProtocol; +import org.eclipse.linuxtools.tmf.pcap.core.trace.PcapTrace; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.google.common.collect.ImmutableList; + +/** + * JUnit that test the PcapEvent class. + * + * @author Vincent Perot + */ +public class PcapEventTest { + + private static PcapEvent fEvent; + private static List fProtocolList; + + /** + * Initialize the Packet and the EventField. + * + * @throws BadPcapFileException + * Thrown when the pcap file is erroneous. + * @throws IOException + * Thrown when an IO error occurs. + * @throws TmfTraceException + * Thrown when the trace is not valid. + */ + @BeforeClass + public static void setUp() throws IOException, BadPcapFileException, TmfTraceException { + + PcapTestTrace trace = PcapTestTrace.MOSTLY_TCP; + assumeTrue(trace.exists()); + String file = trace.getPath(); + try (PcapFile pcap = new PcapFile(file); + PcapTrace pcapTrace = new PcapTrace();) { + pcapTrace.initTrace(null, trace.getPath(), PcapEvent.class); + fEvent = pcapTrace.parseEvent(new TmfContext(new TmfLongLocation(3), 3)); + } + + // Initialize protocol list. + List list = new ArrayList<>(); + list.add(TmfProtocol.PCAP); + list.add(TmfProtocol.ETHERNET_II); + list.add(TmfProtocol.IPV4); + list.add(TmfProtocol.TCP); + list.add(TmfProtocol.UNKNOWN); + fProtocolList = ImmutableList.copyOf(list); + } + + /** + * Method that tests getProtocols of PcapEvent. + */ + @Test + public void getProtocolsTest() { + assertEquals(fProtocolList, fEvent.getProtocols()); + } + + /** + * Method that tests getMostEncapsulatedProtocol of PcapEvent. + */ + @Test + public void getMostEncapsulatedProtocolTest() { + assertEquals(TmfProtocol.TCP, fEvent.getMostEncapsulatedProtocol()); + } + + /** + * Method that tests getFields of PcapEvent. + */ + @Test + public void getFieldsTest() { + Map map = fEvent.getFields(TmfProtocol.IPV4); + if (map == null) { + fail("getFieldsTest() failed because map is null!"); + return; + } + assertEquals("145.254.160.237", map.get("Source IP Address")); + } + + /** + * Method that tests getPayload of PcapEvent. + */ + @Test + public void getPayloadTest() { + ByteBuffer bb = fEvent.getPayload(TmfProtocol.TCP); + if (bb == null) { + fail("getPayloadTest() failed because bb is null!"); + return; + } + assertEquals((byte) 0x47, bb.get()); + } + + /** + * Method that tests getSourceEndpoint of PcapEvent. + */ + @Test + public void getSourceEndpointTest() { + assertEquals("00:00:01:00:00:00/145.254.160.237/3372", fEvent.getSourceEndpoint(TmfProtocol.TCP)); + } + + /** + * Method that tests getDestinationEndpointTest of PcapEvent. + */ + @Test + public void getDestinationEndpointTest() { + assertEquals("fe:ff:20:00:01:00", fEvent.getDestinationEndpoint(TmfProtocol.ETHERNET_II)); + } + + /** + * Method that tests toString() of PcapEvent. + */ + @Test + public void toStringTest() { + assertEquals("3372 > 80 [ACK, PSH] Seq=951057940 Ack=290218380 Len=20", fEvent.toString()); + } + + /** + * Method that tests toString(protocol) of PcapEvent. + */ + @Test + public void toStringAtSpecificProtocolTest() { + assertEquals("Src: 145.254.160.237 , Dst: 65.208.228.223", fEvent.toString(TmfProtocol.IPV4)); + } + +} diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/trace/AllTests.java b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/trace/AllTests.java new file mode 100644 index 0000000000..a17b490e96 --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/trace/AllTests.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2014 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Perot - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.tmf.pcap.core.tests.trace; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Pcap trace test suite + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + PcapTraceTest.class +}) +public class AllTests { + +} diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/trace/PcapTraceTest.java b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/trace/PcapTraceTest.java new file mode 100644 index 0000000000..ab2724b253 --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/src/org/eclipse/linuxtools/tmf/pcap/core/tests/trace/PcapTraceTest.java @@ -0,0 +1,307 @@ +/******************************************************************************* + * Copyright (c) 2014 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Perot - Initial API and implementation + ******************************************************************************/ + +package org.eclipse.linuxtools.tmf.pcap.core.tests.trace; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeTrue; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException; +import org.eclipse.linuxtools.tmf.core.signal.TmfEndSynchSignal; +import org.eclipse.linuxtools.tmf.core.signal.TmfSignal; +import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp; +import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange; +import org.eclipse.linuxtools.tmf.core.trace.ITmfContext; +import org.eclipse.linuxtools.tmf.core.trace.location.TmfLongLocation; +import org.eclipse.linuxtools.tmf.pcap.core.event.PcapEvent; +import org.eclipse.linuxtools.tmf.pcap.core.tests.shared.PcapTmfTestTrace; +import org.eclipse.linuxtools.tmf.pcap.core.trace.PcapTrace; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * JUnit that test the PcapTrace class. + * + * @author Vincent Perot + */ +public class PcapTraceTest { + + private static final PcapTmfTestTrace TEST_TRACE = PcapTmfTestTrace.MOSTLY_TCP; + + private PcapTrace fFixture; + + /** + * Perform pre-test initialization. + * + * @throws TmfTraceException + * If the test trace is not found + */ + @Before + public void setUp() throws TmfTraceException { + assumeTrue(TEST_TRACE.exists()); + fFixture = new PcapTrace(); + fFixture.initTrace((IResource) null, TEST_TRACE.getPath(), PcapEvent.class); + } + + /** + * Perform post-test clean-up. + */ + @After + public void tearDown() { + if (fFixture != null) { + fFixture.dispose(); + } + } + + /** + * Run the PcapTrace() constructor test. + */ + @Test + public void testPcapTrace() { + try (PcapTrace result = new PcapTrace();) { + assertNotNull(result); + assertEquals(1000, result.getCacheSize()); + assertEquals(0L, result.getNbEvents()); + assertEquals(0L, result.getStreamingInterval()); + assertNull(result.getResource()); + assertNull(result.getType()); + } + } + + /** + * Test the parseEvent() method + */ + @Test + public void testParseEvent() { + ITmfContext ctx = fFixture.seekEvent(0); + fFixture.getNext(ctx); + PcapEvent event = fFixture.parseEvent(ctx); + assertNotNull(event); + } + + /** + * Run the void broadcast(TmfSignal) method test. + */ + @Test + public void testBroadcast() { + TmfSignal signal = new TmfEndSynchSignal(1); + fFixture.broadcast(signal); + } + + /** + * Run the void dispose() method test. + */ + @Test + public void testClose() { + try (PcapTrace emptyFixture = new PcapTrace();) { + } + } + + /** + * Run the int getCacheSize() method test. + */ + @Test + public void testGetCacheSize() { + try (PcapTrace emptyFixture = new PcapTrace();) { + int result = emptyFixture.getCacheSize(); + assertEquals(1000, result); + } + } + + /** + * Run the ITmfLocation getCurrentLocation() method test. + */ + @Test + public void testGetCurrentLocation() { + TmfLongLocation result = (TmfLongLocation) fFixture.getCurrentLocation(); + assertEquals(new TmfLongLocation(0), result); + } + + /** + * Test the seekEvent() method with a null location. + */ + @Test + public void testSeekEventLoc_null() { + TmfLongLocation loc = null; + fFixture.seekEvent(loc); + assertNotNull(fFixture); + } + + /** + * Test the seekEvent() method with a normal location. + */ + @Test + public void testSeekEventLoc_normal() { + TmfLongLocation loc = new TmfLongLocation(3L); + fFixture.seekEvent(loc); + assertNotNull(fFixture); + } + + /** + * Run the ITmfTimestamp getEndTime() method test. + */ + @Test + public void testGetEndTime() { + ITmfTimestamp result = fFixture.getEndTime(); + assertNotNull(result); + } + + /** + * Test the {@link PcapTrace#getEventType()} method. + */ + @Test + public void testGetEventType() { + Class result = fFixture.getEventType(); + assertNotNull(result); + assertEquals(PcapEvent.class, result); + } + + /** + * Run the double getLocationRatio(ITmfLocation) method test. + */ + @Test + public void testGetLocationRatio() { + TmfLongLocation location = new TmfLongLocation(20L); + double result = fFixture.getLocationRatio(location); + + assertEquals(20.0 / 43.0, result, 0.01); + } + + /** + * Run the String getName() method test. + */ + @Test + public void testGetName() { + String result = fFixture.getName(); + assertNotNull(result); + } + + /** + * Run the getTraceProperties() method test. + */ + @Test + public void testGetTraceProperties() { + int result = fFixture.getTraceProperties().size(); + assertEquals(6, result); + } + + /** + * Run the long getNbEvents() method test. + */ + @Test + public void testGetNbEvents() { + long result = fFixture.getNbEvents(); + assertEquals(0, result); + } + + /** + * Run the String getPath() method test. + */ + @Test + public void testGetPath() { + String result = fFixture.getPath(); + assertNotNull(result); + } + + /** + * Run the IResource getResource() method test. + */ + @Test + public void testGetResource() { + IResource result = fFixture.getResource(); + assertNull(result); + } + + /** + * Run the ITmfTimestamp getStartTime() method test. + */ + @Test + public void testGetStartTime() { + ITmfTimestamp result = fFixture.getStartTime(); + assertNotNull(result); + } + + /** + * Run the long getStreamingInterval() method test. + */ + @Test + public void testGetStreamingInterval() { + long result = fFixture.getStreamingInterval(); + assertEquals(0L, result); + } + + /** + * Run the TmfTimeRange getTimeRange() method test. + */ + @Test + public void testGetTimeRange() { + TmfTimeRange result = fFixture.getTimeRange(); + assertNotNull(result); + } + + /** + * Run the ITmfContext seekEvent(double) method test. + */ + @Test + public void testSeekEvent_ratio() { + double ratio = 21.0 / 43.0; + ITmfContext result = fFixture.seekEvent(ratio); + assertNotNull(result); + } + + /** + * Run the ITmfContext seekEvent(long) method test. + */ + @Test + public void testSeekEvent_rank() { + long rank = 1L; + ITmfContext result = fFixture.seekEvent(rank); + assertNotNull(result); + } + + /** + * Run the ITmfContext seekEvent(ITmfLocation) method test. + */ + @Test + public void testSeekEvent_location() { + TmfLongLocation pcapLocation = new TmfLongLocation(10L); + ITmfContext result = fFixture.seekEvent(pcapLocation); + assertNotNull(result); + } + + /** + * Run the boolean validate(IProject,String) method test. + */ + @Test + public void testValidate() { + IProject project = null; + IStatus result = fFixture.validate(project, TEST_TRACE.getPath()); + assertTrue(result.isOK()); + } + + /** + * Run the String getHostId() method test + */ + @Test + public void getSource() { + String a = fFixture.getHostId(); + assertEquals("mostlyTCP.pcap", a); + } + +} diff --git a/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/stubs/org/eclipse/linuxtools/tmf/pcap/core/tests/stubs/PcapTmfTraceStub.java b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/stubs/org/eclipse/linuxtools/tmf/pcap/core/tests/stubs/PcapTmfTraceStub.java new file mode 100644 index 0000000000..574af69fb2 --- /dev/null +++ b/lttng/org.eclipse.linuxtools.tmf.pcap.core.tests/stubs/org/eclipse/linuxtools/tmf/pcap/core/tests/stubs/PcapTmfTraceStub.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2014 École Polytechnique de Montréal + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Perot - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.linuxtools.tmf.pcap.core.tests.stubs; + +import org.eclipse.linuxtools.tmf.core.signal.TmfSignalManager; +import org.eclipse.linuxtools.tmf.core.signal.TmfTraceOpenedSignal; +import org.eclipse.linuxtools.tmf.core.signal.TmfTraceSelectedSignal; +import org.eclipse.linuxtools.tmf.pcap.core.trace.PcapTrace; + +/** + * Dummy test pcap trace + */ +public class PcapTmfTraceStub extends PcapTrace { + + /** + * Simulate trace opening, to be called by tests who need an actively opened + * trace + */ + public void openTrace() { + TmfSignalManager.dispatchSignal(new TmfTraceOpenedSignal(this, this, null)); + selectTrace(); + } + + /** + * Simulate selecting the trace + */ + public void selectTrace() { + TmfSignalManager.dispatchSignal(new TmfTraceSelectedSignal(this, this)); + } + +} -- cgit v1.2.3