BuildMaster 1.0.9 → 1.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. data/lib/buildmaster/algorithms.rb +3 -0
  2. data/lib/buildmaster/algorithms/opn_compare.rb +108 -0
  3. data/lib/buildmaster/cotta/cotta_dir.rb +7 -4
  4. data/lib/buildmaster/cotta/cotta_file.rb +5 -2
  5. data/lib/buildmaster/cotta/in_memory_system.rb +28 -4
  6. data/lib/buildmaster/project/java.rb +4 -0
  7. data/lib/buildmaster/project/java/class_path.rb +0 -0
  8. data/lib/buildmaster/project/java/javac.rb +9 -0
  9. data/lib/buildmaster/project/mysql_served_driver.rb +15 -0
  10. data/lib/buildmaster/project/pscp_driver.rb +0 -1
  11. data/lib/buildmaster/project/svn_driver.rb +4 -4
  12. data/lib/buildmaster/project/svn_server_driver.rb +18 -0
  13. data/lib/buildmaster/project/svn_status_info.rb +45 -42
  14. data/lib/buildmaster/site/content_engine_repository.rb +9 -0
  15. data/lib/buildmaster/site/file_processor.rb +5 -1
  16. data/lib/buildmaster/site/site.rb +11 -4
  17. data/lib/buildmaster/site/site_server.rb +1 -1
  18. data/lib/buildmaster/site/templatelets/href.rb +1 -1
  19. data/lib/buildmaster/version +1 -1
  20. data/test/buildmaster/algorithms/tc_opn_compare.rb +44 -0
  21. data/test/buildmaster/common/tc_properties.rb +8 -8
  22. data/test/buildmaster/common/tc_tree_to_object.rb +8 -8
  23. data/test/buildmaster/cotta/cotta_dir_behaviors.rb +167 -0
  24. data/test/buildmaster/cotta/cotta_file_behaviors.rb +127 -0
  25. data/test/buildmaster/cotta/cotta_specifications.rb +20 -0
  26. data/test/buildmaster/cotta/file_system_behaviors.rb +167 -0
  27. data/test/buildmaster/cotta/tc_command_interface.rb +6 -6
  28. data/test/buildmaster/cotta/tc_command_runner.rb +5 -5
  29. data/test/buildmaster/cotta/tc_cotta.rb +12 -12
  30. data/test/buildmaster/cotta/tc_cotta_dir_in_memory.rb +17 -17
  31. data/test/buildmaster/cotta/tc_cotta_dir_physical.rb +5 -5
  32. data/test/buildmaster/cotta/tc_cotta_file_in_memory.rb +8 -9
  33. data/test/buildmaster/cotta/tc_cotta_file_physical.rb +11 -8
  34. data/test/buildmaster/cotta/tc_cotta_zip_support.rb +9 -9
  35. data/test/buildmaster/cotta/tc_in_memory_system.rb +7 -7
  36. data/test/buildmaster/cotta/tc_io_chain.rb +3 -3
  37. data/test/buildmaster/cotta/tc_pathname.rb +6 -6
  38. data/test/buildmaster/cotta/tc_physical_system.rb +7 -8
  39. data/test/buildmaster/project/tc_ant_driver.rb +8 -8
  40. data/test/buildmaster/project/tc_build_number_file.rb +5 -5
  41. data/test/buildmaster/project/tc_cvs_driver.rb +9 -9
  42. data/test/buildmaster/project/tc_java_manifest.rb +9 -11
  43. data/test/buildmaster/project/tc_release.rb +12 -12
  44. data/test/buildmaster/project/tc_server_manager.rb +8 -8
  45. data/test/buildmaster/project/tc_svn_driver.rb +18 -13
  46. data/test/buildmaster/project/tc_svn_status_info.rb +8 -8
  47. data/test/buildmaster/project/tc_version_number_file.rb +6 -6
  48. data/test/buildmaster/project/windows/tc_iis_driver.rb +4 -4
  49. data/test/buildmaster/project/windows/tc_sql_server_driver.rb +2 -2
  50. data/test/buildmaster/site/content/tc_content_engine_repository.rb +5 -5
  51. data/test/buildmaster/site/tc_element_processor_by_name.rb +4 -4
  52. data/test/buildmaster/site/tc_file_processor.rb +8 -9
  53. data/test/buildmaster/site/tc_site.rb +23 -7
  54. data/test/buildmaster/site/tc_site_server.rb +2 -2
  55. data/test/buildmaster/site/tc_site_spec.rb +5 -5
  56. data/test/buildmaster/site/tc_source_file_handler.rb +2 -2
  57. data/test/buildmaster/site/tc_template_builder.rb +22 -11
  58. data/test/buildmaster/site/tc_template_error.rb +2 -2
  59. data/test/buildmaster/site/tc_template_runner.rb +4 -4
  60. data/test/buildmaster/site/tc_templatelets.rb +4 -4
  61. data/test/buildmaster/site/tc_xtemplate.rb +5 -5
  62. data/test/buildmaster/site/templatelets/tc_attribute.rb +6 -6
  63. data/test/buildmaster/site/templatelets/tc_code.rb +10 -10
  64. data/test/buildmaster/site/templatelets/tc_each.rb +3 -3
  65. data/test/buildmaster/site/templatelets/tc_href.rb +7 -7
  66. data/test/buildmaster/site/templatelets/tc_include.rb +3 -3
  67. data/test/buildmaster/site/templatelets/tc_link.rb +6 -6
  68. data/test/buildmaster/site/templatelets/tc_text.rb +4 -4
  69. data/test/buildmaster/site/templatelets/tc_when.rb +4 -4
  70. data/test/tmp/svn_test/repository/db/revprops/0 +1 -1
  71. data/test/tmp/svn_test/repository/db/revprops/1 +1 -1
  72. data/test/tmp/svn_test/repository/db/revprops/2 +1 -1
  73. data/test/tmp/svn_test/repository/db/revprops/3 +1 -1
  74. data/test/tmp/svn_test/repository/db/revprops/4 +1 -1
  75. data/test/tmp/svn_test/repository/db/uuid +1 -1
  76. metadata +60 -46
@@ -3,8 +3,8 @@ $:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib', 'buildmast
3
3
  require 'site/template_error'
4
4
  require 'spec'
5
5
 
6
- context 'template error' do
7
- specify 'format of exception' do
6
+ describe 'template error' do
7
+ it 'format of exception' do
8
8
  begin
9
9
  raise BuildMaster::TemplateError.new('test'), 'message'
10
10
  fail('error should have been raised')
@@ -20,12 +20,12 @@ class NameTemplatelet
20
20
  end
21
21
  end
22
22
 
23
- context 'TemplateRunnerTest' do
24
- setup do
23
+ describe 'TemplateRunnerTest' do
24
+ before do
25
25
  @templatelets = Hash.new
26
26
  end
27
27
 
28
- specify 'process_element_in_document' do
28
+ it 'process_element_in_document' do
29
29
  target_content = <<END
30
30
  <html>
31
31
  <h1/>
@@ -57,7 +57,7 @@ END
57
57
  REXML::XPath.first(REXML::Document.new(target_xml.to_s), '/html/h1/text()').value.strip.should == 'Name One'
58
58
  end
59
59
 
60
- specify 'should_use_templatelet_based_on_name' do
60
+ it 'should_use_templatelet_based_on_name' do
61
61
  output = REXML::Document.new
62
62
  template_content = <<END
63
63
  <html xmlns="http://www.w3.org/1999/xhtml"
@@ -9,10 +9,10 @@ require 'spec'
9
9
 
10
10
  module BuildMaster
11
11
 
12
- context 'element class alternation' do
12
+ describe 'element class alternation' do
13
13
  include HelperMethods
14
14
 
15
- specify 'get attribute value' do
15
+ it 'get attribute value' do
16
16
  content = <<CONTENT
17
17
  <root>
18
18
  <element name="value"/>
@@ -22,14 +22,14 @@ CONTENT
22
22
  element.attribute_value('name').should == 'value'
23
23
  end
24
24
 
25
- specify 'raise template error if value is not there' do
25
+ it 'raise template error if value is not there' do
26
26
  content = <<CONTENT
27
27
  <root>
28
28
  <element/>
29
29
  </root>
30
30
  CONTENT
31
31
  element = create_template_element(content, 'root/element')
32
- Proc.new{element.attribute_value!('name')}.should_raise TemplateError
32
+ Proc.new{element.attribute_value!('name')}.should raise_error(TemplateError)
33
33
  end
34
34
  end
35
35
 
@@ -8,12 +8,12 @@ require 'cotta/in_memory_system'
8
8
 
9
9
  module BuildMaster
10
10
 
11
- context 'XTemplate' do
12
- setup do
11
+ describe 'XTemplate' do
12
+ before do
13
13
  @cotta = Cotta.new(InMemorySystem.new)
14
14
  end
15
15
 
16
- specify 'should_initialize_with_io' do
16
+ it 'should_initialize_with_io' do
17
17
  template_file = @cotta.file('template.xhtml')
18
18
  template_file.save <<CONTENT
19
19
  <html xmlns="http://www.w3.org/1999/xhtml"
@@ -30,7 +30,7 @@ CONTENT
30
30
  template = BuildMaster::XTemplate.new(REXML::Document.new(template_file.load), Hash.new)
31
31
  end
32
32
 
33
- specify 'should_initialize_with_content' do
33
+ it 'should_initialize_with_content' do
34
34
  template_content = <<CONTENT
35
35
  <html xmlns="http://www.w3.org/1999/xhtml"
36
36
  xmlns:template="http://buildmaster.rubyforge.org/xtemplate/1.0">
@@ -45,7 +45,7 @@ CONTENT
45
45
  REXML::XPath.first(xml_output, '/html/body').text.should == 'Body'
46
46
  end
47
47
 
48
- specify 'should_hook_up_templatelets' do
48
+ it 'should_hook_up_templatelets' do
49
49
  template_content = <<INCLUDE_CONTENT
50
50
  <html xmlns="http://www.w3.org/1999/xhtml"
51
51
  xmlns:template="http://buildmaster.rubyforge.org/xtemplate/1.0">
@@ -15,14 +15,14 @@ class AttributeForTest
15
15
  end
16
16
  end
17
17
 
18
- context 'AttributeTest' do
18
+ describe Attribute do
19
19
  include HelperMethods
20
20
 
21
- setup do
21
+ before do
22
22
  setup_spec
23
23
  end
24
24
 
25
- specify 'should_set_attribute_based_on_evaluation' do
25
+ it 'should_set_attribute_based_on_evaluation' do
26
26
  templatelet = Attribute.new(AttributeForTest.new(self))
27
27
  target = create_element('a')
28
28
  template_element = create_attribute_element('attr-name', 'expression')
@@ -33,15 +33,15 @@ context 'AttributeTest' do
33
33
  @path_logged.path.should == expected_pathname
34
34
  end
35
35
 
36
- specify 'should_check_for_expression_responder' do
36
+ it 'should_check_for_expression_responder' do
37
37
  target = create_element('a')
38
38
  template_element = create_attribute_element('name', 'eval')
39
39
  source_path = SourceContent.new(Pathname.new('./'), create_element('name'), nil)
40
40
  attribute = Attribute.new(self)
41
- Proc.new {attribute.process(target, template_element, source_path)}.should_raise TemplateError
41
+ Proc.new {attribute.process(target, template_element, source_path)}.should raise_error(TemplateError)
42
42
  end
43
43
 
44
- specify 'shoul check properties as a backup' do
44
+ it 'shoul check properties as a backup' do
45
45
  target = create_element('a')
46
46
  template_element = create_attribute_element('name', 'property')
47
47
  source_path = SourceContent.new(Pathname.new('./'), create_element('name'), nil)
@@ -3,14 +3,14 @@ $:.unshift File.dirname(__FILE__)
3
3
  require 'common_templatelet_test'
4
4
 
5
5
  module BuildMaster
6
- context 'code template processsing' do
6
+ describe 'code template processsing' do
7
7
  include HelperMethods
8
8
 
9
- setup do
9
+ before do
10
10
  @cotta = Cotta.new(InMemorySystem.new)
11
11
  end
12
12
 
13
- specify 'generate <pre> tag with code class by default' do
13
+ it 'generate <pre> tag with code class by default' do
14
14
  template_content = <<CONTENT
15
15
  <html>
16
16
  <code source="samples/sample.rb" tag="sample"/>
@@ -43,7 +43,7 @@ root = cotta.file(__FILE__).parent
43
43
  CONTENT
44
44
  end
45
45
 
46
- specify 'handle the case of only blank lines' do
46
+ it 'handle the case of only blank lines' do
47
47
  template_content = <<CONTENT
48
48
  <html>
49
49
  <code source="samples/sample.rb" tag="sample"/>
@@ -69,7 +69,7 @@ CONTENT
69
69
  end
70
70
 
71
71
 
72
- specify 'generate error if none found' do
72
+ it 'generate error if none found' do
73
73
  template_content = <<CONTENT
74
74
  <html>
75
75
  <code source="samples/sample.rb" tag="sample"/>
@@ -82,10 +82,10 @@ CONTENT
82
82
  site_spec = SiteSpec.new('/root', @cotta);
83
83
  code_processor = Code.new(site_spec)
84
84
  source = SourceContent.new('doc/doc.html', nil, @cotta.file(content_path))
85
- Proc.new {code_processor.process(target, template, source)}.should_raise TemplateError
85
+ Proc.new {code_processor.process(target, template, source)}.should raise_error(TemplateError)
86
86
  end
87
87
 
88
- specify 'use PCDATA if no source specified' do
88
+ it 'use PCDATA if no source specified' do
89
89
  template_content = <<CONTENT
90
90
  <html>
91
91
  <code tag="sample">
@@ -114,7 +114,7 @@ end
114
114
  CONTENT
115
115
  end
116
116
 
117
- specify 'raise error if no source and no pcdata' do
117
+ it 'raise error if no source and no pcdata' do
118
118
  template_content = <<CONTENT
119
119
  <html>
120
120
  <code tag="sample">
@@ -127,10 +127,10 @@ CONTENT
127
127
  site_spec = SiteSpec.new('/root', @cotta);
128
128
  code_processor = Code.new(site_spec)
129
129
  source = SourceContent.new('doc/doc.html', nil, @cotta.file(content_path))
130
- Proc.new{code_processor.process(target, template, source)}.should_raise TemplateError
130
+ Proc.new{code_processor.process(target, template, source)}.should raise_error(TemplateError)
131
131
  end
132
132
 
133
- specify 'generate syntax support' do
133
+ it 'generate syntax support' do
134
134
  template_content = <<CONTENT
135
135
  <html>
136
136
  <code source="samples/sample.rb" tag="sample" syntax="ruby"/>
@@ -23,9 +23,9 @@ CONTENT
23
23
  end
24
24
  end
25
25
 
26
- context 'EachTest' do
26
+ describe 'EachTest' do
27
27
  include HelperMethods
28
- specify 'should_iteration_through_selected_elements' do
28
+ it 'should_iteration_through_selected_elements' do
29
29
  template_content = <<CONTENT
30
30
  <each source="rss" select="/rss/item" count="2">
31
31
  <div class="NewsItem">
@@ -43,7 +43,7 @@ CONTENT
43
43
  REXML::XPath.match(target, 'div').size.should == 2
44
44
  end
45
45
 
46
- specify 'handles the case where there are not enough items' do
46
+ it 'handles the case where there are not enough items' do
47
47
  template_content = <<CONTENT
48
48
  <each source="rss" select="/rss/item" count="4">
49
49
  <div class="NewsItem">
@@ -3,9 +3,9 @@ $:.unshift File.dirname(__FILE__)
3
3
  require 'common_templatelet_test'
4
4
 
5
5
  module BuildMaster
6
- context 'HrefTest' do
6
+ describe 'HrefTest' do
7
7
  include HelperMethods
8
- setup do
8
+ before do
9
9
  setup_spec
10
10
  @template_element = create_element('href')
11
11
  @target_element = create_element('a')
@@ -16,34 +16,34 @@ context 'HrefTest' do
16
16
  SourceContent.new(Pathname.new(path), nil, nil)
17
17
  end
18
18
 
19
- specify 'should_populate_href_attribute_with_full_url' do
19
+ it 'should_populate_href_attribute_with_full_url' do
20
20
  expected_url = 'http://www.rubyforge.org'
21
21
  @template_element.attributes['url']=expected_url
22
22
  @href.process(@target_element, @template_element, source('index.html'))
23
23
  @target_element.attributes['href'].should == expected_url
24
24
  end
25
25
 
26
- specify 'should_populate_href_attribute_with_relative_path' do
26
+ it 'should_populate_href_attribute_with_relative_path' do
27
27
  @template_element.attributes['url']='doc/doc.html'
28
28
  @href.process(@target_element, @template_element, source('download/index.html'))
29
29
  @target_element.attributes['href'].should == '../doc/doc.html'
30
30
  end
31
31
 
32
- specify 'should_support_image_tag_by_generating_src_attribute' do
32
+ it 'should_support_image_tag_by_generating_src_attribute' do
33
33
  @template_element.attributes['url']='doc/doc.gif'
34
34
  @target_element = create_element('img')
35
35
  @href.process(@target_element, @template_element, source('download/download.html'))
36
36
  @target_element.attributes['src'].should == '../doc/doc.gif'
37
37
  end
38
38
 
39
- specify 'should_handle_external_links' do
39
+ it 'should_handle_external_links' do
40
40
  @template_element.attributes['url'] = 'http://www.google.com'
41
41
  @target_element = create_element('img')
42
42
  @href.process(@target_element, @template_element, source('download/download.html'))
43
43
  @target_element.attributes['src'].should == 'http://www.google.com'
44
44
  end
45
45
 
46
- specify 'should_handle_absolute_path' do
46
+ it 'should_handle_absolute_path' do
47
47
  @template_element.attributes['url'] = '/doc.html'
48
48
  @target_element = create_element('img')
49
49
  @href.process(@target_element, @template_element, source('download/download.html'))
@@ -3,14 +3,14 @@ $:.unshift File.dirname(__FILE__)
3
3
  require 'common_templatelet_test'
4
4
  module BuildMaster
5
5
 
6
- context 'IncludeTest' do
6
+ describe 'IncludeTest' do
7
7
  include HelperMethods
8
8
 
9
- setup do
9
+ before do
10
10
  setup_spec
11
11
  end
12
12
 
13
- specify 'should_include_the_source' do
13
+ it 'should_include_the_source' do
14
14
  target = create_element('target')
15
15
  template = create_element('include')
16
16
  template.attributes['elements'] = '/item/*'
@@ -3,14 +3,14 @@ $:.unshift File.dirname(__FILE__)
3
3
  require 'common_templatelet_test'
4
4
 
5
5
  module BuildMaster
6
- context 'LinkTest' do
6
+ describe 'LinkTest' do
7
7
  include HelperMethods
8
8
 
9
- setup do
9
+ before do
10
10
  setup_spec
11
11
  end
12
12
 
13
- specify 'should_generate_link_with_relative_path' do
13
+ it 'should_generate_link_with_relative_path' do
14
14
  target = create_element('div')
15
15
  template_content = <<CONTENT
16
16
  <?xml ?>
@@ -28,7 +28,7 @@ CONTENT
28
28
  actual.text.should == 'text'
29
29
  end
30
30
 
31
- specify 'should_copy_all_attributes' do
31
+ it 'should_copy_all_attributes' do
32
32
  target = create_element('div')
33
33
  template = create_element('link')
34
34
  template.attributes['href'] = 'content/path.html'
@@ -42,7 +42,7 @@ CONTENT
42
42
  actual.attributes['attribute2'].should == 'value2'
43
43
  end
44
44
 
45
- specify 'should_handle_absolute_path' do
45
+ it 'should_handle_absolute_path' do
46
46
  target = create_element('div')
47
47
  template = create_element('link')
48
48
  template.attributes['href'] = '/content/path.html'
@@ -53,7 +53,7 @@ CONTENT
53
53
  actual.attributes['href'].should == '../../content/path.html'
54
54
  end
55
55
 
56
- specify 'should_generate_div_with_current_class_attribute_if_link_is_on_current_page' do
56
+ it 'should_generate_div_with_current_class_attribute_if_link_is_on_current_page' do
57
57
  target = create_element('div')
58
58
  template = create_element('link')
59
59
  template.attributes['href'] = '/content/path.html'
@@ -3,13 +3,13 @@ $:.unshift File.dirname(__FILE__)
3
3
  require 'common_templatelet_test'
4
4
 
5
5
  module BuildMaster
6
- context 'TextTest' do
6
+ describe 'TextTest' do
7
7
  include HelperMethods
8
- setup do
8
+ before do
9
9
  setup_spec
10
10
  end
11
11
 
12
- specify 'should_generate_text_based_on_property' do
12
+ it 'should_generate_text_based_on_property' do
13
13
  target = create_element('target')
14
14
  template = create_element('text')
15
15
  template.attributes['property'] = 'property'
@@ -18,7 +18,7 @@ context 'TextTest' do
18
18
  target.text.should == 'text'
19
19
  end
20
20
 
21
- specify 'should_throw_exception_if_property_not_set' do
21
+ it 'should_throw_exception_if_property_not_set' do
22
22
  target = create_element('target')
23
23
  template = create_element('text')
24
24
  template.attributes['property'] = 'one'
@@ -3,14 +3,14 @@ $:.unshift File.dirname(__FILE__)
3
3
  require 'common_templatelet_test'
4
4
 
5
5
  module BuildMaster
6
- context 'WhenTest' do
6
+ describe 'WhenTest' do
7
7
  include HelperMethods
8
8
 
9
- setup do
9
+ before do
10
10
  setup_spec
11
11
  end
12
12
 
13
- specify 'should_process_child_when_evaluated_true' do
13
+ it 'should_process_child_when_evaluated_true' do
14
14
  target = create_element('target')
15
15
  template_content = <<CONTENT
16
16
  <when test='expression_for_true'>
@@ -27,7 +27,7 @@ CONTENT
27
27
  actual.text.should == 'Header'
28
28
  end
29
29
 
30
- specify 'should_not_process_child_when_evaluated_false' do
30
+ it 'should_not_process_child_when_evaluated_false' do
31
31
  target = create_element('target')
32
32
  template_content = <<CONTENT
33
33
  <when test='expression_for_false'>
@@ -1,5 +1,5 @@
1
1
  K 8
2
2
  svn:date
3
3
  V 27
4
- 2007-01-16T00:33:04.625000Z
4
+ 2008-04-27T16:11:43.093750Z
5
5
  END
@@ -5,7 +5,7 @@ Shane and Lianxin
5
5
  K 8
6
6
  svn:date
7
7
  V 27
8
- 2007-01-16T00:33:04.875000Z
8
+ 2008-04-27T16:11:43.250000Z
9
9
  K 7
10
10
  svn:log
11
11
  V 24
@@ -5,7 +5,7 @@ Shane and Lianxin
5
5
  K 8
6
6
  svn:date
7
7
  V 27
8
- 2007-01-16T00:33:05.078125Z
8
+ 2008-04-27T16:11:43.656250Z
9
9
  K 7
10
10
  svn:log
11
11
  V 23
@@ -5,7 +5,7 @@ Shane and Lianxin
5
5
  K 8
6
6
  svn:date
7
7
  V 27
8
- 2007-01-16T00:33:05.250000Z
8
+ 2008-04-27T16:11:44.093750Z
9
9
  K 7
10
10
  svn:log
11
11
  V 27
@@ -5,7 +5,7 @@ Shane and Lianxin
5
5
  K 8
6
6
  svn:date
7
7
  V 27
8
- 2007-01-16T00:33:07.468750Z
8
+ 2008-04-27T16:11:46.421875Z
9
9
  K 7
10
10
  svn:log
11
11
  V 19
@@ -1 +1 @@
1
- a576fdff-2425-4247-8608-1a231a07b88f
1
+ f2c2fdcb-b41e-ac41-a4e3-be7ce5ecf444