mirror of
https://github.com/FatttSnake/OxygenToolbox.git
synced 2026-04-06 11:11:25 +08:00
Added TimeScreen
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
package com.fatapp.oxygentoolbox;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import com.fatapp.oxygentoolbox.util.VariableChangeListener;
|
||||
import com.fatapp.oxygentoolbox.util.VariableChangeSupport;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
@@ -14,4 +17,21 @@ public class ExampleUnitTest {
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void variableChangeTest() {
|
||||
VariableChangeSupport<String> stringVariableChangeSupport = new VariableChangeSupport<>("Hello", new VariableChangeListener() {
|
||||
@Override
|
||||
public <T> void onChange(T newValue, T oldValue) {
|
||||
System.out.println("newValue = " + newValue);
|
||||
System.out.println("oldValue = " + oldValue);
|
||||
}
|
||||
});
|
||||
|
||||
stringVariableChangeSupport.setValue("Hello");
|
||||
stringVariableChangeSupport.setValue("Hi");
|
||||
stringVariableChangeSupport.setValue("Hi");
|
||||
stringVariableChangeSupport.setValue("HI");
|
||||
stringVariableChangeSupport.setValue("HI");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user