Add Java alternatives for RHEL based distros.
This commit is contained in:
@@ -15,6 +15,15 @@ describe 'java', :type => :class do
|
||||
context 'select openjdk for Centos 6.2' do
|
||||
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Centos', :operatingsystemrelease => '6.2'} }
|
||||
it { should contain_package('java').with_name('java-1.6.0-openjdk-devel') }
|
||||
it { should_not contain_exec('update-java-alternatives') }
|
||||
end
|
||||
|
||||
context 'select Oracle JRE with alternatives for Centos 6.3' do
|
||||
let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'Centos', :operatingsystemrelease => '6.3'} }
|
||||
let(:params) { { 'package' => 'jre', 'java_alternative' => '/usr/bin/java', 'java_alternative_path' => '/usr/java/jre1.7.0_67/bin/java'} }
|
||||
it { should contain_package('java').with_name('jre') }
|
||||
it { should contain_exec('create-java-alternatives').with_command('alternatives --install /usr/bin/java java /usr/java/jre1.7.0_67/bin/java 20000') }
|
||||
it { should contain_exec('update-java-alternatives').with_command('alternatives --set java /usr/java/jre1.7.0_67/bin/java') }
|
||||
end
|
||||
|
||||
context 'select openjdk for Fedora' do
|
||||
@@ -48,7 +57,7 @@ describe 'java', :type => :class do
|
||||
end
|
||||
|
||||
context 'select Oracle JRE for Debian Wheezy' do
|
||||
let(:facts) { {:osfamily => 'Debian', :operatingsystem => 'Debian', :lsbdistcodename => 'wheezy', :operatingsystemrelease => '7.1', } }
|
||||
let(:facts) { {:osfamily => 'Debian', :operatingsystem => 'Debian', :lsbdistcodename => 'wheezy', :operatingsystemrelease => '7.1', :architecture => 'amd64',} }
|
||||
let(:params) { { 'distribution' => 'oracle-jre' } }
|
||||
it { should contain_package('java').with_name('oracle-j2re1.7') }
|
||||
it { should contain_exec('update-java-alternatives').with_command('update-java-alternatives --set j2re1.7-oracle --jre') }
|
||||
@@ -61,14 +70,14 @@ describe 'java', :type => :class do
|
||||
end
|
||||
|
||||
context 'select Oracle JRE for Debian Squeeze' do
|
||||
let(:facts) { {:osfamily => 'Debian', :operatingsystem => 'Debian', :lsbdistcodename => 'squeeze', :operatingsystemrelease => '6.0.5'} }
|
||||
let(:facts) { {:osfamily => 'Debian', :operatingsystem => 'Debian', :lsbdistcodename => 'squeeze', :operatingsystemrelease => '6.0.5', :architecture => 'amd64',} }
|
||||
let(:params) { { 'distribution' => 'sun-jre', } }
|
||||
it { should contain_package('java').with_name('sun-java6-jre') }
|
||||
it { should contain_exec('update-java-alternatives').with_command('update-java-alternatives --set java-6-sun --jre') }
|
||||
end
|
||||
|
||||
context 'select random alternative for Debian Wheezy' do
|
||||
let(:facts) { {:osfamily => 'Debian', :operatingsystem => 'Debian', :lsbdistcodename => 'wheezy', :operatingsystemrelease => '7.1'} }
|
||||
let(:facts) { {:osfamily => 'Debian', :operatingsystem => 'Debian', :lsbdistcodename => 'wheezy', :operatingsystemrelease => '7.1', :architecture => 'amd64',} }
|
||||
let(:params) { { 'java_alternative' => 'bananafish' } }
|
||||
it { should contain_package('java').with_name('openjdk-7-jdk') }
|
||||
it { should contain_exec('update-java-alternatives').with_command('update-java-alternatives --set bananafish --jre') }
|
||||
|
||||
Reference in New Issue
Block a user