def test_create_delete_xa_datasource(provider, datasource):
    """Tests XA datasource creation and deletion on EAP server
    Method is executed for all database types

    Steps:
        * Get servers list from UI
        * Chooses JBoss EAP server from list
        * Invokes 'Add JDBC Driver' toolbar operation
        * Fills all necessary fields and saves
        * Invokes 'Add Datasource' toolbar operation
        * Selects Datasource type.
        * Selects XA Datasource type.
        * Click Next.
        * Input Datasource Name.
        * Input Datasource JNDI Name.
        * Click Next.
        * Input Driver Name.
        * Input Module Name.
        * Input Driver Name.
        * Input Driver Class.
        * Click Next.
        * Input Database Connection URL.
        * Input Database username.
        * Input Database password.
        * Submits the form.
        * Checks if newly created datasource is listed. Selects it.
        * Deletes that Datasource via UI operation.
        * Checks whether resource is deleted.
    """
    server = get_eap_server(provider)
    file_path = download_jdbc_driver(datasource.driver.database_name)
    deploy_jdbc_driver(provider,
                       server,
                       file_path,
                       driver_name=datasource.driver.driver_name,
                       module_name=datasource.driver.module_name,
                       driver_class=datasource.driver.driver_class,
                       major_version=datasource.driver.major_version,
                       minor_version=datasource.driver.minor_version)
    server.add_datasource(ds_type='{} XA'.format(datasource.database_type),
                          ds_name='{}XA'.format(datasource.datasource_name),
                          jndi_name='{}XA'.format(datasource.jndi_name),
                          xa_ds=True,
                          driver_name=datasource.driver.driver_name,
                          driver_module_name=datasource.driver.module_name,
                          driver_class=datasource.driver.xa_class,
                          ds_url=datasource.connection_url.replace("\\", ""),
                          username=datasource.username,
                          password=datasource.password)
    datasource_name = "XA Datasource [{}XA]".format(datasource.datasource_name)
    verify_datasource_listed(provider, datasource_name, server)
    delete_datasource(provider, server, datasource_name)
    verify_datasource_not_listed(provider, datasource_name)
def test_create_delete_datasource(provider):
    """Tests datasource creation and deletion on EAP server

    Steps:
        * Get servers list from UI
        * Chooses JBoss EAP server from list
        * Invokes 'Add JDBC Driver' toolbar operation
        * Fills all necessary fields and saves
        * Invokes 'Add Datasource' toolbar operation
        * Selects Datasource type.
        * Click Next.
        * Input Datasource Name.
        * Input Datasource JNDI Name.
        * Click Next.
        * Input Driver Name.
        * Input Module Name.
        * Input Driver Name.
        * Input Driver Class.
        * Click Next.
        * Input Database Connection URL.
        * Input Database username.
        * Input Database password.
        * Submits the form.
        * Checks if newly created datasource is listed. Selects it.
        * Deletes that Datasource via UI operation.
        * Checks whether resource is deleted.
    """
    server = get_eap_server(provider)
    datasource = ORACLE_12C_DS
    file_path = download_jdbc_driver(datasource.driver.database_name)
    deploy_jdbc_driver(provider, server, file_path,
                       driver_name=datasource.driver.driver_name,
                       module_name=datasource.driver.module_name,
                       driver_class=datasource.driver.driver_class,
                       xa_class=datasource.driver.xa_class,
                       major_version=datasource.driver.major_version,
                       minor_version=datasource.driver.minor_version)
    server.add_datasource(ds_type=datasource.database_type,
                          ds_name=datasource.datasource_name,
                          jndi_name=datasource.jndi_name,
                          driver_name=datasource.driver.driver_name,
                          driver_module_name=datasource.driver.module_name,
                          driver_class=datasource.driver.driver_class,
                          ds_url=datasource.connection_url.replace("\\", ""),
                          username=datasource.username,
                          password=datasource.password)
    datasource_name = "Datasource [{}]".format(datasource.datasource_name)
    verify_datasource_listed(provider, datasource_name, server)
    """ @TODO enable when BZ#1460296 is fixed
def test_create_xa_datasource(provider, datasource):
    """Tests XA datasource creation and deletion on EAP server
    Method is executed for all database types

    Steps:
        * Get servers list from UI
        * Chooses JBoss EAP server from list
        * Invokes 'Add JDBC Driver' toolbar operation
        * Fills all necessary fields and saves
        * Invokes 'Add Datasource' toolbar operation
        * Selects Datasource type.
        * Selects XA Datasource type.
        * Click Next.
        * Input Datasource Name.
        * Input Datasource JNDI Name.
        * Click Next.
        * Input Driver Name.
        * Input Module Name.
        * Input Driver Name.
        * Input Driver Class.
        * Click Next.
        * Input Database Connection URL.
        * Input Database username.
        * Input Database password.
        * Submits the form.
        * Checks if newly created datasource is listed.
    """
    server = get_eap_server(provider)
    file_path = download_jdbc_driver(datasource.driver.database_name)
    deploy_jdbc_driver(provider, server, file_path,
                       driver_name=datasource.driver.driver_name,
                       module_name=datasource.driver.module_name,
                       driver_class=datasource.driver.driver_class,
                       xa_class=datasource.driver.xa_class,
                       major_version=datasource.driver.major_version,
                       minor_version=datasource.driver.minor_version)
    server.add_datasource(ds_type='{} XA'.format(datasource.database_type),
                          ds_name='{}XA'.format(datasource.datasource_name),
                          jndi_name='{}XA'.format(datasource.jndi_name),
                          xa_ds=True,
                          driver_name=datasource.driver.driver_name,
                          driver_module_name=datasource.driver.module_name,
                          driver_class=datasource.driver.xa_class,
                          ds_url=datasource.connection_url.replace("\\", ""),
                          username=datasource.username,
                          password=datasource.password)
    datasource_name = "XA Datasource [{}XA]".format(datasource.datasource_name)
    verify_datasource_listed(provider, datasource_name, server)
Ejemplo n.º 4
0
def test_create_datasource_select_driver(provider, datasource):
    """Tests datasource creation and deletion on EAP server
    Method is executed for all database types

    Steps:
        * Get servers list from UI
        * Chooses JBoss EAP server from list
        * Invokes 'Add JDBC Driver' toolbar operation
        * Fills all necessary fields and saves
        * Invokes 'Add Datasource' toolbar operation
        * Selects Datasource type.
        * Click Next.
        * Input Datasource Name.
        * Input Datasource JNDI Name.
        * Click Next.
        * Choose the tab "Existing Driver".
        * Select just created driver
        * Click Next.
        * Input Database Connection URL.
        * Input Database username.
        * Input Database password.
        * Submits the form.
        * Checks if newly created datasource is listed.
    """
    server = get_eap_server(provider)
    file_path = download_jdbc_driver(datasource.driver.database_name)
    deploy_jdbc_driver(provider,
                       server,
                       file_path,
                       driver_name=datasource.driver.driver_name,
                       module_name=datasource.driver.module_name,
                       driver_class=datasource.driver.driver_class,
                       xa_class=datasource.driver.xa_class,
                       major_version=datasource.driver.major_version,
                       minor_version=datasource.driver.minor_version)
    verify_server_running(provider, server)
    server.add_datasource(ds_type=datasource.database_type,
                          ds_name=datasource.datasource_name,
                          jndi_name=datasource.jndi_name,
                          existing_driver=datasource.driver.driver_name,
                          ds_url=datasource.connection_url.replace("\\", ""),
                          username=datasource.username,
                          password=datasource.password)
    datasource_name = "Datasource [{}]".format(datasource.datasource_name)
    verify_datasource_listed(provider, datasource_name, server)