Add Salt 2018.3 tests
- remove oracle-jdk-9 tests - package is not publicly available for download
- add oracle-jdk-10 tests

Change-Id: I96793d6927562b6917ca602cd18b653b7cfc85d2
diff --git a/.kitchen.yml b/.kitchen.yml
index f494b9b..4f776d8 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -32,7 +32,7 @@
 platforms:
   - name: <%=ENV['PLATFORM'] ||  'saltstack-ubuntu-xenial-salt-stable' %>
     driver_config:
-      image: <%=ENV['PLATFORM'] || 'epcim/salt-formulas:saltstack-ubuntu-xenial-salt-stable'%>
+      image: <%=ENV['PLATFORM'] || 'epcim/salt:saltstack-ubuntu-xenial-salt-stable'%>
       platform: ubuntu
 
 suites:
@@ -52,6 +52,11 @@
       pillars-from-files:
         java.sls: tests/pillar/openjdk-9.sls
 
+  - name: openjdk-10
+    provisioner:
+      pillars-from-files:
+        java.sls: tests/pillar/openjdk-10.sls
+
   - name: oracle-jdk-8
     provisioner:
       pillars-from-files:
@@ -62,4 +67,8 @@
       pillars-from-files:
         java.sls: tests/pillar/oracle-jdk-9.sls
 
+  - name: oracle-jdk-10
+    provisioner:
+      pillars-from-files:
+        java.sls: tests/pillar/oracle-jdk-10.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 dbd573c..f44c2ff 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,14 +17,26 @@
   - bundle install
 
 env:
-    - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-xenial-salt-2017.7 SUITE=openjdk-8
-    - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-xenial-salt-2017.7 SUITE=openjdk-9
-    - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-xenial-salt-2017.7 SUITE=oracle-jdk-8
-    - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-xenial-salt-2017.7 SUITE=oracle-jdk-9
-#    - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-bionic-salt-2017.7 SUITE=openjdk-8
-#    - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-bionic-salt-2017.7 SUITE=openjdk-9
-#    - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-bionic-salt-2017.7 SUITE=oracle-jdk-8
-#    - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-bionic-salt-2017.7 SUITE=oracle-jdk-9
+    - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 SUITE=openjdk-8
+    - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 SUITE=openjdk-9
+    - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 SUITE=openjdk-10
+    - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 SUITE=oracle-jdk-8
+    - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 SUITE=oracle-jdk-10
+    - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 SUITE=openjdk-8
+    - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 SUITE=openjdk-9
+    - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 SUITE=openjdk-10
+    - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 SUITE=oracle-jdk-8
+    - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 SUITE=oracle-jdk-10
+#    - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2017.7 SUITE=openjdk-8
+#    - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2017.7 SUITE=openjdk-9
+#    - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2017.7 SUITE=openjdk-10
+#    - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2017.7 SUITE=oracle-jdk-8
+#    - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2017.7 SUITE=oracle-jdk-10
+#    - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2018.3 SUITE=openjdk-8
+#    - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2018.3 SUITE=openjdk-9
+#    - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2018.3 SUITE=openjdk-10
+#    - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2018.3 SUITE=oracle-jdk-8
+#    - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2018.3 SUITE=oracle-jdk-10
 
 before_script:
   - set -o pipefail
diff --git a/README.rst b/README.rst
index 5ebd680..c03f7eb 100644
--- a/README.rst
+++ b/README.rst
@@ -18,6 +18,22 @@
         platform: openjdk
         development: true
 
+OpenJDK 10
+
+.. code-block:: yaml
+
+    java:
+      environment:
+        enabled: true
+        version: '10'
+        release: '0.1'
+        platform: openjdk
+        oracle_hash: 'fb4372174a714e6b8c52526dc134031e'
+        sha256_hash: '0b14aaecd5323457bd15dc7798d08181ad04bad4156e55387ed714190912a9ce'
+        verify_sha256_hash: true
+        development: false
+
+
 Oracle JAVA JDK 8
 
 .. code-block:: yaml
@@ -29,16 +45,17 @@
         platform: oracle-java
         development: true
 
-Oracle JAVA JDK 9
+Oracle JAVA JDK 10
 
 .. code-block:: yaml
 
     java:
       environment:
         enabled: true
-        version: '9'
+        version: '10'
         release: '0.1'
-        build: '11'
+        build: '10'
+        oracle_hash: 'fb4372174a714e6b8c52526dc134031e'
         platform: oracle-java
         development: true
 
diff --git a/java/environment/openjdk.sls b/java/environment/openjdk.sls
index f9b1784..78df73a 100644
--- a/java/environment/openjdk.sls
+++ b/java/environment/openjdk.sls
@@ -1,5 +1,20 @@
 {%- from "java/map.jinja" import environment with context %}
 
+{%- if environment.version == '10' %}
+
+java_archive:
+  archive.extracted:
+    - name: {{ environment.home_dir }}
+    - source: https://download.java.net/java/GA/jdk{{ environment.version }}/{{ environment.version }}.{{ environment.release}}/{{ environment.oracle_hash }}/{{ environment.version }}/openjdk-{{ environment.version }}.{{ environment.release}}_linux-x64_bin.tar.gz
+    - options: zxvf
+    {%- if environment.get('verify_sha256_hash', False) %}
+    - source_hash: {{ environment.sha256_hash }}
+    {%- else %}
+    - skip_verify: true
+    {%- endif %}
+
+{%- else %}
+
 java_packages:
   pkg.installed:
   - names: {{ environment.pkgs }}
@@ -16,3 +31,5 @@
   file.symlink:
   - name: {{ environment.home_dir }}
   - target: /usr/lib/jvm/java-{{ environment.version }}-openjdk-amd64
+
+{%- endif %}
\ No newline at end of file
diff --git a/java/map.jinja b/java/map.jinja
index 59c7a23..2cb9cda 100644
--- a/java/map.jinja
+++ b/java/map.jinja
@@ -41,7 +41,7 @@
 {%- 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' %}
+{%- elif (java_version == '9' or java_version == '10') %}
 {%- set java_build = environment.build %}
 {%- set java_release = environment.release %}
 {%- set version_name = java_version + '.' + java_release + '+' + java_build %}
diff --git a/tests/pillar/openjdk-10.sls b/tests/pillar/openjdk-10.sls
new file mode 100644
index 0000000..562400b
--- /dev/null
+++ b/tests/pillar/openjdk-10.sls
@@ -0,0 +1,10 @@
+java:
+  environment:
+    enabled: true
+    version: '10'
+    release: '0.1'
+    platform: openjdk
+    oracle_hash: 'fb4372174a714e6b8c52526dc134031e'
+    sha256_hash: '0b14aaecd5323457bd15dc7798d08181ad04bad4156e55387ed714190912a9ce'
+    verify_sha256_hash: true
+    development: false
diff --git a/tests/pillar/oracle-jdk-10.sls b/tests/pillar/oracle-jdk-10.sls
new file mode 100644
index 0000000..f7d469b
--- /dev/null
+++ b/tests/pillar/oracle-jdk-10.sls
@@ -0,0 +1,9 @@
+java:
+  environment:
+    enabled: true
+    version: '10'
+    release: '0.1'
+    build: '10'
+    oracle_hash: 'fb4372174a714e6b8c52526dc134031e'
+    platform: oracle-java
+    development: true