Skip to content

Commit

Permalink
Disable UDP test (not supported on all networks). Check float write
Browse files Browse the repository at this point in the history
  • Loading branch information
kasemir committed Jun 16, 2017
1 parent 14f970b commit 1c5e701
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/etherip/EtherIPDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;

import java.util.logging.Level;
import java.util.logging.Logger;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import etherip.data.CipException;
Expand Down Expand Up @@ -59,6 +61,7 @@ public void testConnectTcp() throws Exception
}

@Test
@Ignore
public void testConnectUdp() throws Exception
{
Logger.getLogger("").setLevel(Level.INFO);
Expand Down Expand Up @@ -111,7 +114,16 @@ public void testFloat() throws Exception

value = plc.readTag(tag);
assertThat(value, not(nullValue()));
System.out.println(value);
System.out.println("Changed to " + value);
assertEquals(47.11, value.getNumber(0).doubleValue(), 0.01);

value.set(0, 48.12);
plc.writeTag(tag, value);

value = plc.readTag(tag);
assertThat(value, not(nullValue()));
System.out.println("Changed to " + value);
assertEquals(48.12, value.getNumber(0).doubleValue(), 0.01);
}
}

Expand Down

0 comments on commit 1c5e701

Please sign in to comment.