mirror of
https://github.com/processing/processing4.git
synced 2026-01-28 19:01:08 +01:00
Fixed Table's use of deprecated isAccessible, finishing parseInto.
Fixed the Table's use of the deprected isAccessible, finishing the parseInto method in the process in order to test taht the new implementation is "correct". Note that there is not a published API for this method on processing.org so it is unclear if the interface's intended behavior was maintained. See https://processing.github.io/processing-javadocs/core/processing/data/Table.html#parseInto-java.lang.Object-java.lang.String-.
This commit is contained in:
39
core/test/processing/data/TableTest.java
Normal file
39
core/test/processing/data/TableTest.java
Normal file
@@ -0,0 +1,39 @@
|
||||
package processing.data;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class TableTest {
|
||||
|
||||
class Person {
|
||||
public String name;
|
||||
public int age;
|
||||
|
||||
public Person() {
|
||||
name = "";
|
||||
age = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Person[] people;
|
||||
|
||||
@Test
|
||||
public void parseInto() {
|
||||
Table table = new Table();
|
||||
table.addColumn("name");
|
||||
table.addColumn("age");
|
||||
|
||||
TableRow row = table.addRow();
|
||||
row.setString("name", "Person1");
|
||||
row.setInt("age", 30);
|
||||
|
||||
table.parseInto(this, "people");
|
||||
|
||||
Assert.assertEquals(people[0].name, "Person1");
|
||||
Assert.assertEquals(people[0].age, 30);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user