From cd5d3fab37fa4b1b240875ad13bac404a6312bd8 Mon Sep 17 00:00:00 2001 From: Timo Westkämper Date: Wed, 30 Jul 2014 22:29:18 +0300 Subject: Add test --- api/src/test/java/org/osjava/jardiff/ToolsTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 api/src/test/java/org/osjava/jardiff/ToolsTest.java (limited to 'api/src/test') diff --git a/api/src/test/java/org/osjava/jardiff/ToolsTest.java b/api/src/test/java/org/osjava/jardiff/ToolsTest.java new file mode 100644 index 0000000..8066264 --- /dev/null +++ b/api/src/test/java/org/osjava/jardiff/ToolsTest.java @@ -0,0 +1,19 @@ +package org.osjava.jardiff; + +import org.junit.Test; +import org.objectweb.asm.Opcodes; +import static org.junit.Assert.*; + +public class ToolsTest { + + @Test + public void isAccessChange() { + assertTrue(Tools.isAccessChange(0, Opcodes.ACC_FINAL)); + assertTrue(Tools.isAccessChange(0, Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL)); + assertTrue(Tools.isAccessChange(Opcodes.ACC_FINAL + Opcodes.ACC_PUBLIC, 0)); + assertTrue(Tools.isAccessChange(Opcodes.ACC_PUBLIC, Opcodes.ACC_PROTECTED)); + assertFalse(Tools.isAccessChange(Opcodes.ACC_FINAL, 0)); + assertFalse(Tools.isAccessChange(Opcodes.ACC_FINAL + Opcodes.ACC_PUBLIC, Opcodes.ACC_PUBLIC)); + } + +} -- cgit v1.2.3