OpenEdgeComponents { public Collection<License> getLicenses() { return licenseRegistrar.getLicenses(); } OpenEdgeComponents(Server server);  OpenEdgeComponents(Server server, CheckRegistration[] checkRegistrars);  OpenEdgeComponents(Server server, LicenseRegistration[] licRegistrars);  OpenEdgeComponents(Server server, CheckRegistration[] checkRegistrars, LicenseRegistration[] licRegistrars);  OpenEdgeComponents(Server server, CheckRegistration[] checkRegistrars, LicenseRegistration[] licRegistrars,
      TreeParserRegistration[] tpRegistrars); Iterable<Class<? extends ProparseListener>> getProparseListeners(); Collection<License> getLicenses(); License getLicense(SonarProduct product, String permId, String repoName); void initializeLicense(SensorContext context); void initializeChecks(SensorContext context); Map<ActiveRule, OpenEdgeProparseCheck> getProparseRules(); Map<ActiveRule, OpenEdgeDumpFileCheck> getDumpFileRules(); String getServerId();  }
@Test public void testNoLicenses() throws IOException { OpenEdgeComponents components1 = new OpenEdgeComponents(OpenEdgePluginTest.SERVER); assertEquals(components1.getLicenses().size(), 0); OpenEdgeComponents components2 = new OpenEdgeComponents(OpenEdgePluginTest.SERVER, new LicenseRegistration[] {}); assertEquals(components2.getLicenses().size(), 0); OpenEdgeComponents components3 = new OpenEdgeComponents(OpenEdgePluginTest.SERVER, new CheckRegistration[] {}, new LicenseRegistration[] {}); assertEquals(components3.getLicenses().size(), 0); }
@Test public void testOneLicense() throws IOException { OpenEdgeComponents components = new OpenEdgeComponents(OpenEdgePluginTest.SERVER, new LicenseRegistration[] {LICENSE_ME_OE_2015}); assertEquals(components.getLicenses().size(), 1); }
@Test public void testTwoLicenses() throws IOException { OpenEdgeComponents components = new OpenEdgeComponents(OpenEdgePluginTest.SERVER, new LicenseRegistration[] {LICENSE_ME_OE_2015, LICENSE_ME_OE_2025}); assertEquals(components.getLicenses().size(), 1); }
@Test public void testTwoPermId() throws IOException { OpenEdgeComponents components = new OpenEdgeComponents(OpenEdgePluginTest.SERVER, new LicenseRegistration[] {LICENSE_ME_OE_2015, LICENSE_YOU_OE_2025}); assertEquals(components.getLicenses().size(), 2); }
@Test public void testTwoRepositories() throws IOException { OpenEdgeComponents components = new OpenEdgeComponents(OpenEdgePluginTest.SERVER, new LicenseRegistration[] {LICENSE_ME_OE_2015, LICENSE_YOU_OTHER_2015}); assertEquals(components.getLicenses().size(), 2); }
@Test public void testThreeLicenses() throws IOException { OpenEdgeComponents components = new OpenEdgeComponents(OpenEdgePluginTest.SERVER, new LicenseRegistration[] {LICENSE_ME_OE_2015, LICENSE_ME_OE_2030, LICENSE_ME_OE_2025}); assertEquals(components.getLicenses().size(), 1); }
@Test public void testMixedLicenses() throws IOException { OpenEdgeComponents components = new OpenEdgeComponents(OpenEdgePluginTest.SERVER, new LicenseRegistration[] { LICENSE_ME_OE_2015, LICENSE_ME_OE_2030, LICENSE_ME_OE_2025, LICENSE_YOU_OTHER_2015, LICENSE_YOU_OE_2015, LICENSE_YOU_OE_2015}); assertEquals(components.getLicenses().size(), 3); }
@Test public void testSLPlusSQLicenses() throws IOException { OpenEdgeComponents components = new OpenEdgeComponents(OpenEdgePluginTest.SERVER, new LicenseRegistration[] {LICENSE_ME_OE_2025, LICENSE_SL_ME_OE_2025, LICENSE_SL_YOU_OE_2025}); assertEquals(components.getLicenses().size(), 3); }