diff --git a/bundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/internal/emf/BlindResource.java b/bundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/internal/emf/BlindResource.java index 5ff413511..f9539ea7c 100644 --- a/bundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/internal/emf/BlindResource.java +++ b/bundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/internal/emf/BlindResource.java @@ -18,6 +18,7 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.Resource.Factory.Descriptor; import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl; import org.eclipse.passage.lic.emf.resource.BlindResourceFactory; @@ -37,9 +38,12 @@ public BlindResource(EObject source) { public Resource get() { String domain = type.getEPackage().getName(); Object factory = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().get(domain); + if (factory instanceof Resource.Factory.Descriptor) { + Resource.Factory.Descriptor descriptor = (Descriptor) factory; + factory = descriptor.createFactory(); + } if (factory instanceof BlindResourceFactory) { return ((BlindResourceFactory) factory).createResource(); - } return new XMIResourceImpl(); } diff --git a/tests/org.eclipse.passage.seal.demo.tests/src/org/eclipse/passage/seal/demo/tests/condition/mining/BaseLicenseReadingServiceTest.java b/tests/org.eclipse.passage.seal.demo.tests/src/org/eclipse/passage/seal/demo/tests/condition/mining/BaseLicenseReadingServiceTest.java index 9e0e73fd9..b882f6883 100644 --- a/tests/org.eclipse.passage.seal.demo.tests/src/org/eclipse/passage/seal/demo/tests/condition/mining/BaseLicenseReadingServiceTest.java +++ b/tests/org.eclipse.passage.seal.demo.tests/src/org/eclipse/passage/seal/demo/tests/condition/mining/BaseLicenseReadingServiceTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020, 2021 ArSysOp + * Copyright (c) 2020, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -9,6 +9,7 @@ * * Contributors: * ArSysOp - initial API and implementation + * ArSysOp - further support *******************************************************************************/ package org.eclipse.passage.seal.demo.tests.condition.mining; @@ -47,6 +48,7 @@ import org.eclipse.passage.lic.base.conditions.MatchingRuleCompatible; import org.eclipse.passage.lic.base.conditions.mining.BaseLicenseReadingService; import org.eclipse.passage.lic.base.conditions.mining.PersonalLicenseMiningEquipment; +import org.eclipse.passage.lic.base.diagnostic.DiagnosticExplained; import org.eclipse.passage.lic.base.io.PathFromLicensedProduct; import org.eclipse.passage.lic.base.registry.ReadOnlyRegistry; import org.eclipse.passage.lic.bc.BcStreamCodec; @@ -71,9 +73,9 @@ public final class BaseLicenseReadingServiceTest { @Test public void test() throws Exception { ServiceInvocationResult> result = service().read(license()); - assertTrue(result.diagnostic().severe().isEmpty()); - assertTrue(result.diagnostic().bearable().isEmpty()); - assertTrue(result.data().isPresent()); + assertTrue(new DiagnosticExplained(result.diagnostic()).get(), result.diagnostic().severe().isEmpty()); + assertTrue(new DiagnosticExplained(result.diagnostic()).get(), result.diagnostic().bearable().isEmpty()); + assertTrue(new DiagnosticExplained(result.diagnostic()).get(), result.data().isPresent()); assertEquals(1, result.data().get().size()); assertPackState(result.data().get().iterator().next()); }