Skip to content

Commit

Permalink
# WARNING: head commit changed in the meantime
Browse files Browse the repository at this point in the history
98: Update JUnit

Task-Url: #98
  • Loading branch information
keilw committed Nov 18, 2020
1 parent adc84e7 commit 0bbf37c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions console/basic/src/main/java/tech/uom/demo/basic/UnitDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import javax.measure.quantity.Speed;
import javax.measure.quantity.Volume;

import tech.units.indriya.AbstractUnit;
import tech.units.indriya.quantity.Quantities;
import javax.measure.MetricPrefix;
import javax.measure.Quantity;
Expand All @@ -55,6 +56,7 @@ public static void main(String[] args) {
// System.out.println(UCUM.POUND.getName());

System.out.println(Units.KILOGRAM);
//System.out.println(Units.KILOGRAM.isEquivalentTo(AbstractUnit.ONE)); doesn't compile
System.out.println(Units.KILOGRAM.getSymbol());
System.out.println(Units.KILOGRAM.getName());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
*/
package tech.uom.demo.systems.ucum;

import static javax.measure.spi.FormatService.FormatType.UNIT_FORMAT;

import java.util.List;

import javax.measure.Unit;
import javax.measure.format.UnitFormat;
import javax.measure.spi.ServiceProvider;
import javax.measure.spi.UnitFormatService;
import javax.measure.spi.FormatService;

public class UCUMServiceDemo {

Expand All @@ -42,7 +44,7 @@ public static void main(String[] args) {
System.out.println();
System.out.println(ServiceProvider.current());

for (String formatName : ServiceProvider.current().getFormatService().getAvailableFormatNames()) {
for (String formatName : ServiceProvider.current().getFormatService().getAvailableFormatNames(UNIT_FORMAT)) {
System.out.println(formatName);
}

Expand All @@ -67,7 +69,7 @@ public static void main(String[] args) {

List<ServiceProvider> providers = ServiceProvider.available();
ServiceProvider ucumProvider = providers.get(0);
UnitFormatService ucumFormatService = ucumProvider.getFormatService();
FormatService ucumFormatService = ucumProvider.getFormatService();
UnitFormat ucumFormatter = ucumFormatService.getUnitFormat("CS");
System.out.println("m3 dimension =" + ucumFormatter.parse("m3").getDimension());
System.out.println("ft3 (wrong) dimension =" + ucumFormatter.parse("ft3").getDimension());
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>tech.uom</groupId>
<artifactId>uom-parent</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.1</version>
</parent>
<groupId>tech.uom.demo</groupId>
<artifactId>uom-demos</artifactId>
Expand All @@ -32,8 +32,8 @@
<project.build.javaVersion>${jdkVersion}</project.build.javaVersion>
<maven.compile.targetLevel>${jdkVersion}</maven.compile.targetLevel>
<maven.compile.sourceLevel>${jdkVersion}</maven.compile.sourceLevel>
<ri.version>2.1-SNAPSHOT</ri.version>
<lib.version>2.1-SNAPSHOT</lib.version>
<ri.version>2.1</ri.version>
<lib.version>2.1</lib.version>
<si.version>2.1-SNAPSHOT</si.version>
<systems.version>2.1-SNAPSHOT</systems.version>
</properties>
Expand Down

0 comments on commit 0bbf37c

Please sign in to comment.