(MODULES-1749) Update java_version fact...
with maximum memory size Add -Xmx8m to make large systems happy.
This commit is contained in:
committed by
Peter Souter
parent
3124798492
commit
79805000cc
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user