Merge pull request #106 from petems/improve_java_version_fact_with_args
(MODULES-1749) Update java_version fact with maximum memory size
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
if Facter::Util::Resolution.which('java')
|
if Facter::Util::Resolution.which('java')
|
||||||
Facter.add(:java_version) do
|
Facter.add(:java_version) do
|
||||||
setcode do
|
setcode do
|
||||||
Facter::Util::Resolution.exec('java -version 2>&1').lines.first.split(/"/)[1].strip
|
Facter::Util::Resolution.exec('java -Xmx8m -version 2>&1').lines.first.split(/"/)[1].strip
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
|
|||||||
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
|
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
|
||||||
EOS
|
EOS
|
||||||
Facter::Util::Resolution.expects(:which).with("java").returns(true)
|
Facter::Util::Resolution.expects(:which).with("java").returns(true)
|
||||||
Facter::Util::Resolution.expects(:exec).with("java -version 2>&1").returns(java_version_output)
|
Facter::Util::Resolution.expects(:exec).with("java -Xmx8m -version 2>&1").returns(java_version_output)
|
||||||
Facter.fact(:java_version).value.should == "1.7.0_71"
|
Facter.fact(:java_version).value.should == "1.7.0_71"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -27,4 +27,4 @@ Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user