Package org.jacorb.orb

Examples of org.jacorb.orb.CDRInputStream.read_string()


        char[] buffer = new char[4];
        buffer[0] = 'w';
        stream.read_char_array( buffer, 1, 3 );
        assertEquals( "char array", "wxyz", new String( buffer ) );
        assertEquals( "string value", "CAFE", stream.read_string() );
        stream.close();
    }


    /**
 
View Full Code Here


                'x'
        };
        CDRInputStream stream = new CDRInputStream( orb, codedText );
        selectCodeSets( stream, "UTF8", "UTF8" );
        stream.setGIOPMinor( 1 );
        assertEquals( "sstring value", "asdf", stream.read_string() );
        assertEquals( "char 1", 'x', stream.read_char() );
        stream.close();
    }

View Full Code Here

    {
        byte[] codedText = {0,0,0,0};
        CDRInputStream stream = new CDRInputStream( orb, codedText );
        try
        {
            stream.read_string();
            fail("Null encoded string should have failed with an exception");
        }
        catch (MARSHAL e)
        {
            assertNotNull(e.getMessage());
View Full Code Here

        assertTrue("Buffer size should be 9",
                bufferCopy.length == (4 + 1 + length(source)));

        CDRInputStream cdrin = (CDRInputStream) cdrOutputStream.create_input_stream();
        String result = cdrin.read_string();
        assertTrue("Strings should match", source.equals(result));

        Assert.assertArrayEquals(sourceMatch, result.getBytes("utf-8"));
        Assert.assertArrayEquals(sourceMatch, toMatch);
View Full Code Here

    @Test
    public void testZeroSizedNullEncodedString() throws Exception
    {
        byte[] codedText = {0,0,0,0};
        CDRInputStream stream = new CDRInputStream( orb, codedText );
        assertEquals( "read_string ", null, stream.read_string() );
        stream.close();
    }

    @Test
    public void testCorrectlyEncodedEmptyString() {
View Full Code Here

    @Test
    public void testCorrectlyEncodedEmptyString() {
        byte[] codedText = {0,0,0,1,0};
        CDRInputStream stream = new CDRInputStream( orb, codedText );
        assertEquals( "read_string of size 1", "", stream.read_string() );
        stream.close();
    }

    @Test
    public void testWriteNullString() throws Exception
View Full Code Here

        cdr.write_string(null);
        cdr.write_string("TEST");

        CDRInputStream read = (CDRInputStream)cdr.create_input_stream();

        assertEquals (null, read.read_string());
        read.read_boolean();
        assertEquals (null, read.read_string());
        assertEquals ("TEST", read.read_string());

        cdr.close();
View Full Code Here

        CDRInputStream read = (CDRInputStream)cdr.create_input_stream();

        assertEquals (null, read.read_string());
        read.read_boolean();
        assertEquals (null, read.read_string());
        assertEquals ("TEST", read.read_string());

        cdr.close();
        read.close();
    }
View Full Code Here

        CDRInputStream read = (CDRInputStream)cdr.create_input_stream();

        assertEquals (null, read.read_string());
        read.read_boolean();
        assertEquals (null, read.read_string());
        assertEquals ("TEST", read.read_string());

        cdr.close();
        read.close();
    }
}
View Full Code Here

        t1.write_string(UNI1);

        CDRInputStream t2 = new CDRInputStream (myorb, t1.getBufferCopy());

        String result = t2.read_string();

        if( configuration == Mode.CODESET_ON)
        {
            assertTrue (UNI1.equals (result));
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.