Beispiel #1
0
def test_require_default_jdk_version():

    from fabtools.oracle_jdk import version, DEFAULT_VERSION
    from fabtools.require.oracle_jdk import installed

    installed()

    assert is_file('/opt/jdk/bin/java')
    assert version() == DEFAULT_VERSION
Beispiel #2
0
def test_require_jdk_version_6():

    from fabtools.oracle_jdk import version
    from fabtools.require.oracle_jdk import installed

    installed('6u45-b06')

    assert is_file('/opt/jdk/bin/java')
    assert version() == '6u45-b06'
Beispiel #3
0
def test_require_default_jdk_version():

    from fabtools.oracle_jdk import version, DEFAULT_VERSION
    from fabtools.require.oracle_jdk import installed

    installed()

    assert is_file('/opt/jdk/bin/java')
    assert version() == DEFAULT_VERSION
Beispiel #4
0
def test_require_jdk_version_6():

    from fabtools.oracle_jdk import version
    from fabtools.require.oracle_jdk import installed

    installed('6u45-b06')

    assert is_file('/opt/jdk/bin/java')
    assert version() == '6u45-b06'
Beispiel #5
0
def require_oracle_jdk():
    """
    Test high level API
    """

    from fabtools import oracle_jdk
    from fabtools import require
    from fabtools.files import is_file

    # Require Oracle JDK

    require.oracle_jdk.installed()

    assert is_file('/opt/jdk/bin/java')
    assert oracle_jdk.version() == oracle_jdk.DEFAULT_VERSION

    # Require Oracle JDK version 6
    require.oracle_jdk.installed('6u45-b06')

    assert is_file('/opt/jdk/bin/java')
    assert oracle_jdk.version() == '6u45-b06'
Beispiel #6
0
def require_oracle_jdk():
    """
    Test high level API
    """

    from fabtools import oracle_jdk
    from fabtools import require
    from fabtools.files import is_file

    # Require Oracle JDK

    require.oracle_jdk.installed()

    assert is_file("/opt/jdk/bin/java")
    assert oracle_jdk.version() == oracle_jdk.DEFAULT_VERSION

    # Require Oracle JDK version 6
    require.oracle_jdk.installed("6u45-b06")

    assert is_file("/opt/jdk/bin/java")
    assert oracle_jdk.version() == "6u45-b06"
Beispiel #7
0
def installed(version=oracle_jdk.DEFAULT_VERSION):
    """
    Require Oracle JDK to be installed.

    ::

        from fabtools import require

        require.oracle_jdk.installed()

    """
    if oracle_jdk.version() != version:
        oracle_jdk.install_from_oracle_site(version)