Beispiel #1
0
        GetRecordingsResponseItem[] GetAllRecordings()
        {
            GetRecordingsResponseItem[] recordings = GetRecordings();
            Assert(recordings != null, "No recordings returned", "Check that recordings list is not empty");

            StorageTestsUtils.ValidateFullRecordingsList(recordings, Assert);
            return(recordings);
        }
Beispiel #2
0
        public void GetRecordingsTest()
        {
            RunTest(() =>
            {
                GetRecordingsResponseItem[] recordings = GetRecordings();

                // validation?
                Assert(recordings != null, "No recordings returned", "Check that recordings list is not empty");

                StorageTestsUtils.ValidateFullRecordingsList(recordings, Assert);
            });
        }
Beispiel #3
0
        public void GetRecordingJobStateTest()
        {
            RunTest(() =>
            {
                GetRecordingsResponseItem[] recordings = GetRecordings();
                // validation?
                //Assert(recordings != null,
                //    "No recordings returned",
                //        "Check that recordings list is not empty");

                BeginStep("Check recording list");
                if (recordings == null || recordings.Length == 0)
                {
                    LogStepEvent("Recording list is empty");
                    StepPassed();
                    return;
                }
                else
                {
                    StepPassed();
                }

                StorageTestsUtils.ValidateFullRecordingsList(recordings, Assert);

                GetRecordingJobsResponseItem[] jobs = GetRecordingJobs();

                BeginStep("Check recording job list");
                if (jobs == null || jobs.Length == 0)
                {
                    LogStepEvent("RecordingJob list is empty");
                    StepPassed();
                    return;
                }
                else
                {
                    StepPassed();
                }

                ValidateFullRecordingJobsList(jobs, recordings, Assert);
                foreach (var job in jobs)
                {
                    string token = job.JobToken;
                    var jobState = GetRecordingJobState(job.JobToken);
                    Assert(jobState != null,
                           string.Format("Recording job state with jobtoken {0} wasn't returned", token),
                           "Check that recording jobs list is not empty");
                    CompareJobStates(job, jobState);
                }
            });
        }
Beispiel #4
0
        public void GetTrackConfigurationTest()
        {
            RunTest(() =>
            {
                GetRecordingsResponseItem[] recordings = GetRecordings();
                BeginStep("Check that recording list is not empty");
                if (recordings == null || recordings.Length == 0)
                {
                    LogStepEvent("Recording list is empty");
                    StepPassed();
                    return;
                }
                else
                {
                    StepPassed();
                }

                StorageTestsUtils.ValidateFullRecordingsList(recordings, Assert);

                string recordingToken = string.Empty;
                string trackToken     = string.Empty;
                foreach (var recording in recordings)
                {
                    recordingToken = recording.RecordingToken;
                    BeginStep(string.Format("Check that recording '{0}' has tracks", recording.RecordingToken));
                    if (recording.Tracks == null || recording.Tracks.Track == null || recording.Tracks.Track.Length == 0)
                    {
                        LogStepEvent("Track list is empty");
                        StepPassed();
                        continue;
                    }
                    else
                    {
                        StepPassed();
                    }
                    foreach (var track in recording.Tracks.Track)
                    {
                        trackToken = track.TrackToken;

                        var trackConfig = GetTrackConfiguration(recording.RecordingToken, track.TrackToken);
                        Assert(trackConfig != null,
                               string.Format("Track configuration (recording token = '{0}', track token = '{1}')", recordingToken, trackToken),
                               "Check that track configuration was returned");

                        CompareTrackConfigurations(track.Configuration, trackConfig);
                    }
                }
            });
        }
Beispiel #5
0
        public void SetRecordingsConfigTest()
        {
            RecordingConfiguration oldConfig = null;
            RecordingConfiguration newConfig = null;
            String recordingToken            = null;

            RunTest(() =>
            {
                GetRecordingsResponseItem[] recordings = GetRecordings();

                // Recording list validation
                Assert(recordings != null, "No recordings returned", "Check that recordings list is not empty");
                StorageTestsUtils.ValidateFullRecordingsList(recordings, Assert);

                // Saving of old recording config
                oldConfig = recordings[0].Configuration;

                recordingToken   = recordings[0].RecordingToken;
                newConfig        = new RecordingConfiguration();
                newConfig.Source = new RecordingSourceInformation();

                // A device shall support at least 20 characters.
                newConfig.Source.Name = "SourceNameForTest001";
                // A device shall support at least 128 characters.
                newConfig.Source.SourceId = "http://source-id-for-test.com/identifier/for/the/source/chosen/by/the/client/that/creates/the/structure/0001/0002/0003/0004/005";
                // A device shall support at least 128 characters.
                newConfig.Source.Address = "http://source-address-for-test.com/uri/provided/by/the/service/supplying/data/to/be/recorded/0001/0002/0003/0004/0005/0006/0007";

                // Other values without changing
                newConfig.Source.Location      = oldConfig.Source.Location;
                newConfig.Source.Description   = oldConfig.Source.Description;
                newConfig.Content              = oldConfig.Content;
                newConfig.MaximumRetentionTime = oldConfig.MaximumRetentionTime;

                // Setting of recording config
                SetRecordingConfiguration(recordingToken, newConfig);

                RecordingConfiguration actualConfig = GetRecordingConfiguration(recordingToken);

                // Validation of the result
                Assert(new CheckCondition(() =>
                {
                    if (actualConfig.Source.Name == newConfig.Source.Name &&
                        actualConfig.Source.SourceId == newConfig.Source.SourceId &&
                        actualConfig.Source.Address == newConfig.Source.Address)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }),
                       "Settings were not applied", "Validation of applied settings");
            },
                    () =>
            {
                if (newConfig != null)
                {
                    LogTestEvent(string.Format("Restoring the initial settings...{0}", Environment.NewLine));

                    SetRecordingConfiguration(recordingToken, oldConfig, "Restore previous settings");
                }
            });
        }