rscm-accurev 0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +25 -0
- data/README +9 -0
- data/Rakefile +137 -0
- data/STATUS +63 -0
- data/TODO +43 -0
- data/apitest.rb +21 -0
- data/bumprelease.sh +13 -0
- data/lib/rscm/accurev.rb +18 -0
- data/lib/rscm/scm/accurev/api.rb +411 -0
- data/lib/rscm/scm/accurev/api.rb.mine +382 -0
- data/lib/rscm/scm/accurev/api.rb.r263 +364 -0
- data/lib/rscm/scm/accurev/api.rb.r265 +393 -0
- data/lib/rscm/scm/accurev/command.rb +151 -0
- data/lib/rscm/scm/accurev/exception.rb +38 -0
- data/lib/rscm/scm/accurev/filterio.rb +57 -0
- data/lib/rscm/scm/accurev/xml.rb +224 -0
- data/lib/test/unit/ui/xml/testrunner.rb +165 -0
- data/lib/test/unit/ui/xml/xmltestrunner.xslt +79 -0
- data/test/acreplay.rb +22 -0
- data/test/coverage/analyzer.rb +127 -0
- data/test/coverage/c_loader.rb +34 -0
- data/test/coverage/cover.rb +91 -0
- data/test/coverage/coverage_loader.rb +21 -0
- data/test/coverage/coveragetask.rb +38 -0
- data/test/coverage/index_tmpl.html +42 -0
- data/test/coverage/template.html +36 -0
- data/test/eg/ac-files.xml +172 -0
- data/test/eg/ac-pop.txt +195 -0
- data/test/eg/files-various-states.xml +188 -0
- data/test/eg/hist-oneweek-all.xml +1483 -0
- data/test/eg/hist-oneweek-external.xml +246 -0
- data/test/eg/hist-oneweek-promotes.xml +1092 -0
- data/test/eg/info.txt +14 -0
- data/test/eg/stat-a-various.xml +1789 -0
- data/test/eg/stat-m.xml +13 -0
- data/test/eg/stat-overlap.xml +13 -0
- data/test/eg/stat-x.xml +20 -0
- data/test/eg/update-i-mods-and-updates-and-overlap.xml +73 -0
- data/test/eg/update-i-nochanges.xml +8 -0
- data/test/eg/update-i-stale.xml +0 -0
- data/test/eg/update-i-updates.xml +125 -0
- data/test/eg/update-newwksp.xml +183 -0
- data/test/eg/update-nochanges.xml +7 -0
- data/test/eg/update-stale.xml +12 -0
- data/test/eg/update-updates.xml +147 -0
- data/test/t_api.rb +163 -0
- data/test/t_command.rb +85 -0
- data/test/t_filterio.rb +60 -0
- data/test/t_load.rb +11 -0
- data/test/t_scrubio.rb +117 -0
- data/test/t_xmlmapper.rb +75 -0
- metadata +106 -0
data/test/t_load.rb
ADDED
data/test/t_scrubio.rb
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
require 'rexml/document'
|
2
|
+
require 'rubygems'
|
3
|
+
require 'rscm/accurev'
|
4
|
+
require 'test/unit'
|
5
|
+
|
6
|
+
include REXML
|
7
|
+
include RSCM::Accurev
|
8
|
+
|
9
|
+
module TestBase
|
10
|
+
|
11
|
+
def test_parse
|
12
|
+
begin
|
13
|
+
doc = Document.new( AcXMLScrubIO.new( StringIO.new(input) ) )
|
14
|
+
assert( fixable, "Input not fixable; should have raised" )
|
15
|
+
assert( !doc.nil? )
|
16
|
+
assert( !doc.elements.nil? )
|
17
|
+
assert( !doc.elements.empty?, "Should have elements" )
|
18
|
+
found = false
|
19
|
+
doc.elements.each( "/AcResponse" ) do |e|
|
20
|
+
found = true
|
21
|
+
end
|
22
|
+
assert( found, "Root needs to be AcResponse" )
|
23
|
+
rescue Exception => e
|
24
|
+
if fixable
|
25
|
+
raise
|
26
|
+
end
|
27
|
+
assert( ! fixable, "Fixed-up input should have been parseable" )
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
class HappyXMLTest < Test::Unit::TestCase
|
34
|
+
include TestBase
|
35
|
+
def broken; false; end
|
36
|
+
def fixable; true; end
|
37
|
+
def input
|
38
|
+
return <<-EOFOK
|
39
|
+
<?xml version="1.0"?>
|
40
|
+
<AcResponse
|
41
|
+
command="update"
|
42
|
+
>
|
43
|
+
<element location="/./foo.txt" />
|
44
|
+
<message>Hello, world!</message>
|
45
|
+
</AcResponse>
|
46
|
+
EOFOK
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
class BrokenTagTest < Test::Unit::TestCase
|
51
|
+
include TestBase
|
52
|
+
def broken; true; end
|
53
|
+
def fixable; true; end
|
54
|
+
def input
|
55
|
+
# note these also are missing the <?xml?> decl.
|
56
|
+
return <<-EOFBROKED
|
57
|
+
<acResponse
|
58
|
+
command="update"
|
59
|
+
>
|
60
|
+
<element location="/./foo.txt" />
|
61
|
+
<message>Hello, world!</message>
|
62
|
+
</acResponse>
|
63
|
+
EOFBROKED
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
class BrokenGarbleTest < Test::Unit::TestCase
|
68
|
+
include TestBase
|
69
|
+
def broken; true; end
|
70
|
+
def fixable; true; end
|
71
|
+
def input
|
72
|
+
return <<-EOFBROKED2
|
73
|
+
<acResponse
|
74
|
+
command="update"Filehandles are hard, let's go shopping!
|
75
|
+
>
|
76
|
+
<element location="/./foo.txt" />
|
77
|
+
<message>Hello, world!</message>
|
78
|
+
</acResponse>
|
79
|
+
EOFBROKED2
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
class BrokenGarbleTest2 < Test::Unit::TestCase
|
84
|
+
include TestBase
|
85
|
+
def broken; true; end
|
86
|
+
def fixable; true; end
|
87
|
+
def input
|
88
|
+
return <<-EOFBROKED3
|
89
|
+
<?xml version="1.0"?>
|
90
|
+
<!-- comment before root element -->
|
91
|
+
<acResponse
|
92
|
+
command="update"Filehandles are hard, let's go shopping!
|
93
|
+
>
|
94
|
+
<element location="/./foo.txt" />
|
95
|
+
<message>Hello, world!</message>
|
96
|
+
</acResponse>
|
97
|
+
EOFBROKED3
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
class BrokenGarbleTest3 < Test::Unit::TestCase
|
102
|
+
include TestBase
|
103
|
+
def broken; true; end
|
104
|
+
def fixable; true; end
|
105
|
+
def input
|
106
|
+
return <<-EOFBROKED4
|
107
|
+
<?xml version="1.0"?>
|
108
|
+
<!-- comment before root element -->
|
109
|
+
<acResponse
|
110
|
+
command="update">
|
111
|
+
<element location="/./foo.txt" />
|
112
|
+
<message>Hello, world!</message>
|
113
|
+
</acResponse>
|
114
|
+
EOFBROKED4
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
data/test/t_xmlmapper.rb
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
require 'stringio'
|
4
|
+
require 'rexml/document'
|
5
|
+
require 'rubygems'
|
6
|
+
require 'rscm/scm/accurev/xml'
|
7
|
+
include REXML
|
8
|
+
include RSCM::Accurev
|
9
|
+
|
10
|
+
class ReadQueue < ElementBackedClass
|
11
|
+
element_name 'readqueue'
|
12
|
+
attr_accessor :owner
|
13
|
+
end
|
14
|
+
|
15
|
+
class Book < ElementBackedClass
|
16
|
+
element_name 'book'
|
17
|
+
attr_accessor :title, :author
|
18
|
+
end
|
19
|
+
|
20
|
+
class Paper < ElementBackedClass
|
21
|
+
element_name 'paper'
|
22
|
+
attr_accessor :uri
|
23
|
+
end
|
24
|
+
|
25
|
+
class Note < ElementBackedClass
|
26
|
+
element_name 'note'
|
27
|
+
attr_accessor :text, :text_content
|
28
|
+
end
|
29
|
+
|
30
|
+
INPUT = <<-EOI
|
31
|
+
<?xml version="1.0"?>
|
32
|
+
<readqueue owner="gdf">
|
33
|
+
<book title="Iron Council" author="China Mieville" />
|
34
|
+
<paper uri="http://svk.elixus.org?SVKTutorial">
|
35
|
+
<note text="re-read" />
|
36
|
+
</paper>
|
37
|
+
<book title="Someone Comes to Town, Someone Leaves Town"
|
38
|
+
author="Cory Doctorow" />
|
39
|
+
<book title="Concurrent Programming in Java" author="Doug Lea">
|
40
|
+
<note>Need Brains</note>
|
41
|
+
</book>
|
42
|
+
</readqueue>
|
43
|
+
EOI
|
44
|
+
|
45
|
+
class XMLMapperTest < Test::Unit::TestCase
|
46
|
+
def testmap
|
47
|
+
d = Document.new( StringIO.new( INPUT ) )
|
48
|
+
assert_equal( "readqueue", d.root.name )
|
49
|
+
mapper = XMLMapper.new
|
50
|
+
o = mapper.map( d.root )
|
51
|
+
assert( o.kind_of?( ElementBackedClass ) )
|
52
|
+
assert( o.kind_of?( ReadQueue ) )
|
53
|
+
assert_equal( 3, o.children['book'].length )
|
54
|
+
assert_equal( 1, o.children['paper'].length )
|
55
|
+
paper = o.children['paper'][0]
|
56
|
+
assert( paper.kind_of?( Paper ) )
|
57
|
+
assert_equal( "paper", paper.class.element_name )
|
58
|
+
assert_equal( "http://svk.elixus.org?SVKTutorial", paper.uri )
|
59
|
+
assert_equal( 1, paper.children['note'].length )
|
60
|
+
note = paper.children['note'][0]
|
61
|
+
assert_equal( "re-read", note.text )
|
62
|
+
b = nil
|
63
|
+
o.children['book'].each do |book|
|
64
|
+
b = book if book.author == "Doug Lea"
|
65
|
+
end
|
66
|
+
assert_equal( "Concurrent Programming in Java", b.title )
|
67
|
+
note = b.children['note'][0]
|
68
|
+
assert( note.text.nil? )
|
69
|
+
assert_equal( "Need Brains", note.text_content )
|
70
|
+
|
71
|
+
# test []
|
72
|
+
assert_equal( 3, o['book'].length )
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
metadata
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.8.11
|
3
|
+
specification_version: 1
|
4
|
+
name: rscm-accurev
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: "0.0"
|
7
|
+
date: 2005-09-01 00:00:00 -05:00
|
8
|
+
summary: "RSCM::Accurev - RSCM API for Accurev"
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: gdf@speakeasy.net
|
12
|
+
homepage: http://rscm-accurev.rubyforge.org
|
13
|
+
rubyforge_project:
|
14
|
+
description: RSCM::Accurev is an RSCM API for the SCM tool Accurev (http://www.accurev.com/).
|
15
|
+
autorequire: rscm/scm/accurev
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
-
|
22
|
+
- ">"
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: 0.0.0
|
25
|
+
version:
|
26
|
+
platform: ruby
|
27
|
+
signing_key:
|
28
|
+
cert_chain:
|
29
|
+
authors:
|
30
|
+
- Greg Fast
|
31
|
+
files:
|
32
|
+
- tmp
|
33
|
+
- lib
|
34
|
+
- apitest.rb
|
35
|
+
- STATUS
|
36
|
+
- test
|
37
|
+
- LICENSE
|
38
|
+
- eg
|
39
|
+
- TODO
|
40
|
+
- doc
|
41
|
+
- Rakefile
|
42
|
+
- pkg
|
43
|
+
- README
|
44
|
+
- bumprelease.sh
|
45
|
+
- lib/rscm
|
46
|
+
- lib/test
|
47
|
+
- lib/rscm/scm
|
48
|
+
- lib/rscm/accurev.rb
|
49
|
+
- lib/rscm/scm/accurev
|
50
|
+
- lib/rscm/scm/accurev/command.rb
|
51
|
+
- lib/rscm/scm/accurev/xml.rb
|
52
|
+
- lib/rscm/scm/accurev/api.rb
|
53
|
+
- lib/rscm/scm/accurev/filterio.rb
|
54
|
+
- lib/rscm/scm/accurev/exception.rb
|
55
|
+
- lib/rscm/scm/accurev/api.rb.r263
|
56
|
+
- lib/rscm/scm/accurev/api.rb.r265
|
57
|
+
- lib/rscm/scm/accurev/api.rb.mine
|
58
|
+
- lib/test/unit
|
59
|
+
- lib/test/unit/ui
|
60
|
+
- lib/test/unit/ui/xml
|
61
|
+
- lib/test/unit/ui/xml/xmltestrunner.xslt
|
62
|
+
- lib/test/unit/ui/xml/testrunner.rb
|
63
|
+
- test/t_scrubio.rb
|
64
|
+
- test/t_load.rb
|
65
|
+
- test/eg
|
66
|
+
- test/t_filterio.rb
|
67
|
+
- test/t_xmlmapper.rb
|
68
|
+
- test/acreplay.rb
|
69
|
+
- test/t_command.rb
|
70
|
+
- test/t_api.rb
|
71
|
+
- test/coverage
|
72
|
+
- test/eg/update-stale.xml
|
73
|
+
- test/eg/ac-files.xml
|
74
|
+
- test/eg/update-i-nochanges.xml
|
75
|
+
- test/eg/update-newwksp.xml
|
76
|
+
- test/eg/update-nochanges.xml
|
77
|
+
- test/eg/update-i-updates.xml
|
78
|
+
- test/eg/update-updates.xml
|
79
|
+
- test/eg/info.txt
|
80
|
+
- test/eg/files-various-states.xml
|
81
|
+
- test/eg/stat-x.xml
|
82
|
+
- test/eg/stat-m.xml
|
83
|
+
- test/eg/stat-a-various.xml
|
84
|
+
- test/eg/update-i-stale.xml
|
85
|
+
- test/eg/ac-pop.txt
|
86
|
+
- test/eg/update-i-mods-and-updates-and-overlap.xml
|
87
|
+
- test/eg/stat-overlap.xml
|
88
|
+
- test/eg/hist-oneweek-all.xml
|
89
|
+
- test/eg/hist-oneweek-promotes.xml
|
90
|
+
- test/eg/hist-oneweek-external.xml
|
91
|
+
- test/coverage/analyzer.rb
|
92
|
+
- test/coverage/cover.rb
|
93
|
+
- test/coverage/coverage_loader.rb
|
94
|
+
- test/coverage/coveragetask.rb
|
95
|
+
- test/coverage/index_tmpl.html
|
96
|
+
- test/coverage/c_loader.rb
|
97
|
+
- test/coverage/template.html
|
98
|
+
test_files: []
|
99
|
+
rdoc_options:
|
100
|
+
- "--line-numbers"
|
101
|
+
- "--inline-source"
|
102
|
+
extra_rdoc_files: []
|
103
|
+
executables: []
|
104
|
+
extensions: []
|
105
|
+
requirements: []
|
106
|
+
dependencies: []
|