use of org.edx.mobile.model.VideoModel in project edx-app-android by edx.
the class DbTests method testgetVideoByVideoUrl.
@Test
public void testgetVideoByVideoUrl() throws Exception {
db.clearDataByUser(username);
String videoUrl = "url";
db.getVideoByVideoUrl(videoUrl, new DataCallback<VideoModel>() {
@Override
public void onResult(VideoModel result) {
assertNull("result should be null", result);
unlock();
}
@Override
public void onFail(Exception ex) {
fail(ex.getMessage());
}
});
lock();
DownloadEntry de = getDummyVideoModel();
de.url = "http://fake/url";
db.addVideoData(de, null);
db.getVideoByVideoUrl(de.url, new DataCallback<VideoModel>() {
@Override
public void onResult(VideoModel result) {
assertNotNull(result);
// assertTrue(result == 1);
print("Result for getVideoByVideoUrl for not null:" + result);
unlock();
}
@Override
public void onFail(Exception ex) {
fail(ex.getMessage());
}
});
lock();
}
use of org.edx.mobile.model.VideoModel in project edx-app-android by edx.
the class DbTests method testgetDownloadEntryByDmId.
@Test
public void testgetDownloadEntryByDmId() throws Exception {
db.clearDataByUser(username);
long dmId = 1;
db.getDownloadEntryByDmId(dmId, new DataCallback<VideoModel>() {
@Override
public void onResult(VideoModel result) {
assertNull("result should be null", result);
unlock();
}
@Override
public void onFail(Exception ex) {
fail(ex.getMessage());
}
});
lock();
DownloadEntry de = getDummyVideoModel();
de.dmId = 1;
db.addVideoData(de, null);
db.getDownloadEntryByDmId(de.dmId, new DataCallback<VideoModel>() {
@Override
public void onResult(VideoModel result) {
assertTrue(result != null);
print("result for getDownloadEntryByDmId for not null is:" + result);
unlock();
}
@Override
public void onFail(Exception ex) {
fail(ex.getMessage());
}
});
lock();
}
use of org.edx.mobile.model.VideoModel in project edx-app-android by edx.
the class DbTests method testgetVideoEntryByVideoId.
@Test
public void testgetVideoEntryByVideoId() throws Exception {
db.clearDataByUser(username);
String videoid = "videoid";
db.getVideoEntryByVideoId(videoid, new DataCallback<VideoModel>() {
@Override
public void onResult(VideoModel result) {
assertTrue(result == null);
print("result for get VideoEntryByVideoId is:" + result);
unlock();
}
@Override
public void onFail(Exception ex) {
fail(ex.getMessage());
}
});
lock();
DownloadEntry de = getDummyVideoModel();
de.videoId = "videoid";
db.addVideoData(de, null);
db.getVideoEntryByVideoId(videoid, new DataCallback<VideoModel>() {
@Override
public void onResult(VideoModel result) {
assertTrue(result != null);
print("result for get VideoEntryByVideoId in AssertTrue:" + result);
unlock();
}
@Override
public void onFail(Exception ex) {
fail(ex.getMessage());
}
});
lock();
}
Aggregations