Package org.apache.ace.log.listener.MockLog

Examples of org.apache.ace.log.listener.MockLog.LogEntry


        listeners.stopInternal();

        List logEntries = ((MockLog) m_mockLog).getLogEntries();
        assert logEntries.size() == 2 : "2 log entries should be logged";

        LogEntry bundleEntry = (LogEntry) logEntries.get(0);
        assert bundleEntry.getType() == AuditEvent.BUNDLE_INSTALLED : "state BUNDLE_INSTALLED (" + AuditEvent.BUNDLE_INSTALLED + ") should be in log but '" + bundleEntry.getType() + "' is in log instead";
        Dictionary bundleProps = bundleEntry.getProperties();
        assert bundleProps.size() == 4 : "4 properties should be stored, but found: " + bundleProps.size();
        assert bundleProps.get(AuditEvent.KEY_ID).equals(Long.toString(bundleId)) : "id should be " + bundleId + " but is: " + bundleProps.get(AuditEvent.KEY_ID);
        assert bundleProps.get(AuditEvent.KEY_NAME).equals(symbolicName) : "symbolicName should be " + symbolicName + " but is " + bundleProps.get(AuditEvent.KEY_NAME);
        assert bundleProps.get(AuditEvent.KEY_VERSION).equals(bundleVersion) : "version should be " + bundleVersion + " but is " + bundleProps.get(AuditEvent.KEY_VERSION);
        assert bundleProps.get(AuditEvent.KEY_LOCATION).equals(bundleLocation) : "location should be " + bundleLocation + " but is " + bundleProps.get(AuditEvent.KEY_LOCATION);

        LogEntry frameworkEntry = (LogEntry) logEntries.get(1);
        assert frameworkEntry.getType() == AuditEvent.FRAMEWORK_INFO : "state FRAMEWORK_INFO (" + AuditEvent.FRAMEWORK_INFO + ") should be in log but '" + frameworkEntry.getType() + "' is in log instead";
        Dictionary frameworkProps = frameworkEntry.getProperties();
        assert frameworkProps.size() == 2 : "2 properties should be stored, but found: " + frameworkProps.size();
        assert frameworkProps.get(AuditEvent.KEY_ID).equals(Long.toString(bundleId)) : "id should be " + bundleId + " but is: " + frameworkProps.get(AuditEvent.KEY_ID);
        assert frameworkProps.get(AuditEvent.KEY_TYPE).equals(IllegalStateException.class.getName()) : "exceptionType should be " + IllegalStateException.class.getName() + " but is: " + frameworkProps.get(AuditEvent.KEY_TYPE);
    }
View Full Code Here


        listeners.stopInternal();

        List logEntries = ((MockLog) m_mockLog).getLogEntries();
        assert logEntries.size() == 2 : "2 log entries should be logged";

        LogEntry bundleEntry = (LogEntry) logEntries.get(0);
        assert bundleEntry.getType() == AuditEvent.BUNDLE_INSTALLED : "state BUNDLE_INSTALLED (" + AuditEvent.BUNDLE_INSTALLED + ") should be in log but '" + bundleEntry.getType() + "' is in log instead";
        Dictionary bundleProps = bundleEntry.getProperties();
        assert bundleProps.size() == 4 : "4 properties should be stored, but found: " + bundleProps.size();
        assert bundleProps.get(AuditEvent.KEY_ID).equals(Long.toString(bundleId)) : "id should be " + bundleId + " but is: " + bundleProps.get(AuditEvent.KEY_ID);
        assert bundleProps.get(AuditEvent.KEY_NAME).equals(symbolicName) : "symbolicName should be " + symbolicName + " but is " + bundleProps.get(AuditEvent.KEY_NAME);
        assert bundleProps.get(AuditEvent.KEY_VERSION).equals(bundleVersion) : "version should be " + bundleVersion + " but is " + bundleProps.get(AuditEvent.KEY_VERSION);
        assert bundleProps.get(AuditEvent.KEY_LOCATION).equals(bundleLocation) : "location should be " + bundleLocation + " but is " + bundleProps.get(AuditEvent.KEY_LOCATION);

        LogEntry frameworkEntry = (LogEntry) logEntries.get(1);
        assert frameworkEntry.getType() == AuditEvent.FRAMEWORK_INFO : "state FRAMEWORK_INFO (" + AuditEvent.FRAMEWORK_INFO + ") should be in log but '" + frameworkEntry.getType() + "' is in log instead";
        Dictionary frameworkProps = frameworkEntry.getProperties();
        assert frameworkProps.size() == 2 : "2 properties should be stored, but found: " + frameworkProps.size();
        assert frameworkProps.get(AuditEvent.KEY_ID).equals(Long.toString(bundleId)) : "id should be " + bundleId + " but is: " + frameworkProps.get(AuditEvent.KEY_ID);
        assert frameworkProps.get(AuditEvent.KEY_TYPE).equals(IllegalStateException.class.getName()) : "exceptionType should be " + IllegalStateException.class.getName() + " but is: " + frameworkProps.get(AuditEvent.KEY_TYPE);
    }
View Full Code Here

TOP

Related Classes of org.apache.ace.log.listener.MockLog.LogEntry

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.