Package mock.org.osgi.framework

Examples of mock.org.osgi.framework.BundleMock


    protected void setUp() throws Exception {
        super.setUp();

        // An authorized bundle.
        authorizedBundleMock =
                new BundleMock("authorizedBundleMock", expectations);

        authorizedBundleMock.expects.getLocation()
                .returns(AUTHORIZED_BUNDLE_LOCATION).any();
        authorizedBundleMock.expects
                .hasPermission(SecurityHelper.CONFIGURATION_PERMISSION)
                .returns(true).any();

        // An unauthorized bundle.
        unauthorizedBundleMock =
                new BundleMock("unauthorizedBundleMock", expectations);

        unauthorizedBundleMock.expects.getLocation()
                .returns(UNAUTHORIZED_BUNDLE_LOCATION).any();
        unauthorizedBundleMock.expects
                .hasPermission(SecurityHelper.CONFIGURATION_PERMISSION)
                .returns(false).any();

        // An attacking bundle.
        attackingBundleMock =
                new BundleMock("attackingBundleMock", expectations);

        attackingBundleMock.expects.getLocation()
                .returns(ATTACKING_BUNDLE_LOCATION)
                .any();
        attackingBundleMock.expects
View Full Code Here


    /**
     * Tests that all the mock objects can be initialised correctly.
     */
    public void testInitialisation() {
        new BundleMock("bundleMock", expectations);
        new BundleContextMock("bundleContextMock", expectations);
        new ServiceReferenceMock("serviceReferenceMock", expectations);
        new ServiceRegistrationMock("serviceRegistrationMock", expectations);
        new FilterMock("filterMock", expectations);
    }
View Full Code Here

TOP

Related Classes of mock.org.osgi.framework.BundleMock

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.