Merge "Remove salt-master, reclass from pkg dependencis"
diff --git a/.kitchen.travis.yml b/.kitchen.travis.yml
deleted file mode 100644
index 5ca6369..0000000
--- a/.kitchen.travis.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-suites:
-
-  - name: <%= ENV['SUITE'] %>
-    provisioner:
-      pillars-from-files:
-        java.sls: tests/pillar/<%= ENV['SUITE'] %>.sls
diff --git a/.kitchen.yml b/.kitchen.yml
index 8441ac3..c338a04 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -47,14 +47,19 @@
       pillars-from-files:
         java.sls: tests/pillar/openjdk-8.sls
 
-  - name: oracle-jdk-7
+  - name: openjdk-9
     provisioner:
       pillars-from-files:
-        java.sls: tests/pillar/oracle-jdk-7.sls
+        java.sls: tests/pillar/openjdk-9.sls
 
   - name: oracle-jdk-8
     provisioner:
       pillars-from-files:
         java.sls: tests/pillar/oracle-jdk-8.sls
 
+  - name: oracle-jdk-9
+    provisioner:
+      pillars-from-files:
+        java.sls: tests/pillar/oracle-jdk-9.sls
+
 # vim: ft=yaml sw=2 ts=2 sts=2 tw=125
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index f3496bd..8c8060c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,16 +18,18 @@
 
 env:
     - PLATFORM=trevorj/salty-whales:trusty SUITE=openjdk-7
-    - PLATFORM=trevorj/salty-whales:trusty SUITE=oracle-jdk-7
     - PLATFORM=trevorj/salty-whales:xenial SUITE=openjdk-8
+    - PLATFORM=trevorj/salty-whales:xenial SUITE=openjdk-9
     - PLATFORM=trevorj/salty-whales:xenial SUITE=oracle-jdk-8
+    - PLATFORM=trevorj/salty-whales:xenial SUITE=oracle-jdk-9
 
 before_script:
   - set -o pipefail
   - make test | tail
 
 script:
-  - KITCHEN_LOCAL_YAML=.kitchen.travis.yml bundle exec kitchen test -t tests/integration
+  - test ! -e .kitchen.yml || bundle exec kitchen converge ${SUITE} || true
+  - test ! -e .kitchen.yml || bundle exec kitchen verify ${SUITE} -t tests/integration
 
 notifications:
   webhooks:
diff --git a/README.rst b/README.rst
index 789c759..5ebd680 100644
--- a/README.rst
+++ b/README.rst
@@ -7,25 +7,38 @@
 Sample pillars
 ==============
 
-OpenJDK environment with development libs
+OpenJDK 8 environment with development libs
 
 .. code-block:: yaml
 
     java:
       environment:
         enabled: true
-        version: '7'
+        version: '8'
         platform: openjdk
         development: true
 
-Oracle JAVA JDK
+Oracle JAVA JDK 8
 
 .. code-block:: yaml
 
     java:
       environment:
         enabled: true
-        version: '7'
+        version: '8'
+        platform: oracle-java
+        development: true
+
+Oracle JAVA JDK 9
+
+.. code-block:: yaml
+
+    java:
+      environment:
+        enabled: true
+        version: '9'
+        release: '0.1'
+        build: '11'
         platform: oracle-java
         development: true
 
diff --git a/java/map.jinja b/java/map.jinja
index 8fb7f5a..fe7baca 100644
--- a/java/map.jinja
+++ b/java/map.jinja
@@ -6,9 +6,6 @@
 {% elif java_version == '8' %}
 {% set java_release = '60' %}
 {% set java_build = '27' %}
-{% else %}
-{% set java_release = '666' %}
-{% set java_build = '666' %}
 {% endif %}
 
 {%- if pillar.java.environment.get('headless', False) %}
@@ -35,24 +32,24 @@
     },
 }, merge=salt['pillar.get']('java:environment')) %}
 
+{%- if environment.platform == 'oracle-java' %}
 {%- set java_home = environment.home_dir %}
 {%- set prefix = '/usr/share/java' %}
 {%- set oracle_cookie = 'Cookie: oraclelicense=accept-securebackup-cookie' %}
 {%- set dl_opts = '-LOH' %}
-{%- if java_version == 7 %}
-{%- set source_url = salt['cmd.run']('curl -s https://lv.binarybabel.org/catalog-api/java/jdk7.txt?p=downloads.tgz') %}
-{%- set version_name = salt['cmd.run']('curl -s https://lv.binarybabel.org/catalog-api/java/jdk7.txt?p=version') %}
-{%- set oracle_file_name = 'jdk-' + salt['cmd.run']('curl -s https://lv.binarybabel.org/catalog-api/java/jdk7.txt?p=version_parsed.major') + 'u' + salt['cmd.run']('curl -s https://lv.binarybabel.org/catalog-api/java/jdk7.txt?p=version_parsed.minor') + '-linux-x64.tar.gz' %}
-{%- elif java_version == 9 %}
-{%- set source_url = salt['cmd.run']('curl -s https://lv.binarybabel.org/catalog-api/java/jdk9.txt?p=downloads.tgz') %}
-{%- set version_name = salt['cmd.run']('curl -s https://lv.binarybabel.org/catalog-api/java/jdk9.txt?p=version') %}
-{%- set oracle_file_name = 'jdk-' + salt['cmd.run']('curl -s https://lv.binarybabel.org/catalog-api/java/jdk9.txt?p=version_parsed.major') + 'u' + salt['cmd.run']('curl -s https://lv.binarybabel.org/catalog-api/java/jdk9.txt?p=version_parsed.minor') + '-linux-x64.tar.gz' %}
-{% else %}
+{%- if java_version == '8' %}
 {%- set source_url = salt['cmd.run']('curl -s https://lv.binarybabel.org/catalog-api/java/jdk8.txt?p=downloads.tgz') %}
 {%- set version_name = salt['cmd.run']('curl -s https://lv.binarybabel.org/catalog-api/java/jdk8.txt?p=version') %}
 {%- set oracle_file_name = 'jdk-' + salt['cmd.run']('curl -s https://lv.binarybabel.org/catalog-api/java/jdk8.txt?p=version_parsed.major') + 'u' + salt['cmd.run']('curl -s https://lv.binarybabel.org/catalog-api/java/jdk8.txt?p=version_parsed.minor') + '-linux-x64.tar.gz' %}
+{%- elif java_version == '9' %}
+{%- set java_build = environment.build %}
+{%- set java_release = environment.release %}
+{%- set version_name = java_version + '.' + java_release + '+' + java_build %}
+{%- set oracle_file_name = 'jdk-' + java_version + '.' + java_release + '_linux-x64_bin.tar.gz' %}
+{%- set source_url = 'http://download.oracle.com/otn-pub/java/jdk/' + version_name + '/' + oracle_file_name %}
 {%- endif %}
 {%- set java_real_home = prefix + '/' + version_name %}
+{%- endif %}
 
 {%- do environment.update( { 'version_name' : version_name,
     'source_url' : source_url,
@@ -62,4 +59,4 @@
     'java_home' : java_home,
     'prefix' : prefix,
     'java_real_home' : java_real_home
-}) %}
+}) %}
\ No newline at end of file
diff --git a/tests/pillar/openjdk-9.sls b/tests/pillar/openjdk-9.sls
new file mode 100644
index 0000000..03bf307
--- /dev/null
+++ b/tests/pillar/openjdk-9.sls
@@ -0,0 +1,6 @@
+java:
+  environment:
+    enabled: true
+    version: '9'
+    platform: openjdk
+    development: false
diff --git a/tests/pillar/oracle-jdk-7.sls b/tests/pillar/oracle-jdk-9.sls
similarity index 62%
rename from tests/pillar/oracle-jdk-7.sls
rename to tests/pillar/oracle-jdk-9.sls
index 5d78917..9b7135f 100644
--- a/tests/pillar/oracle-jdk-7.sls
+++ b/tests/pillar/oracle-jdk-9.sls
@@ -1,6 +1,8 @@
 java:
   environment:
     enabled: true
-    version: '7'
+    version: '9'
+    release: '0.1'
+    build: '11'
     platform: oracle-java
     development: true