(MODULES-1749) Update java_version fact...

with maximum memory size

Add -Xmx8m to make large systems happy.
This commit is contained in:
Oliver Falk
2015-02-06 12:47:23 +00:00
committed by Peter Souter
parent 3124798492
commit 79805000cc
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
if Facter::Util::Resolution.which('java')
Facter.add(:java_version) 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
+2 -2
View File
@@ -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)
EOS
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"
end
end
@@ -27,4 +27,4 @@ Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
end
end
end
end
end