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 2013/10/01 11:28:27 UTC

svn commit: r1527987 - /buildr/trunk/spec/ide/idea_spec.rb

Author: donaldp
Date: Tue Oct  1 09:28:27 2013
New Revision: 1527987

URL: http://svn.apache.org/r1527987
Log:
Add some basic tests around add_exploded_war_artifact

Modified:
    buildr/trunk/spec/ide/idea_spec.rb

Modified: buildr/trunk/spec/ide/idea_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/ide/idea_spec.rb?rev=1527987&r1=1527986&r2=1527987&view=diff
==============================================================================
--- buildr/trunk/spec/ide/idea_spec.rb (original)
+++ buildr/trunk/spec/ide/idea_spec.rb Tue Oct  1 09:28:27 2013
@@ -835,6 +835,35 @@ describe Buildr::IntellijIdea do
       end
     end
 
+    describe "that uses add_exploded_war_artifact with no overrides" do
+      before do
+        write 'foo/bar/src/main/java/foo/Foo.java' # needed so that buildr will treat as a java project
+        artifact('net.sourceforge.jtds:jtds:jar:1.2.7.XX') { |task| write task.name }
+
+        @foo = define "foo" do
+          project.version = '1.0'
+          define "bar" do
+            compile.with 'net.sourceforge.jtds:jtds:jar:1.2.7.XX'
+            package :war
+          end
+          ipr.add_exploded_war_artifact(project("bar"))
+        end
+        invoke_generate_task
+      end
+
+      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']"
+        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='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']")
+      end
+    end
+
     describe "with configurations added to root project" do
       before do
         @foo = define "foo" do