[rygel] test: Adapt ObjectCreator test
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] test: Adapt ObjectCreator test
- Date: Tue, 20 Aug 2013 19:09:03 +0000 (UTC)
commit a753a7c89fb6a24a68636124f7fe934ec599e1d7
Author: Jens Georg <jensg openismus com>
Date: Tue Aug 20 21:07:08 2013 +0200
test: Adapt ObjectCreator test
src/librygel-server/rygel-object-creator.vala | 2 +-
tests/Makefile.am | 3 +-
tests/rygel-media-engine.vala | 1 -
tests/rygel-object-creator-test.vala | 44 +++++++++++--------------
4 files changed, 22 insertions(+), 28 deletions(-)
---
diff --git a/src/librygel-server/rygel-object-creator.vala b/src/librygel-server/rygel-object-creator.vala
index 6e1fe25..3e44e46 100644
--- a/src/librygel-server/rygel-object-creator.vala
+++ b/src/librygel-server/rygel-object-creator.vala
@@ -311,7 +311,7 @@ internal class Rygel.ObjectCreator: GLib.Object, Rygel.StateMachine {
builder.append (")");
try {
- var parser = new SearchCriteriaParser (builder.str);
+ var parser = new Rygel.SearchCriteriaParser (builder.str);
yield parser.run ();
var rel = new LogicalExpression ();
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 217b67f..ab69dfa 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -142,8 +142,9 @@ rygel_object_creator_test_SOURCES = rygel-object-creator-test.vala \
rygel-http-seek_object-creator.vala \
rygel-state-machine_object-creator.vala \
rygel-relational-expression.vala \
+ rygel-logical-expression.vala \
rygel-search-expression.vala \
- rygel-media-engine.vala \
+ rygel-search-criteria-parser.vala \
rygel-serializer_object-creator.vala \
rygel-m3u-playlist_object-creator.vala
rygel_object_creator_test_VALAFLAGS = \
diff --git a/tests/rygel-object-creator-test.vala b/tests/rygel-object-creator-test.vala
index 95bd5e4..80b8395 100644
--- a/tests/rygel-object-creator-test.vala
+++ b/tests/rygel-object-creator-test.vala
@@ -108,6 +108,11 @@ public class Rygel.ObjectRemovalQueue : GLib.Object {
}
}
+public class Rygel.MediaServerPlugin : GLib.Object {
+ public GLib.List<DLNAProfile> upload_profiles = new GLib.List<DLNAProfile>
+ ();
+}
+
public class Rygel.MediaObject : GLib.Object {
public string id {get; set; }
public string ref_id;
@@ -210,10 +215,23 @@ public class Rygel.PlaylistItem : Rygel.MediaItem {
}
}
+public class Rygel.RootDevice : GLib.Object {
+ public MediaServerPlugin resource_factory;
+
+ public RootDevice () {
+ this.resource_factory = new MediaServerPlugin ();
+ }
+}
+
public class Rygel.ContentDirectory : GLib.Object {
public Cancellable cancellable;
public MediaContainer root_container;
public HTTPServer http_server;
+ public RootDevice root_device;
+
+ public ContentDirectory () {
+ this.root_device = new RootDevice ();
+ }
}
public class Rygel.MediaContainer : Rygel.MediaObject {
@@ -292,30 +310,6 @@ public errordomain Rygel.ContentDirectoryError {
public class Rygel.Transcoder {
}
-public class Rygel.TestMediaEngine : Rygel.MediaEngine {
- private GLib.List<DLNAProfile> dlna_profiles = new GLib.List<DLNAProfile>();
-
- public override unowned GLib.List<DLNAProfile> get_dlna_profiles () {
- return dlna_profiles;
- }
-
- public override unowned GLib.List<Transcoder>? get_transcoders () {
- return null;
- }
-
- public override DataSource? create_data_source (string uri) {
- return null;
- }
-}
-
-public class Rygel.EngineLoader {
- public EngineLoader () { }
-
- public MediaEngine load_engine () {
- return new TestMediaEngine ();
- }
-}
-
public static void log_func (string? domain,
LogLevelFlags flags,
string message) {
@@ -375,7 +369,7 @@ public class Rygel.HTTPObjectCreatorTest : GLib.Object {
var action = new ServiceAction (null, "");
var creator = new ObjectCreator (content_directory, action);
creator.run.begin ();
- assert (action.error_code == no_such_object.code);
+ assert (action.error_code == invalid_args.code);
// check elements containing a comment
action = new ServiceAction ("0", "<!-- This is an XML comment -->");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]