Пример #1
0
 @Test
 public void testFetchProp() {
   EnumWeatherProperty[] ps = new EnumWeatherProperty[2];
   ps[0] = new EnumWeatherProperty("ocean.temp", Float.class);
   ps[0].put("test", 20.5f);
   ps[1] = new EnumWeatherProperty("wind", Vector3f.class);
   ps[1].put("test", new Vector3f(1, 0, 0));
   WeatherController wc = create("test", ps);
   assertTrue(20.5f == wc.getFloat("ocean.temp"));
   assertTrue(wc.getVec3("wind").distance(new Vector3f(1, 0, 0)) < weakEps);
 }
Пример #2
0
 @Test
 public void testFetchMissingProp() {
   WeatherController wc = create("test", new WeatherProperty[0]);
   assertNull(wc.getFloat("foo"));
 }