From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- vo/votest/tests/req_1.2.1.cl | 108 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 vo/votest/tests/req_1.2.1.cl (limited to 'vo/votest/tests/req_1.2.1.cl') diff --git a/vo/votest/tests/req_1.2.1.cl b/vo/votest/tests/req_1.2.1.cl new file mode 100644 index 00000000..10111452 --- /dev/null +++ b/vo/votest/tests/req_1.2.1.cl @@ -0,0 +1,108 @@ +# +# Demonstrate column selection by id/name/ucd attribute. + +# Set the test description string. +votest.descr = "Demonstrate column selection by id/name/ucd attribute" + +# Convert the data$logical to a local path. +s1 = data_url // "/usno-b.xml" +s2 = "file://" // data_path // "/usno-b.xml" +s3 = "file:///localhost" // data_path // "/usno-b.xml" + +print ("------------------------------------------------------------------") +print ("Req 1.2.1: Users shall be able to identify a column in a VOTable") +print (" by the 'id', 'name' or 'ucd' attribute of a or") +print (" by column number.") +print ("------------------------------------------------------------------") + + +fcache init + +int ra_col, dec_col + +# Execute the test commands. + +unlearn ("colbyid") ; colbyid.print = yes +unlearn ("colbyname") ; colbyname.print = yes +unlearn ("colbyucd") ; colbyucd.print = yes + + +######################################################################## + +print ("\n------ Identify RA,DEC col by 'id' string ------\n") + +print ("\nLogical Path: data$usno-b.xml") # logical path + colbyid ("data$usno-b.xml", "RA") | scan (ra_col) + colbyid ("data$usno-b.xml", "DEC") | scan (dec_col) + printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col) + +print ("\nHTTP URI: " // s1) # remote http URI + colbyid (s1, "RA") | scan (ra_col) + colbyid (s1, "DEC") | scan (dec_col) + printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col) + +print ("\nFile URI: " // s2) # file URI + colbyid (s2, "RA") | scan (ra_col) + colbyid (s2, "DEC") | scan (dec_col) + printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col) + +print ("\nFile URI: " // s3) # file URI + colbyid (s3, "RA") | scan (ra_col) + colbyid (s3, "DEC") | scan (dec_col) + printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col) + +unlearn ("colbyid") + + +######################################################################## + +print ("\n------ Identify RA,DEC col by 'name' string ------\n") + +print ("\nLogical Path: data$usno-b.xml") # logical path + colbyname ("data$usno-b.xml", "RA") | scan (ra_col) + colbyname ("data$usno-b.xml", "DEC") | scan (dec_col) + printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col) + +print ("\nHTTP URI: " // s1) # remote http URI + colbyname (s1, "RA") | scan (ra_col) + colbyname (s1, "DEC") | scan (dec_col) + printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col) + +print ("\nFile URI: " // s2) # file URI + colbyname (s2, "RA") | scan (ra_col) + colbyname (s2, "DEC") | scan (dec_col) + printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col) + +print ("\nFile URI: " // s3) # file URI + colbyname (s3, "RA") | scan (ra_col) + colbyname (s3, "DEC") | scan (dec_col) + printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col) + +unlearn ("colbyname") + + +######################################################################## + +print ("\n------ Identify RA,DEC col by 'ucd' string ------\n") + +print ("\nLogical Path: data$usno-b.xml") # logical path + colbyucd ("data$usno-b.xml", "POS_EQ_RA_MAIN") | scan (ra_col) + colbyucd ("data$usno-b.xml", "POS_EQ_DEC_MAIN") | scan (dec_col) + printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col) + +print ("\nHTTP URI: " // s1) # remote http URI + colbyucd (s1, "POS_EQ_RA_MAIN") | scan (ra_col) + colbyucd (s1, "POS_EQ_DEC_MAIN") | scan (dec_col) + printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col) + +print ("\nFile URI: " // s2) # file URI + colbyucd (s2, "POS_EQ_RA_MAIN") | scan (ra_col) + colbyucd (s2, "POS_EQ_DEC_MAIN") | scan (dec_col) + printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col) + +print ("\nFile URI: " // s3) # file URI + colbyucd (s3, "POS_EQ_RA_MAIN") | scan (ra_col) + colbyucd (s3, "POS_EQ_DEC_MAIN") | scan (dec_col) + printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col) + +unlearn ("colbyucd") -- cgit