Source:
public void testCoreSubTypesWithHotReload() throws Exception { Collection<String> testSchemas = Arrays.asList(new String[]{"schema1", "schema2"}); Collection<String> testFacets = Arrays.asList(new String[]{"myFacet", "facet1", "facet2"}); Collection<String> subtypes = schemaManager.getAllowedSubTypes("MyDocType"); assertNotNull(subtypes); assertEquals(2, subtypes.size()); assertTrue(subtypes.contains("MyOtherDocType")); assertTrue(subtypes.contains("MyHiddenDocType")); Collection<String> ecmSubtypes = getEcmSubtypes("MyDocType"); assertEquals(subtypes.size(), subtypes.size()); ecmSubtypes.containsAll(subtypes); verifyFacetsAndSchemas("MyDocType", testFacets, testSchemas); deployContrib("org.nuxeo.ecm.platform.types.core.tests", "test-types-override-bundle.xml"); subtypes = schemaManager.getAllowedSubTypes("MyDocType"); assertNotNull(subtypes); assertEquals(2, subtypes.size()); assertTrue(subtypes.contains("MyOtherDocType2")); assertTrue(subtypes.contains("MyHiddenDocType")); ecmSubtypes = getEcmSubtypes("MyDocType"); assertEquals(subtypes.size(), subtypes.size()); ecmSubtypes.containsAll(subtypes); verifyFacetsAndSchemas("MyDocType", testFacets, testSchemas); undeployContrib("org.nuxeo.ecm.platform.types.core.tests", "test-types-override-bundle.xml"); subtypes = schemaManager.getAllowedSubTypes("MyDocType"); assertNotNull(subtypes); assertEquals(2, subtypes.size()); assertTrue(subtypes.contains("MyOtherDocType")); assertTrue(subtypes.contains("MyHiddenDocType")); ecmSubtypes = getEcmSubtypes("MyDocType"); assertEquals(subtypes.size(), subtypes.size()); ecmSubtypes.containsAll(subtypes); verifyFacetsAndSchemas("MyDocType", testFacets, testSchemas); undeployContrib("org.nuxeo.ecm.platform.types.core.tests", "test-types-bundle.xml"); verifyFacetsAndSchemas("MyDocType", testFacets, testSchemas); }

Target:
public void testCoreSubTypesWithHotReload() throws Exception { Collection<String> testSchemas = Arrays.asList("schema1", "schema2"); Collection<String> testFacets = Arrays.asList("myFacet", "facet1", "facet2"); Collection<String> subtypes = schemaManager.getAllowedSubTypes("MyDocType"); assertNotNull(subtypes); assertEquals(2, subtypes.size()); assertTrue(subtypes.contains("MyOtherDocType")); assertTrue(subtypes.contains("MyHiddenDocType")); Collection<String> ecmSubtypes = getEcmSubtypes("MyDocType"); assertEquals(subtypes.size(), subtypes.size()); ecmSubtypes.containsAll(subtypes); verifyFacetsAndSchemas("MyDocType", testFacets, testSchemas); deployContrib("org.nuxeo.ecm.platform.types.core.tests", "test-types-override-bundle.xml"); subtypes = schemaManager.getAllowedSubTypes("MyDocType"); assertNotNull(subtypes); assertEquals(2, subtypes.size()); assertTrue(subtypes.contains("MyOtherDocType2")); assertTrue(subtypes.contains("MyHiddenDocType")); ecmSubtypes = getEcmSubtypes("MyDocType"); assertEquals(subtypes.size(), subtypes.size()); ecmSubtypes.containsAll(subtypes); verifyFacetsAndSchemas("MyDocType", testFacets, testSchemas); undeployContrib("org.nuxeo.ecm.platform.types.core.tests", "test-types-override-bundle.xml"); subtypes = schemaManager.getAllowedSubTypes("MyDocType"); assertNotNull(subtypes); assertEquals(2, subtypes.size()); assertTrue(subtypes.contains("MyOtherDocType")); assertTrue(subtypes.contains("MyHiddenDocType")); ecmSubtypes = getEcmSubtypes("MyDocType"); assertEquals(subtypes.size(), subtypes.size()); ecmSubtypes.containsAll(subtypes); verifyFacetsAndSchemas("MyDocType", testFacets, testSchemas); undeployContrib("org.nuxeo.ecm.platform.types.core.tests", "test-types-bundle.xml"); verifyFacetsAndSchemas("MyDocType", testFacets, testSchemas); }