index.html revision 3983b1555a39b3f344a2a71c9f7100da4bb4a7e4
2362N/A }).use("dump", "test", "console", "io-base", "cache", "base", "plugin", "json", "datatype", "dataschema", "datasource", function(Y) {
1008N/A ARRAYASSERT = Y.ArrayAssert,
1008N/A OBJECTASSERT = Y.ObjectAssert,
1821N/A BTNRUN.set("disabled", false);
1821N/A var testClass = new Y.Test.Case({
1821N/A var ds = new Y.DataSource.Local();
2391N/A var ds = new Y.DataSource.XHR();
1821N/A var testLocal = new Y.Test.Case({
1821N/A name: "DataSource.Local Tests",
1821N/A var ds = new Y.DataSource.Local({
1008N/A Y.Mock.expect(handler,{
1008N/A args: [Y.Mock.Value(function(e){
1821N/A ds.sendRequest(null, {
1821N/A success: handler.handleSuccess,
1821N/A ASSERT.fail("XHR failure case.");
2228N/A Y.Mock.verify(handler);
0N/A var ds = new Y.DataSource.Local({
2402N/A Y.Mock.expect(handler,{
2402N/A args: [Y.Mock.Value(function(e){
2402N/A Y.Mock.expect(handler,{
2402N/A args: [Y.Mock.Value(function(e){
2228N/A Y.Mock.expect(handler,{
2228N/A args: [Y.Mock.Value(function(e){
2402N/A ds.sendRequest("a", "callback");
2402N/A Y.Mock.verify(handler);
2402N/A var ds = new Y.DataSource.Local({
2402N/A Y.Mock.expect(handler,{
2402N/A args: [Y.Mock.Value(function(e){
2228N/A ds.sendRequest("a", "callback");
2228N/A var testXHR = new Y.Test.Case({
1821N/A name: "DataSource.XHR Tests",
2228N/A var ds = new Y.DataSource.XHR({
1821N/A Y.Mock.expect(handler,{
1821N/A args: [Y.Mock.Value(function(e){
1821N/A OBJECTASSERT.ownsKeys({tId:null,request:null,data:null,response:null,callback:null}, e, "Expected all properties.");
1821N/A ds.sendRequest(null, {
1821N/A success: handler.handleSuccess,
1821N/A ASSERT.fail("XHR failure case.");
1821N/A var ds = new Y.DataSource.XHR({
1821N/A Y.Mock.expect(handler,{
1821N/A args: [Y.Mock.Value(function(e){
0N/A OBJECTASSERT.ownsKeys({tId:null,request:null,data:null,response:null,callback:null}, e, "Expected all properties.");
2228N/A ds.sendRequest(null, {
2228N/A success: handler.handleSuccess,
0N/A ASSERT.fail("XHR failure case.");
0N/A var ds = new Y.DataSource.XHR({
2228N/A resultListLocator: "ResultSet.Result",
1008N/A Y.Mock.expect(handler,{
1008N/A args: [Y.Mock.Value(function(e){
0N/A Y.Mock.expect(handler,{
1008N/A args: [Y.Mock.Value(function(e){
1821N/A Y.Mock.expect(handler,{
1821N/A args: [Y.Mock.Value(function(e){
2391N/A ds.sendRequest(null, "callback");
1008N/A var ds = new Y.DataSource.XHR({
2391N/A resultListLocator: "ResultSet.Result",
1821N/A Y.Mock.expect(handler,{
1821N/A args: [Y.Mock.Value(function(e){
1947N/A ds.sendRequest("a", "callback");
1947N/A var testScriptNode = new Y.Test.Case({
1947N/A name: "DataSource.ScriptNode Tests",
1821N/A var ds = new Y.DataSource.ScriptNode({
1821N/A Y.Mock.expect(handler,{
1821N/A args: [Y.Mock.Value(function(e){
1947N/A ASSERT.areSame("q=select%20*%20from%20search.web%20where%20query%3D%22pizza%22", e.request, "Expected same request.");
1821N/A OBJECTASSERT.ownsKeys({tId:null,request:null,data:null,response:null,callback:null}, e, "Expected all properties.");
1821N/A success: handler.handleSuccess,
1821N/A ASSERT.fail("ScriptNode failure case.");
1821N/A var ds = new Y.DataSource.ScriptNode({
1008N/A resultListLocator: "query.results.result",
1008N/A Y.Mock.expect(handler,{
1008N/A args: [Y.Mock.Value(function(e){
0N/A ASSERT.areSame("q=select%20*%20from%20search.web%20where%20query%3D%22pizza%22", e.request, "Expected same request.");
1008N/A Y.Mock.expect(handler,{
1008N/A args: [Y.Mock.Value(function(e){
1008N/A ASSERT.areSame("q=select%20*%20from%20search.web%20where%20query%3D%22pizza%22", e.request, "Expected same request.");
1008N/A Y.Mock.expect(handler,{
1008N/A args: [Y.Mock.Value(function(e){
1821N/A ASSERT.areSame("q=select%20*%20from%20search.web%20where%20query%3D%22pizza%22", e.request, "Expected same request.");
1821N/A ds.sendRequest("q=select%20*%20from%20search.web%20where%20query%3D%22pizza%22", "callback");
1821N/A testScriptNodeError: (Y.UA.gecko) ? function() {
1821N/A var ds = new Y.DataSource.ScriptNode({
1821N/A resultListLocator: "query.results.result",
1934N/A Y.Mock.expect(handler,{
2228N/A args: [Y.Mock.Value(function(e){
1821N/A ds.sendRequest("a", "callback");
1934N/A var testFunction = new Y.Test.Case({
1934N/A name: "DataSource.Function Tests",
1821N/A var ds = new Y.DataSource.Function({
1934N/A Y.Mock.expect(handler,{
1821N/A args: [Y.Mock.Value(function(e){
2017N/A OBJECTASSERT.ownsKeys({tId:null,request:null,data:null,response:null,callback:null}, e, "Expected all properties.");
1821N/A ds.sendRequest("foo", {
1821N/A success: handler.handleSuccess,
1821N/A ASSERT.fail("Function failure case.");
1821N/A var ds = new Y.DataSource.Function({
2017N/A Y.Mock.expect(handler,{
2017N/A args: [Y.Mock.Value(function(e){
1934N/A Y.Mock.expect(handler,{
1821N/A args: [Y.Mock.Value(function(e){
1821N/A Y.Mock.expect(handler,{
1821N/A args: [Y.Mock.Value(function(e){
1934N/A ds.sendRequest("foo", "callback");
1821N/A var ds = new Y.DataSource.Function({
1821N/A Y.Mock.expect(handler,{
1821N/A args: [Y.Mock.Value(function(e){
1821N/A ds.sendRequest("a", "callback");
1821N/A var testDataSchemaPlugin = new Y.Test.Case({
2017N/A var ds = new Y.DataSource.XHR({
1821N/A resultListLocator: "ResultSet.Result",
1821N/A Y.Mock.expect(handler,{
1821N/A args: [Y.Mock.Value(function(e){
2017N/A ds.sendRequest(null, {
1821N/A success: handler.handleSuccess,
2402N/A ASSERT.fail("XHR failure case.");
1821N/A var ds = new Y.DataSource.XHR({
1821N/A Y.Mock.expect(handler,{
2017N/A args: [Y.Mock.Value(function(e){
1934N/A ds.sendRequest(null, {
1934N/A success: handler.handleSuccess,
1821N/A ASSERT.fail("XHR failure case.");
2017N/A var ds = new Y.DataSource.Local({
1008N/A Y.Mock.expect(handler,{
1821N/A args: [Y.Mock.Value(function(e){
2020N/A ds.sendRequest(null, {
2020N/A success: handler.handleSuccess,
2020N/A ASSERT.fail("Local failure case.");
1821N/A var ds = new Y.DataSource.Local({
1821N/A Y.Mock.expect(handler,{
1947N/A args: [Y.Mock.Value(function(e){
2402N/A ds.sendRequest(null, {
2402N/A success: handler.handleSuccess,
2402N/A ASSERT.fail("Local failure case.");
1008N/A var testCaching = new Y.Test.Case({
1008N/A var ds = new Y.DataSource.Local();
1008N/A var ds = new Y.DataSource.Local();
1008N/A var ds = new Y.DataSource.Local();
1008N/A ds.cache.set("max", 5);
1254N/A var ds = new Y.DataSource.Local({
1254N/A ds.sendRequest("a");
1254N/A ds.subscribe("data", function(e) {
1254N/A ASSERT.fail("Entry should be cached -- 'data' event is unexpected");
1254N/A ds.sendRequest("a");
1254N/A var ds = new Y.DataSource.Local({
1008N/A ds.sendRequest("a");
1008N/A ds.cache.subscribe("retrieve", function(e) {
1008N/A ASSERT.fail("Cache is unset -- 'retrieve' event is unexpected");
1008N/A ds.sendRequest("a");
1008N/A var testPolling = new Y.Test.Case({
1008N/A var ds = new Y.DataSource.Local();
1008N/A ds = new Y.DataSource.XHR();
1008N/A var ds = new Y.DataSource.Local();
1008N/A Y.Mock.expect(handler,{
1008N/A args: [Y.Mock.Value.Any],
1008N/A var id = ds.setInterval(500, null, {
1008N/A success: handler.handleSuccess,
1008N/A ASSERT.fail("XHR failure case.");
1008N/A ASSERT.isNumber(id, "Expected interval id.");
1008N/A ds.clearInterval(id);
1008N/A Y.Mock.verify(handler);
1008N/A var ds = new Y.DataSource.Local();
1008N/A Y.Mock.expect(handler,{
1008N/A args: [Y.Mock.Value.Any],
1008N/A ds.setInterval(500, null, {
1008N/A success: handler.handleSuccess,
1008N/A ASSERT.fail("XHR failure case.");
1008N/A ds.setInterval(500, null, {
1008N/A success: handler.handleSuccess,
1008N/A ASSERT.fail("XHR failure case.");
1008N/A ds.setInterval(500, null, {
1008N/A success: handler.handleSuccess,
1008N/A ASSERT.fail("XHR failure case.");
1008N/A Y.Mock.verify(handler);
1008N/A Y.Test.Runner.add(testClass);
1008N/A Y.Test.Runner.add(testLocal);
1008N/A Y.Test.Runner.add(testXHR);
1008N/A Y.Test.Runner.add(testScriptNode);
1008N/A Y.Test.Runner.add(testFunction);
1008N/A Y.Test.Runner.add(testDataSchemaPlugin);
1008N/A Y.Test.Runner.add(testCaching);
1008N/A Y.Test.Runner.add(testPolling);