@@ -490,7 +490,7 @@ public String getResponse(String description, String major, String severity,
490490
491491 }
492492
493- static final String replaceResultMessage =
493+ public static final String replaceResultMessage =
494494 "<?xml version = \" 1.0\" encoding = \" UTF-8\" ?>" +
495495 "<imsx_POXEnvelopeRequest xmlns=\" http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0\" >" +
496496 " <imsx_POXHeader>" +
@@ -548,58 +548,6 @@ public static void sendReplaceResult(String url, String key, String secret, Stri
548548 }
549549 }
550550
551- /** Unit Tests */
552- public static void runTest () {
553- System .out .println ("Runnig test." );
554- String inputTestData = String .format (replaceResultMessage , "3124567" , "A" , "" );
555- IMSPOXRequest pox = new IMSPOXRequest (inputTestData );
556- System .out .println ("Version = " +pox .getHeaderVersion ());
557- System .out .println ("Operation = " +pox .getOperation ());
558- Map <String ,String > bodyMap = pox .getBodyMap ();
559- String guid = bodyMap .get ("/resultRecord/sourcedGUID/sourcedId" );
560- System .out .println ("guid=" +guid );
561- String grade = bodyMap .get ("/resultRecord/result/resultScore/textString" );
562- System .out .println ("grade=" +grade );
563-
564- String desc = "Message received and validated operation=" +pox .getOperation ()+
565- " guid=" +guid +" grade=" +grade ;
566-
567- String output = pox .getResponseUnsupported (desc );
568- System .out .println ("---- Unsupported ----" );
569- System .out .println (output );
570-
571- Properties props = new Properties ();
572- props .setProperty ("fred" ,"zap" );
573- props .setProperty ("sam" ,IMSPOXRequest .MINOR_IDALLOC );
574- System .out .println ("---- Generate Log Error ----" );
575- output = pox .getResponseFailure (desc ,props );
576- System .out .println ("---- Failure ----" );
577- System .out .println (output );
578-
579-
580-
581- Map <String , Object > theMap = new TreeMap <String , Object > ();
582- theMap .put ("/readMembershipResponse/membershipRecord/sourcedId" , "123course456" );
583-
584- List <Map <String ,String >> lm = new ArrayList <Map <String ,String >>();
585- Map <String ,String > mm = new TreeMap <String ,String >();
586- mm .put ("/personSourcedId" ,"123user456" );
587- mm .put ("/role/roleType" ,"Learner" );
588- lm .add (mm );
589-
590- mm = new TreeMap <String ,String >();
591- mm .put ("/personSourcedId" ,"789user123" );
592- mm .put ("/role/roleType" ,"Instructor" );
593- lm .add (mm );
594- theMap .put ("/readMembershipResponse/membershipRecord/membership/member" , lm );
595-
596- String theXml = XMLMap .getXMLFragment (theMap , true );
597- // System.out.println("th="+theXml);
598- output = pox .getResponseSuccess (desc ,theXml );
599- System .out .println ("---- Success String ----" );
600- System .out .println (output );
601- }
602-
603551 /*
604552
605553roleType:
0 commit comments