8050893: (smartcardio) Invert reset argument in tests in sun/security/smartcardio
Reviewed-by: valeriep
--- a/jdk/test/sun/security/smartcardio/TestAll.java Fri Jul 18 13:43:28 2014 +0100
+++ b/jdk/test/sun/security/smartcardio/TestAll.java Fri Jul 18 17:04:10 2014 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
// Because all the tests are marked @ignore as they require special hardware,
// we cannot use jtreg to do this.
-import java.lang.reflect.*;
+import java.lang.reflect.Method;
public class TestAll {
--- a/jdk/test/sun/security/smartcardio/TestChannel.java Fri Jul 18 13:43:28 2014 +0100
+++ b/jdk/test/sun/security/smartcardio/TestChannel.java Fri Jul 18 17:04:10 2014 +0400
@@ -31,10 +31,10 @@
// This test requires special hardware.
-import java.io.*;
-import java.util.*;
-
-import javax.smartcardio.*;
+import javax.smartcardio.Card;
+import javax.smartcardio.CardChannel;
+import javax.smartcardio.CardTerminal;
+import javax.smartcardio.CommandAPDU;
public class TestChannel extends Utils {
@@ -95,7 +95,7 @@
}
// disconnect
- card.disconnect(false);
+ card.disconnect(true);
System.out.println("OK.");
}
--- a/jdk/test/sun/security/smartcardio/TestConnect.java Fri Jul 18 13:43:28 2014 +0100
+++ b/jdk/test/sun/security/smartcardio/TestConnect.java Fri Jul 18 17:04:10 2014 +0400
@@ -31,10 +31,11 @@
// This test requires special hardware.
-import java.io.*;
-import java.util.*;
-
-import javax.smartcardio.*;
+import java.util.List;
+import javax.smartcardio.TerminalFactory;
+import javax.smartcardio.Card;
+import javax.smartcardio.CardChannel;
+import javax.smartcardio.CardTerminal;
public class TestConnect extends Utils {
@@ -63,7 +64,7 @@
throw new Exception("Not T=0 protocol");
}
transmit(card);
- card.disconnect(false);
+ card.disconnect(true);
try {
transmit(card);
@@ -96,7 +97,7 @@
throw new Exception("Not T=0 protocol");
}
transmit(card);
- card.disconnect(true);
+ card.disconnect(false);
card = terminal.connect("*");
System.out.println("card: " + card);
@@ -105,7 +106,6 @@
}
transmit(card);
card.disconnect(true);
- card.disconnect(true);
System.out.println("OK.");
}
--- a/jdk/test/sun/security/smartcardio/TestConnectAgain.java Fri Jul 18 13:43:28 2014 +0100
+++ b/jdk/test/sun/security/smartcardio/TestConnectAgain.java Fri Jul 18 17:04:10 2014 +0400
@@ -31,10 +31,10 @@
// This test requires special hardware.
-import java.io.*;
-import java.util.*;
-
-import javax.smartcardio.*;
+import javax.smartcardio.Card;
+import javax.smartcardio.CardException;
+import javax.smartcardio.CardChannel;
+import javax.smartcardio.CardTerminal;
public class TestConnectAgain extends Utils {
@@ -95,7 +95,7 @@
}
// disconnect
- card.disconnect(false);
+ card.disconnect(true);
System.out.println("OK.");
}
--- a/jdk/test/sun/security/smartcardio/TestControl.java Fri Jul 18 13:43:28 2014 +0100
+++ b/jdk/test/sun/security/smartcardio/TestControl.java Fri Jul 18 17:04:10 2014 +0400
@@ -31,10 +31,9 @@
// This test requires special hardware.
-import java.io.*;
-import java.util.*;
-
-import javax.smartcardio.*;
+import javax.smartcardio.Card;
+import javax.smartcardio.CardException;
+import javax.smartcardio.CardTerminal;
public class TestControl extends Utils {
@@ -68,7 +67,7 @@
}
// disconnect
- card.disconnect(false);
+ card.disconnect(true);
System.out.println("OK.");
}
--- a/jdk/test/sun/security/smartcardio/TestDefault.java Fri Jul 18 13:43:28 2014 +0100
+++ b/jdk/test/sun/security/smartcardio/TestDefault.java Fri Jul 18 17:04:10 2014 +0400
@@ -31,10 +31,9 @@
// This test requires special hardware.
-import java.io.*;
-import java.util.*;
-
-import javax.smartcardio.*;
+import java.util.List;
+import javax.smartcardio.CardTerminal;
+import javax.smartcardio.TerminalFactory;
public class TestDefault {
--- a/jdk/test/sun/security/smartcardio/TestExclusive.java Fri Jul 18 13:43:28 2014 +0100
+++ b/jdk/test/sun/security/smartcardio/TestExclusive.java Fri Jul 18 17:04:10 2014 +0400
@@ -31,10 +31,11 @@
// This test requires special hardware.
-import java.io.*;
-import java.util.*;
-
-import javax.smartcardio.*;
+import javax.smartcardio.Card;
+import javax.smartcardio.CardChannel;
+import javax.smartcardio.CardException;
+import javax.smartcardio.CardTerminal;
+import javax.smartcardio.CommandAPDU;
public class TestExclusive extends Utils {
@@ -84,9 +85,9 @@
Thread.sleep(1000);
// disconnect
- card.disconnect(false);
+ card.disconnect(true);
- if (otherOK == false) {
+ if (! otherOK) {
throw new Exception("Secondary thread failed");
}
--- a/jdk/test/sun/security/smartcardio/TestMultiplePresent.java Fri Jul 18 13:43:28 2014 +0100
+++ b/jdk/test/sun/security/smartcardio/TestMultiplePresent.java Fri Jul 18 17:04:10 2014 +0400
@@ -31,10 +31,10 @@
// This test requires special hardware.
-import java.io.*;
-import java.util.*;
-
-import javax.smartcardio.*;
+import java.util.List;
+import javax.smartcardio.CardTerminal;
+import javax.smartcardio.CardTerminals;
+import javax.smartcardio.TerminalFactory;
import static javax.smartcardio.CardTerminals.State.*;
public class TestMultiplePresent {
--- a/jdk/test/sun/security/smartcardio/TestPresent.java Fri Jul 18 13:43:28 2014 +0100
+++ b/jdk/test/sun/security/smartcardio/TestPresent.java Fri Jul 18 17:04:10 2014 +0400
@@ -31,10 +31,9 @@
// This test requires special hardware.
-import java.io.*;
-import java.util.*;
-
-import javax.smartcardio.*;
+import java.util.List;
+import javax.smartcardio.CardTerminal;
+import javax.smartcardio.TerminalFactory;
public class TestPresent {
--- a/jdk/test/sun/security/smartcardio/TestTransmit.java Fri Jul 18 13:43:28 2014 +0100
+++ b/jdk/test/sun/security/smartcardio/TestTransmit.java Fri Jul 18 17:04:10 2014 +0400
@@ -31,10 +31,16 @@
// This test requires special hardware.
-import java.io.*;
-import java.util.*;
-
-import javax.smartcardio.*;
+import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.StringReader;
+import javax.smartcardio.Card;
+import javax.smartcardio.CardChannel;
+import javax.smartcardio.CardTerminal;
+import javax.smartcardio.CommandAPDU;
+import javax.smartcardio.ResponseAPDU;
public class TestTransmit extends Utils {
@@ -79,7 +85,7 @@
}
// disconnect
- card.disconnect(false);
+ card.disconnect(true);
System.out.println("OK.");
}
--- a/jdk/test/sun/security/smartcardio/Utils.java Fri Jul 18 13:43:28 2014 +0100
+++ b/jdk/test/sun/security/smartcardio/Utils.java Fri Jul 18 17:04:10 2014 +0400
@@ -24,10 +24,16 @@
// common utility functions for the PC/SC tests
-import javax.smartcardio.*;
-
-import java.io.*;
-import java.util.*;
+import java.io.StringReader;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import javax.smartcardio.CardTerminal;
+import javax.smartcardio.CardChannel;
+import javax.smartcardio.ResponseAPDU;
+import javax.smartcardio.CommandAPDU;
+import javax.smartcardio.TerminalFactory;
public class Utils {