Skip to content

Commit bec259d

Browse files
committed
v0.9.16
1 parent db76601 commit bec259d

File tree

7 files changed

+56
-5
lines changed

7 files changed

+56
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ is recommended for better performances on disk operations (detection of physical
1717
[![Codecov](https://codecov.io/gh/lecousin/java-framework-core/graph/badge.svg)](https://codecov.io/gh/lecousin/java-framework-core/branch/master)
1818

1919
- core [![Maven Central](https://img.shields.io/maven-central/v/net.lecousin/core.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22net.lecousin%22%20AND%20a%3A%22core%22)
20-
[![Javadoc](https://img.shields.io/badge/javadoc-0.9.15-brightgreen.svg)](https://www.javadoc.io/doc/net.lecousin/core/0.9.15)
20+
[![Javadoc](https://img.shields.io/badge/javadoc-0.9.16-brightgreen.svg)](https://www.javadoc.io/doc/net.lecousin/core/0.9.16)
2121

2222
- core.javaee [![Maven Central](https://img.shields.io/maven-central/v/net.lecousin/core.javaee.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22net.lecousin%22%20AND%20a%3A%22core.javaee%22)
2323
[![Javadoc](https://img.shields.io/badge/javadoc-0.9.0-brightgreen.svg)](https://www.javadoc.io/doc/net.lecousin/core.javaee/0.9.0)

core.javaee/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<dependency>
1212
<groupId>net.lecousin</groupId>
1313
<artifactId>core</artifactId>
14-
<version>0.9.15</version>
14+
<version>0.9.16</version>
1515
</dependency>
1616
<dependency>
1717
<groupId>javax.enterprise.concurrent</groupId>

net.lecousin.core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<artifactId>core</artifactId>
5-
<version>0.9.15</version>
5+
<version>0.9.16</version>
66

77
<parent>
88
<groupId>net.lecousin</groupId>

net.lecousin.core/src/test/java/net/lecousin/framework/core/tests/progress/TestWorkProgressImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ public void test() throws Exception {
9393
p.error(new Exception());
9494
p.cancel(new CancelException(new Exception()));
9595
p.getSynch();
96+
p.setAmount(1);
97+
Assert.assertEquals(1, p.getAmount());
98+
Assert.assertEquals(0, p.getRemainingWork());
99+
Assert.assertEquals(1, p.getPosition());
96100
}
97101

98102
}

net.lecousin.core/src/test/java/net/lecousin/framework/core/tests/util/TestClassUtil.java

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,51 @@ public void testGettersAndSetters() {
7171
Assert.assertNull(ClassUtil.getSetter(Class2.class, "myBoolean3"));
7272
}
7373

74+
@SuppressWarnings("unused")
75+
public static class Class3 {
76+
public int toto(String s, int i) { return 1; }
77+
public int toto(String s, long l) { return 2; }
78+
public int toto(int i, String s) { return 3; }
79+
}
80+
81+
@Test(timeout=30000)
82+
public void testGetMethod() throws Exception {
83+
Object[] toto1 = new Object[] { "test", Integer.valueOf(51) };
84+
Object[] toto2 = new Object[] { "test", Long.valueOf(51) };
85+
Object[] toto3 = new Object[] { Integer.valueOf(1), "test" };
86+
Class3 o = new Class3();
87+
Assert.assertEquals(Integer.valueOf(1), ClassUtil.getMethodFor(Class3.class, "toto", toto1).invoke(o, toto1));
88+
Assert.assertEquals(Integer.valueOf(2), ClassUtil.getMethodFor(Class3.class, "toto", toto2).invoke(o, toto2));
89+
Assert.assertEquals(Integer.valueOf(3), ClassUtil.getMethodFor(Class3.class, "toto", toto3).invoke(o, toto3));
90+
91+
Assert.assertNotNull(ClassUtil.getMethod(Class3.class, "toto"));
92+
Assert.assertNull(ClassUtil.getMethod(Class3.class, "titi"));
93+
Assert.assertNotNull(ClassUtil.getMethod(Class3.class, "toto", 2));
94+
Assert.assertNull(ClassUtil.getMethod(Class3.class, "toto", 3));
95+
}
96+
97+
public static class Root {
98+
public Element e1 = new Element();
99+
public Element e2 = new Element();
100+
}
101+
102+
public static class Element {
103+
public Leaf sub1 = new Leaf();
104+
public Leaf sub2 = new Leaf();
105+
}
106+
107+
public static class Leaf {
108+
public int i = 1;
109+
}
110+
111+
@Test(timeout=30000)
112+
public void testFieldPath() throws Exception {
113+
Root root = new Root();
114+
Assert.assertEquals(1, root.e1.sub1.i);
115+
ClassUtil.setFieldFromPath(root, "e1.sub1.i", Integer.valueOf(51));
116+
Assert.assertEquals(51, root.e1.sub1.i);
117+
root.e2.sub2.i = 11;
118+
Assert.assertEquals(Integer.valueOf(11), ClassUtil.getFieldFromPath(root, "e2.sub2.i"));
119+
}
120+
74121
}

net.lecousin.core/src/test/java/net/lecousin/framework/core/tests/util/TestTriple.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
public class TestTriple extends LCCoreAbstractTest {
1010

1111
@Test
12-
public void test() throws Exception {
12+
public void test() {
1313
Triple<Object, Object, Object> t;
1414
t = new Triple<>(Integer.valueOf(10), Integer.valueOf(20), Integer.valueOf(30));
1515
Assert.assertEquals(Integer.valueOf(10), t.getValue1());

net.lecousin.framework.log.bridges/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<dependency>
3636
<groupId>net.lecousin</groupId>
3737
<artifactId>core</artifactId>
38-
<version>0.9.15</version>
38+
<version>0.9.16</version>
3939
</dependency>
4040
</dependencies>
4141
</dependencyManagement>

0 commit comments

Comments
 (0)