@@ -32,8 +32,8 @@ class java::params {
|
||||
}
|
||||
}
|
||||
'Fedora': {
|
||||
$jdk_package = 'java'
|
||||
$jre_package = 'java'
|
||||
$jdk_package = 'java-1.7.0-openjdk-devel'
|
||||
$jre_package = 'java-1.7.0-openjdk'
|
||||
}
|
||||
'Amazon': {
|
||||
$jdk_package = 'java-1.7.0-openjdk-devel'
|
||||
|
||||
@@ -17,6 +17,17 @@ describe 'java', :type => :class do
|
||||
it { should contain_package('java').with_name('java-1.6.0-openjdk-devel') }
|
||||
end
|
||||
|
||||
context 'select openjdk for Fedora' do
|
||||
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Fedora'} }
|
||||
it { should contain_package('java').with_name('java-1.7.0-openjdk-devel') }
|
||||
end
|
||||
|
||||
context 'select passed value for Fedora' do
|
||||
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Fedora'} }
|
||||
let(:params) { { 'distribution' => 'jre' } }
|
||||
it { should contain_package('java').with_name('java-1.7.0-openjdk') }
|
||||
end
|
||||
|
||||
context 'select passed value for Centos 5.3' do
|
||||
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Centos', :operatingsystemrelease => '5.3'} }
|
||||
let(:params) { { 'package' => 'jdk' } }
|
||||
@@ -27,13 +38,13 @@ describe 'java', :type => :class do
|
||||
context 'select default for Centos 5.3' do
|
||||
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Centos', :operatingsystemrelease => '5.3'} }
|
||||
it { should contain_package('java').with_name('java-1.6.0-openjdk-devel') }
|
||||
it { should_not contain_exec('update-java-alternatives') }
|
||||
it { should_not contain_exec('update-java-alternatives') }
|
||||
end
|
||||
|
||||
context 'select default for Debian Wheezy' do
|
||||
let(:facts) { {:osfamily => 'Debian', :operatingsystem => 'Debian', :lsbdistcodename => 'wheezy', :operatingsystemrelease => '7.1', :architecture => 'amd64',} }
|
||||
it { should contain_package('java').with_name('openjdk-7-jdk') }
|
||||
it { should contain_exec('update-java-alternatives').with_command('update-java-alternatives --set java-1.7.0-openjdk-amd64 --jre') }
|
||||
it { should contain_exec('update-java-alternatives').with_command('update-java-alternatives --set java-1.7.0-openjdk-amd64 --jre') }
|
||||
end
|
||||
|
||||
context 'select Oracle JRE for Debian Wheezy' do
|
||||
@@ -46,7 +57,7 @@ describe 'java', :type => :class do
|
||||
context 'select default for Debian Squeeze' do
|
||||
let(:facts) { {:osfamily => 'Debian', :operatingsystem => 'Debian', :lsbdistcodename => 'squeeze', :operatingsystemrelease => '6.0.5'} }
|
||||
it { should contain_package('java').with_name('openjdk-6-jdk') }
|
||||
it { should contain_exec('update-java-alternatives').with_command('update-java-alternatives --set java-6-openjdk --jre') }
|
||||
it { should contain_exec('update-java-alternatives').with_command('update-java-alternatives --set java-6-openjdk --jre') }
|
||||
end
|
||||
|
||||
context 'select Oracle JRE for Debian Squeeze' do
|
||||
|
||||
Reference in New Issue
Block a user