Java Code Examples for java.rmi.server.RemoteServer#getLog()

The following examples show how to use java.rmi.server.RemoteServer#getLog() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CheckLogging.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Check serverCallLog output
 */
private static void checkServerCallLog() throws Exception {
    ByteArrayOutputStream serverCallLog = new ByteArrayOutputStream();
    RemoteServer.setLog(serverCallLog);
    Naming.list(LOCATION);
    verifyLog(serverCallLog, "list");

    serverCallLog.reset();
    RemoteServer.setLog(null);
    PrintStream callStream = RemoteServer.getLog();
    if (callStream != null) {
        TestLibrary.bomb("call stream not null after calling " +
                         "setLog(null)");
    } else {
        System.err.println("call stream should be null and it is");
    }
    Naming.list(LOCATION);

    if (usingOld) {
        if (serverCallLog.toString().indexOf("UnicastServerRef") >= 0) {
            TestLibrary.bomb("server call logging not turned off");
        }
    } else if (serverCallLog.toByteArray().length != 0) {
        TestLibrary.bomb("call log contains output but it " +
                         "should be empty");
    }

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    try {
        // generates a notbound exception
        Naming.lookup(LOCATION + "notthere");
    } catch (Exception e) {
    }
    verifyLog(serverCallLog, "exception");

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    callStream = RemoteServer.getLog();
    callStream.println("bingo, this is a getLog test");
    verifyLog(serverCallLog, "bingo");
}
 
Example 2
Source File: CheckLogging.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Check serverCallLog output
 */
private static void checkServerCallLog() throws Exception {
    ByteArrayOutputStream serverCallLog = new ByteArrayOutputStream();
    RemoteServer.setLog(serverCallLog);
    Naming.list(LOCATION);
    verifyLog(serverCallLog, "list");

    serverCallLog.reset();
    RemoteServer.setLog(null);
    PrintStream callStream = RemoteServer.getLog();
    if (callStream != null) {
        TestLibrary.bomb("call stream not null after calling " +
                         "setLog(null)");
    } else {
        System.err.println("call stream should be null and it is");
    }
    Naming.list(LOCATION);

    if (usingOld) {
        if (serverCallLog.toString().indexOf("UnicastServerRef") >= 0) {
            TestLibrary.bomb("server call logging not turned off");
        }
    } else if (serverCallLog.toByteArray().length != 0) {
        TestLibrary.bomb("call log contains output but it " +
                         "should be empty");
    }

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    try {
        // generates a notbound exception
        Naming.lookup(LOCATION + "notthere");
    } catch (Exception e) {
    }
    verifyLog(serverCallLog, "exception");

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    callStream = RemoteServer.getLog();
    callStream.println("bingo, this is a getLog test");
    verifyLog(serverCallLog, "bingo");
}
 
Example 3
Source File: CheckLogging.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Check serverCallLog output
 */
private static void checkServerCallLog() throws Exception {
    ByteArrayOutputStream serverCallLog = new ByteArrayOutputStream();
    RemoteServer.setLog(serverCallLog);
    Naming.list(LOCATION);
    verifyLog(serverCallLog, "list");

    serverCallLog.reset();
    RemoteServer.setLog(null);
    PrintStream callStream = RemoteServer.getLog();
    if (callStream != null) {
        TestLibrary.bomb("call stream not null after calling " +
                         "setLog(null)");
    } else {
        System.err.println("call stream should be null and it is");
    }
    Naming.list(LOCATION);

    if (usingOld) {
        if (serverCallLog.toString().indexOf("UnicastServerRef") >= 0) {
            TestLibrary.bomb("server call logging not turned off");
        }
    } else if (serverCallLog.toByteArray().length != 0) {
        TestLibrary.bomb("call log contains output but it " +
                         "should be empty");
    }

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    try {
        // generates a notbound exception
        Naming.lookup(LOCATION + "notthere");
    } catch (Exception e) {
    }
    verifyLog(serverCallLog, "exception");

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    callStream = RemoteServer.getLog();
    callStream.println("bingo, this is a getLog test");
    verifyLog(serverCallLog, "bingo");
}
 
Example 4
Source File: CheckLogging.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Check serverCallLog output
 */
private static void checkServerCallLog() throws Exception {
    ByteArrayOutputStream serverCallLog = new ByteArrayOutputStream();
    RemoteServer.setLog(serverCallLog);
    Naming.list(LOCATION);
    verifyLog(serverCallLog, "list");

    serverCallLog.reset();
    RemoteServer.setLog(null);
    PrintStream callStream = RemoteServer.getLog();
    if (callStream != null) {
        TestLibrary.bomb("call stream not null after calling " +
                         "setLog(null)");
    } else {
        System.err.println("call stream should be null and it is");
    }
    Naming.list(LOCATION);

    if (usingOld) {
        if (serverCallLog.toString().indexOf("UnicastServerRef") >= 0) {
            TestLibrary.bomb("server call logging not turned off");
        }
    } else if (serverCallLog.toByteArray().length != 0) {
        TestLibrary.bomb("call log contains output but it " +
                         "should be empty");
    }

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    try {
        // generates a notbound exception
        Naming.lookup(LOCATION + "notthere");
    } catch (Exception e) {
    }
    verifyLog(serverCallLog, "exception");

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    callStream = RemoteServer.getLog();
    callStream.println("bingo, this is a getLog test");
    verifyLog(serverCallLog, "bingo");
}
 
Example 5
Source File: CheckLogging.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Check serverCallLog output
 */
private static void checkServerCallLog() throws Exception {
    ByteArrayOutputStream serverCallLog = new ByteArrayOutputStream();
    RemoteServer.setLog(serverCallLog);
    Naming.list(LOCATION);
    verifyLog(serverCallLog, "list");

    serverCallLog.reset();
    RemoteServer.setLog(null);
    PrintStream callStream = RemoteServer.getLog();
    if (callStream != null) {
        TestLibrary.bomb("call stream not null after calling " +
                         "setLog(null)");
    } else {
        System.err.println("call stream should be null and it is");
    }
    Naming.list(LOCATION);

    if (usingOld) {
        if (serverCallLog.toString().indexOf("UnicastServerRef") >= 0) {
            TestLibrary.bomb("server call logging not turned off");
        }
    } else if (serverCallLog.toByteArray().length != 0) {
        TestLibrary.bomb("call log contains output but it " +
                         "should be empty");
    }

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    try {
        // generates a notbound exception
        Naming.lookup(LOCATION + "notthere");
    } catch (Exception e) {
    }
    verifyLog(serverCallLog, "exception");

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    callStream = RemoteServer.getLog();
    callStream.println("bingo, this is a getLog test");
    verifyLog(serverCallLog, "bingo");
}
 
Example 6
Source File: CheckLogging.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Check serverCallLog output
 */
private static void checkServerCallLog() throws Exception {
    ByteArrayOutputStream serverCallLog = new ByteArrayOutputStream();
    RemoteServer.setLog(serverCallLog);
    Naming.list(LOCATION);
    verifyLog(serverCallLog, "list");

    serverCallLog.reset();
    RemoteServer.setLog(null);
    PrintStream callStream = RemoteServer.getLog();
    if (callStream != null) {
        TestLibrary.bomb("call stream not null after calling " +
                         "setLog(null)");
    } else {
        System.err.println("call stream should be null and it is");
    }
    Naming.list(LOCATION);

    if (usingOld) {
        if (serverCallLog.toString().indexOf("UnicastServerRef") >= 0) {
            TestLibrary.bomb("server call logging not turned off");
        }
    } else if (serverCallLog.toByteArray().length != 0) {
        TestLibrary.bomb("call log contains output but it " +
                         "should be empty");
    }

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    try {
        // generates a notbound exception
        Naming.lookup(LOCATION + "notthere");
    } catch (Exception e) {
    }
    verifyLog(serverCallLog, "exception");

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    callStream = RemoteServer.getLog();
    callStream.println("bingo, this is a getLog test");
    verifyLog(serverCallLog, "bingo");
}
 
Example 7
Source File: CheckLogging.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Check serverCallLog output
 */
private static void checkServerCallLog() throws Exception {
    ByteArrayOutputStream serverCallLog = new ByteArrayOutputStream();
    RemoteServer.setLog(serverCallLog);
    Naming.list(LOCATION);
    verifyLog(serverCallLog, "list");

    serverCallLog.reset();
    RemoteServer.setLog(null);
    PrintStream callStream = RemoteServer.getLog();
    if (callStream != null) {
        TestLibrary.bomb("call stream not null after calling " +
                         "setLog(null)");
    } else {
        System.err.println("call stream should be null and it is");
    }
    Naming.list(LOCATION);

    if (usingOld) {
        if (serverCallLog.toString().indexOf("UnicastServerRef") >= 0) {
            TestLibrary.bomb("server call logging not turned off");
        }
    } else if (serverCallLog.toByteArray().length != 0) {
        TestLibrary.bomb("call log contains output but it " +
                         "should be empty");
    }

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    try {
        // generates a notbound exception
        Naming.lookup(LOCATION + "notthere");
    } catch (Exception e) {
    }
    verifyLog(serverCallLog, "exception");

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    callStream = RemoteServer.getLog();
    callStream.println("bingo, this is a getLog test");
    verifyLog(serverCallLog, "bingo");
}
 
Example 8
Source File: CheckLogging.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Check serverCallLog output
 */
private static void checkServerCallLog() throws Exception {
    ByteArrayOutputStream serverCallLog = new ByteArrayOutputStream();
    RemoteServer.setLog(serverCallLog);
    Naming.list(LOCATION);
    verifyLog(serverCallLog, "list");

    serverCallLog.reset();
    RemoteServer.setLog(null);
    PrintStream callStream = RemoteServer.getLog();
    if (callStream != null) {
        TestLibrary.bomb("call stream not null after calling " +
                         "setLog(null)");
    } else {
        System.err.println("call stream should be null and it is");
    }
    Naming.list(LOCATION);

    if (usingOld) {
        if (serverCallLog.toString().indexOf("UnicastServerRef") >= 0) {
            TestLibrary.bomb("server call logging not turned off");
        }
    } else if (serverCallLog.toByteArray().length != 0) {
        TestLibrary.bomb("call log contains output but it " +
                         "should be empty");
    }

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    try {
        // generates a notbound exception
        Naming.lookup(LOCATION + "notthere");
    } catch (Exception e) {
    }
    verifyLog(serverCallLog, "exception");

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    callStream = RemoteServer.getLog();
    callStream.println("bingo, this is a getLog test");
    verifyLog(serverCallLog, "bingo");
}
 
Example 9
Source File: CheckLogging.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Check serverCallLog output
 */
private static void checkServerCallLog() throws Exception {
    ByteArrayOutputStream serverCallLog = new ByteArrayOutputStream();
    RemoteServer.setLog(serverCallLog);
    Naming.list(LOCATION);
    verifyLog(serverCallLog, "list");

    serverCallLog.reset();
    RemoteServer.setLog(null);
    PrintStream callStream = RemoteServer.getLog();
    if (callStream != null) {
        TestLibrary.bomb("call stream not null after calling " +
                         "setLog(null)");
    } else {
        System.err.println("call stream should be null and it is");
    }
    Naming.list(LOCATION);

    if (usingOld) {
        if (serverCallLog.toString().indexOf("UnicastServerRef") >= 0) {
            TestLibrary.bomb("server call logging not turned off");
        }
    } else if (serverCallLog.toByteArray().length != 0) {
        TestLibrary.bomb("call log contains output but it " +
                         "should be empty");
    }

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    try {
        // generates a notbound exception
        Naming.lookup(LOCATION + "notthere");
    } catch (Exception e) {
    }
    verifyLog(serverCallLog, "exception");

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    callStream = RemoteServer.getLog();
    callStream.println("bingo, this is a getLog test");
    verifyLog(serverCallLog, "bingo");
}
 
Example 10
Source File: CheckLogging.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Check serverCallLog output
 */
private static void checkServerCallLog() throws Exception {
    ByteArrayOutputStream serverCallLog = new ByteArrayOutputStream();
    RemoteServer.setLog(serverCallLog);
    Naming.list(LOCATION);
    verifyLog(serverCallLog, "list");

    serverCallLog.reset();
    RemoteServer.setLog(null);
    PrintStream callStream = RemoteServer.getLog();
    if (callStream != null) {
        TestLibrary.bomb("call stream not null after calling " +
                         "setLog(null)");
    } else {
        System.err.println("call stream should be null and it is");
    }
    Naming.list(LOCATION);

    if (usingOld) {
        if (serverCallLog.toString().indexOf("UnicastServerRef") >= 0) {
            TestLibrary.bomb("server call logging not turned off");
        }
    } else if (serverCallLog.toByteArray().length != 0) {
        TestLibrary.bomb("call log contains output but it " +
                         "should be empty");
    }

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    try {
        // generates a notbound exception
        Naming.lookup(LOCATION + "notthere");
    } catch (Exception e) {
    }
    verifyLog(serverCallLog, "exception");

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    callStream = RemoteServer.getLog();
    callStream.println("bingo, this is a getLog test");
    verifyLog(serverCallLog, "bingo");
}
 
Example 11
Source File: CheckLogging.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Check serverCallLog output
 */
private static void checkServerCallLog() throws Exception {
    ByteArrayOutputStream serverCallLog = new ByteArrayOutputStream();
    RemoteServer.setLog(serverCallLog);
    Naming.list(LOCATION);
    verifyLog(serverCallLog, "list");

    serverCallLog.reset();
    RemoteServer.setLog(null);
    PrintStream callStream = RemoteServer.getLog();
    if (callStream != null) {
        TestLibrary.bomb("call stream not null after calling " +
                         "setLog(null)");
    } else {
        System.err.println("call stream should be null and it is");
    }
    Naming.list(LOCATION);

    if (usingOld) {
        if (serverCallLog.toString().indexOf("UnicastServerRef") >= 0) {
            TestLibrary.bomb("server call logging not turned off");
        }
    } else if (serverCallLog.toByteArray().length != 0) {
        TestLibrary.bomb("call log contains output but it " +
                         "should be empty");
    }

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    try {
        // generates a notbound exception
        Naming.lookup(LOCATION + "notthere");
    } catch (Exception e) {
    }
    verifyLog(serverCallLog, "exception");

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    callStream = RemoteServer.getLog();
    callStream.println("bingo, this is a getLog test");
    verifyLog(serverCallLog, "bingo");
}
 
Example 12
Source File: CheckLogging.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Check serverCallLog output
 */
private static void checkServerCallLog() throws Exception {
    ByteArrayOutputStream serverCallLog = new ByteArrayOutputStream();
    RemoteServer.setLog(serverCallLog);
    Naming.list(LOCATION);
    verifyLog(serverCallLog, "list");

    serverCallLog.reset();
    RemoteServer.setLog(null);
    PrintStream callStream = RemoteServer.getLog();
    if (callStream != null) {
        TestLibrary.bomb("call stream not null after calling " +
                         "setLog(null)");
    } else {
        System.err.println("call stream should be null and it is");
    }
    Naming.list(LOCATION);

    if (usingOld) {
        if (serverCallLog.toString().indexOf("UnicastServerRef") >= 0) {
            TestLibrary.bomb("server call logging not turned off");
        }
    } else if (serverCallLog.toByteArray().length != 0) {
        TestLibrary.bomb("call log contains output but it " +
                         "should be empty");
    }

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    try {
        // generates a notbound exception
        Naming.lookup(LOCATION + "notthere");
    } catch (Exception e) {
    }
    verifyLog(serverCallLog, "exception");

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    callStream = RemoteServer.getLog();
    callStream.println("bingo, this is a getLog test");
    verifyLog(serverCallLog, "bingo");
}
 
Example 13
Source File: CheckLogging.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Check serverCallLog output
 */
private static void checkServerCallLog() throws Exception {
    ByteArrayOutputStream serverCallLog = new ByteArrayOutputStream();
    RemoteServer.setLog(serverCallLog);
    Naming.list(LOCATION);
    verifyLog(serverCallLog, "list");

    serverCallLog.reset();
    RemoteServer.setLog(null);
    PrintStream callStream = RemoteServer.getLog();
    if (callStream != null) {
        TestLibrary.bomb("call stream not null after calling " +
                         "setLog(null)");
    } else {
        System.err.println("call stream should be null and it is");
    }
    Naming.list(LOCATION);

    if (usingOld) {
        if (serverCallLog.toString().indexOf("UnicastServerRef") >= 0) {
            TestLibrary.bomb("server call logging not turned off");
        }
    } else if (serverCallLog.toByteArray().length != 0) {
        TestLibrary.bomb("call log contains output but it " +
                         "should be empty");
    }

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    try {
        // generates a notbound exception
        Naming.lookup(LOCATION + "notthere");
    } catch (Exception e) {
    }
    verifyLog(serverCallLog, "exception");

    serverCallLog.reset();
    RemoteServer.setLog(serverCallLog);
    callStream = RemoteServer.getLog();
    callStream.println("bingo, this is a getLog test");
    verifyLog(serverCallLog, "bingo");
}