Exemplo n.º 1
0
	static void setupFm(void) {
		int rc = 0;
		bundle_pt bundle = NULL;

		//server
		rc = celixLauncher_launch("server.properties", &serverFramework);
		CHECK_EQUAL(CELIX_SUCCESS, rc);

		bundle = NULL;
		rc = framework_getFrameworkBundle(serverFramework, &bundle);
		CHECK_EQUAL(CELIX_SUCCESS, rc);

		rc = bundle_getContext(bundle, &serverContext);
		CHECK_EQUAL(CELIX_SUCCESS, rc);

		//client
		rc = celixLauncher_launch("client.properties", &clientFramework);
		CHECK_EQUAL(CELIX_SUCCESS, rc);

		bundle = NULL;
		rc = framework_getFrameworkBundle(clientFramework, &bundle);
		CHECK_EQUAL(CELIX_SUCCESS, rc);

		rc = bundle_getContext(bundle, &clientContext);
		CHECK_EQUAL(CELIX_SUCCESS, rc);
	}
Exemplo n.º 2
0
    static void setupFm(void) {
        int rc = 0;

        rc = celixLauncher_launch("config.properties", &framework);
        CHECK_EQUAL(CELIX_SUCCESS, rc);

        bundle_pt bundle = NULL;
        rc = framework_getFrameworkBundle(framework, &bundle);
        CHECK_EQUAL(CELIX_SUCCESS, rc);

        rc = bundle_getContext(bundle, &context);
        CHECK_EQUAL(CELIX_SUCCESS, rc);

        rc = bundleContext_getServiceReference(context, (char *)OSGI_RSA_REMOTE_SERVICE_ADMIN, &rsaRef);
        CHECK_EQUAL(CELIX_SUCCESS, rc);
        CHECK(rsaRef != NULL);

        rc = bundleContext_getService(context, rsaRef, (void **)&rsa);
        CHECK_EQUAL(CELIX_SUCCESS, rc);

        rc = bundleContext_getServiceReference(context, (char *)CALCULATOR2_SERVICE, &calcRef);
        CHECK_EQUAL(CELIX_SUCCESS, rc);
        CHECK(calcRef != NULL);

        rc = bundleContext_getService(context, calcRef, (void **)&calc);
        CHECK_EQUAL(CELIX_SUCCESS, rc);
    }
Exemplo n.º 3
0
    static void setupFmImport(void) {
        int rc = 0;
        rc = celixLauncher_launch("config_import.properties", &framework);
        CHECK_EQUAL(CELIX_SUCCESS, rc);

        bundle_pt bundle = NULL;
        rc = framework_getFrameworkBundle(framework, &bundle);
        CHECK_EQUAL(CELIX_SUCCESS, rc);

        rc = bundle_getContext(bundle, &context);
        CHECK_EQUAL(CELIX_SUCCESS, rc);

        rc = bundleContext_getServiceReference(context, (char *)OSGI_RSA_REMOTE_SERVICE_ADMIN, &rsaRef);
        CHECK_EQUAL(CELIX_SUCCESS, rc);
        CHECK(rsaRef != NULL);

        rc = bundleContext_getService(context, rsaRef, (void **)&rsa);
        CHECK_EQUAL(CELIX_SUCCESS, rc);

        rc = bundleContext_getServiceReference(context, (char *)TOPOLOGYMANAGER_SCOPE_SERVICE, &scopeServiceRef);
        CHECK_EQUAL(CELIX_SUCCESS, rc);
        CHECK(scopeServiceRef != NULL);

        rc = bundleContext_getService(context, scopeServiceRef, (void **)&tmScopeService);
        CHECK_EQUAL(CELIX_SUCCESS, rc);

        rc = bundleContext_getServiceReference(context, (char *)TST_SERVICE_NAME, &testRef);
        CHECK_EQUAL(CELIX_SUCCESS, rc);
        CHECK(testRef != NULL);

        rc = bundleContext_getService(context, testRef, (void **)&testImport);
        CHECK_EQUAL(CELIX_SUCCESS, rc);

        rc = bundleContext_getServiceReference(context, (char*)OSGI_ENDPOINT_LISTENER_SERVICE, &eplRef);
        CHECK_EQUAL(CELIX_SUCCESS, rc);
        CHECK(eplRef != NULL);

        rc = bundleContext_getService(context, eplRef, (void **)&eplService);
        CHECK_EQUAL(CELIX_SUCCESS, rc);
    }