src/com/shrewdify/diaroser/tests/PeerImplTest.java
public void test345() throws SQLException,ClassNotFoundException,IOException,NoSpaceException{
		PeerImpl.Worker w=(new PeerImpl("ggg")).new Worker(className, dbhost, dbname, dbuser, dbpassword);
		byte temp[]={1, 0, 0, -92, -128, 0, 1, 16, 0, 0, 0, 0, 117, 127, 19, -116, 41, -96, 0, 0};
		HashSet<Avp> avpset=createSet();
		avpset.add(new Avp(263, (short)80, 0, sessionId.getBytes()));
		avpset.add(new Avp(283, (short)80, 0, "truphone".getBytes()));
		avpset.add(new Avp(461, (short)80, 0, "dskljhfsdlkjfh".getBytes()));
		avpset.add(new Avp(416, (short)80, 0, par.int32ToBytes(4)));//
		avpset.add(new Avp(415, (short)80, 0, par.int32ToBytes(1)));
		avpset.add(new Avp(456, (short)80, 0, par.encodeAvp(new Avp(437, (short)80, 0, par.encodeAvp(new Avp(417, (short)80, 0, par.int64ToBytes(1)))))));

		HashSet<Avp> e = new HashSet<Avp>();
		HashSet<Avp> et = new HashSet<Avp>();
		HashSet<Avp> ted = new HashSet<Avp>();
		{
			{

				{
					{
						e.add(new Avp(897, (short)192, 10415,  "tel:18622429128".getBytes()));
						e.add(new Avp(899, (short)192, 10415,  par.int32ToBytes(1)));
						e.add(new Avp(898, (short)192, 10415,  par.encodeAvp(new Avp(8, (short)192, 10415, "20404".getBytes()))));
					}
					et.add(new Avp(886, (short)192, 10415, par.encodeAvpSet(e)));

					{
						e.clear();
						e.add(new Avp(899, (short)192, 10415,  par.int32ToBytes(1)));
						e.add(new Avp(897, (short)192, 10415,  "tel:12018788170".getBytes()));	
					}
					et.add(new Avp(1201, (short)192, 10415, par.encodeAvpSet(e)));

					et.add(new Avp(1210, (short)192, 10415, "abcdefg".getBytes()));

				}
				ted.add(new Avp(877, (short)192, 10415, par.encodeAvpSet(et)));
			}

			{
				et.clear();
				e.clear();
				{
					e.add(new Avp(2017, (short)192, 10415,  "home alone".getBytes()));
					e.add(new Avp(2002, (short)192, 10415,  par.encodeAvp(new Avp(2006,(short)192,10415,par.int32ToBytes(2)))));
					e.add(new Avp(2009, (short)192, 10415,  par.encodeAvp(new Avp(2006, (short)192, 10415, par.int32ToBytes(1)))));
				}
				ted.add(new Avp(2000, (short)192, 10415, par.encodeAvp(new Avp(2017, (short)192, 10415, par.encodeAvpSet(e)))));
			}

			{
				byte mncmcc[]={0,98,(byte)248,48,(byte)255,(byte)255,(byte)255,(byte)255};
				ted.add(new Avp(874, (short)80, 10415, par.encodeAvp(new Avp(22, (short)80, 10415, mncmcc))));
			}

			avpset.add(new Avp(873, (short)192, 10415,par.encodeAvpSet(ted)));			
		}


		byte packet[]=merge(par.encodeAvpSet(avpset),temp);
		byte[] resulPac = w.processCCRE(packet);
		Hashtable<Integer, Avp> hds = par.decodeAvpSet(resulPac, 20);
		assertEquals(5002,par.bytesToInt(hds.get(268).rawData));

	}
// Session Not Exist Testing for Message

Session Not Exist Testing for Message
Session Not Exist Testing for Message
public void test345() throws SQLException,ClassNotFoundException,IOException,NoSpaceException{
		PeerImpl.Worker w=(new PeerImpl("ggg")).new Worker(className, dbhost, dbname, dbuser, dbpassword);
		byte temp[]={1, 0, 0, -92, -128, 0, 1, 16, 0, 0, 0, 0, 117, 127, 19, -116, 41, -96, 0, 0};
		HashSet<Avp> avpset=createSet();
		avpset.add(new Avp(263, (short)80, 0, sessionId.getBytes()));
		avpset.add(new Avp(283, (short)80, 0, "truphone".getBytes()));
		avpset.add(new Avp(461, (short)80, 0, "dskljhfsdlkjfh".getBytes()));
		avpset.add(new Avp(416, (short)80, 0, par.int32ToBytes(4)));
		avpset.add(new Avp(415, (short)80, 0, par.int32ToBytes(1)));
		avpset.add(new Avp(456, (short)80, 0, par.encodeAvp(new Avp(437, (short)80, 0, par.encodeAvp(new Avp(417, (short)80, 0, par.int64ToBytes(1)))))));
		HashSet<Avp> e = new HashSet<Avp>();
		HashSet<Avp> et = new HashSet<Avp>();
		HashSet<Avp> ted = new HashSet<Avp>();
		{
			{
				{
					{
						e.add(new Avp(897, (short)192, 10415,  "tel:18622429128".getBytes()));
						e.add(new Avp(899, (short)192, 10415,  par.int32ToBytes(1)));
						e.add(new Avp(898, (short)192, 10415,  par.encodeAvp(new Avp(8, (short)192, 10415, "20404".getBytes()))));
					}
					et.add(new Avp(886, (short)192, 10415, par.encodeAvpSet(e)));
					{
						e.clear();
						e.add(new Avp(899, (short)192, 10415,  par.int32ToBytes(1)));
						e.add(new Avp(897, (short)192, 10415,  "tel:12018788170".getBytes()));	
					}
					et.add(new Avp(1201, (short)192, 10415, par.encodeAvpSet(e)));
					et.add(new Avp(1210, (short)192, 10415, "abcdefg".getBytes()));
				}
				ted.add(new Avp(877, (short)192, 10415, par.encodeAvpSet(et)));
			}
			{
				et.clear();
				e.clear();
				{
					e.add(new Avp(2017, (short)192, 10415,  "home alone".getBytes()));
					e.add(new Avp(2002, (short)192, 10415,  par.encodeAvp(new Avp(2006,(short)192,10415,par.int32ToBytes(2)))));
					e.add(new Avp(2009, (short)192, 10415,  par.encodeAvp(new Avp(2006, (short)192, 10415, par.int32ToBytes(1)))));
				}
				ted.add(new Avp(2000, (short)192, 10415, par.encodeAvp(new Avp(2017, (short)192, 10415, par.encodeAvpSet(e)))));
			}
			{
				byte mncmcc[]={0,98,(byte)248,48,(byte)255,(byte)255,(byte)255,(byte)255};
				ted.add(new Avp(874, (short)80, 10415, par.encodeAvp(new Avp(22, (short)80, 10415, mncmcc))));
			}
			avpset.add(new Avp(873, (short)192, 10415,par.encodeAvpSet(ted)));			
		}
		byte packet[]=merge(par.encodeAvpSet(avpset),temp);
		byte[] resulPac = w.processCCRE(packet);
		Hashtable<Integer, Avp> hds = par.decodeAvpSet(resulPac, 20);
		assertEquals(5002,par.bytesToInt(hds.get(268).rawData));
	}
public void test345 ( ) throws SQLException , ClassNotFoundException , IOException , NoSpaceException { PeerImpl . Worker w = ( new PeerImpl ( "ggg" ) ) . new Worker ( className , dbhost , dbname , dbuser , dbpassword ) ; byte temp [ ] = { 1 , 0 , 0 , - 92 , - 128 , 0 , 1 , 16 , 0 , 0 , 0 , 0 , 117 , 127 , 19 , - 116 , 41 , - 96 , 0 , 0 } ; HashSet < Avp > avpset = createSet ( ) ; avpset . add ( new Avp ( 263 , ( short ) 80 , 0 , sessionId . getBytes ( ) ) ) ; avpset . add ( new Avp ( 283 , ( short ) 80 , 0 , "truphone" . getBytes ( ) ) ) ; avpset . add ( new Avp ( 461 , ( short ) 80 , 0 , "dskljhfsdlkjfh" . getBytes ( ) ) ) ; avpset . add ( new Avp ( 416 , ( short ) 80 , 0 , par . int32ToBytes ( 4 ) ) ) ; avpset . add ( new Avp ( 415 , ( short ) 80 , 0 , par . int32ToBytes ( 1 ) ) ) ; avpset . add ( new Avp ( 456 , ( short ) 80 , 0 , par . encodeAvp ( new Avp ( 437 , ( short ) 80 , 0 , par . encodeAvp ( new Avp ( 417 , ( short ) 80 , 0 , par . int64ToBytes ( 1 ) ) ) ) ) ) ) ; HashSet < Avp > e = new HashSet < Avp > ( ) ; HashSet < Avp > et = new HashSet < Avp > ( ) ; HashSet < Avp > ted = new HashSet < Avp > ( ) ; { { { { e . add ( new Avp ( 897 , ( short ) 192 , 10415 , "tel:18622429128" . getBytes ( ) ) ) ; e . add ( new Avp ( 899 , ( short ) 192 , 10415 , par . int32ToBytes ( 1 ) ) ) ; e . add ( new Avp ( 898 , ( short ) 192 , 10415 , par . encodeAvp ( new Avp ( 8 , ( short ) 192 , 10415 , "20404" . getBytes ( ) ) ) ) ) ; } et . add ( new Avp ( 886 , ( short ) 192 , 10415 , par . encodeAvpSet ( e ) ) ) ; { e . clear ( ) ; e . add ( new Avp ( 899 , ( short ) 192 , 10415 , par . int32ToBytes ( 1 ) ) ) ; e . add ( new Avp ( 897 , ( short ) 192 , 10415 , "tel:12018788170" . getBytes ( ) ) ) ; } et . add ( new Avp ( 1201 , ( short ) 192 , 10415 , par . encodeAvpSet ( e ) ) ) ; et . add ( new Avp ( 1210 , ( short ) 192 , 10415 , "abcdefg" . getBytes ( ) ) ) ; } ted . add ( new Avp ( 877 , ( short ) 192 , 10415 , par . encodeAvpSet ( et ) ) ) ; } { et . clear ( ) ; e . clear ( ) ; { e . add ( new Avp ( 2017 , ( short ) 192 , 10415 , "home alone" . getBytes ( ) ) ) ; e . add ( new Avp ( 2002 , ( short ) 192 , 10415 , par . encodeAvp ( new Avp ( 2006 , ( short ) 192 , 10415 , par . int32ToBytes ( 2 ) ) ) ) ) ; e . add ( new Avp ( 2009 , ( short ) 192 , 10415 , par . encodeAvp ( new Avp ( 2006 , ( short ) 192 , 10415 , par . int32ToBytes ( 1 ) ) ) ) ) ; } ted . add ( new Avp ( 2000 , ( short ) 192 , 10415 , par . encodeAvp ( new Avp ( 2017 , ( short ) 192 , 10415 , par . encodeAvpSet ( e ) ) ) ) ) ; } { byte mncmcc [ ] = { 0 , 98 , ( byte ) 248 , 48 , ( byte ) 255 , ( byte ) 255 , ( byte ) 255 , ( byte ) 255 } ; ted . add ( new Avp ( 874 , ( short ) 80 , 10415 , par . encodeAvp ( new Avp ( 22 , ( short ) 80 , 10415 , mncmcc ) ) ) ) ; } avpset . add ( new Avp ( 873 , ( short ) 192 , 10415 , par . encodeAvpSet ( ted ) ) ) ; } byte packet [ ] = merge ( par . encodeAvpSet ( avpset ) , temp ) ; byte [ ] resulPac = w . processCCRE ( packet ) ; Hashtable < Integer , Avp > hds = par . decodeAvpSet ( resulPac , 20 ) ; assertEquals ( 5002 , par . bytesToInt ( hds . get ( 268 ) . rawData ) ) ; }
Session Not Exist Testing for Message
Session Not Exist Testing for Message
//
