summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradamedx <adamed@opscode.com>2014-03-31 09:48:02 -0700
committeradamedx <adamed@opscode.com>2014-03-31 09:48:02 -0700
commit2d0d205f60baacc13a58a45cb94de04b495864e6 (patch)
treec2ed7e0d128080b39532fb0286aca9cec4e8e7a5
parent87d56cf6322afc0cbb659e070d62775e73a63ce0 (diff)
parentf4dcc0b5772591fa0cd6fe4500ef297ef57a1c4f (diff)
downloadohai-2d0d205f60baacc13a58a45cb94de04b495864e6.tar.gz
Merge branch 'OHAI-550' into adamed/merge-2014-03-31
-rw-r--r--lib/ohai/plugins/java.rb2
-rw-r--r--spec/unit/plugins/java_spec.rb18
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/ohai/plugins/java.rb b/lib/ohai/plugins/java.rb
index e8321de6..9f71eb7f 100644
--- a/lib/ohai/plugins/java.rb
+++ b/lib/ohai/plugins/java.rb
@@ -22,7 +22,7 @@ Ohai.plugin(:Java) do
def get_java_info
java = Mash.new
- so = shell_out("java -version")
+ so = shell_out("java -mx64m -version")
if so.exitstatus == 0
so.stderr.split(/\r?\n/).each do |line|
case line
diff --git a/spec/unit/plugins/java_spec.rb b/spec/unit/plugins/java_spec.rb
index 13f29996..a56e0e1e 100644
--- a/spec/unit/plugins/java_spec.rb
+++ b/spec/unit/plugins/java_spec.rb
@@ -28,11 +28,11 @@ describe Ohai::System, "plugin java (Java5 Client VM)" do
shared_examples_for "when the JRE is installed" do
before do
@stderr = "java version \"1.5.0_16\"\nJava(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)\nJava HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)"
- @plugin.stub(:shell_out).with("java -version").and_return(mock_shell_out(0, "", @stderr))
+ @plugin.stub(:shell_out).with("java -mx64m -version").and_return(mock_shell_out(0, "", @stderr))
end
- it "should run java -version" do
- @plugin.should_receive(:shell_out).with("java -version").and_return(mock_shell_out(0, "", @stderr))
+ it "should run java -mx64m -version" do
+ @plugin.should_receive(:shell_out).with("java -mx64m -version").and_return(mock_shell_out(0, "", @stderr))
@plugin.run
end
@@ -63,7 +63,7 @@ describe Ohai::System, "plugin java (Java5 Client VM)" do
it "should not set the languages[:java] tree up if java command fails" do
@stderr = "Some error output here"
- @plugin.stub(:shell_out).with("java -version").and_return(mock_shell_out(1, "", @stderr))
+ @plugin.stub(:shell_out).with("java -mx64m -version").and_return(mock_shell_out(1, "", @stderr))
@plugin.run
@plugin[:languages].should_not have_key(:java)
end
@@ -73,11 +73,11 @@ describe Ohai::System, "plugin java (Java5 Client VM)" do
before(:each) do
@stderr = "java version \"1.6.0_22\"\nJava(TM) 2 Runtime Environment (build 1.6.0_22-b04)\nJava HotSpot(TM) Server VM (build 17.1-b03, mixed mode)"
- @plugin.stub(:shell_out).with("java -version").and_return(mock_shell_out(0, "", @stderr))
+ @plugin.stub(:shell_out).with("java -mx64m -version").and_return(mock_shell_out(0, "", @stderr))
end
- it "should run java -version" do
- @plugin.should_receive(:shell_out).with("java -version").and_return(mock_shell_out(0, "", @stderr))
+ it "should run java -mx64m -version" do
+ @plugin.should_receive(:shell_out).with("java -mx64m -version").and_return(mock_shell_out(0, "", @stderr))
@plugin.run
end
@@ -108,7 +108,7 @@ describe Ohai::System, "plugin java (Java5 Client VM)" do
it "should not set the languages[:java] tree up if java command fails" do
@stderr = "Some error output here"
- @plugin.stub(:shell_out).with("java -version").and_return(mock_shell_out(0, "", @stderr))
+ @plugin.stub(:shell_out).with("java -mx64m -version").and_return(mock_shell_out(0, "", @stderr))
@plugin.run
@plugin[:languages].should_not have_key(:java)
end
@@ -159,7 +159,7 @@ describe Ohai::System, "plugin java (Java5 Client VM)" do
end
it "does not attempt to get java info" do
- @plugin.should_not_receive(:shell_out).with("java -version")
+ @plugin.should_not_receive(:shell_out).with("java -mx64m -version")
@plugin.run
@plugin[:languages].should_not have_key(:java)
end