Skip to content

Commit

Permalink
224: Improvement: Provide a mechanism to get list of all Dimension for
Browse files Browse the repository at this point in the history
given quantity

Task-Url: #224
Signed-off-by: Werner Keil <[email protected]>
  • Loading branch information
keilw committed Nov 4, 2020
1 parent 1f6aa14 commit 74a8f57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
import javax.measure.spi.QuantityFactory;
import javax.measure.spi.ServiceProvider;
import javax.measure.spi.SystemOfUnitsService;
import javax.measure.spi.UnitFormatService;

import tech.units.indriya.quantity.DefaultQuantityFactory;

import java.util.ArrayList;
Expand All @@ -54,7 +52,7 @@
* services.
*
* @author Werner Keil
* @version 1.2
* @version 2.0
* @since 2.0
*/
public abstract class AbstractServiceProvider extends ServiceProvider implements Comparable<ServiceProvider> {
Expand Down Expand Up @@ -144,11 +142,6 @@ public SystemOfUnitsService getSystemOfUnitsService() {
return getService(SystemOfUnitsService.class);
}

@Override
public UnitFormatService getUnitFormatService() {
return getService(UnitFormatService.class);
}

@Override
public FormatService getFormatService() {
return getService(FormatService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void testGetServices() throws Exception {

@Test
public void testGetService() throws Exception {
UnitFormatService ufs = ServiceProvider.current().getUnitFormatService();
UnitFormatService ufs = ServiceProvider.current().getFormatService();
assertNotNull(ufs);
assertNotNull(ufs.getUnitFormat());
final UnitFormat uf = ufs.getUnitFormat();
Expand All @@ -64,7 +64,7 @@ public void testGetService() throws Exception {

@Test
public void testGetFormatFound() throws Exception {
UnitFormatService ufs = ServiceProvider.current().getUnitFormatService();
UnitFormatService ufs = ServiceProvider.current().getFormatService();
assertNotNull(ufs);
final UnitFormat uf = ufs.getUnitFormat("EBNF");
assertNotNull(uf);
Expand All @@ -73,7 +73,7 @@ public void testGetFormatFound() throws Exception {

@Test
public void testGetFormatNotFound() throws Exception {
UnitFormatService ufs = ServiceProvider.current().getUnitFormatService();
UnitFormatService ufs = ServiceProvider.current().getFormatService();
assertNotNull(ufs);
assertNull(ufs.getUnitFormat("XYZ"));
}
Expand Down

0 comments on commit 74a8f57

Please sign in to comment.