Skip to content

Commit

Permalink
Fixed wrong ResourceFactoryRegistry
Browse files Browse the repository at this point in the history
- registration GeckoXMLResourceFactory
- modified tests
- added bundle names
- adjusted github build

Signed-off-by: Mark Hoffmann <[email protected]>
  • Loading branch information
maho7791 committed Nov 3, 2023
1 parent 70365b6 commit c1b7556
Show file tree
Hide file tree
Showing 20 changed files with 87 additions and 93 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ jobs:
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: "temurin"
cache: "gradle"
java-version: ${{ matrix.java }}
distribution: temurin
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Gradle version
Expand All @@ -49,7 +50,7 @@ jobs:
run: ./gradlew build
- name: Upload Test Reports
if: ${{ always() && ((steps.build.outcome == 'success') || (steps.build.outcome == 'failure')) }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: JDK${{ matrix.java }}_${{ matrix.os }}-test-reports
path: |
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
bnd_version=6.4.0-SNAPSHOT
bnd_version=7.0.0
bnd_snapshots=https://bndtools.jfrog.io/bndtools/libs-snapshot-local
3 changes: 2 additions & 1 deletion org.gecko.emf.osgi.bnd.library.project/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ gecko-base:\
bnd.library;\
bnd.library = enable-emf; \
version = 1.0.0;\
path = template
path = template
Bundle-Name: EMF OSGi Project Library
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-buildpath.emf = ${emf.lib}

emf.lib: \
org.gecko.emf.osgi.api;version=latest,\
org.eclipse.emf.common;version=latest,\
Expand Down
5 changes: 3 additions & 2 deletions org.gecko.emf.osgi.bnd.library.workspace/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
-include: ${.}/buildpath.bnd
mavendeps: ${sjoin;\n; ${template;-maven-dependencies;${@}}}


-includeresource: resources,\
{template/geckoEMF.maven=resources/template/geckoEMF.maven}

Expand All @@ -12,4 +11,6 @@ Provide-Capability: \
gecko-base:\
bnd.library;\
bnd.library = geckoEMF; \
path = template
path = template
Bundle-Name: EMF OSGi Bndtools Workspace Library
Bundle-Description: EMF OSGi Bndtools Workspace Library
4 changes: 2 additions & 2 deletions org.gecko.emf.osgi.bnd.library.workspace/buildpath.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
-buildpath.extra: \
org.osgi.service.component.annotations;version=1.4,\
org.osgi.framework;version=1.9,\
org.osgi.annotation.versioning,\
org.osgi.annotation.bundle
org.osgi.annotation.versioning;version=latest,\
org.osgi.annotation.bundle;version=latest
1 change: 0 additions & 1 deletion org.gecko.emf.osgi.bnd.library.workspace/required.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
org.gecko.emf.osgi.component;version=snapshot,\
org.gecko.emf.osgi.extender;version=snapshot,\
org.gecko.emf.osgi.model.info;version=snapshot,\
org.osgi.service.cm;version='[1.6.0,1.6.1)',\
org.osgi.util.function;version='[1.1.0,1.1.1)',\
slf4j.api;version='[1.7.25,1.7.26)',\
org.gecko.emf.osgi.bnd.library.project;version=snapshot,\
Expand Down
4 changes: 2 additions & 2 deletions org.gecko.emf.osgi.bnd.templates.project/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Bundle-Name: GeckoEMF BND Project Templates
Bundle-Description: Project templates for GeckoEMF
Bundle-Name: EMF OSGi BND Project Templates
Bundle-Description: Bndtools project templates for EMF OSGi

-includeresource: resources
-resourceonly: true
Expand Down
4 changes: 3 additions & 1 deletion org.gecko.emf.osgi.codegen/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,6 @@ Import-Package: \
-generate: \
gen/**.java; \
output='src-gen/' ; \
generate='javagen -o src-gen gen/'
generate='javagen -o src-gen gen/'
Bundle-Name: EMF OSGi Bnd Codegen
Bundle-Description: EMF OSGi code generator for bnd
2 changes: 1 addition & 1 deletion org.gecko.emf.osgi.example.model.basic/test.log
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[INFO] Running Gecko EMF Codegen Version 5.0.0.202311031656-SNAPSHOT
[INFO] Running Gecko EMF Codegen Version 5.0.0.202311032010-SNAPSHOT
[INFO] Output configured: src-gen
[INFO] Output result: /opt/git/org.gecko.emf/org.gecko.emf.osgi.example.model.basic/src-gen
[INFO] genmodelLocation: null
Expand Down
13 changes: 5 additions & 8 deletions org.gecko.emf.osgi.extender.itest/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
Test-Cases: ${classes;HIERARCHY_INDIRECTLY_ANNOTATED;org.junit.platform.commons.annotation.Testable;CONCRETE}

-library: enableOSGi-Test

-buildpath: \
org.gecko.emf.osgi.api;version=snapshot,\
junit-jupiter-api;version=latest,\
junit-platform-commons;version=latest,\
org.osgi.test.junit5;version=latest,\
org.apiguardian.api;version=latest,\
org.osgi.test.common;version=latest,\
org.osgi.test.assertj.framework;version=latest,\
org.osgi.framework;version=latest,\
org.eclipse.emf.common;version=latest,\
org.eclipse.emf.ecore;version=latest,\
org.eclipse.emf.ecore.xmi;version=latest,\
org.osgi.framework;version=latest
org.gecko.emf.osgi.api;version=snapshot

Bundle-Name: EMF Model Extender Tests
Bundle-Description: Gecko EMF OSGi model extender integration tests

Expand Down
2 changes: 1 addition & 1 deletion org.gecko.emf.osgi.extender/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
org.eclipse.emf.ecore.xmi

Bundle-Name: EMF OSGI Model Extender
Bundle-Description: Gecko EMF: OSGi extender implementation for EMF Models
Bundle-Description: EMF OSGi extender implementation for EMF Models
33 changes: 15 additions & 18 deletions org.gecko.emf.osgi.itest/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
Test-Cases: ${classes;HIERARCHY_INDIRECTLY_ANNOTATED;org.junit.platform.commons.annotation.Testable;CONCRETE}

-library: enableOSGi-Test

# Build dependencies
-buildpath: \
org.osgi.framework;version=latest,\
org.osgi.service.cm;version=latest,\
org.osgi.service.condition;version=latest,\
org.osgi.annotation.versioning;version=latest,\
org.osgi.util.promise;version=latest,\
org.eclipse.emf.ecore;version=latest,\
org.eclipse.emf.common;version=latest,\
org.eclipse.emf.ecore.xmi;version=latest,\
org.gecko.emf.osgi.api;version=snapshot,\
org.gecko.emf.osgi.component;version=snapshot,\
org.gecko.emf.osgi.model.info;version=snapshot,\
org.gecko.emf.osgi.example.model.extended;version=snapshot,\
org.gecko.emf.osgi.example.model.basic;version=snapshot,\
org.gecko.emf.osgi.model.info;version=snapshot,\
org.gecko.emf.osgi.example.model.manual;version=snapshot,\
junit-jupiter-api,\
org.osgi.test.junit5,\
org.osgi.framework,\
org.eclipse.emf.ecore,\
org.osgi.test.common,\
assertj-core,\
org.osgi.service.cm,\
org.osgi.test.assertj.monitoring;version=latest,\
org.eclipse.emf.common,\
org.osgi.util.promise,\
org.osgi.annotation.versioning,\
org.osgi.test.assertj.framework,\
org.osgi.service.condition,\
junit-platform-commons,\
org.apiguardian.api,\
org.eclipse.emf.ecore.xmi,\
org.mockito.junit-jupiter,\
org.mockito.mockito-core
org.osgi.test.assertj.monitoring;version=snapshot

-includeresource: \
data/=data/

Export-Package: org.gecko.emf.osgi.itest
Private-Package: org.gecko.emf.osgi.itest.configurator

Bundle-Name: EMF OSGi Tests
Bundle-Description: Gecko EMF OSGi integration tests

#-baseline: test
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void testLoadResourceFailNoEPackage(@InjectService ServiceAware<ResourceS
assertFalse(modelNameList.contains("manual"));
Object configNames = reference.getProperty(EMFNamespaces.EMF_CONFIGURATOR_NAME);
assertNotNull(configNames);
assertEquals(4, ((String[]) configNames).length);
assertEquals(2, ((String[]) configNames).length);

ResourceSet rs = sa.getService();
assertNotNull(rs);
Expand Down Expand Up @@ -178,7 +178,7 @@ public void testLoadResourceRegisteredEPackage_Factory(@InjectService ServiceAwa
assertFalse(modelNameList.contains("manual"));
Object configNames = reference.getProperty(EMFNamespaces.EMF_CONFIGURATOR_NAME);
assertNotNull(configNames);
assertEquals(4, ((String[]) configNames).length);
assertEquals(2, ((String[]) configNames).length);

assertNotNull(reference);
ResourceSetFactory factory = sa.getService();
Expand Down Expand Up @@ -238,7 +238,7 @@ public void testLoadResourceRegisteredEPackage_FactoryWithModelName(
assertTrue(modelNameList.contains("manual"));
Object configNames = reference.getProperty(EMFNamespaces.EMF_CONFIGURATOR_NAME);
assertNotNull(configNames);
assertEquals(4, ((String[]) configNames).length);
assertEquals(2, ((String[]) configNames).length);

assertNotNull(reference);
ResourceSetFactory factory = serviceAwareRSF.getService();
Expand Down Expand Up @@ -906,7 +906,7 @@ public void testEPackageAndConfiguratorProperties_Factory(
assertNotNull(configNames);
assertTrue(configNames instanceof String[]);
List<String> configNameList = Arrays.asList((String[]) configNames);
assertEquals(4, configNameList.size());
assertEquals(2, configNameList.size());

Dictionary<String, Object> configProperties = new Hashtable<String, Object>();
configProperties.put(EMFNamespaces.EMF_CONFIGURATOR_NAME, new String[]{"testConfigurator", "testResourceConfigurator"});
Expand All @@ -923,7 +923,7 @@ public void testEPackageAndConfiguratorProperties_Factory(
assertNotNull(configNames);
assertTrue(configNames instanceof String[]);
configNameList = Arrays.asList((String[]) configNames);
assertEquals(6, configNameList.size());
assertEquals(4, configNameList.size());
assertTrue(configNameList.contains("testConfigurator"));
assertTrue(configNameList.contains("testResourceConfigurator"));

Expand Down Expand Up @@ -965,7 +965,7 @@ public void testEPackageAndConfiguratorProperties_Factory(
assertNotNull(configNames);
assertTrue(configNames instanceof String[]);
configNameList = Arrays.asList((String[]) configNames);
assertEquals(4, configNameList.size());
assertEquals(2, configNameList.size());
assertFalse(configNameList.contains("testConfigurator"));
assertFalse(configNameList.contains("testResourceConfigurator"));
}
Expand Down Expand Up @@ -1001,7 +1001,7 @@ public void testEPackageAndConfiguratorProperties(
assertNotNull(configNames);
assertTrue(configNames instanceof String[]);
List<String> configNameList = Arrays.asList((String[]) configNames);
assertEquals(4, configNameList.size());
assertEquals(2, configNameList.size());

Dictionary<String, Object> configProperties = new Hashtable<String, Object>();
configProperties.put(EMFNamespaces.EMF_CONFIGURATOR_NAME, new String[]{"testConfigurator", "testResourceConfigurator"});
Expand All @@ -1018,7 +1018,7 @@ public void testEPackageAndConfiguratorProperties(
assertNotNull(configNames);
assertTrue(configNames instanceof String[]);
configNameList = Arrays.asList((String[]) configNames);
assertEquals(6, configNameList.size());
assertEquals(4, configNameList.size());
assertTrue(configNameList.contains("testConfigurator"));
assertTrue(configNameList.contains("testResourceConfigurator"));

Expand Down Expand Up @@ -1059,7 +1059,7 @@ public void testEPackageAndConfiguratorProperties(
assertNotNull(configNames);
assertTrue(configNames instanceof String[]);
configNameList = Arrays.asList((String[]) configNames);
assertEquals(4, configNameList.size());
assertEquals(2, configNameList.size());
assertFalse(configNameList.contains("testConfigurator"));
assertFalse(configNameList.contains("testResourceConfigurator"));
}
Expand Down
4 changes: 2 additions & 2 deletions org.gecko.emf.osgi.itest/test.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
-runee: JavaSE-1.8
-runbundles: \
org.gecko.emf.osgi.example.model.basic;version=snapshot,\
org.gecko.emf.osgi.example.model.extended;version=snapshot,\
org.gecko.emf.osgi.example.model.manual;version=snapshot,\
org.gecko.emf.osgi.model.info;version=snapshot,\
org.opentest4j;version='[1.2.0,1.2.1)',\
Expand All @@ -32,7 +31,8 @@
net.bytebuddy.byte-buddy-agent;version='[1.12.21,1.12.22)',\
org.mockito.junit-jupiter;version='[4.11.0,4.11.1)',\
org.mockito.mockito-core;version='[4.11.0,4.11.1)',\
org.osgi.util.converter;version='[1.0.8,1.0.9)'
org.osgi.util.converter;version='[1.0.8,1.0.9)',\
org.gecko.emf.osgi.example.model.extended;version=snapshot
-runblacklist: bnd.identity;id='org.gecko.emf.osgi.extender'
-runrepos: \
Workspace,\
Expand Down
28 changes: 14 additions & 14 deletions org.gecko.emf.osgi/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ Export-Package: \
org.gecko.emf.osgi.annotation.*

-buildpath: \
org.osgi.framework,\
org.osgi.annotation.bundle,\
org.osgi.annotation.versioning,\
org.osgi.service.component.annotations,\
org.osgi.service.cm,\
org.osgi.service.component,\
org.eclipse.emf.common,\
org.eclipse.emf.ecore,\
org.eclipse.emf.ecore.xmi,\
org.osgi.namespace.service,\
org.osgi.util.converter,\
org.osgi.service.condition,\
org.osgi.namespace.extender,\
biz.aQute.bnd.annotation
org.osgi.framework;version=latest,\
org.osgi.annotation.bundle;version=latest,\
org.osgi.annotation.versioning;version=latest,\
org.osgi.namespace.service;version=latest,\
org.osgi.namespace.extender;version=latest,\
org.osgi.service.component.annotations;version=latest,\
org.osgi.service.cm;version=latest,\
org.osgi.service.component;version=latest,\
org.osgi.service.condition;version=latest,\
org.osgi.util.converter;version=latest,\
org.eclipse.emf.common;version=latest,\
org.eclipse.emf.ecore;version=latest,\
org.eclipse.emf.ecore.xmi;version=latest,\
biz.aQute.bnd.annotation;version=latest

# We shoudl consider deactivating this. For the Momemnt the Baselining is a bit harsch, e
# specially given that we know that it is still backward compatible.
Expand Down
1 change: 1 addition & 0 deletions org.gecko.emf.osgi/component.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ Export-Package: \
org.gecko.emf.osgi.components.config,\
org.gecko.emf.osgi.provider,\
org.gecko.emf.osgi.resourceset

Bundle-Name: EMF OSGi Implementation
Bundle-Description: Gecko EMF OSGi Implementation
Loading

0 comments on commit c1b7556

Please sign in to comment.