From cda73a6a5864b76e252ed0d3b69ff4b55a6def4b Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Wed, 30 Jan 2019 13:02:20 -0800 Subject: mavenizing testing - wip --- testing/figures-coverage/figures/Main.java | 56 ++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 testing/figures-coverage/figures/Main.java (limited to 'testing/figures-coverage/figures/Main.java') diff --git a/testing/figures-coverage/figures/Main.java b/testing/figures-coverage/figures/Main.java new file mode 100644 index 000000000..189f05cee --- /dev/null +++ b/testing/figures-coverage/figures/Main.java @@ -0,0 +1,56 @@ + +package figures; + +import figures.primitives.planar.Point; +import figures.primitives.solid.SolidPoint; + +class Main { + + private static Point startPoint; + + public static void main(String[] args) { + try { + System.out.println("> starting..."); + + startPoint = makeStartPoint(); + //startPoint.setX(3); new Point(0, 0); +// SolidPoint sp1 = new SolidPoint(1, 3, 3); + +// sp1.setZ(1); +// p1.incrXY(3, 3); + } catch (RuntimeException re) { + re.printStackTrace(); + } + System.out.println("> finished."); + } + + /** @deprecated use something else */ + public static Point makeStartPoint() { + //return new Point(1, 2); + return null; + } + + /** This should produce a deprecation warning with JDK > 1.2 */ + static class TestGUI extends javax.swing.JFrame { + TestGUI() { + this.disable(); + } + } + + /** This should produce a porting-deprecation warning. */ + //static pointcut mainExecution(): execution(void main(*)); +} + +privileged aspect Test { + pointcut testptct(): call(* *.*(..)); + + before(Point p, int newval): target(p) && set(int Point.xx) && args(newval) { + System.err.println("> new value of x is: " + p.x + ", setting to: " + newval); + } + + before(int newValue): set(int Point.*) && args(newValue) { + if (newValue < 0) { + throw new IllegalArgumentException("too small"); + } + } +} -- cgit v1.2.3