Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce2009-09-30 01:18:28 +0000
committerShawn O. Pearce2009-09-30 01:18:28 +0000
commitdfbdc456d8645fc0c310b5e15cf8d25d8ff7f84b (patch)
tree73461cd1d4e0481e18d25b0c75bd2a4b6d130e45 /org.eclipse.egit.core.test
downloadegit-dfbdc456d8645fc0c310b5e15cf8d25d8ff7f84b.tar.gz
egit-dfbdc456d8645fc0c310b5e15cf8d25d8ff7f84b.tar.xz
egit-dfbdc456d8645fc0c310b5e15cf8d25d8ff7f84b.zip
Initial EGit contribution to eclipse.org
Per CQ 3393 this is the initial contribution of the EGit project (an Eclipse team provider for Git) to eclipse.org. This initial version is derived from the historial EGit repository at commit a9578ba7361b66ab403c6605a1b87fb7b2f94c6e. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.egit.core.test')
-rw-r--r--org.eclipse.egit.core.test/.classpath7
-rw-r--r--org.eclipse.egit.core.test/.gitignore1
-rw-r--r--org.eclipse.egit.core.test/.project28
-rw-r--r--org.eclipse.egit.core.test/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--org.eclipse.egit.core.test/.settings/org.eclipse.core.runtime.prefs3
-rw-r--r--org.eclipse.egit.core.test/.settings/org.eclipse.jdt.core.prefs320
-rw-r--r--org.eclipse.egit.core.test/.settings/org.eclipse.jdt.ui.prefs9
-rw-r--r--org.eclipse.egit.core.test/META-INF/MANIFEST.MF20
-rw-r--r--org.eclipse.egit.core.test/build.properties4
-rw-r--r--org.eclipse.egit.core.test/org.eclipse.egit.core--All-Tests.launch41
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/T0003_AdaptableFileTreeIteratorTest.java77
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/mapping/T0002_history.java189
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/op/T0001_ConnectProviderOperationTest.java124
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/Activator.java59
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java54
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestProject.java178
16 files changed, 1117 insertions, 0 deletions
diff --git a/org.eclipse.egit.core.test/.classpath b/org.eclipse.egit.core.test/.classpath
new file mode 100644
index 000000000..304e86186
--- /dev/null
+++ b/org.eclipse.egit.core.test/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.egit.core.test/.gitignore b/org.eclipse.egit.core.test/.gitignore
new file mode 100644
index 000000000..5e56e040e
--- /dev/null
+++ b/org.eclipse.egit.core.test/.gitignore
@@ -0,0 +1 @@
+/bin
diff --git a/org.eclipse.egit.core.test/.project b/org.eclipse.egit.core.test/.project
new file mode 100644
index 000000000..36089b8b0
--- /dev/null
+++ b/org.eclipse.egit.core.test/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.egit.core.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.egit.core.test/.settings/org.eclipse.core.resources.prefs b/org.eclipse.egit.core.test/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..84e44d8d3
--- /dev/null
+++ b/org.eclipse.egit.core.test/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Mon Aug 11 16:47:12 PDT 2008
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/org.eclipse.egit.core.test/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.egit.core.test/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 000000000..29b7c796c
--- /dev/null
+++ b/org.eclipse.egit.core.test/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,3 @@
+#Mon Mar 24 18:54:45 EDT 2008
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/org.eclipse.egit.core.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.egit.core.test/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..fb77da2f8
--- /dev/null
+++ b/org.eclipse.egit.core.test/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,320 @@
+#Sun Feb 03 03:52:00 CET 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+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=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+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.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
+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=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+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.nullReference=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+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.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.unusedParameter=warning
+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.varargsArgumentNeedCast=error
+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_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_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_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.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+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_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=false
+org.eclipse.jdt.core.formatter.comment.format_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_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.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.format_guardian_clause_on_one_line=false
+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=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_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_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_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_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=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_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.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=80
+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=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
diff --git a/org.eclipse.egit.core.test/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.egit.core.test/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..709a44074
--- /dev/null
+++ b/org.eclipse.egit.core.test/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,9 @@
+#Wed May 09 00:20:24 CEST 2007
+eclipse.preferences.version=1
+formatter_profile=_JGit
+formatter_settings_version=10
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
diff --git a/org.eclipse.egit.core.test/META-INF/MANIFEST.MF b/org.eclipse.egit.core.test/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..5548c87c7
--- /dev/null
+++ b/org.eclipse.egit.core.test/META-INF/MANIFEST.MF
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Test Plug-in (Incubation)
+Bundle-SymbolicName: org.eclipse.egit.core.test
+Bundle-Version: 0.5.0.qualifier
+Bundle-Activator: org.eclipse.egit.core.test.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.team.core,
+ org.junit,
+ org.eclipse.egit.core,
+ org.eclipse.egit.ui,
+ org.eclipse.jgit,
+ org.eclipse.core.filesystem
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.core.resources,
+ org.eclipse.jdt.core,
+ org.eclipse.jdt.junit,
+ org.eclipse.jdt.launching
+Export-Package: org.eclipse.egit.core.internal.mapping
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/org.eclipse.egit.core.test/build.properties b/org.eclipse.egit.core.test/build.properties
new file mode 100644
index 000000000..34d2e4d2d
--- /dev/null
+++ b/org.eclipse.egit.core.test/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/org.eclipse.egit.core.test/org.eclipse.egit.core--All-Tests.launch b/org.eclipse.egit.core.test/org.eclipse.egit.core--All-Tests.launch
new file mode 100644
index 000000000..10b0eb760
--- /dev/null
+++ b/org.eclipse.egit.core.test/org.eclipse.egit.core--All-Tests.launch
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.egit.core.test"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.egit.core.test"/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.egit.core.test"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/T0003_AdaptableFileTreeIteratorTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/T0003_AdaptableFileTreeIteratorTest.java
new file mode 100644
index 000000000..f7a501a1e
--- /dev/null
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/T0003_AdaptableFileTreeIteratorTest.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (C) 2009, Tor Arne Vestbø <torarnv@gmail.com>
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.egit.core;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.egit.core.AdaptableFileTreeIterator;
+import org.eclipse.egit.core.ContainerTreeIterator;
+import org.eclipse.egit.core.op.ConnectProviderOperation;
+import org.eclipse.egit.core.project.RepositoryMapping;
+import org.eclipse.egit.core.test.GitTestCase;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.treewalk.TreeWalk;
+import org.eclipse.jgit.treewalk.WorkingTreeIterator;
+import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
+
+public class T0003_AdaptableFileTreeIteratorTest extends GitTestCase {
+
+ private Repository repository;
+
+ private File repositoryRoot;
+
+ private File file;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ repository = new Repository(gitDir);
+ repositoryRoot = repository.getWorkDir();
+ repository.create();
+
+ file = new File(project.getProject().getLocation().toFile(), "a.txt");
+ final FileWriter fileWriter = new FileWriter(file);
+ fileWriter.write("aaaaaaaaaaa");
+ fileWriter.close();
+
+ final ConnectProviderOperation operation = new ConnectProviderOperation(
+ project.getProject());
+ operation.run(null);
+ }
+
+ public void testFileTreeToContainerAdaptation() throws IOException {
+ final IWorkspaceRoot root = project.getProject().getWorkspace()
+ .getRoot();
+
+ final TreeWalk treeWalk = new TreeWalk(repository);
+ treeWalk.addTree(new AdaptableFileTreeIterator(repositoryRoot, root));
+ treeWalk.setRecursive(true);
+
+ final IFile eclipseFile = project.getProject().getFile(file.getName());
+ final RepositoryMapping mapping = RepositoryMapping
+ .getMapping(eclipseFile);
+ final Set<String> repositoryPaths = Collections.singleton(mapping
+ .getRepoRelativePath(eclipseFile));
+
+ assertTrue(repositoryPaths.size() == 1);
+ treeWalk.setFilter(PathFilterGroup.createFromStrings(repositoryPaths));
+
+ assertTrue(treeWalk.next());
+
+ final WorkingTreeIterator iterator = treeWalk.getTree(1,
+ WorkingTreeIterator.class);
+ assertTrue(iterator instanceof ContainerTreeIterator);
+ }
+}
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/mapping/T0002_history.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/mapping/T0002_history.java
new file mode 100644
index 000000000..d2a6c937f
--- /dev/null
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/mapping/T0002_history.java
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
+ * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.mapping;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.egit.core.GitProvider;
+import org.eclipse.egit.core.op.ConnectProviderOperation;
+import org.eclipse.egit.core.test.GitTestCase;
+import org.eclipse.team.core.RepositoryProvider;
+import org.eclipse.team.core.history.IFileHistory;
+import org.eclipse.team.core.history.IFileHistoryProvider;
+import org.eclipse.team.core.history.IFileRevision;
+import org.eclipse.jgit.lib.Commit;
+import org.eclipse.jgit.lib.FileTreeEntry;
+import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.ObjectWriter;
+import org.eclipse.jgit.lib.PersonIdent;
+import org.eclipse.jgit.lib.RefUpdate;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.lib.Tree;
+
+public class T0002_history extends GitTestCase {
+
+ protected static final PersonIdent jauthor;
+
+ protected static final PersonIdent jcommitter;
+
+ static {
+ jauthor = new PersonIdent("J. Author", "jauthor@example.com");
+ jcommitter = new PersonIdent("J. Committer", "jcommitter@example.com");
+ }
+
+ private File workDir;
+ private File gitDir;
+ private Repository thisGit;
+ private Tree tree;
+ private ObjectWriter objectWriter;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ project.createSourceFolder();
+ gitDir = new File(project.getProject().getWorkspace().getRoot()
+ .getRawLocation().toFile(), ".git");
+ thisGit = new Repository(gitDir);
+ workDir = thisGit.getWorkDir();
+ thisGit.create();
+ objectWriter = new ObjectWriter(thisGit);
+
+ tree = new Tree(thisGit);
+ Tree projectTree = tree.addTree("Project-1");
+ File project1_a_txt = createFile("Project-1/A.txt","A.txt - first version\n");
+ addFile(projectTree,project1_a_txt);
+ projectTree.setId(objectWriter.writeTree(projectTree));
+ File project1_b_txt = createFile("Project-1/B.txt","B.txt - first version\n");
+ addFile(projectTree,project1_b_txt);
+ projectTree.setId(objectWriter.writeTree(projectTree));
+ tree.setId(objectWriter.writeTree(tree));
+ Commit commit = new Commit(thisGit);
+ commit.setAuthor(new PersonIdent(jauthor, new Date(0L), TimeZone
+ .getTimeZone("GMT+1")));
+ commit.setCommitter(new PersonIdent(jcommitter, new Date(0L), TimeZone
+ .getTimeZone("GMT+1")));
+ commit.setMessage("Foo\n\nMessage");
+ commit.setTree(tree);
+ ObjectId commitId = objectWriter.writeCommit(commit);
+
+ tree = new Tree(thisGit);
+ projectTree = tree.addTree("Project-1");
+ addFile(projectTree,project1_a_txt);
+
+ File project1_b_v2_txt = createFile("Project-1/B.txt","B.txt - second version\n");
+ addFile(projectTree,project1_b_v2_txt);
+ projectTree.setId(objectWriter.writeTree(projectTree));
+ tree.setId(objectWriter.writeTree(tree));
+ commit = new Commit(thisGit);
+ commit.setAuthor(new PersonIdent(jauthor, new Date(0L), TimeZone
+ .getTimeZone("GMT+1")));
+ commit.setCommitter(new PersonIdent(jcommitter, new Date(0L), TimeZone
+ .getTimeZone("GMT+1")));
+ commit.setMessage("Modified");
+ commit.setParentIds(new ObjectId[] { commitId });
+ commit.setTree(tree);
+ commitId = objectWriter.writeCommit(commit);
+
+ RefUpdate lck = thisGit.updateRef("refs/heads/master");
+ assertNotNull("obtained lock", lck);
+ lck.setNewObjectId(commitId);
+ assertEquals(RefUpdate.Result.NEW, lck.forceUpdate());
+
+ ConnectProviderOperation operation = new ConnectProviderOperation(
+ project.getProject());
+ operation.run(null);
+ }
+
+ private void addFile(Tree t,File f) throws IOException {
+ ObjectId id = objectWriter.writeBlob(f);
+ t.addEntry(new FileTreeEntry(t,id,f.getName().getBytes("UTF-8"),false));
+ }
+
+ private File createFile(String name, String content) throws IOException {
+ File f = new File(workDir, name);
+ FileWriter fileWriter = new FileWriter(f);
+ fileWriter.write(content);
+ fileWriter.close();
+ return f;
+ }
+
+ public void testSingleRevision_1() {
+ GitProvider provider = (GitProvider)RepositoryProvider.getProvider(project.project);
+ assertNotNull(provider);
+ IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
+ IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/A.txt"), IFileHistoryProvider.SINGLE_LINE_OF_DESCENT, new NullProgressMonitor());
+ IFileRevision fileRevision = fileHistory.getFileRevision("60f0d7917fe2aed5c92b5bc35dfb55b9b8ada359");
+ assertEquals("60f0d7917fe2aed5c92b5bc35dfb55b9b8ada359", fileRevision.getContentIdentifier());
+ assertEquals("J. Author",fileRevision.getAuthor());
+
+ }
+
+ public void testSingleRevision_2() {
+ GitProvider provider = (GitProvider)RepositoryProvider.getProvider(project.project);
+ assertNotNull(provider);
+ IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
+ IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/A.txt"), IFileHistoryProvider.SINGLE_LINE_OF_DESCENT, new NullProgressMonitor());
+ IFileRevision fileRevision = fileHistory.getFileRevision("fd5a571c8a3a4a152e4c413d09d3ecb7d41e1e5f");
+ assertNull(fileRevision); // not matched by getFileHistoryFor
+ }
+
+ public void testSingleRevision_3() {
+ GitProvider provider = (GitProvider)RepositoryProvider.getProvider(project.project);
+ assertNotNull(provider);
+ IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
+ IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/B.txt"), IFileHistoryProvider.SINGLE_LINE_OF_DESCENT, new NullProgressMonitor());
+ IFileRevision fileRevision = fileHistory.getFileRevision("fd5a571c8a3a4a152e4c413d09d3ecb7d41e1e5f");
+ assertEquals("fd5a571c8a3a4a152e4c413d09d3ecb7d41e1e5f", fileRevision.getContentIdentifier());
+ assertEquals("J. Author",fileRevision.getAuthor());
+
+ }
+
+ public void testShallowHistory() {
+ GitProvider provider = (GitProvider)RepositoryProvider.getProvider(project.project);
+ assertNotNull(provider);
+ IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
+ IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/A.txt"), IFileHistoryProvider.SINGLE_LINE_OF_DESCENT, new NullProgressMonitor());
+ IFileRevision[] fileRevisions = fileHistory.getFileRevisions();
+ assertEquals(1, fileRevisions.length);
+ assertEquals("60f0d7917fe2aed5c92b5bc35dfb55b9b8ada359", fileRevisions[0].getContentIdentifier());
+ assertEquals("J. Author",fileRevisions[0].getAuthor());
+
+ }
+
+ public void testDeepHistory_A() {
+ GitProvider provider = (GitProvider)RepositoryProvider.getProvider(project.project);
+ assertNotNull(provider);
+ IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
+ IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/A.txt"), IFileHistoryProvider.NONE, new NullProgressMonitor());
+ IFileRevision[] fileRevisions = fileHistory.getFileRevisions();
+ assertEquals(1, fileRevisions.length);
+ assertEquals("60f0d7917fe2aed5c92b5bc35dfb55b9b8ada359", fileRevisions[0].getContentIdentifier());
+ assertEquals("J. Author",fileRevisions[0].getAuthor());
+
+ }
+
+ public void testDeepHistory_B() {
+ GitProvider provider = (GitProvider)RepositoryProvider.getProvider(project.project);
+ assertNotNull(provider);
+ IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
+ IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/B.txt"), IFileHistoryProvider.NONE, new NullProgressMonitor());
+ IFileRevision[] fileRevisions = fileHistory.getFileRevisions();
+ assertEquals(2, fileRevisions.length);
+ assertEquals("fd5a571c8a3a4a152e4c413d09d3ecb7d41e1e5f", fileRevisions[0].getContentIdentifier());
+ assertEquals("J. Author",fileRevisions[0].getAuthor());
+ assertEquals("60f0d7917fe2aed5c92b5bc35dfb55b9b8ada359", fileRevisions[1].getContentIdentifier());
+ assertEquals("J. Author",fileRevisions[0].getAuthor());
+
+ }
+}
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/op/T0001_ConnectProviderOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/op/T0001_ConnectProviderOperationTest.java
new file mode 100644
index 000000000..dc3969f43
--- /dev/null
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/op/T0001_ConnectProviderOperationTest.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>
+ * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.egit.core.op;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.egit.core.op.ConnectProviderOperation;
+import org.eclipse.egit.core.test.GitTestCase;
+import org.eclipse.team.core.RepositoryProvider;
+import org.eclipse.jgit.lib.Commit;
+import org.eclipse.jgit.lib.FileTreeEntry;
+import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.ObjectWriter;
+import org.eclipse.jgit.lib.PersonIdent;
+import org.eclipse.jgit.lib.RefUpdate;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.lib.Tree;
+
+public class T0001_ConnectProviderOperationTest extends GitTestCase {
+
+ public void testNoRepository() throws CoreException {
+
+ ConnectProviderOperation operation = new ConnectProviderOperation(
+ project.getProject());
+ operation.run(null);
+
+ // We are shared because we declared as shared
+ assertTrue(RepositoryProvider.isShared(project.getProject()));
+ assertTrue(!gitDir.exists());
+ }
+
+ public void testNewRepository() throws CoreException, IOException {
+
+ File gitDir = new File(project.getProject().getWorkspace().getRoot()
+ .getRawLocation().toFile(), ".git");
+ Repository repository = new Repository(gitDir);
+ repository.create();
+ repository.close();
+ ConnectProviderOperation operation = new ConnectProviderOperation(
+ project.getProject());
+ operation.run(null);
+
+ assertTrue(RepositoryProvider.isShared(project.getProject()));
+
+ assertTrue(gitDir.exists());
+ }
+
+ public void testNewUnsharedFile() throws CoreException, IOException,
+ InterruptedException {
+
+ project.createSourceFolder();
+ IFile fileA = project.getProject().getFolder("src").getFile("A.java");
+ String srcA = "class A {\n" + "}\n";
+ fileA.create(new ByteArrayInputStream(srcA.getBytes()), false, null);
+
+ File gitDir = new File(project.getProject().getWorkspace().getRoot()
+ .getRawLocation().toFile(), ".git");
+ Repository thisGit = new Repository(gitDir);
+ thisGit.create();
+ Tree rootTree = new Tree(thisGit);
+ Tree prjTree = rootTree.addTree(project.getProject().getName());
+ Tree srcTree = prjTree.addTree("src");
+ FileTreeEntry entryA = srcTree.addFile("A.java");
+ ObjectWriter writer = new ObjectWriter(thisGit);
+ entryA.setId(writer.writeBlob(fileA.getRawLocation().toFile()));
+ srcTree.setId(writer.writeTree(srcTree));
+ prjTree.setId(writer.writeTree(prjTree));
+ rootTree.setId(writer.writeTree(rootTree));
+ Commit commit = new Commit(thisGit);
+ commit.setTree(rootTree);
+ commit.setAuthor(new PersonIdent("J. Git", "j.git@egit.org", new Date(
+ 60876075600000L), TimeZone.getTimeZone("GMT+1")));
+ commit.setCommitter(commit.getAuthor());
+ commit.setMessage("testNewUnsharedFile\n\nJunit tests\n");
+ ObjectId id = writer.writeCommit(commit);
+ RefUpdate lck = thisGit.updateRef("refs/heads/master");
+ assertNotNull("obtained lock", lck);
+ lck.setNewObjectId(id);
+ assertEquals(RefUpdate.Result.NEW, lck.forceUpdate());
+
+ ConnectProviderOperation operation = new ConnectProviderOperation(
+ project.getProject());
+ operation.run(null);
+
+ final boolean f[] = new boolean[1];
+ new Job("wait") {
+ protected IStatus run(IProgressMonitor monitor) {
+
+ System.out.println("MyJob");
+ f[0] = true;
+ return null;
+ }
+
+ {
+ setRule(project.getProject());
+ schedule();
+ }
+ };
+ while (!f[0]) {
+ System.out.println("Waiting");
+ Thread.sleep(1000);
+ }
+ System.out.println("DONE");
+
+ assertNotNull(RepositoryProvider.getProvider(project.getProject()));
+
+ }
+}
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/Activator.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/Activator.java
new file mode 100644
index 000000000..e49d527bd
--- /dev/null
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/Activator.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.egit.core.test;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.egit.core.test";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ // Empty
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java
new file mode 100644
index 000000000..cbe89c3c4
--- /dev/null
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.egit.core.test;
+
+import java.io.File;
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
+public abstract class GitTestCase extends TestCase {
+
+ protected TestProject project;
+
+ protected File gitDir;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ project = new TestProject();
+ gitDir = new File(project.getProject().getWorkspace().getRoot()
+ .getRawLocation().toFile(), ".git");
+ rmrf(gitDir);
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ project.dispose();
+ rmrf(gitDir);
+ }
+
+ private void rmrf(File d) throws IOException {
+ if (!d.exists())
+ return;
+
+ File[] files = d.listFiles();
+ if (files != null) {
+ for (int i = 0; i < files.length; ++i) {
+ if (files[i].isDirectory())
+ rmrf(files[i]);
+ else if (!files[i].delete())
+ throw new IOException(files[i] + " in use or undeletable");
+ }
+ }
+ if (!d.delete())
+ throw new IOException(d + " in use or undeletable");
+ assert !d.exists();
+ }
+
+}
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestProject.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestProject.java
new file mode 100644
index 000000000..b9ea08708
--- /dev/null
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestProject.java
@@ -0,0 +1,178 @@
+/*******************************************************************************
+ * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>
+ * Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.egit.core.test;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IPluginDescriptor;
+import org.eclipse.core.runtime.IPluginRegistry;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.launching.JavaRuntime;
+
+public class TestProject {
+ public IProject project;
+
+ public IJavaProject javaProject;
+
+ private IPackageFragmentRoot sourceFolder;
+
+ public TestProject() throws CoreException {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ project = root.getProject("Project-1");
+ project.create(null);
+ project.open(null);
+ javaProject = JavaCore.create(project);
+ IFolder binFolder = createBinFolder();
+ setJavaNature();
+ javaProject.setRawClasspath(new IClasspathEntry[0], null);
+ createOutputFolder(binFolder);
+ addSystemLibraries();
+ }
+
+ public IProject getProject() {
+ return project;
+ }
+
+ public IJavaProject getJavaProject() {
+ return javaProject;
+ }
+
+ public void addJar(String plugin, String jar) throws MalformedURLException,
+ IOException, JavaModelException {
+ Path result = findFileInPlugin(plugin, jar);
+ IClasspathEntry[] oldEntries = javaProject.getRawClasspath();
+ IClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length + 1];
+ System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
+ newEntries[oldEntries.length] = JavaCore.newLibraryEntry(result, null,
+ null);
+ javaProject.setRawClasspath(newEntries, null);
+ }
+
+ public IPackageFragment createPackage(String name) throws CoreException {
+ if (sourceFolder == null)
+ sourceFolder = createSourceFolder();
+ return sourceFolder.createPackageFragment(name, false, null);
+ }
+
+ public IType createType(IPackageFragment pack, String cuName, String source)
+ throws JavaModelException {
+ StringBuffer buf = new StringBuffer();
+ buf.append("package " + pack.getElementName() + ";\n");
+ buf.append("\n");
+ buf.append(source);
+ ICompilationUnit cu = pack.createCompilationUnit(cuName,
+ buf.toString(), false, null);
+ return cu.getTypes()[0];
+ }
+
+ public void dispose() throws CoreException {
+ waitForIndexer();
+ project.delete(true, true, null);
+ }
+
+ private IFolder createBinFolder() throws CoreException {
+ IFolder binFolder = project.getFolder("bin");
+ binFolder.create(false, true, null);
+ return binFolder;
+ }
+
+ private void setJavaNature() throws CoreException {
+ IProjectDescription description = project.getDescription();
+ description.setNatureIds(new String[] { JavaCore.NATURE_ID });
+ project.setDescription(description, null);
+ }
+
+ private void createOutputFolder(IFolder binFolder)
+ throws JavaModelException {
+ IPath outputLocation = binFolder.getFullPath();
+ javaProject.setOutputLocation(outputLocation, null);
+ }
+
+ public IPackageFragmentRoot createSourceFolder() throws CoreException {
+ IFolder folder = project.getFolder("src");
+ folder.create(false, true, null);
+ IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(folder);
+ IClasspathEntry[] oldEntries = javaProject.getRawClasspath();
+ IClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length + 1];
+ System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
+ newEntries[oldEntries.length] = JavaCore.newSourceEntry(root.getPath());
+ javaProject.setRawClasspath(newEntries, null);
+ return root;
+ }
+
+ private void addSystemLibraries() throws JavaModelException {
+ IClasspathEntry[] oldEntries = javaProject.getRawClasspath();
+ IClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length + 1];
+ System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
+ newEntries[oldEntries.length] = JavaRuntime
+ .getDefaultJREContainerEntry();
+ javaProject.setRawClasspath(newEntries, null);
+ }
+
+ private Path findFileInPlugin(String plugin, String file)
+ throws MalformedURLException, IOException {
+ IPluginRegistry registry = Platform.getPluginRegistry();
+ IPluginDescriptor descriptor = registry.getPluginDescriptor(plugin);
+ URL pluginURL = descriptor.getInstallURL();
+ URL jarURL = new URL(pluginURL, file);
+ URL localJarURL = Platform.asLocalURL(jarURL);
+ return new Path(localJarURL.getPath());
+ }
+
+ public void waitForIndexer() {
+ // new SearchEngine().searchAllTypeNames(ResourcesPlugin.getWorkspace(),
+ // null, null, IJavaSearchConstants.EXACT_MATCH,
+ // IJavaSearchConstants.CASE_SENSITIVE,
+ // IJavaSearchConstants.CLASS, SearchEngine
+ // .createJavaSearchScope(new IJavaElement[0]),
+ // new ITypeNameRequestor() {
+ // public void acceptClass(char[] packageName,
+ // char[] simpleTypeName, char[][] enclosingTypeNames,
+ // String path) {
+ // }
+ // public void acceptInterface(char[] packageName,
+ // char[] simpleTypeName, char[][] enclosingTypeNames,
+ // String path) {
+ // }
+ // }, IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
+ }
+
+ /**
+ * @return Returns the sourceFolder.
+ */
+ public IPackageFragmentRoot getSourceFolder() {
+ return sourceFolder;
+ }
+
+ /**
+ * @param sourceFolder The sourceFolder to set.
+ */
+ public void setSourceFolder(IPackageFragmentRoot sourceFolder) {
+ this.sourceFolder = sourceFolder;
+ }
+}

Back to the top