Share via


ContentDeploymentJob.Test method (Boolean, String)

Performs a test run for the content deployment job based on the type of transformation and by using the specified snapshot.

Namespace:  Microsoft.SharePoint.Publishing.Administration
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

Syntax

'Declaration
Public Sub Test ( _
    runAsynchronously As Boolean, _
    sourceContentDBSnapshotName As String _
)
'Usage
Dim instance As ContentDeploymentJob
Dim runAsynchronously As Boolean
Dim sourceContentDBSnapshotName As String

instance.Test(runAsynchronously, sourceContentDBSnapshotName)
public void Test(
    bool runAsynchronously,
    string sourceContentDBSnapshotName
)

Parameters

  • runAsynchronously
    Type: System.Boolean

    Specifies whether to execute the content deployment job synchronously or asynchronously.

  • sourceContentDBSnapshotName
    Type: System.String

    Specifies a name of a SQL snapshot to be used for an export operation.

Exceptions

Exception Condition
ContentDeploymentException

A specific reason is better described by the actual exception's message. Some common messages include:

  • An attempt is made to execute a job that is already running.

  • An attempt is made to execute a job that is in a timed out state (LastStatus property).

  • An attempt was made to run the job by using SQL snapshot for an export, but the SQL Server being used does not support SQL snapshots.

  • The SQL snapshot specified by sourceContentDBSnapshotName was not found.

SPException

Can be propagated from underlying Windows SharePoint Services (WSS) layers.

Remarks

The test run includes the export phase of the content deployment job only.

If runAsynchronously is true, the method starts to execute the content deployment job and can return before the execution of the content deployment job is complete. In this case, that means that the export phase of the job will run in the timer service. Otherwise, the method will not return until the execution is complete; in this case, the export phase of the job will run in the current process.

The execution of the content deployment job is propagates content to the target normally as —determined by the value of the ExportMethod property of the job.

If the sourceContentDBSnapshotName parameter is null or Empty, the use of SQL snapshot for an export during the execution of the content deployment job is determined by the value of the SqlSnapshotSetting property (see the SqlSnapshotSetting for more information). Otherwise, the execution of the content deployment job will use SQL snapshot specified by the sourceContentDBSnapshotName parameter for export. In this case, if the SQL snapshot specified by sourceContentDBSnapshotName does not exist or if the SQL Server being used does not support SQL snapshots, the execution of the job will fail.

If an attempt is made to execute a job that is already running or is in a timed out state (LastStatus property), the execution of the job will fail.

See also

Reference

ContentDeploymentJob class

ContentDeploymentJob members

Test overload

Microsoft.SharePoint.Publishing.Administration namespace