* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
- * *
+ * *
* * http://www.apache.org/licenses/LICENSE-2.0
- * *
+ * *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* Test the functioning of the "Content" class, which holds, and routes to the right code based on Accept values
*/
public class JU_Content1 {
-
+
@Test
public void test() throws Exception {
//BogusReq req = new BogusReq();
//expected = (expected);
//HttpServletResponse resp = new BogusResp();
-
+
assertNotNull("Same Content String and Accept String",ct.prep(trans,expected));
//expects Null (not run)
expected = "application/java.lang.Boolean+xml;charset=UTF8;version=1.0";
assertNotNull("Minor Charset in Caps acceptable",ct.prep(trans,expected));
- // expects no run
+ // expects no run
expected="application/java.lang.Boolean+xml;charset=MyType;version=1.0";
assertNull("Unknown Minor Charset",ct.prep(trans,expected));
expected="";
assertNotNull("Blank Acceptance",ct.prep(trans,expected));
-
+
expected=null;
- assertNotNull("Null Acceptance",ct.prep(trans,expected));
+ assertNotNull("Null Acceptance",ct.prep(trans,expected));
expected = ("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
assertNotNull("Matches application/xml, and other content not known",ct.prep(trans,expected));
-
+
// No SemiColon
expected = ("i/am/bogus,application/xml");
assertNotNull("Match second entry, with no Semis",ct.prep(trans,expected));
- } finally {
+ } finally {
StringBuilder sb = new StringBuilder();
trans.auditTrail(0, sb);
//System.out.println(sb);