Skip to content

Commit 82c9ff1

Browse files
time operations (#177)
* date operation * time utils * junit test
1 parent eef7b46 commit 82c9ff1

20 files changed

+239
-9
lines changed

src/main/java/com/examplehub/basics/MathExample.java renamed to src/main/java/com/examplehub/basics/math/MathExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.examplehub.basics;
1+
package com.examplehub.basics.math;
22

33
public class MathExample {
44
public static void main(String[] args) {
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.examplehub.basics.system;
2+
3+
public class FileSeparatorTest {
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.examplehub.basics.time;
2+
3+
public class CalendarExample {
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.examplehub.basics.time;
2+
3+
public class DateExample {
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.examplehub.basics.time;
2+
3+
public class GetTime {
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.examplehub.basics.time;
2+
3+
public class InstantExample {
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.examplehub.basics.time;
2+
3+
public class LocalDateTimeExample {
4+
5+
}

src/main/java/com/examplehub/utils/StringUtils.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,14 @@ public static String toString(byte[] bytes, int offset, int len) {
1616
}
1717
return builder.toString();
1818
}
19+
20+
public static String capitalize(String origin) {
21+
if (origin == null) {
22+
throw new NullPointerException();
23+
}
24+
if (origin.length() == 0) {
25+
return "";
26+
}
27+
return Character.toUpperCase(origin.charAt(0)) + origin.substring(1).toLowerCase();
28+
}
1929
}

src/test/java/com/examplehub/basics/file/CreateFolderTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
import static org.junit.jupiter.api.Assertions.*;
44

5+
import org.junit.jupiter.api.Disabled;
56
import org.junit.jupiter.api.Test;
67

78
class CreateFolderTest {
9+
10+
@Disabled
811
@Test
912
void test() {
1013
String path = "example_folder";

src/test/java/com/examplehub/basics/floats/FloatOperationTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class FloatOperationTest {
99
void testCompare() {
1010
assertEquals(0.1, 1.0 / 10);
1111
assertTrue(0.1 > 1 - 9.0 / 10);
12+
assertEquals(0.1, 1 - 9 / 10.0, 0.00000001);
1213
}
1314

1415
@Test

0 commit comments

Comments
 (0)