Moved "ESH-INF/" folders to "OH-INF/" folders (#1328)

* Moved ESH-INF folders to OH-INF folders

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
pull/1332/head
Christoph Weitkamp 2020-01-17 15:29:18 +01:00 committed by Kai Kreuzer
parent cc702266fe
commit 08da8de5cf
116 changed files with 19 additions and 19 deletions

View File

@ -79,7 +79,7 @@ public abstract class AbstractResourceBundleProvider<E> {
* This static field provides a root directory for automation object resources in the bundle resources.
* It is common for all resources - {@link ModuleType}s, {@link RuleTemplate}s and {@link Rule}s.
*/
protected static final String ROOT_DIRECTORY = "ESH-INF/automation";
protected static final String ROOT_DIRECTORY = "OH-INF/automation";
protected @Nullable ConfigI18nLocalizationService configI18nService;
@ -97,10 +97,10 @@ public abstract class AbstractResourceBundleProvider<E> {
* This field is initialized in constructors of any particular provider with specific path for the particular
* resources from specific type as {@link ModuleType}s, {@link RuleTemplate}s and {@link Rule}s:
* <li>for
* {@link ModuleType}s it is a "ESH-INF/automation/moduletypes/"
* {@link ModuleType}s it is a "OH-INF/automation/moduletypes/"
* <li>for {@link RuleTemplate}s it is a
* "ESH-INF/automation/templates/"
* <li>for {@link Rule}s it is a "ESH-INF/automation/rules/"
* "OH-INF/automation/templates/"
* <li>for {@link Rule}s it is a "OH-INF/automation/rules/"
*/
protected final String path;

View File

@ -52,7 +52,7 @@ import org.osgi.service.component.annotations.Reference;
public class XmlBindingInfoProvider extends AbstractXmlBasedProvider<String, BindingInfo>
implements BindingInfoProvider, XmlDocumentProviderFactory<BindingInfoXmlResult> {
private static final String XML_DIRECTORY = "/ESH-INF/binding/";
private static final String XML_DIRECTORY = "/OH-INF/binding/";
public static final String READY_MARKER = "esh.xmlBindingInfo";
private final BindingI18nLocalizationService bindingI18nService;

View File

@ -46,7 +46,7 @@ import org.osgi.service.component.annotations.Reference;
public class ConfigXmlConfigDescriptionProvider extends AbstractXmlConfigDescriptionProvider
implements XmlDocumentProviderFactory<List<ConfigDescription>> {
private static final String XML_DIRECTORY = "/ESH-INF/config/";
private static final String XML_DIRECTORY = "/OH-INF/config/";
public static final String READY_MARKER = "esh.xmlConfig";
private final ConfigI18nLocalizationService configI18nService;

View File

@ -58,7 +58,7 @@ import org.osgi.service.component.annotations.Reference;
public class XmlThingTypeProvider extends AbstractXmlBasedProvider<UID, ThingType>
implements ThingTypeProvider, XmlDocumentProviderFactory<List<?>> {
private static final String XML_DIRECTORY = "/ESH-INF/thing/";
private static final String XML_DIRECTORY = "/OH-INF/thing/";
public static final String READY_MARKER = "esh.xmlThingTypes";
private final ThingTypeI18nLocalizationService thingTypeI18nLocalizationService;

View File

@ -40,7 +40,7 @@ import org.osgi.framework.Bundle;
public class LanguageResourceBundleManager {
/** The directory within the bundle where the resource files are searched. */
protected static final String RESOURCE_DIRECTORY = "/ESH-INF/i18n";
protected static final String RESOURCE_DIRECTORY = "/OH-INF/i18n";
/** The file pattern to filter out resource files. */
private static final String RESOURCE_FILE_PATTERN = "*.properties";

View File

@ -47,18 +47,18 @@ public class ResourceBundleClassLoaderTest {
@Test
public void testName() throws Exception {
Path tmp = Files.createTempDirectory("tmp");
URL hostPropertiesURL = createTmpTestPropetiesFile(tmp, "host/ESH-INF/i18n/test.properties");
URL fragmentPropertiesURL = createTmpTestPropetiesFile(tmp, "fragment/ESH-INF/i18n/test.properties");
URL hostPropertiesURL = createTmpTestPropetiesFile(tmp, "host/OH-INF/i18n/test.properties");
URL fragmentPropertiesURL = createTmpTestPropetiesFile(tmp, "fragment/OH-INF/i18n/test.properties");
Bundle bundleMock = mock(Bundle.class);
when(bundleMock.findEntries(any(), any(), anyBoolean()))
.thenAnswer(answer -> Collections.enumeration(Arrays.asList(hostPropertiesURL, fragmentPropertiesURL)));
when(bundleMock.getEntry(any())).thenReturn(hostPropertiesURL);
ResourceBundleClassLoader classloader = new ResourceBundleClassLoader(bundleMock, "/ESH-INF/i18n",
ResourceBundleClassLoader classloader = new ResourceBundleClassLoader(bundleMock, "/OH-INF/i18n",
"*.properties");
List<URL> propertiesURLs = Collections.list(bundleMock.findEntries("/ESH-INF/i18n", "*.properties", true));
List<URL> propertiesURLs = Collections.list(bundleMock.findEntries("/OH-INF/i18n", "*.properties", true));
assertEquals(2, propertiesURLs.size());
assertTrue(propertiesURLs.contains(hostPropertiesURL));

View File

@ -62,7 +62,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This tests the RuleEngineImpl and the import from JSON resources contained in the ESH-INF folder.
* This tests the RuleEngineImpl and the import from JSON resources contained in the OH-INF folder.
* This test must be run first otherwise imported rules will be cleared.
*
* @author Benedikt Niehues - Initial contribution

View File

@ -34,7 +34,7 @@ public class ScopeTest extends JavaOSGiTest {
private ScriptEngine engine;
private final String path = "ESH-INF/automation/jsr223/";
private final String path = "OH-INF/automation/jsr223/";
private final String workingFile = "scopeWorking.js";
private final String failureFile = "scopeFailure.js";

Some files were not shown because too many files have changed in this diff Show More