You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by do...@apache.org on 2012/12/11 11:39:37 UTC
svn commit: r1420085 - in /buildr/trunk/spec: java/pom_spec.rb
packaging/artifact_spec.rb packaging/packaging_spec.rb
Author: donaldp
Date: Tue Dec 11 10:39:33 2012
New Revision: 1420085
URL: http://svn.apache.org/viewvc?rev=1420085&view=rev
Log:
Update the remote repository URL to something other than example.com that now actually has a site
Modified:
buildr/trunk/spec/java/pom_spec.rb
buildr/trunk/spec/packaging/artifact_spec.rb
buildr/trunk/spec/packaging/packaging_spec.rb
Modified: buildr/trunk/spec/java/pom_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/java/pom_spec.rb?rev=1420085&r1=1420084&r2=1420085&view=diff
==============================================================================
--- buildr/trunk/spec/java/pom_spec.rb (original)
+++ buildr/trunk/spec/java/pom_spec.rb Tue Dec 11 10:39:33 2012
@@ -18,7 +18,7 @@ require 'fileutils'
describe Buildr::POM do
before do
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
@app = 'group:pomapp:jar:1.0'
write artifact(@app).pom.to_s, <<-XML
<project>
@@ -70,7 +70,7 @@ end
describe Buildr::POM do
before do
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
@app = 'group:app:jar:1.0'
write artifact(@app).pom.to_s, <<-XML
<project>
Modified: buildr/trunk/spec/packaging/artifact_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/packaging/artifact_spec.rb?rev=1420085&r1=1420084&r2=1420085&view=diff
==============================================================================
--- buildr/trunk/spec/packaging/artifact_spec.rb (original)
+++ buildr/trunk/spec/packaging/artifact_spec.rb Tue Dec 11 10:39:33 2012
@@ -99,20 +99,20 @@ describe Artifact do
end
it 'should handle lack of POM gracefully' do
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
URI.should_receive(:download).twice { |*args| raise URI::NotFoundError if args[0].to_s.end_with?('.pom') }
lambda { @artifact.invoke }.should_not raise_error
end
it 'should pass if POM provided' do
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
@artifact.pom.enhance { |task| write task.name, @artifact.pom_xml }
write repositories.locate(@artifact)
lambda { @artifact.invoke }.should_not raise_error
end
it 'should pass if POM not required' do
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
class << @artifact ; def pom() ; end ; end
write repositories.locate(@artifact)
lambda { @artifact.invoke }.should_not raise_error
@@ -239,14 +239,14 @@ describe Repositories, 'remote' do
end
it 'should be used to download artifact' do
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
URI.should_receive(:download).twice.and_return { |uri, target, options| write target }
lambda { artifact('com.example:library:jar:2.0').invoke }.
should change { File.exist?(File.join(repositories.local, 'com/example/library/2.0/library-2.0.jar')) }.to(true)
end
it 'should lookup in array order' do
- repositories.remote = [ 'http://example.com', 'http://example.org' ]
+ repositories.remote = [ 'http://buildr.apache.org/repository/noexist', 'http://example.org' ]
order = ['com', 'org']
URI.should_receive(:download).any_number_of_times do |uri, target, options|
order.shift if order.first && uri.to_s[order.first]
@@ -257,33 +257,33 @@ describe Repositories, 'remote' do
end
it 'should fail if artifact not found' do
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
URI.should_receive(:download).once.ordered.and_return { fail URI::NotFoundError }
lambda { artifact('com.example:library:jar:2.0').invoke }.should raise_error(RuntimeError, /Failed to download/)
File.exist?(File.join(repositories.local, 'com/example/library/2.0/library-2.0.jar')).should be_false
end
it 'should support artifact classifier' do
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
URI.should_receive(:download).once.and_return { |uri, target, options| write target }
lambda { artifact('com.example:library:jar:all:2.0').invoke }.
should change { File.exist?(File.join(repositories.local, 'com/example/library/2.0/library-2.0-all.jar')) }.to(true)
end
it 'should deal well with repositories URL that lack the last slash' do
- repositories.remote = 'http://example.com/base'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist/base'
uri = nil
URI.should_receive(:download).twice.and_return { |_uri, args| uri = _uri }
artifact('group:id:jar:1.0').invoke
- uri.to_s.should eql('http://example.com/base/group/id/1.0/id-1.0.pom')
+ uri.to_s.should eql('http://buildr.apache.org/repository/noexist/base/group/id/1.0/id-1.0.pom')
end
it 'should deal well with repositories URL that have the last slash' do
- repositories.remote = 'http://example.com/base/'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist/base/'
uri = nil
URI.should_receive(:download).twice.and_return { |_uri, args| uri = _uri }
artifact('group:id:jar:1.0').invoke
- uri.to_s.should eql('http://example.com/base/group/id/1.0/id-1.0.pom')
+ uri.to_s.should eql('http://buildr.apache.org/repository/noexist/base/group/id/1.0/id-1.0.pom')
end
it 'should resolve m2-style deployed snapshots' do
@@ -302,7 +302,7 @@ describe Repositories, 'remote' do
</versioning>
</metadata>
XML
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
URI.should_receive(:download).twice.with(uri(/2.1-SNAPSHOT\/library-2.1-SNAPSHOT.(jar|pom)$/), anything()).
and_return { fail URI::NotFoundError }
URI.should_receive(:download).twice.with(uri(/2.1-SNAPSHOT\/maven-metadata.xml$/), duck_type(:write)).
@@ -329,7 +329,7 @@ describe Repositories, 'remote' do
</versioning>
</metadata>
XML
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
URI.should_receive(:download).once.with(uri(/2.1-SNAPSHOT\/library-2.1-20071012.190008-8-classifier.jar$/), anything()).
and_return { |uri, target, options| write target }
URI.should_receive(:download).once.with(uri(/2.1-SNAPSHOT\/maven-metadata.xml$/), duck_type(:write)).
@@ -354,7 +354,7 @@ describe Repositories, 'remote' do
</versioning>
</metadata>
XML
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
URI.should_receive(:download).once.with(uri(/2.1-SNAPSHOT\/library-2.1-SNAPSHOT.(jar|pom)$/), anything()).
and_return { fail URI::NotFoundError }
URI.should_receive(:download).once.with(uri(/2.1-SNAPSHOT\/maven-metadata.xml$/), duck_type(:write)).
@@ -380,7 +380,7 @@ describe Repositories, 'remote' do
</versioning>
</metadata>
XML
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
URI.should_receive(:download).once.with(uri(/2.1-SNAPSHOT\/library-2.1-SNAPSHOT.(jar|pom)$/), anything()).
and_return { fail URI::NotFoundError }
URI.should_receive(:download).once.with(uri(/2.1-SNAPSHOT\/maven-metadata.xml$/), duck_type(:write)).
@@ -392,7 +392,7 @@ describe Repositories, 'remote' do
end
it 'should handle missing maven metadata by reporting the artifact unavailable' do
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
URI.should_receive(:download).with(uri(/2.1-SNAPSHOT\/library-2.1-SNAPSHOT.jar$/), anything()).
and_return { fail URI::NotFoundError }
URI.should_receive(:download).with(uri(/2.1-SNAPSHOT\/maven-metadata.xml$/), duck_type(:write)).
@@ -417,7 +417,7 @@ describe Repositories, 'remote' do
</versioning>
</metadata>
XML
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
URI.should_receive(:download).with(uri(/2.1-SNAPSHOT\/library-2.1-SNAPSHOT.jar$/), anything()).
and_return { fail URI::NotFoundError }
URI.should_receive(:download).with(uri(/2.1-SNAPSHOT\/maven-metadata.xml$/), duck_type(:write)).
@@ -432,81 +432,81 @@ describe Repositories, 'remote' do
write 'home/.buildr/settings.yaml', <<-YAML
repositories:
remote:
- - http://example.com
+ - http://buildr.apache.org/repository/noexist
- http://example.org
YAML
- repositories.remote.should include('http://example.com', 'http://example.org')
+ repositories.remote.should include('http://buildr.apache.org/repository/noexist', 'http://example.org')
end
it 'should load with all repositories specified in build.yaml file' do
write 'build.yaml', <<-YAML
repositories:
remote:
- - http://example.com
+ - http://buildr.apache.org/repository/noexist
- http://example.org
YAML
- repositories.remote.should include('http://example.com', 'http://example.org')
+ repositories.remote.should include('http://buildr.apache.org/repository/noexist', 'http://example.org')
end
it 'should load with all repositories specified in settings and build.yaml files' do
write 'home/.buildr/settings.yaml', <<-YAML
repositories:
remote:
- - http://example.com
+ - http://buildr.apache.org/repository/noexist
YAML
write 'build.yaml', <<-YAML
repositories:
remote:
- http://example.org
YAML
- repositories.remote.should include('http://example.com', 'http://example.org')
+ repositories.remote.should include('http://buildr.apache.org/repository/noexist', 'http://example.org')
end
end
describe Repositories, 'release_to' do
it 'should accept URL as first argument' do
- repositories.release_to = 'http://example.com'
- repositories.release_to.should == { :url=>'http://example.com' }
+ repositories.release_to = 'http://buildr.apache.org/repository/noexist'
+ repositories.release_to.should == { :url=>'http://buildr.apache.org/repository/noexist' }
end
it 'should accept hash with options' do
- repositories.release_to = { :url=>'http://example.com', :username=>'john' }
- repositories.release_to.should == { :url=>'http://example.com', :username=>'john' }
+ repositories.release_to = { :url=>'http://buildr.apache.org/repository/noexist', :username=>'john' }
+ repositories.release_to.should == { :url=>'http://buildr.apache.org/repository/noexist', :username=>'john' }
end
it 'should allow the hash to be manipulated' do
- repositories.release_to = 'http://example.com'
- repositories.release_to.should == { :url=>'http://example.com' }
+ repositories.release_to = 'http://buildr.apache.org/repository/noexist'
+ repositories.release_to.should == { :url=>'http://buildr.apache.org/repository/noexist' }
repositories.release_to[:username] = 'john'
- repositories.release_to.should == { :url=>'http://example.com', :username=>'john' }
+ repositories.release_to.should == { :url=>'http://buildr.apache.org/repository/noexist', :username=>'john' }
end
it 'should load URL from settings file' do
write 'home/.buildr/settings.yaml', <<-YAML
repositories:
- release_to: http://john:secret@example.com
+ release_to: http://john:secret@buildr.apache.org/repository/noexist
YAML
- repositories.release_to.should == { :url=>'http://john:secret@example.com' }
+ repositories.release_to.should == { :url=>'http://john:secret@buildr.apache.org/repository/noexist' }
end
it 'should load URL from build settings file' do
write 'build.yaml', <<-YAML
repositories:
- release_to: http://john:secret@example.com
+ release_to: http://john:secret@buildr.apache.org/repository/noexist
YAML
- repositories.release_to.should == { :url=>'http://john:secret@example.com' }
+ repositories.release_to.should == { :url=>'http://john:secret@buildr.apache.org/repository/noexist' }
end
it 'should load URL, username and password from settings file' do
write 'home/.buildr/settings.yaml', <<-YAML
repositories:
release_to:
- url: http://example.com
+ url: http://buildr.apache.org/repository/noexist
username: john
password: secret
YAML
- repositories.release_to.should == { :url=>'http://example.com', :username=>'john', :password=>'secret' }
+ repositories.release_to.should == { :url=>'http://buildr.apache.org/repository/noexist', :username=>'john', :password=>'secret' }
end
end
@@ -652,7 +652,7 @@ describe Buildr, '#artifact' do
end
def run_with_repo
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
end
end
@@ -788,7 +788,7 @@ describe Buildr, '#install' do
end
it 'should download snapshot to temporary location' do
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
snapshot = artifact(@snapshot_spec)
same_time = Time.new
download_file = "#{Dir.tmpdir}/#{File.basename(snapshot.name)}#{same_time.to_i}"
@@ -831,7 +831,7 @@ describe Buildr, '#upload' do
before do
@spec = 'group:id:jar:1.0'
write @file = 'test.jar'
- repositories.release_to = 'sftp://example.com/base'
+ repositories.release_to = 'sftp://buildr.apache.org/repository/noexist/base'
end
it 'should return the upload task' do
@@ -847,9 +847,9 @@ describe Buildr, '#upload' do
write @file
upload artifact(@spec).from(@file)
URI.should_receive(:upload).once.
- with(URI.parse('sftp://example.com/base/group/id/1.0/id-1.0.jar'), artifact(@spec).to_s, anything)
+ with(URI.parse('sftp://buildr.apache.org/repository/noexist/base/group/id/1.0/id-1.0.jar'), artifact(@spec).to_s, anything)
URI.should_receive(:upload).once.
- with(URI.parse('sftp://example.com/base/group/id/1.0/id-1.0.pom'), artifact(@spec).pom.to_s, anything)
+ with(URI.parse('sftp://buildr.apache.org/repository/noexist/base/group/id/1.0/id-1.0.pom'), artifact(@spec).pom.to_s, anything)
upload.invoke
end
end
@@ -862,10 +862,10 @@ describe ActsAsArtifact, '#upload' do
write repositories.locate(artifact)
write repositories.locate(artifact.pom)
URI.should_receive(:upload).once.
- with(URI.parse('sftp://example.com/base/com/example/library/2.0/library-2.0.pom'), artifact.pom.to_s, anything)
+ with(URI.parse('sftp://buildr.apache.org/repository/noexist/base/com/example/library/2.0/library-2.0.pom'), artifact.pom.to_s, anything)
URI.should_receive(:upload).once.
- with(URI.parse('sftp://example.com/base/com/example/library/2.0/library-2.0.jar'), artifact.to_s, anything)
- verbose(false) { artifact.upload(:url=>'sftp://example.com/base') }
+ with(URI.parse('sftp://buildr.apache.org/repository/noexist/base/com/example/library/2.0/library-2.0.jar'), artifact.to_s, anything)
+ verbose(false) { artifact.upload(:url=>'sftp://buildr.apache.org/repository/noexist/base') }
end
it 'should support artifact classifier and should not upload pom if artifact has classifier' do
@@ -873,8 +873,8 @@ describe ActsAsArtifact, '#upload' do
# Prevent artifact from downloading anything.
write repositories.locate(artifact)
URI.should_receive(:upload).exactly(:once).
- with(URI.parse('sftp://example.com/base/com/example/library/2.0/library-2.0-all.jar'), artifact.to_s, anything)
- verbose(false) { artifact.upload(:url=>'sftp://example.com/base') }
+ with(URI.parse('sftp://buildr.apache.org/repository/noexist/base/com/example/library/2.0/library-2.0-all.jar'), artifact.to_s, anything)
+ verbose(false) { artifact.upload(:url=>'sftp://buildr.apache.org/repository/noexist/base') }
end
it 'should complain without any repository configuration' do
@@ -891,7 +891,7 @@ describe ActsAsArtifact, '#upload' do
write repositories.locate(artifact)
write repositories.locate(artifact.pom)
URI.should_receive(:upload).at_least(:once)
- repositories.release_to = 'sftp://example.com/base'
+ repositories.release_to = 'sftp://buildr.apache.org/repository/noexist/base'
artifact.upload
lambda { artifact.upload }.should_not raise_error
end
@@ -908,7 +908,7 @@ describe Rake::Task, ' artifacts' do
it 'should download all specified artifacts' do
artifact 'group:id:jar:1.0'
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
URI.should_receive(:download).twice.and_return { |uri, target, options| write target }
task('artifacts').invoke
end
@@ -934,7 +934,7 @@ describe Rake::Task, ' artifacts:sources
@local = @remote = @release_to = nil
end
task('artifacts:sources').clear
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
end
it 'should download sources for all specified artifacts' do
@@ -973,7 +973,7 @@ describe Rake::Task, ' artifacts:javadoc
@local = @remote = @release_to = nil
end
task('artifacts:javadoc').clear
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
end
it 'should download javadoc for all specified artifacts' do
@@ -1007,7 +1007,7 @@ end
describe Buildr, '#transitive' do
before do
- repositories.remote = 'http://example.com'
+ repositories.remote = 'http://buildr.apache.org/repository/noexist'
@simple = [ 'saxon:saxon:jar:8.4', 'saxon:saxon-dom:jar:8.4', 'saxon:saxon-xpath:jar:8.4' ]
@simple.map { |spec| artifact(spec).pom }.each { |task| write task.name, task.pom_xml }
@provided = @simple.first
Modified: buildr/trunk/spec/packaging/packaging_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/packaging/packaging_spec.rb?rev=1420085&r1=1420084&r2=1420085&view=diff
==============================================================================
--- buildr/trunk/spec/packaging/packaging_spec.rb (original)
+++ buildr/trunk/spec/packaging/packaging_spec.rb Tue Dec 11 10:39:33 2012
@@ -665,7 +665,7 @@ describe Rake::Task, ' upload' do
it 'should not upload twice the pom when artifacts are uploaded from a project' do
write 'src/main/java/Foo.java', 'public class Foo {}'
- repositories.release_to = 'sftp://example.com/base'
+ repositories.release_to = 'sftp://buildr.apache.org/repository/noexist/base'
define 'foo' do
project.group = "attached"
project.version = "1.0"
@@ -673,11 +673,11 @@ describe Rake::Task, ' upload' do
package(:sources)
end
URI.should_receive(:upload).exactly(:once).
- with(URI.parse('sftp://example.com/base/attached/foo/1.0/foo-1.0-sources.jar'), project("foo").package(:sources).to_s, anything)
+ with(URI.parse('sftp://buildr.apache.org/repository/noexist/base/attached/foo/1.0/foo-1.0-sources.jar'), project("foo").package(:sources).to_s, anything)
URI.should_receive(:upload).exactly(:once).
- with(URI.parse('sftp://example.com/base/attached/foo/1.0/foo-1.0.jar'), project("foo").package(:jar).to_s, anything)
+ with(URI.parse('sftp://buildr.apache.org/repository/noexist/base/attached/foo/1.0/foo-1.0.jar'), project("foo").package(:jar).to_s, anything)
URI.should_receive(:upload).exactly(:once).
- with(URI.parse('sftp://example.com/base/attached/foo/1.0/foo-1.0.pom'), project("foo").package(:jar).pom.to_s, anything)
+ with(URI.parse('sftp://buildr.apache.org/repository/noexist/base/attached/foo/1.0/foo-1.0.pom'), project("foo").package(:jar).pom.to_s, anything)
verbose(false) { project("foo").upload.invoke }
end