Package net.sf.fmj.test.tracing

Examples of net.sf.fmj.test.tracing.TracingBuffer


    assertFalse(c.getPendingEOM());
    assertTrue(c.doIsEOM(b));
   
    assertFalse(c.getPendingEOM());
   
    final TracingBuffer b2 = new TracingBuffer();
    assertEquals(b2.getStringBuffer().toString(), "");
   
    assertFalse(c.doIsEOM(b2));
    assertEquals(b2.getStringBuffer().toString(), "isEOM\n");
   
    c.setOutputFormat(new Format("zzz"));
    c.doPropagateEOM(b2);
    assertEquals(b2.getStringBuffer().toString(), "isEOM\nsetFormat(zzz)\nsetLength(0)\nsetOffset(0)\nsetEOM\n");
   
    //System.out.println(b2.getStringBuffer().toString());
    assertTrue(c.doIsEOM(b2));
    assertEquals(b2.getStringBuffer().toString(), "isEOM\nsetFormat(zzz)\nsetLength(0)\nsetOffset(0)\nsetEOM\nisEOM\n");
   
    assertFalse(c.getPendingEOM());
   
    assertEquals(b2.getStringBuffer().toString(), "isEOM\nsetFormat(zzz)\nsetLength(0)\nsetOffset(0)\nsetEOM\nisEOM\n");
    //System.out.println(b2.getStringBuffer().toString());
   
  }
View Full Code Here


 
  public void testUpdateOutput()
  {
    {
      final MyBasicCodec c = new MyBasicCodec();
      final TracingBuffer b = new TracingBuffer();
      final Format f = new Format("abc");
      c.doUpdateOutput(b, f, 10, 20);
      assertEquals(b.getLength(), 10);
      assertEquals(b.getOffset(), 20);
      assertTrue(b.getFormat() == f);
      //System.out.println(b.getStringBuffer().toString());
      assertEquals(b.getStringBuffer().toString(),
          "setFormat(abc)\n" +
          "setLength(10)\n" +
          "setOffset(20)\n" +
          "getLength\n" +
          "getOffset\n" +
          "getFormat\n");
    }
   
    {
      final MyBasicCodec c = new MyBasicCodec();
      final TracingBuffer b = new TracingBuffer()
      {

        //@Override
        public int getLength()
        {
          super.getLength();
          return 1;
        }
       
      };
      final TracingFormat f = new TracingFormat("abc");
      assertEquals(f.getStringBuffer().toString(), "");
      c.doUpdateOutput(b, f, 10, 20);
      assertEquals(f.getStringBuffer().toString(), "getEncoding\n");
     
      assertEquals(b.getLength(), 1);
      assertEquals(b.getOffset(), 20);
      assertTrue(b.getFormat() == f);
      //System.out.println(b.getStringBuffer().toString());
      assertEquals(b.getStringBuffer().toString(),
          "setFormat(abc)\n" +
          "setLength(10)\n" +
          "setOffset(20)\n" +
          "getLength\n" +
          "getOffset\n" +
          "getFormat\n");
     
    }
   
    {
      final MyBasicCodec c = new MyBasicCodec();
      final TracingBuffer b = new TracingBuffer();
      final TracingFormat f = new TracingFormat(null);
      c.doUpdateOutput(b, f, 10, 20);
      assertEquals(f.getStringBuffer().toString(), "getEncoding\n");
      assertEquals(b.getLength(), 10);
      assertEquals(b.getOffset(), 20);
      assertTrue(b.getFormat() == f);
      //System.out.println(b.getStringBuffer().toString());
      assertEquals(b.getStringBuffer().toString(),
          "setFormat(null)\n" +
          "setLength(10)\n" +
          "setOffset(20)\n" +
          "getLength\n" +
          "getOffset\n" +
          "getFormat\n");
      assertEquals(f.getStringBuffer().toString(), "getEncoding\n");
      f.toString();
      assertEquals(f.getStringBuffer().toString(), "getEncoding\ngetEncoding\n");
    }

    {
      final MyBasicCodec c = new MyBasicCodec();
      final TracingBuffer b = new TracingBuffer();
      final Format f = null;
      c.doUpdateOutput(b, f, 0, 0);
      assertEquals(b.getLength(), 0);
      assertEquals(b.getOffset(), 0);
      assertTrue(b.getFormat() == f);
      //System.out.println(b.getStringBuffer().toString());
      assertEquals(b.getStringBuffer().toString(),
          "setFormat(null)\n" +
          "setLength(0)\n" +
          "setOffset(0)\n" +
          "getLength\n" +
          "getOffset\n" +
View Full Code Here

      assertEquals(c.doCheckInputBuffer(b), true);
    }
 
    {
      final MyBasicCodec c = new MyBasicCodec();
      final TracingBuffer b = new TracingBuffer();
      final Format f = new Format(null);
      b.setFormat(f);
      b.setEOM(true);
     
      assertEquals(c.doCheckFormat(f), true);
      //System.out.println(b.getStringBuffer().toString());
      assertEquals(b.getStringBuffer().toString(), "setFormat(null)\nsetEOM\n");
     
    }
   
    {
      final MyBasicCodec c = new MyBasicCodec();
      final TracingBuffer b = new TracingBuffer();
      final Format f = new Format(null);
      b.setFormat(f);
      b.setEOM(true);
     
      assertEquals(c.doCheckInputBuffer(b), true);
      assertEquals(b.getStringBuffer().toString(), "setFormat(null)\nsetEOM\nisEOM\n");
     
    }
   
    {
      final MyBasicCodec c = new MyBasicCodec();
      final TracingBuffer b = new TracingBuffer();
      final Format f = null;
      b.setFormat(f);
      b.setEOM(true);
     
      assertEquals(c.doCheckInputBuffer(b), true);
      //System.out.println(b.getStringBuffer().toString());
      assertEquals(b.getStringBuffer().toString(), "setFormat(null)\nsetEOM\nisEOM\n");
     
    }
   
    {
      final MyBasicCodec c = new MyBasicCodec();
      final TracingBuffer b = new TracingBuffer();
      final Format f = new Format(null);
      b.setFormat(f);
     
      assertEquals(b.getStringBuffer().toString(), "setFormat(null)\n");
      assertEquals(c.doCheckInputBuffer(b), true);
      assertEquals(b.getStringBuffer().toString(), "setFormat(null)\nisEOM\ngetFormat\ngetFormat\n");
     
    }
   
    {
      final MyBasicCodec c = new MyBasicCodec();
      final TracingBuffer b = new TracingBuffer();
      final TracingFormat f = new TracingFormat(null);
      b.setFormat(f);
     
      assertEquals(c.doCheckInputBuffer(b), true);
      assertEquals(b.getStringBuffer().toString(), "setFormat(null)\nisEOM\ngetFormat\ngetFormat\n");
     
     
    }

   
    {
      final MyBasicCodec c = new MyBasicCodec();
      final TracingBuffer b = new TracingBuffer();
      final Format f = new Format("xyz");
      b.setFormat(f);
     
      assertEquals(c.doCheckInputBuffer(b), true);
      assertEquals(b.getStringBuffer().toString(), "setFormat(xyz)\nisEOM\ngetFormat\ngetFormat\n");
    }
   
    {
      final MyBasicCodec c = new MyBasicCodec();
      final TracingBuffer b = new TracingBuffer();
      b.setEOM(true);
      final Format f = new Format("xyz");
      b.setFormat(f);
     
      assertEquals(c.doCheckInputBuffer(b), true);
      //System.out.println(b.getStringBuffer().toString());
      assertEquals(b.getStringBuffer().toString(), "setEOM\nsetFormat(xyz)\nisEOM\n");
    }
   
   
  }
View Full Code Here

      assertEquals(p.doGetNativeData(b.getData()), 0L);
     
    }
   
    {
      final TracingBuffer b = new TracingBuffer();
      final Long n = new Long(1000);
      b.setData(n);
   
     
      assertEquals(p.doGetNativeData(b.getData()), 0L);
      //System.out.println(b.getStringBuffer().toString());
     
    }
   
  }
View Full Code Here

    final MyBasicPlugIn p = new MyBasicPlugIn();
   
   
   
    {
      final TracingBuffer b = new TracingBuffer();
      final Long n = new Long(1000);
      b.setData(n);
     
      assertEquals(p.doGetNativeData("12345678"), 0L);
      assertEquals(p.doGetNativeData(new Short((short) 100)), 0L);
      assertEquals(p.doGetNativeData(new Integer(100)), 0L);
      assertEquals(p.doGetNativeData(new byte[]{0,1,2,3,4,5,6,7}), 0L);
View Full Code Here

 
  public void testgetInputData()
  {
    final MyBasicPlugIn p = new MyBasicPlugIn();
    {
      final TracingBuffer b = new TracingBuffer();
      p.doGetInputData(b);
      //System.out.println(b.getStringBuffer().toString());
      assertEquals(b.getStringBuffer().toString(), "getData\n");
    }
   
    if (true)
    {
      final TracingBuffer b = new TracingBuffer();
      final byte[] bytes = new byte[] {0, 1};
      b.setData(bytes);
      p.doGetInputData(b);
      //System.out.println(b.getStringBuffer().toString());
      assertEquals(b.getStringBuffer().toString(), "setData\ngetData\n");
      assertTrue(bytes == b.getData());
    }
   
 
   
  }
View Full Code Here

 
  public void testgetOutputData()
  {
    final MyBasicPlugIn p = new MyBasicPlugIn();
    {
      final TracingBuffer b = new TracingBuffer();
      p.doGetOutputData(b);
      //System.out.println(b.getStringBuffer().toString());
      assertEquals(b.getStringBuffer().toString(), "getData\n");
    }
   
    if (true)
    {
      final TracingBuffer b = new TracingBuffer();
      final byte[] bytes = new byte[] {0, 1};
      b.setData(bytes);
      p.doGetOutputData(b);
      //System.out.println(b.getStringBuffer().toString());
      assertEquals(b.getStringBuffer().toString(), "setData\ngetData\n");
      assertTrue(bytes == b.getData());
    }
   
  }
View Full Code Here

TOP

Related Classes of net.sf.fmj.test.tracing.TracingBuffer

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.