JobTypeManager { public synchronized JobTypePluginSet getJobTypePluginSet() { return this.pluginSet; } JobTypeManager(final String jobtypePluginDir, final Props globalProperties,
      final ClassLoader parentClassLoader); void loadPlugins(); Job buildJobExecutor(final String jobId, Props jobProps, final Logger logger); synchronized JobTypePluginSet getJobTypePluginSet();  }
@Test public void testCommonPluginProps() throws Exception { final JobTypePluginSet pluginSet = this.manager.getJobTypePluginSet(); final Props props = pluginSet.getCommonPluginJobProps(); System.out.println(props.toString()); assertEquals("commonprop1", props.getString("commonprop1")); assertEquals("commonprop2", props.getString("commonprop2")); assertEquals("commonprop3", props.getString("commonprop3")); final Props priv = pluginSet.getCommonPluginLoadProps(); assertEquals("commonprivate1", priv.getString("commonprivate1")); assertEquals("commonprivate2", priv.getString("commonprivate2")); assertEquals("commonprivate3", priv.getString("commonprivate3")); }
@Test public void testLoadedClasses() throws Exception { final JobTypePluginSet pluginSet = this.manager.getJobTypePluginSet(); final Props props = pluginSet.getCommonPluginJobProps(); System.out.println(props.toString()); assertEquals("commonprop1", props.getString("commonprop1")); assertEquals("commonprop2", props.getString("commonprop2")); assertEquals("commonprop3", props.getString("commonprop3")); assertNull(props.get("commonprivate1")); final Props priv = pluginSet.getCommonPluginLoadProps(); assertEquals("commonprivate1", priv.getString("commonprivate1")); assertEquals("commonprivate2", priv.getString("commonprivate2")); assertEquals("commonprivate3", priv.getString("commonprivate3")); final Class<? extends Job> aPluginClass = pluginSet.getPluginClass("anothertestjob"); assertEquals("azkaban.jobtype.FakeJavaJob", aPluginClass.getName()); final Props ajobProps = pluginSet.getPluginJobProps("anothertestjob"); final Props aloadProps = pluginSet.getPluginLoaderProps("anothertestjob"); assertEquals("lib/*", aloadProps.get("jobtype.classpath")); assertEquals("azkaban.jobtype.FakeJavaJob", aloadProps.get("jobtype.class")); assertEquals("commonprivate1", aloadProps.get("commonprivate1")); assertEquals("commonprivate2", aloadProps.get("commonprivate2")); assertEquals("commonprivate3", aloadProps.get("commonprivate3")); assertEquals("commonprop1", ajobProps.get("commonprop1")); assertEquals("commonprop2", ajobProps.get("commonprop2")); assertEquals("commonprop3", ajobProps.get("commonprop3")); assertNull(ajobProps.get("commonprivate1")); final Class<? extends Job> tPluginClass = pluginSet.getPluginClass("testjob"); assertEquals("azkaban.jobtype.FakeJavaJob2", tPluginClass.getName()); final Props tjobProps = pluginSet.getPluginJobProps("testjob"); final Props tloadProps = pluginSet.getPluginLoaderProps("testjob"); assertNull(tloadProps.get("jobtype.classpath")); assertEquals("azkaban.jobtype.FakeJavaJob2", tloadProps.get("jobtype.class")); assertEquals("commonprivate1", tloadProps.get("commonprivate1")); assertEquals("commonprivate2", tloadProps.get("commonprivate2")); assertEquals("private3", tloadProps.get("commonprivate3")); assertEquals("0", tloadProps.get("testprivate")); assertEquals("commonprop1", tjobProps.get("commonprop1")); assertEquals("commonprop2", tjobProps.get("commonprop2")); assertEquals("1", tjobProps.get("pluginprops1")); assertEquals("2", tjobProps.get("pluginprops2")); assertEquals("3", tjobProps.get("pluginprops3")); assertEquals("pluginprops", tjobProps.get("commonprop3")); assertNull(tjobProps.get("commonprivate1")); assertNull(tjobProps.get("testprivate")); }