Elements  6.2
A C++ base framework for the Euclid Software.
Public Member Functions | Private Attributes | List of all members
Elements::Services::DataSync::DataSync Class Reference

A class to download test data from a data repository prior to the unit test run. More...

#include <DataSync.h>

Collaboration diagram for Elements::Services::DataSync::DataSync:
Collaboration graph
[legend]

Public Member Functions

 DataSync (path connectionFile, path dependencyFile)
 Initialize the synchronizer with configuration files. More...
 
void download ()
 Download the test data. More...
 
void downloadWithFallback (path connectionFile)
 Download the test data and provide a fallback host in case the primary host fails. More...
 
path absolutePath (path relativePath)
 Get the absolute path to a local test file which has been downloaded. More...
 

Private Attributes

ConnectionConfiguration m_connectionConfig
 
path m_distantRoot
 
path m_localRoot
 
DependencyConfiguration m_dependencyConfig
 

Detailed Description

A class to download test data from a data repository prior to the unit test run.

Refer to the corresponding Redmine project for more details.

See also
https://euclid.roe.ac.uk/projects/testdata/wiki

Definition at line 47 of file DataSync.h.

Constructor & Destructor Documentation

◆ DataSync()

Elements::Services::DataSync::DataSync::DataSync ( path  connectionFile,
path  dependencyFile 
)

Initialize the synchronizer with configuration files.

Parameters
connectionFilePath to the connection configuration file relative to the configuration directory.
dependencyFilePath to the dependency configuration file relative to the configuration directory.

Definition at line 27 of file DataSync.cpp.

Member Function Documentation

◆ absolutePath()

path Elements::Services::DataSync::DataSync::absolutePath ( path  relativePath)

Get the absolute path to a local test file which has been downloaded.

The absolute path is the concatenation of:

  • a system-defined prefix,
  • the local workspace,
  • the path of the file relative to the local workspace.

On LODEEN, the prefix is empty. On CODEEN, it is the job workspace which the user do not know. It can be set by the user through the $WORKSPACE environment variable.

Warning
This function must be used to access any data downloaded by the DataSync tool.

Definition at line 47 of file DataSync.cpp.

References m_localRoot.

◆ download()

void Elements::Services::DataSync::DataSync::download ( )

Download the test data.

Definition at line 33 of file DataSync.cpp.

References Elements::Services::DataSync::createSynchronizer(), m_connectionConfig, and m_dependencyConfig.

Referenced by downloadWithFallback().

Here is the call graph for this function:

◆ downloadWithFallback()

void Elements::Services::DataSync::DataSync::downloadWithFallback ( path  connectionFile)

Download the test data and provide a fallback host in case the primary host fails.

Parameters
connectionFilePath to the connection configuration file of the fallback host relative to the configuration directory.

Definition at line 38 of file DataSync.cpp.

References download(), Elements::Kernel::Units::e, and m_connectionConfig.

Here is the call graph for this function:

Member Data Documentation

◆ m_connectionConfig

ConnectionConfiguration Elements::Services::DataSync::DataSync::m_connectionConfig
private

Definition at line 94 of file DataSync.h.

Referenced by download(), and downloadWithFallback().

◆ m_dependencyConfig

DependencyConfiguration Elements::Services::DataSync::DataSync::m_dependencyConfig
private

Definition at line 97 of file DataSync.h.

Referenced by download().

◆ m_distantRoot

path Elements::Services::DataSync::DataSync::m_distantRoot
private

Definition at line 95 of file DataSync.h.

◆ m_localRoot

path Elements::Services::DataSync::DataSync::m_localRoot
private

Definition at line 96 of file DataSync.h.

Referenced by absolutePath().


The documentation for this class was generated from the following files: