From 6d2cd68c8adff8c27a6a3a18711ea44a2e7bfe30 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 18 Nov 2008 18:00:44 +0000 Subject: GUI refactoring 2 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@178 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../test/java/at/gv/egiz/bku/gui/BKUGUITest.java | 5 +- .../test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java | 122 +++++---------------- 2 files changed, 32 insertions(+), 95 deletions(-) (limited to 'BKUCommonGUI/src/test/java') diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java index b57e1923..0d2712dd 100644 --- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java +++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java @@ -32,16 +32,15 @@ import org.junit.Test; * * @author clemens */ -@Ignore +//@Ignore public class BKUGUITest { @Test public void testBKUGUI() { JFrame testFrame = new JFrame("BKUGUITest"); - BKUGUI gui = new BKUGUI(); Container contentPane = testFrame.getContentPane(); contentPane.setPreferredSize(new Dimension(380, 150)); - gui.init(contentPane, null, BKUGUIFacade.Style.advanced, null, null); + BKUGUIFacade gui = BKUGUIFactory.createGUI(contentPane, null, BKUGUIFacade.Style.advanced, null, null); BKUGUIWorker worker = new BKUGUIWorker(); worker.init(gui); testFrame.pack(); diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java index e4936067..82b42d0f 100644 --- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java +++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java @@ -22,6 +22,7 @@ package at.gv.egiz.bku.gui; import at.gv.egiz.smcc.PINSpec; import at.gv.egiz.stal.HashDataInput; +import at.gv.egiz.stal.impl.ByteArrayHashDataInput; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.ByteArrayInputStream; @@ -78,99 +79,36 @@ public class BKUGUIWorker implements Runnable { gui.showSignaturePINDialog(signPinSpec, signListener, "sign", cancelListener, "cancel", null, "hashdata"); } }; - HashDataInput signedRef1 = new HashDataInput() { - - @Override - public InputStream getHashDataInput() { - return new ByteArrayInputStream("Ich bin ein einfacher Text mit Umlauten: öäüßéç@€\n123\n456\n\tHello, world!\n\nlkjsd\nnksdjf".getBytes()); - } - - @Override - public String getMimeType() { - return "text/plain"; - } - - @Override - public String getReferenceId() { - return "Reference-ref1-00000000000000000000001"; - } - @Override - public String getEncoding() { - return "UTF-8"; - } - }; - HashDataInput signedRef2 = new HashDataInput() { - - @Override - public InputStream getHashDataInput() { - return new ByteArrayInputStream("HashDataInput_002".getBytes()); - } - - @Override - public String getMimeType() { - return "text/xml"; - } - - @Override - public String getReferenceId() { - return "Reference-ref2-00000000000000000000002"; - } - @Override - public String getEncoding() { - return "UTF-8"; - } - }; - HashDataInput signedRef3 = new HashDataInput() { - - @Override - public InputStream getHashDataInput() { - return new ByteArrayInputStream("HashDataInput_003".getBytes()); - } - - @Override - public String getMimeType() { - return "text/xml"; - } - - @Override - public String getReferenceId() { - return "Reference-ref3-00000000000000000000003"; - } - - @Override - public String getEncoding() { - return "UTF-8"; - } - }; - HashDataInput signedRef4 = new HashDataInput() { - - @Override - public InputStream getHashDataInput() { - return new ByteArrayInputStream("HashDataInput_004".getBytes()); - } - - @Override - public String getMimeType() { - return "text/xml"; - } - - @Override - public String getReferenceId() { - return "ref4"; - } - - @Override - public String getEncoding() { - return "UTF-8"; - } - }; + HashDataInput signedRef1 = new ByteArrayHashDataInput( + "Ich bin ein einfacher Text mit Umlauten: öäüßéç@€\n123\n456\n\tHello, world!\n\nlkjsd\nnksdjf".getBytes(), + "ref-id-000000001", + "text/plain", + "UTF-8"); + + HashDataInput signedRef2 = new ByteArrayHashDataInput( + "HashDataInput_002".getBytes(), + "ref-id-000000002", + "application/xhtml+xml", + "UTF-8"); + + HashDataInput signedRef3 = new ByteArrayHashDataInput( + "HashDataInput_003".getBytes(), + "ref-id-000000003", + "application/xhtml+xml", + "UTF-8"); + + HashDataInput signedRef4 = new ByteArrayHashDataInput( + "HashDataInput_004".getBytes(), + "ref-id-000000004", + "text/xml", + "UTF-8"); // List signedRefs = new ArrayList(); signedRefs.add(signedRef1); -// signedRefs.add(signedRef2); -// signedRefs.add(signedRef3); -// signedRefs.add(signedRef4); + signedRefs.add(signedRef2); + signedRefs.add(signedRef3); + signedRefs.add(signedRef4); // signedRefs.add(signedRef4); // signedRefs.add(signedRef4); // signedRefs.add(signedRef4); @@ -182,8 +120,8 @@ public class BKUGUIWorker implements Runnable { - gui.showWelcomeDialog(); - +// gui.showWelcomeDialog(); +// // Thread.sleep(2000); // // gui.showWaitDialog(null); @@ -209,7 +147,7 @@ public class BKUGUIWorker implements Runnable { // // Thread.sleep(2000); // -// gui.showSignaturePINDialog(signPinSpec, signListener, "sign", cancelListener, "cancel", hashdataListener, "hashdata"); + gui.showSignaturePINDialog(signPinSpec, signListener, "sign", cancelListener, "cancel", hashdataListener, "hashdata"); // // Thread.sleep(4000); // -- cgit v1.2.3