Package org.eobjects.datacleaner.user

Examples of org.eobjects.datacleaner.user.ExtensionPackage


  public void testLoadExtension() throws Exception {
    File file = new File("src/test/resources/FooBarPlugin.jar");
    assertTrue("example plugin jar does not exist", file.exists());

    ExtensionPackage extensionPackage = new ExtensionPackage("foobar plugin", "foo.bar", true, new File[] { file });

    assertFalse(extensionPackage.isLoaded());

    ClasspathScanDescriptorProvider descriptorProvider = new ClasspathScanDescriptorProvider();
    extensionPackage.loadExtension(descriptorProvider);

    assertTrue(extensionPackage.isLoaded());
    assertEquals(1, extensionPackage.getLoadedAnalyzers());
    assertEquals(1, extensionPackage.getLoadedTransformers());
    assertEquals(1, extensionPackage.getLoadedFilters());

    assertEquals("[AnnotationBasedAnalyzerBeanDescriptor[foo.bar.analyzer.BazAnalyzer]]", descriptorProvider
        .getAnalyzerBeanDescriptors().toString());
    assertEquals("[AnnotationBasedTransformerBeanDescriptor[foo.bar.transformer.BazTransformer]]", descriptorProvider
        .getTransformerBeanDescriptors().toString());
View Full Code Here


    _userPreferences = userPreferences;
  }

  public ExtensionPackage registerExtensionPackage(ExtensionSwapPackage extensionSwapPackage, File jarFile) {
    String packageName = ExtensionPackage.autoDetectPackageName(jarFile);
    ExtensionPackage extensionPackage = new ExtensionPackage(extensionSwapPackage.getName(), packageName, true,
        new File[] { jarFile });
    extensionPackage.getAdditionalProperties().put(EXTENSIONSWAP_ID_PROPERTY, extensionSwapPackage.getId());
    extensionPackage.getAdditionalProperties().put(EXTENSIONSWAP_VERSION_PROPERTY,
        Integer.toString(extensionSwapPackage.getVersion()));
    extensionPackage.loadExtension(DCConfiguration.get().getDescriptorProvider());
    _userPreferences.getExtensionPackages().add(extensionPackage);
    return extensionPackage;
  }
View Full Code Here

                  extensionNameBuilder.append(", ");
                }
                extensionNameBuilder.append(file.getName());
              }
              final String extensionName = extensionNameBuilder.toString();
              final ExtensionPackage userExtensionPackage = new ExtensionPackage(extensionName, packageName,
                  true, files);
              userExtensionPackage.loadExtension(DCConfiguration.get().getDescriptorProvider());
              extensionPackages.add(userExtensionPackage);

              updateComponents();
            }
          }
View Full Code Here

TOP

Related Classes of org.eobjects.datacleaner.user.ExtensionPackage

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.