@Test public void testCreateInstallable() throws Exception { final Map<String, Object> expectProperties = new LinkedHashMap<>(); expectProperties.put("foo", "bar"); expectProperties.put("bar", "foo"); final String expectServicePid = "myServicePid"; final String expectFactoryPid = "myFactoryPid"; final PackageId expectParentId = PackageId.fromString("test"); final String expectJcrPath = "/some/path"; OsgiConfigInstallableParams params = new OsgiConfigInstallableParams(expectProperties, expectServicePid, expectFactoryPid, null); OsgiConfigInstallable installable = params.createInstallable(expectParentId, expectJcrPath); assertSame("expect same parentId", expectParentId, installable.getParentId()); assertSame("expect same jcrPath", expectJcrPath, installable.getJcrPath()); assertEquals("expect same properties", expectProperties, params.getProperties()); assertEquals("expect same servicePid", expectServicePid, params.getServicePid()); assertEquals("expect same factoryPid", expectFactoryPid, params.getFactoryPid()); assertNull("expect null parseError", params.getParseError()); }
@NotNull @Override public OsgiConfigInstallable createInstallable(final PackageId parentPackageId, final String jcrPath) throws Exception { if (parseError != null) { throw parseError; } return new OsgiConfigInstallable(parentPackageId, jcrPath, properties, servicePid, factoryPid); }
OsgiConfigInstallableParams implements SlingInstallableParams<OsgiConfigInstallable> { @NotNull @Override public OsgiConfigInstallable createInstallable(final PackageId parentPackageId, final String jcrPath) throws Exception { if (parseError != null) { throw parseError; } return new OsgiConfigInstallable(parentPackageId, jcrPath, properties, servicePid, factoryPid); } }
OsgiConfigInstallableParams implements SlingInstallableParams<OsgiConfigInstallable> { @NotNull @Override public OsgiConfigInstallable createInstallable(final PackageId parentPackageId, final String jcrPath) throws Exception { if (parseError != null) { throw parseError; } return new OsgiConfigInstallable(parentPackageId, jcrPath, properties, servicePid, factoryPid); } OsgiConfigInstallableParams(@NotNull final Map<String, Object> properties,
                                       @NotNull final String servicePid,
                                       @Nullable final String factoryPid,
                                       @Nullable final Exception parseError); }
OsgiConfigInstallableParams implements SlingInstallableParams<OsgiConfigInstallable> { @NotNull @Override public OsgiConfigInstallable createInstallable(final PackageId parentPackageId, final String jcrPath) throws Exception { if (parseError != null) { throw parseError; } return new OsgiConfigInstallable(parentPackageId, jcrPath, properties, servicePid, factoryPid); } OsgiConfigInstallableParams(@NotNull final Map<String, Object> properties,
                                       @NotNull final String servicePid,
                                       @Nullable final String factoryPid,
                                       @Nullable final Exception parseError); String getServicePid(); String getFactoryPid(); Map<String, Object> getProperties(); Exception getParseError(); @NotNull @Override OsgiConfigInstallable createInstallable(final PackageId parentPackageId, final String jcrPath); @Override @NotNull Class<OsgiConfigInstallable> getInstallableType(); }
OsgiConfigInstallableParams implements SlingInstallableParams<OsgiConfigInstallable> { @NotNull @Override public OsgiConfigInstallable createInstallable(final PackageId parentPackageId, final String jcrPath) throws Exception { if (parseError != null) { throw parseError; } return new OsgiConfigInstallable(parentPackageId, jcrPath, properties, servicePid, factoryPid); } OsgiConfigInstallableParams(@NotNull final Map<String, Object> properties,
                                       @NotNull final String servicePid,
                                       @Nullable final String factoryPid,
                                       @Nullable final Exception parseError); String getServicePid(); String getFactoryPid(); Map<String, Object> getProperties(); Exception getParseError(); @NotNull @Override OsgiConfigInstallable createInstallable(final PackageId parentPackageId, final String jcrPath); @Override @NotNull Class<OsgiConfigInstallable> getInstallableType();  }