Package com.toc.dton.junit.sample.object

Examples of com.toc.dton.junit.sample.object.TestBean


    String parseResult;
    try {
      testList.add("Test String");
      testList.add(1);
      testList.add(null);
      testList.add(new TestBean());
      //ParserObject obj = new ParserObject(testList);
      Notation notation = NotationHelper.createXMLNotation();
      OutputStream resultStream = new ByteArrayOutputStream();
      notation.encode(testList, resultStream);
      parseResult = resultStream.toString();
View Full Code Here


public class JTestTransferBean {
  @Test
  public void testBeanEncode() {
    String parseResult;
    try {
      TestBean testSubSubBean = new TestBean();
      testSubSubBean.setTestString("Test Sub Sub Bean");
      testSubSubBean.setTestInt(5678);
     
      TestBean testSubBean = new TestBean();
      testSubBean.setTestString("Test Sub Bean");
      testSubBean.setTestBean(testSubSubBean);
     
      TestBean testBean = new TestBean();
      testBean.setTestBean(testSubBean);
      testBean.setTestInt(1234);
      testBean.setTestString("Test");
     
      Notation notation = NotationHelper.createXMLNotation();
      OutputStream resultStream = new ByteArrayOutputStream();
      notation.encode(testBean, resultStream);
      parseResult = resultStream.toString();
View Full Code Here

    }
  }
 
  @Test
  public void testNullBeanEncode() {
    TestBean testBean = null;
    String parseResult;
    try {
      Notation notation = NotationHelper.createXMLNotation();
      OutputStream resultStream = new ByteArrayOutputStream();
      notation.encode(testBean, resultStream);
View Full Code Here

  @Test
  public void testMixMapEncode() {
    HashMap<Object,Object> testMap = new HashMap<Object,Object>();
    String parseResult;
    try {
      testMap.put("Test Key", new TestBean("Test Bean"));
      testMap.put(1, "Test");
      testMap.put(null, 123);
      testMap.put(new TestBean("Test Key 2"), "Test");
      //ParserObject obj = new ParserObject(testMap);
      Notation notation = NotationHelper.createXMLNotation();
      OutputStream resultStream = new ByteArrayOutputStream();
      notation.encode(testMap, resultStream);
      parseResult = resultStream.toString();
View Full Code Here

  @Test
  public void testBeanArrayEncode() {
    TestBean[] testBeanArray = new TestBean[3];
    String parseResult;
    try {
      testBeanArray[0] = new TestBean("Test 1");
      testBeanArray[1] = new TestBean("Test 2");
      testBeanArray[0].setTestBean(new TestBean("Test sub 1"));
     
      //ParserObject obj = new ParserObject(testBeanArray);
      Notation notation = NotationHelper.createXMLNotation();
      OutputStream resultStream = new ByteArrayOutputStream();
      notation.encode(testBeanArray, resultStream);
View Full Code Here

TOP

Related Classes of com.toc.dton.junit.sample.object.TestBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.