Package org.apache.yoko.orb.CORBA

Examples of org.apache.yoko.orb.CORBA.OutputStream


        assertTrue(ll == longlongValue.longValue());
    }
   
    public void testWriteULongLong() {
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
       
        CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
        BigInteger ulonglongValue = new BigInteger("12345678900");
        writer.writeULongLong(ulonglongValue);
       
        InputStream iStream = oStream.create_input_stream();
        long ul = iStream.read_ulonglong();
        assertTrue(ul == ulonglongValue.longValue());
    }
View Full Code Here


        assertTrue(ul == ulonglongValue.longValue());
    }
   
    public void testWriteFloat() {
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
       
        CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
        Float floatValue = new Float((float)123456.78);
        writer.writeFloat(floatValue);
       
        InputStream iStream = oStream.create_input_stream();
        float f = iStream.read_float();
        assertTrue(f == floatValue.floatValue());
    }
View Full Code Here

        assertTrue(f == floatValue.floatValue());
    }
   
    public void testWriteDouble() {
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
       
        CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
        Double doubleValue = new Double(987654.321);
        writer.writeDouble(doubleValue);
       
        InputStream iStream = oStream.create_input_stream();
        double d = iStream.read_double();
        assertTrue(d == doubleValue.doubleValue());
    }
View Full Code Here

        assertTrue(d == doubleValue.doubleValue());
    }
   
    public void testWriteString() {
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
       
        CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
        String stringValue = new String("String");
        writer.writeString(stringValue);
       
        InputStream iStream = oStream.create_input_stream();
        String s = iStream.read_string();
        assertTrue(s.equals(stringValue));
    }
View Full Code Here

        assertTrue(s.equals(stringValue));
    }

    public void testWriteWString() {
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
       
        CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
        String wstringValue = new String("String");
        writer.writeWString(wstringValue);
       
        InputStream iStream = oStream.create_input_stream();
        String s = iStream.read_wstring();
        assertTrue(s.equals(wstringValue));
    }
View Full Code Here

            nestedObj.setValueFromData(Integer.toString(data[i]));
            obj.addElement(nestedObj);
        }

        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
        CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
        writer.writeArray(obj);
       
        InputStream iStream = oStream.create_input_stream();
        for (int i = 0; i < data.length; ++i) {
            int val = iStream.read_long();
            assertTrue(val == data[i]);
        }
    }
View Full Code Here

            nestedObj.setValueFromData(data[i]);
            obj.addElement(nestedObj);
        }
       
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
        CorbaObjectWriter writer =  new CorbaObjectWriter(oStream);
        writer.writeSequence(obj);
       
        InputStream iStream = oStream.create_input_stream();
        int length = iStream.read_long();
        for (int i = 0; i < length; ++i) {
            String val = iStream.read_string();
            assertTrue(val.equals(data[i]));
        }
View Full Code Here

        obj.addMember(memberObj1);
        obj.addMember(memberObj2);
        obj.addMember(memberObj3);
       
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
        CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
        writer.writeStruct(obj);
       
        InputStream iStream = oStream.create_input_stream();
        int readMember1 = iStream.read_long();
        assertTrue(readMember1 == member1);
        String readMember2 = iStream.read_string();
        assertTrue(readMember2.equals(member2));
        boolean readMember3 = iStream.read_boolean();
View Full Code Here

        member2.setValueFromData(message);
        obj.addMember(member1);
        obj.addMember(member2);

        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
        CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
        writer.writeException(obj);

        InputStream iStream = oStream.create_input_stream();
       
        String readId = iStream.read_string();
        assertTrue(readId.equals(reposID));
        short readCode = iStream.read_short();
        assertTrue(readCode == code);
View Full Code Here

        assertTrue(boolValue.booleanValue() == true);
    }
   
    public void testReadChar() {
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
        oStream.write_char('c');
       
        InputStream iStream = oStream.create_input_stream();
        CorbaObjectReader reader = new CorbaObjectReader(iStream);
       
        Character charValue = reader.readChar();
        assertTrue(charValue.charValue() == 'c');
    }
View Full Code Here

TOP

Related Classes of org.apache.yoko.orb.CORBA.OutputStream

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.