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 2014/05/25 09:31:37 UTC
[1/8] git commit: Fix a bug where 'default' configurations in IDEA
projects were being incorrectly created.
Repository: buildr
Updated Branches:
refs/heads/master 0d1b3a4e8 -> a80ece18d
Fix a bug where 'default' configurations in IDEA projects were being incorrectly created.
Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/2687200a
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/2687200a
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/2687200a
Branch: refs/heads/master
Commit: 2687200a12bac0a4b7200cbff7925bd199b1f6c1
Parents: 0d1b3a4
Author: Peter Donald <pe...@realityforge.org>
Authored: Sun May 25 15:42:05 2014 +1000
Committer: Peter Donald <pe...@realityforge.org>
Committed: Sun May 25 15:42:05 2014 +1000
----------------------------------------------------------------------
CHANGELOG | 2 ++
lib/buildr/ide/idea.rb | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/buildr/blob/2687200a/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 2105e7b..7763e0c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,6 @@
1.4.17 (2014-05-25)
+* Fixed: Fix a bug where 'default' configurations in IDEA projects
+ were being incorrectly created.
* Fixed: Fix the vcs detection in IDEA addon for 1.8.6 (!) versions
of ruby by reordering blocks.
* Change: Supply a default xsl file for generating the checkstyle
http://git-wip-us.apache.org/repos/asf/buildr/blob/2687200a/lib/buildr/ide/idea.rb
----------------------------------------------------------------------
diff --git a/lib/buildr/ide/idea.rb b/lib/buildr/ide/idea.rb
index f0c6271..78431b3 100644
--- a/lib/buildr/ide/idea.rb
+++ b/lib/buildr/ide/idea.rb
@@ -658,7 +658,7 @@ module Buildr #:nodoc:
end
def add_default_configuration(type, factory_name)
- add_configuration(nil, type, factory_name)
+ add_configuration(nil, type, factory_name, true)
end
def add_postgres_data_source(name, options = {})
[8/8] git commit: Add the add_default_testng_configuration method to
help IDEA project creation.
Posted by do...@apache.org.
Add the add_default_testng_configuration method to help IDEA project creation.
Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/a80ece18
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/a80ece18
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/a80ece18
Branch: refs/heads/master
Commit: a80ece18dae20a4ecb460d5e26c63863b8a09391
Parents: ee6471a
Author: Peter Donald <pe...@realityforge.org>
Authored: Sun May 25 17:31:03 2014 +1000
Committer: Peter Donald <pe...@realityforge.org>
Committed: Sun May 25 17:31:03 2014 +1000
----------------------------------------------------------------------
CHANGELOG | 3 +++
lib/buildr/ide/idea.rb | 34 ++++++++++++++++++++++++++++++++++
spec/ide/idea_spec.rb | 38 ++++++++++++++++++++++++++++++++++++++
3 files changed, 75 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/buildr/blob/a80ece18/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 7763e0c..2a7ac26 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,7 @@
1.4.17 (2014-05-25)
+* Added: Add the add_default_testng_configuration method to help IDEA
+ project creation. Improves test coverage across 'default'
+ configurations.
* Fixed: Fix a bug where 'default' configurations in IDEA projects
were being incorrectly created.
* Fixed: Fix the vcs detection in IDEA addon for 1.8.6 (!) versions
http://git-wip-us.apache.org/repos/asf/buildr/blob/a80ece18/lib/buildr/ide/idea.rb
----------------------------------------------------------------------
diff --git a/lib/buildr/ide/idea.rb b/lib/buildr/ide/idea.rb
index ee363bb..760ffe1 100644
--- a/lib/buildr/ide/idea.rb
+++ b/lib/buildr/ide/idea.rb
@@ -839,6 +839,40 @@ module Buildr #:nodoc:
end
end
+ def add_default_testng_configuration(options = {})
+ jvm_args = options[:jvm_args] || '-ea'
+ dir = options[:dir] || '$PROJECT_DIR$'
+
+ add_default_configuration('TestNG', 'TestNG') do |xml|
+ xml.extension(:name => 'coverage', :enabled => 'false', :merge => 'false', :sample_coverage => 'true', :runner => 'idea')
+ xml.module(:name => '')
+ xml.option(:name => 'ALTERNATIVE_JRE_PATH_ENABLED', :value => 'false')
+ xml.option(:name => 'ALTERNATIVE_JRE_PATH')
+ xml.option(:name => 'SUITE_NAME')
+ xml.option(:name => 'PACKAGE_NAME')
+ xml.option(:name => 'MAIN_CLASS_NAME')
+ xml.option(:name => 'METHOD_NAME')
+ xml.option(:name => 'GROUP_NAME')
+ xml.option(:name => 'TEST_OBJECT', :value => 'CLASS')
+ xml.option(:name => 'VM_PARAMETERS', :value => jvm_args)
+ xml.option(:name => 'PARAMETERS')
+ xml.option(:name => 'WORKING_DIRECTORY', :value => dir)
+ xml.option(:name => 'OUTPUT_DIRECTORY')
+ xml.option(:name => 'ANNOTATION_TYPE')
+ xml.option(:name => 'ENV_VARIABLES')
+ xml.option(:name => 'PASS_PARENT_ENVS', :value => 'true')
+ xml.option(:name => 'TEST_SEARCH_SCOPE') do |opt|
+ opt.value(:defaultName => 'moduleWithDependencies')
+ end
+ xml.option(:name => 'USE_DEFAULT_REPORTERS', :value => 'false')
+ xml.option(:name => 'PROPERTIES_FILE')
+ xml.envs
+ xml.properties
+ xml.listeners
+ xml.method
+ end
+ end
+
protected
def artifact_content(xml, project, projects, options)
http://git-wip-us.apache.org/repos/asf/buildr/blob/a80ece18/spec/ide/idea_spec.rb
----------------------------------------------------------------------
diff --git a/spec/ide/idea_spec.rb b/spec/ide/idea_spec.rb
index 15f7781..a60c29a 100644
--- a/spec/ide/idea_spec.rb
+++ b/spec/ide/idea_spec.rb
@@ -1101,6 +1101,44 @@ describe Buildr::IntellijIdea do
end
end
+ describe "with add_default_testng_configuration using defaults" do
+ before do
+ @foo = define "foo" do
+ ipr.add_default_testng_configuration
+ end
+ invoke_generate_task
+ end
+
+ it "generates an IPR with default configuration" do
+ doc = xml_document(@foo._("foo.ipr"))
+ configurations_xpath = "/project/component[@name='ProjectRunConfigurationManager']/configuration"
+ doc.should have_nodes(configurations_xpath, 1)
+ configuration_xpath = "#{configurations_xpath}[@type='TestNG' and @factoryName='TestNG' and @default='true']"
+ doc.should have_xpath(configuration_xpath)
+ doc.should have_xpath("#{configuration_xpath}/option[@name='VM_PARAMETERS' and @value='-ea']")
+ doc.should have_xpath("#{configuration_xpath}/option[@name='WORKING_DIRECTORY' and @value='$PROJECT_DIR$']")
+ end
+ end
+
+ describe "with add_default_testng_configuration specifying values" do
+ before do
+ @foo = define "foo" do
+ ipr.add_default_testng_configuration(:dir => 'C:/blah', :jvm_args => '-ea -Dtest.db.url=xxxx')
+ end
+ invoke_generate_task
+ end
+
+ it "generates an IPR with default configuration" do
+ doc = xml_document(@foo._("foo.ipr"))
+ configurations_xpath = "/project/component[@name='ProjectRunConfigurationManager']/configuration"
+ doc.should have_nodes(configurations_xpath, 1)
+ configuration_xpath = "#{configurations_xpath}[@type='TestNG' and @factoryName='TestNG' and @default='true']"
+ doc.should have_xpath(configuration_xpath)
+ doc.should have_xpath("#{configuration_xpath}/option[@name='VM_PARAMETERS' and @value='-ea -Dtest.db.url=xxxx']")
+ doc.should have_xpath("#{configuration_xpath}/option[@name='WORKING_DIRECTORY' and @value='C:/blah']")
+ end
+ end
+
describe "with iml.group specified" do
before do
@foo = define "foo" do
[4/8] git commit: Fix spelling mistake revealed by failing test
Posted by do...@apache.org.
Fix spelling mistake revealed by failing test
Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/35fa29a9
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/35fa29a9
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/35fa29a9
Branch: refs/heads/master
Commit: 35fa29a92c224629af1ad5456a9b9a6d0c26447c
Parents: 0bd0901
Author: Peter Donald <pe...@realityforge.org>
Authored: Sun May 25 17:18:37 2014 +1000
Committer: Peter Donald <pe...@realityforge.org>
Committed: Sun May 25 17:18:37 2014 +1000
----------------------------------------------------------------------
spec/ide/idea_spec.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/buildr/blob/35fa29a9/spec/ide/idea_spec.rb
----------------------------------------------------------------------
diff --git a/spec/ide/idea_spec.rb b/spec/ide/idea_spec.rb
index adaabe2..50cfe03 100644
--- a/spec/ide/idea_spec.rb
+++ b/spec/ide/idea_spec.rb
@@ -484,7 +484,7 @@ describe Buildr::IntellijIdea do
it "generates a web facet with derived webroots" do
doc = xml_document(@foo._("foo.iml"))
web_facet_xpath = ensure_facet_xpath(doc, 'web', 'Web')
- doc.should have_xpath("#{web_facet_xpath}/configuration/webroots/root[@url='file://$MODULE_DIR$/src/main/webapp' and @realtive='/']")
+ doc.should have_xpath("#{web_facet_xpath}/configuration/webroots/root[@url='file://$MODULE_DIR$/src/main/webapp' and @relative='/']")
end
end
@@ -507,8 +507,8 @@ describe Buildr::IntellijIdea do
it "generates a web facet with specified webroots" do
doc = xml_document(@foo._("foo.iml"))
web_facet_xpath = ensure_facet_xpath(doc, 'web', 'Web')
- doc.should have_xpath("#{web_facet_xpath}/configuration/webroots/root[@url='file://$MODULE_DIR$/src/main/webapp2' and @realtive='/']")
- doc.should have_xpath("#{web_facet_xpath}/configuration/webroots/root[@url='file://$MODULE_DIR$/src/main/css' and @realtive='/css']")
+ doc.should have_xpath("#{web_facet_xpath}/configuration/webroots/root[@url='file://$MODULE_DIR$/src/main/webapp2' and @relative='/']")
+ doc.should have_xpath("#{web_facet_xpath}/configuration/webroots/root[@url='file://$MODULE_DIR$/src/main/css' and @relative='/css']")
end
end
[6/8] git commit: Update matcher to ensure it fails on non-match
Posted by do...@apache.org.
Update matcher to ensure it fails on non-match
Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/6c391f0e
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/6c391f0e
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/6c391f0e
Branch: refs/heads/master
Commit: 6c391f0e75ef76b8357d27bec404195e66f2c6d5
Parents: 03bd79f
Author: Peter Donald <pe...@realityforge.org>
Authored: Sun May 25 17:19:57 2014 +1000
Committer: Peter Donald <pe...@realityforge.org>
Committed: Sun May 25 17:19:57 2014 +1000
----------------------------------------------------------------------
spec/xpath_matchers.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/buildr/blob/6c391f0e/spec/xpath_matchers.rb
----------------------------------------------------------------------
diff --git a/spec/xpath_matchers.rb b/spec/xpath_matchers.rb
index e15bd3c..3bb3426 100644
--- a/spec/xpath_matchers.rb
+++ b/spec/xpath_matchers.rb
@@ -61,7 +61,7 @@ module RSpec
def matches?(response)
@response = response
doc = response.is_a?(REXML::Document) ? response : REXML::Document.new(@response)
- ok = true
+ ok = false
REXML::XPath.each(doc, @xpath) do |e|
@actual_val = case e
when REXML::Attribute
@@ -71,6 +71,7 @@ module RSpec
else
e.to_s
end
+ ok = true
return false unless @val == @actual_val
end
return ok
[7/8] git commit: Ensure that the default configuration method yields
so content can be supplied
Posted by do...@apache.org.
Ensure that the default configuration method yields so content can be supplied
Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/ee6471ad
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/ee6471ad
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/ee6471ad
Branch: refs/heads/master
Commit: ee6471ad8bcbbc87c0aeaba4c86bff1e76295fa2
Parents: 6c391f0
Author: Peter Donald <pe...@realityforge.org>
Authored: Sun May 25 17:29:23 2014 +1000
Committer: Peter Donald <pe...@realityforge.org>
Committed: Sun May 25 17:29:23 2014 +1000
----------------------------------------------------------------------
lib/buildr/ide/idea.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/buildr/blob/ee6471ad/lib/buildr/ide/idea.rb
----------------------------------------------------------------------
diff --git a/lib/buildr/ide/idea.rb b/lib/buildr/ide/idea.rb
index 78431b3..ee363bb 100644
--- a/lib/buildr/ide/idea.rb
+++ b/lib/buildr/ide/idea.rb
@@ -658,7 +658,9 @@ module Buildr #:nodoc:
end
def add_default_configuration(type, factory_name)
- add_configuration(nil, type, factory_name, true)
+ add_configuration(nil, type, factory_name, true) do |xml|
+ yield xml if block_given?
+ end
end
def add_postgres_data_source(name, options = {})
[3/8] git commit: Prefer ! over not due to precedence rules
Posted by do...@apache.org.
Prefer ! over not due to precedence rules
Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/0bd09016
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/0bd09016
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/0bd09016
Branch: refs/heads/master
Commit: 0bd090166e789808f865a636b1843de8edd2ca3f
Parents: a08a690
Author: Peter Donald <pe...@realityforge.org>
Authored: Sun May 25 15:57:08 2014 +1000
Committer: Peter Donald <pe...@realityforge.org>
Committed: Sun May 25 15:57:08 2014 +1000
----------------------------------------------------------------------
spec/xpath_matchers.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/buildr/blob/0bd09016/spec/xpath_matchers.rb
----------------------------------------------------------------------
diff --git a/spec/xpath_matchers.rb b/spec/xpath_matchers.rb
index a9120ff..e15bd3c 100644
--- a/spec/xpath_matchers.rb
+++ b/spec/xpath_matchers.rb
@@ -29,7 +29,7 @@ module RSpec
@response = response
doc = response.is_a?(REXML::Document) ? response : REXML::Document.new(@response)
match = REXML::XPath.match(doc, @xpath)
- not match.empty?
+ !match.empty?
end
def failure_message
[2/8] git commit: Update xpaths to correctly use conjunction in
attribtue guards
Posted by do...@apache.org.
Update xpaths to correctly use conjunction in attribtue guards
Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/a08a6900
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/a08a6900
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/a08a6900
Branch: refs/heads/master
Commit: a08a690024ed4a12d046b1f758eaf0b0abd2322d
Parents: 2687200
Author: Peter Donald <pe...@realityforge.org>
Authored: Sun May 25 15:55:47 2014 +1000
Committer: Peter Donald <pe...@realityforge.org>
Committed: Sun May 25 15:55:47 2014 +1000
----------------------------------------------------------------------
spec/ide/idea_spec.rb | 106 ++++++++++++++++++++++-----------------------
1 file changed, 53 insertions(+), 53 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/buildr/blob/a08a6900/spec/ide/idea_spec.rb
----------------------------------------------------------------------
diff --git a/spec/ide/idea_spec.rb b/spec/ide/idea_spec.rb
index b85e121..adaabe2 100644
--- a/spec/ide/idea_spec.rb
+++ b/spec/ide/idea_spec.rb
@@ -20,7 +20,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'xpath_matchers
def ensure_facet_xpath(doc, type, name)
facet_xpath = "/module/component[@name='FacetManager']/facet"
doc.should have_xpath(facet_xpath)
- web_facet_xpath = "#{facet_xpath}[@type='#{type}', @name='#{name}']"
+ web_facet_xpath = "#{facet_xpath}[@type='#{type}' and @name='#{name}']"
doc.should have_xpath(web_facet_xpath)
web_facet_xpath
end
@@ -122,7 +122,7 @@ describe Buildr::IntellijIdea do
end
it "generates one exported 'module-library' orderEntry in IML" do
- root_module_xml(@foo).should have_nodes("#{order_entry_xpath}[@type='module-library', @exported='']/library/CLASSES/root", 1)
+ root_module_xml(@foo).should have_nodes("#{order_entry_xpath}[@type='module-library' and @exported='']/library/CLASSES/root", 1)
end
end
@@ -136,7 +136,7 @@ describe Buildr::IntellijIdea do
end
it "generates one exported 'module-library' orderEntry in IML" do
- root_module_xml(@foo).should have_nodes("#{order_entry_xpath}[@type='module-library', @exported='']/library/CLASSES/root", 1)
+ root_module_xml(@foo).should have_nodes("#{order_entry_xpath}[@type='module-library' and @exported='']/library/CLASSES/root", 1)
end
end
@@ -181,7 +181,7 @@ describe Buildr::IntellijIdea do
end
it "generates 'module-library' orderEntry in IML with SOURCES specified" do
- root_module_xml(@foo).should have_nodes("#{order_entry_xpath}[@type='module-library', @exported='']/library/SOURCES/root", 1)
+ root_module_xml(@foo).should have_nodes("#{order_entry_xpath}[@type='module-library' and @exported='']/library/SOURCES/root", 1)
end
end
@@ -264,11 +264,11 @@ describe Buildr::IntellijIdea do
doc = xml_document(@foo._("foo.ipr"))
doc.should have_nodes("#{xpath_to_module}", 3)
module_ref = "$PROJECT_DIR$/foo.iml"
- doc.should have_xpath("#{xpath_to_module}[@fileurl='file://#{module_ref}', @filepath='#{module_ref}']")
+ doc.should have_xpath("#{xpath_to_module}[@fileurl='file://#{module_ref}' and @filepath='#{module_ref}']")
module_ref = "$PROJECT_DIR$/other.iml"
- doc.should have_xpath("#{xpath_to_module}[@fileurl='file://#{module_ref}', @filepath='#{module_ref}']")
+ doc.should have_xpath("#{xpath_to_module}[@fileurl='file://#{module_ref}' and @filepath='#{module_ref}']")
module_ref = "$PROJECT_DIR$/other_other.iml"
- doc.should have_xpath("#{xpath_to_module}[@fileurl='file://#{module_ref}', @filepath='#{module_ref}']")
+ doc.should have_xpath("#{xpath_to_module}[@fileurl='file://#{module_ref}' and @filepath='#{module_ref}']")
end
end
@@ -326,8 +326,8 @@ describe Buildr::IntellijIdea do
doc = xml_document(@foo._("foo.iml"))
facet_xpath = ensure_facet_xpath(doc, 'gwt', 'GWT')
prefix = "#{facet_xpath}/configuration/packaging/module"
- doc.should have_xpath("#{prefix}[@name='com.biz.MyModule', @enabled='true']")
- doc.should have_xpath("#{prefix}[@name='com.biz.MyOtherModule', @enabled='false']")
+ doc.should have_xpath("#{prefix}[@name='com.biz.MyModule' and @enabled='true']")
+ doc.should have_xpath("#{prefix}[@name='com.biz.MyOtherModule' and @enabled='false']")
end
end
@@ -402,7 +402,7 @@ describe Buildr::IntellijIdea do
it "generates a web facet with jsf facet auto-detected" do
doc = xml_document(@foo._("foo.iml"))
web_facet_xpath = ensure_facet_xpath(doc, 'web', 'Web')
- doc.should have_xpath("#{web_facet_xpath}/facet[@type='jsf', @name='JSF']")
+ doc.should have_xpath("#{web_facet_xpath}/facet[@type='jsf' and @name='JSF']")
end
end
@@ -419,7 +419,7 @@ describe Buildr::IntellijIdea do
it "does not generate a web facet with jsf facet" do
doc = xml_document(@foo._("foo.iml"))
web_facet_xpath = ensure_facet_xpath(doc, 'web', 'Web')
- doc.should_not have_xpath("#{web_facet_xpath}/facet[@type='jsf', @name='JSF']")
+ doc.should_not have_xpath("#{web_facet_xpath}/facet[@type='jsf' and @name='JSF']")
end
end
@@ -438,7 +438,7 @@ describe Buildr::IntellijIdea do
it "does not generate a web facet with jsf facet" do
doc = xml_document(@foo._("foo.iml"))
web_facet_xpath = ensure_facet_xpath(doc, 'web', 'Web')
- doc.should_not have_xpath("#{web_facet_xpath}/facet[@type='jsf', @name='JSF']")
+ doc.should_not have_xpath("#{web_facet_xpath}/facet[@type='jsf' and @name='JSF']")
end
end
@@ -457,7 +457,7 @@ describe Buildr::IntellijIdea do
it "does not generate a web facet with jsf facet" do
doc = xml_document(@foo._("foo.iml"))
web_facet_xpath = ensure_facet_xpath(doc, 'web', 'Web')
- doc.should_not have_xpath("#{web_facet_xpath}/facet[@type='jsf', @name='JSF']")
+ doc.should_not have_xpath("#{web_facet_xpath}/facet[@type='jsf' and @name='JSF']")
end
end
@@ -484,7 +484,7 @@ describe Buildr::IntellijIdea do
it "generates a web facet with derived webroots" do
doc = xml_document(@foo._("foo.iml"))
web_facet_xpath = ensure_facet_xpath(doc, 'web', 'Web')
- doc.should have_xpath("#{web_facet_xpath}/configuration/webroots/root[@url='file://$MODULE_DIR$/src/main/webapp', @realtive='/']")
+ doc.should have_xpath("#{web_facet_xpath}/configuration/webroots/root[@url='file://$MODULE_DIR$/src/main/webapp' and @realtive='/']")
end
end
@@ -507,8 +507,8 @@ describe Buildr::IntellijIdea do
it "generates a web facet with specified webroots" do
doc = xml_document(@foo._("foo.iml"))
web_facet_xpath = ensure_facet_xpath(doc, 'web', 'Web')
- doc.should have_xpath("#{web_facet_xpath}/configuration/webroots/root[@url='file://$MODULE_DIR$/src/main/webapp2', @realtive='/']")
- doc.should have_xpath("#{web_facet_xpath}/configuration/webroots/root[@url='file://$MODULE_DIR$/src/main/css', @realtive='/css']")
+ doc.should have_xpath("#{web_facet_xpath}/configuration/webroots/root[@url='file://$MODULE_DIR$/src/main/webapp2' and @realtive='/']")
+ doc.should have_xpath("#{web_facet_xpath}/configuration/webroots/root[@url='file://$MODULE_DIR$/src/main/css' and @realtive='/css']")
end
end
@@ -534,8 +534,8 @@ describe Buildr::IntellijIdea do
it "generates a jpa facet with default settings" do
doc = xml_document(@foo._("foo.iml"))
facet_xpath = ensure_facet_xpath(doc, 'jpa', 'JPA')
- doc.should have_xpath("#{facet_xpath}/configuration/setting[@name='validation-enabled', @value='true']")
- doc.should have_xpath("#{facet_xpath}/configuration/setting[@name='provider-name', @value='Hibernate']")
+ doc.should have_xpath("#{facet_xpath}/configuration/setting[@name='validation-enabled' and @value='true']")
+ doc.should have_xpath("#{facet_xpath}/configuration/setting[@name='provider-name' and @value='Hibernate']")
end
end
@@ -563,8 +563,8 @@ describe Buildr::IntellijIdea do
it "generates a jpa facet with default settings" do
doc = xml_document(@foo._("foo.iml"))
facet_xpath = ensure_facet_xpath(doc, 'jpa', 'JPA')
- doc.should have_xpath("#{facet_xpath}/configuration/setting[@name='validation-enabled', @value='true']")
- doc.should have_xpath("#{facet_xpath}/configuration/setting[@name='provider-name', @value='Hibernate']")
+ doc.should have_xpath("#{facet_xpath}/configuration/setting[@name='validation-enabled' and @value='true']")
+ doc.should have_xpath("#{facet_xpath}/configuration/setting[@name='provider-name' and @value='Hibernate']")
end
end
@@ -604,8 +604,8 @@ describe Buildr::IntellijIdea do
it "generates a jpa facet with default settings" do
doc = xml_document(@foo._("foo.iml"))
facet_xpath = ensure_facet_xpath(doc, 'jpa', 'JPA')
- doc.should have_xpath("#{facet_xpath}/configuration/setting[@name='validation-enabled', @value='true']")
- doc.should have_xpath("#{facet_xpath}/configuration/setting[@name='provider-name', @value='Hibernate']")
+ doc.should have_xpath("#{facet_xpath}/configuration/setting[@name='validation-enabled' and @value='true']")
+ doc.should have_xpath("#{facet_xpath}/configuration/setting[@name='provider-name' and @value='Hibernate']")
end
end
@@ -623,8 +623,8 @@ describe Buildr::IntellijIdea do
it "generates a jpa facet with default settings" do
doc = xml_document(@foo._("foo.iml"))
facet_xpath = ensure_facet_xpath(doc, 'jpa', 'JPA')
- doc.should have_xpath("#{facet_xpath}/configuration/setting[@name='validation-enabled', @value='true']")
- doc.should have_xpath("#{facet_xpath}/configuration/setting[@name='provider-name', @value='EclipseLink']")
+ doc.should have_xpath("#{facet_xpath}/configuration/setting[@name='validation-enabled' and @value='true']")
+ doc.should have_xpath("#{facet_xpath}/configuration/setting[@name='provider-name' and @value='EclipseLink']")
end
end
@@ -763,9 +763,9 @@ describe Buildr::IntellijIdea do
it "generates a data source manager with specified data source" do
doc = xml_document(@foo._("foo.ipr"))
- prefix_xpath = "/project/component[@name='DataSourceManagerImpl', @format='xml', @hash='3208837817']/data-source"
+ prefix_xpath = "/project/component[@name='DataSourceManagerImpl' and @format='xml' and @hash='3208837817']/data-source"
doc.should have_nodes(prefix_xpath, 1)
- ds_path = "#{prefix_xpath}[@source='LOCAL', @name='Postgres']"
+ ds_path = "#{prefix_xpath}[@source='LOCAL' and @name='Postgres']"
doc.should have_xpath(ds_path)
doc.should have_xpath("#{ds_path}/synchronize/text() = 'true'")
doc.should have_xpath("#{ds_path}/jdbc-driver/text() = 'org.postgresql.Driver'")
@@ -789,9 +789,9 @@ describe Buildr::IntellijIdea do
it "generates a data source manager with specified data source" do
doc = xml_document(@foo._("foo.ipr"))
- prefix_xpath = "/project/component[@name='DataSourceManagerImpl', @format='xml', @hash='3208837817']/data-source"
+ prefix_xpath = "/project/component[@name='DataSourceManagerImpl' and @format='xml' and @hash='3208837817']/data-source"
doc.should have_nodes(prefix_xpath, 1)
- ds_path = "#{prefix_xpath}[@source='LOCAL', @name='Postgres']"
+ ds_path = "#{prefix_xpath}[@source='LOCAL' and @name='Postgres']"
doc.should have_xpath(ds_path)
doc.should have_xpath("#{ds_path}/synchronize/text() = 'true'")
doc.should have_xpath("#{ds_path}/jdbc-driver/text() = 'org.postgresql.Driver'")
@@ -814,9 +814,9 @@ describe Buildr::IntellijIdea do
it "generates a data source manager with specified data source" do
doc = xml_document(@foo._("foo.ipr"))
- prefix_xpath = "/project/component[@name='DataSourceManagerImpl', @format='xml', @hash='3208837817']/data-source"
+ prefix_xpath = "/project/component[@name='DataSourceManagerImpl' and @format='xml' and @hash='3208837817']/data-source"
doc.should have_nodes(prefix_xpath, 1)
- ds_path = "#{prefix_xpath}[@source='LOCAL', @name='SqlServer']"
+ ds_path = "#{prefix_xpath}[@source='LOCAL' and @name='SqlServer']"
doc.should have_xpath(ds_path)
doc.should have_xpath("#{ds_path}/synchronize/text() = 'true'")
@@ -847,8 +847,8 @@ describe Buildr::IntellijIdea do
doc = xml_document(@foo._("foo.ipr"))
facet_xpath = "/project/component[@name='ArtifactManager']/artifact"
doc.should have_nodes(facet_xpath, 2)
- doc.should have_xpath("#{facet_xpath}[@type='jar', @name='MyFancy.jar']")
- doc.should have_xpath("#{facet_xpath}[@type='jar', @name='MyOtherFancy.jar']")
+ doc.should have_xpath("#{facet_xpath}[@type='jar' and @name='MyFancy.jar']")
+ doc.should have_xpath("#{facet_xpath}[@type='jar' and @name='MyOtherFancy.jar']")
end
end
@@ -995,8 +995,8 @@ describe Buildr::IntellijIdea do
doc.should have_xpath(facet_xpath)
doc.should have_xpath("#{facet_xpath}/output-path/text() = $PROJECT_DIR$/artifacts/bar")
- doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='directory' and @name='WEB-INF']/element[@id='directory', @name='classes']/element[@id='module-output' and @name='bar']")
- doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='directory' and @name='WEB-INF']/element[@id='directory', @name='lib']/element[@id='file-copy' and @path='$MAVEN_REPOSITORY$/net/sourceforge/jtds/jtds/1.2.7.XX/jtds-1.2.7.XX.jar']")
+ doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='directory' and @name='WEB-INF']/element[@id='directory' and @name='classes']/element[@id='module-output' and @name='bar']")
+ doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='directory' and @name='WEB-INF']/element[@id='directory' and @name='lib']/element[@id='file-copy' and @path='$MAVEN_REPOSITORY$/net/sourceforge/jtds/jtds/1.2.7.XX/jtds-1.2.7.XX.jar']")
doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='javaee-facet-resources' and @facet='bar/web/Web']")
end
end
@@ -1025,18 +1025,18 @@ describe Buildr::IntellijIdea do
it "generates an IPR with a war artifact" do
doc = xml_document(@foo._("foo.ipr"))
base_xpath = "/project/component[@name='ArtifactManager']/artifact"
- facet_xpath = "#{base_xpath}[@type='exploded-war' @name='MyFancy.jar', @build-on-make='false']"
+ facet_xpath = "#{base_xpath}[@type='exploded-war' @name='MyFancy.jar' and @build-on-make='false']"
doc.should have_xpath(facet_xpath)
doc.should have_xpath("#{facet_xpath}/output-path/text() = $PROJECT_DIR$/artifacts/gar")
- doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='directory' and @name='WEB-INF']/element[@id='directory', @name='classes']/element[@id='module-output' and @name='bar']")
- doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='directory' and @name='WEB-INF']/element[@id='directory', @name='lib']/element[@id='file-copy' and @path='$MAVEN_REPOSITORY$/net/sourceforge/jtds/jtds/1.2.7.XX/jtds-1.2.7.XX.jar']")
+ doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='directory' and @name='WEB-INF']/element[@id='directory' and @name='classes']/element[@id='module-output' and @name='bar']")
+ doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='directory' and @name='WEB-INF']/element[@id='directory' and @name='lib']/element[@id='file-copy' and @path='$MAVEN_REPOSITORY$/net/sourceforge/jtds/jtds/1.2.7.XX/jtds-1.2.7.XX.jar']")
doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='javaee-facet-resources' and @facet='x/web/Web']")
doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='javaee-facet-resources' and @facet='y/web/Web']")
doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='gwt-compiler-output' and @facet='p/gwt/GWT']")
doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='gwt-compiler-output' and @facet='q/gwt/GWT']")
- doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='directory' and @name='WEB-INF']/element[@id='directory', @name='lib']/element[@id='artifact' and @artifact-name='baz.jar']")
- doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='directory' and @name='WEB-INF']/element[@id='directory', @name='lib']/element[@id='artifact' and @artifact-name='biz.jar']")
+ doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='directory' and @name='WEB-INF']/element[@id='directory' and @name='lib']/element[@id='artifact' and @artifact-name='baz.jar']")
+ doc.should have_xpath("#{facet_xpath}/root[@id='root']/element[@id='directory' and @name='WEB-INF']/element[@id='directory' and @name='lib']/element[@id='artifact' and @artifact-name='biz.jar']")
end
end
@@ -1071,8 +1071,8 @@ describe Buildr::IntellijIdea do
doc = xml_document(@foo._("foo.ipr"))
facet_xpath = "/project/component[@name='ProjectRunConfigurationManager']/configuration"
doc.should have_nodes(facet_xpath, 2)
- doc.should have_xpath("#{facet_xpath}[@type='GWT.ConfigurationType', @name='Run Contacts.html']")
- doc.should have_xpath("#{facet_xpath}[@type='GWT.ConfigurationType', @name='Run Planner.html']")
+ doc.should have_xpath("#{facet_xpath}[@type='GWT.ConfigurationType' and @name='Run Contacts.html']")
+ doc.should have_xpath("#{facet_xpath}[@type='GWT.ConfigurationType' and @name='Run Planner.html']")
end
end
@@ -1097,7 +1097,7 @@ describe Buildr::IntellijIdea do
doc = xml_document(@foo._("foo.ipr"))
facet_xpath = "/project/component[@name='ProjectRunConfigurationManager']/configuration"
doc.should have_nodes(facet_xpath, 1)
- doc.should have_xpath("#{facet_xpath}[@type='GWT.ConfigurationType' AND @factoryName='GWT Configuration' AND @default='true']")
+ doc.should have_xpath("#{facet_xpath}[@type='GWT.ConfigurationType' and @factoryName='GWT Configuration' and @default='true']")
end
end
@@ -1121,13 +1121,13 @@ describe Buildr::IntellijIdea do
doc = xml_document(@foo._("foo.ipr"))
doc.should have_nodes("#{xpath_to_module}", 4)
module_ref = "$PROJECT_DIR$/foo.iml"
- doc.should have_xpath("#{xpath_to_module}[@fileurl='file://#{module_ref}', @filepath='#{module_ref}']")
+ doc.should have_xpath("#{xpath_to_module}[@fileurl='file://#{module_ref}' and @filepath='#{module_ref}']")
module_ref = "$PROJECT_DIR$/rab/rab.iml"
- doc.should have_xpath("#{xpath_to_module}[@fileurl='file://#{module_ref}', @filepath='#{module_ref}' @group = 'MyGroup']")
+ doc.should have_xpath("#{xpath_to_module}[@fileurl='file://#{module_ref}' and @filepath='#{module_ref}' @group = 'MyGroup']")
module_ref = "$PROJECT_DIR$/bar/bar.iml"
- doc.should have_xpath("#{xpath_to_module}[@fileurl='file://#{module_ref}', @filepath='#{module_ref}' @group = 'foo']")
+ doc.should have_xpath("#{xpath_to_module}[@fileurl='file://#{module_ref}' and @filepath='#{module_ref}' @group = 'foo']")
module_ref = "$PROJECT_DIR$/bar/baz/baz.iml"
- doc.should have_xpath("#{xpath_to_module}[@fileurl='file://#{module_ref}', @filepath='#{module_ref}' @group = 'foo/bar']")
+ doc.should have_xpath("#{xpath_to_module}[@fileurl='file://#{module_ref}' and @filepath='#{module_ref}' @group = 'foo/bar']")
end
end
@@ -1158,7 +1158,7 @@ describe Buildr::IntellijIdea do
File.should be_exist(@foo._("foo.ipr"))
doc = xml_document(@foo._("foo.ipr"))
module_ref = "$PROJECT_DIR$/foo.iml"
- doc.should have_nodes("#{xpath_to_module}[@fileurl='file://#{module_ref}', @filepath='#{module_ref}']", 1)
+ doc.should have_nodes("#{xpath_to_module}[@fileurl='file://#{module_ref}' and @filepath='#{module_ref}']", 1)
end
end
@@ -1226,7 +1226,7 @@ describe Buildr::IntellijIdea do
File.should be_exist(@foo._("fooble.ipr"))
doc = xml_document(@foo._("fooble.ipr"))
module_ref = "$PROJECT_DIR$/feap.iml"
- doc.should have_nodes("#{xpath_to_module}[@fileurl='file://#{module_ref}', @filepath='#{module_ref}']", 1)
+ doc.should have_nodes("#{xpath_to_module}[@fileurl='file://#{module_ref}' and @filepath='#{module_ref}']", 1)
end
end
@@ -1252,7 +1252,7 @@ describe Buildr::IntellijIdea do
doc = xml_document(@foo._("foo-ipr-suffix.ipr"))
doc.should have_nodes("#{xpath_to_module}", 1)
module_ref = "$PROJECT_DIR$/foo-iml-suffix.iml"
- doc.should have_nodes("#{xpath_to_module}[@fileurl='file://#{module_ref}', @filepath='#{module_ref}']", 1)
+ doc.should have_nodes("#{xpath_to_module}[@fileurl='file://#{module_ref}' and @filepath='#{module_ref}']", 1)
end
end
end
@@ -1278,9 +1278,9 @@ describe Buildr::IntellijIdea do
doc = xml_document(@foo._("foo.ipr"))
doc.should have_nodes("#{xpath_to_module}", 2)
module_ref = "$PROJECT_DIR$/foo.iml"
- doc.should have_nodes("#{xpath_to_module}[@fileurl='file://#{module_ref}', @filepath='#{module_ref}']", 1)
+ doc.should have_nodes("#{xpath_to_module}[@fileurl='file://#{module_ref}' and @filepath='#{module_ref}']", 1)
module_ref = "$PROJECT_DIR$/bar/bar.iml"
- doc.should have_nodes("#{xpath_to_module}[@fileurl='file://#{module_ref}', @filepath='#{module_ref}']", 1)
+ doc.should have_nodes("#{xpath_to_module}[@fileurl='file://#{module_ref}' and @filepath='#{module_ref}']", 1)
end
end
@@ -1317,7 +1317,7 @@ describe Buildr::IntellijIdea do
doc = xml_document(@foo._("foo.ipr"))
doc.should have_nodes("#{xpath_to_module}", 5)
["foo.iml", "fe/bar.iml", "fi/baz.iml", "fi/foe/foe.iml", "fe/fum/fum.iml"].each do |module_ref|
- doc.should have_nodes("#{xpath_to_module}[@fileurl='file://$PROJECT_DIR$/#{module_ref}', @filepath='$PROJECT_DIR$/#{module_ref}']", 1)
+ doc.should have_nodes("#{xpath_to_module}[@fileurl='file://$PROJECT_DIR$/#{module_ref}' and @filepath='$PROJECT_DIR$/#{module_ref}']", 1)
end
end
end
@@ -1356,7 +1356,7 @@ describe Buildr::IntellijIdea do
end
it "depends on the associated module exactly once" do
- @bar_iml.should have_nodes("//orderEntry[@type='module', @module-name='foo', @exported=""]", 1)
+ @bar_iml.should have_nodes("//orderEntry[@type='module' and @module-name='foo' and @exported=""]", 1)
end
it "does not depend on the other project's packaged JAR" do
[5/8] git commit: Correct test to check for scope rather than exports
attribtue
Posted by do...@apache.org.
Correct test to check for scope rather than exports attribtue
Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/03bd79fc
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/03bd79fc
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/03bd79fc
Branch: refs/heads/master
Commit: 03bd79fc59280f0be413884e4ad05a737260e102
Parents: 35fa29a
Author: Peter Donald <pe...@realityforge.org>
Authored: Sun May 25 17:18:57 2014 +1000
Committer: Peter Donald <pe...@realityforge.org>
Committed: Sun May 25 17:18:57 2014 +1000
----------------------------------------------------------------------
spec/ide/idea_spec.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/buildr/blob/03bd79fc/spec/ide/idea_spec.rb
----------------------------------------------------------------------
diff --git a/spec/ide/idea_spec.rb b/spec/ide/idea_spec.rb
index 50cfe03..15f7781 100644
--- a/spec/ide/idea_spec.rb
+++ b/spec/ide/idea_spec.rb
@@ -136,7 +136,7 @@ describe Buildr::IntellijIdea do
end
it "generates one exported 'module-library' orderEntry in IML" do
- root_module_xml(@foo).should have_nodes("#{order_entry_xpath}[@type='module-library' and @exported='']/library/CLASSES/root", 1)
+ root_module_xml(@foo).should have_nodes("#{order_entry_xpath}[@type='module-library' and @scope='TEST']/library/CLASSES/root", 1)
end
end