Home
last modified time | relevance | path

Searched refs:s (Results 1 – 25 of 388) sorted by relevance

12345678910>>...16

/dalvik/libcore/luni/src/test/java/tests/api/java/util/
DScannerTest.java62 private Scanner s; field in ScannerTest
97 s = new Scanner(tmpFile); in test_ConstructorLjava_io_File()
98 assertNotNull(s); in test_ConstructorLjava_io_File()
99 s.close(); in test_ConstructorLjava_io_File()
103 s = new Scanner(tmpFile); in test_ConstructorLjava_io_File()
113 s = new Scanner(tmpFile); in test_ConstructorLjava_io_File()
118 s = new Scanner((File) null); in test_ConstructorLjava_io_File()
139 s = new Scanner(tmpFile, Charset.defaultCharset().name()); in test_ConstructorLjava_io_FileLjava_lang_String()
140 assertNotNull(s); in test_ConstructorLjava_io_FileLjava_lang_String()
141 s.close(); in test_ConstructorLjava_io_FileLjava_lang_String()
[all …]
DStackTest.java31 Stack s; field in StackTest
44 assertEquals("Stack creation failed", 0, s.size()); in test_Constructor()
58 assertTrue("New stack answers non-empty", s.empty()); in test_empty()
59 s.push("blah"); in test_empty()
60 assertTrue("Stack should not be empty but answers empty", !s.empty()); in test_empty()
61 s.pop(); in test_empty()
62 assertTrue("Stack should be empty but answers non-empty", s.empty()); in test_empty()
63 s.push(null); in test_empty()
64 assertTrue("Stack with null should not be empty but answers empty", !s in test_empty()
82 s.push(item1); in test_peek()
[all …]
/dalvik/libcore/concurrent/src/test/java/tests/api/java/util/concurrent/
DSemaphoreTest.java100 Semaphore s = new Semaphore(2, false); in testTryAcquireInSameThread() local
101 assertEquals(2, s.availablePermits()); in testTryAcquireInSameThread()
102 assertTrue(s.tryAcquire()); in testTryAcquireInSameThread()
103 assertTrue(s.tryAcquire()); in testTryAcquireInSameThread()
104 assertEquals(0, s.availablePermits()); in testTryAcquireInSameThread()
105 assertFalse(s.tryAcquire()); in testTryAcquireInSameThread()
112 Semaphore s = new Semaphore(1, false); in testAcquireReleaseInSameThread() local
114 s.acquire(); in testAcquireReleaseInSameThread()
115 s.release(); in testAcquireReleaseInSameThread()
116 s.acquire(); in testAcquireReleaseInSameThread()
[all …]
/dalvik/libcore/luni/src/main/java/org/apache/harmony/luni/util/
DFloatingPointParser.java30 String s; field in FloatingPointParser.StringExponentPair
36 StringExponentPair(String s, int e, boolean negative) { in StringExponentPair() argument
37 this.s = s; in StringExponentPair()
59 private static native double parseDblImpl(String s, int e); in parseDblImpl() argument
77 private static native float parseFltImpl(String s, int e); in parseFltImpl() argument
96 private static StringExponentPair initialParse(String s, int length) { in initialParse() argument
104 throw new NumberFormatException(s); in initialParse()
106 c = s.charAt(length - 1); in initialParse()
110 throw new NumberFormatException(s); in initialParse()
113 end = Math.max(s.indexOf('E'), s.indexOf('e')); in initialParse()
[all …]
/dalvik/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/
DStringTest.java74 String s = new String(new byte[] { 65, 66, 67, 68, 69 }, 0); in test_Constructor$BI() local
75 assertEquals("Incorrect string returned: " + s, "ABCDE", s); in test_Constructor$BI()
76 s = new String(new byte[] { 65, 66, 67, 68, 69 }, 1); in test_Constructor$BI()
77 assertFalse("Did not use nonzero hibyte", s.equals("ABCDE")); in test_Constructor$BI()
112 String s = new String(new byte[] { 65, 66, 67, 68, 69 }, 0, 1, 3); in test_Constructor$BIII() local
113 assertEquals("Incorrect string returned: " + s, "BCD", s); in test_Constructor$BIII()
114 s = new String(new byte[] { 65, 66, 67, 68, 69 }, 1, 0, 5); in test_Constructor$BIII()
115 assertFalse("Did not use nonzero hibyte", s.equals("ABCDE")); in test_Constructor$BIII()
128 String s = new String(new byte[] { 65, 66, 67, 68, 69 }, 0, 5, "8859_1"); in test_Constructor$BIILjava_lang_String() local
129 assertEquals("Incorrect string returned: " + s, "ABCDE", s); in test_Constructor$BIILjava_lang_String()
[all …]
/dalvik/libcore/security/src/test/java/org/apache/harmony/security/tests/java/security/
DSignatureTest.java70 MySignature1 s = new MySignature1(algorithms[i]); in testConstructor() local
71 assertEquals(algorithms[i],s.getAlgorithm()); in testConstructor()
72 assertNull(s.getProvider()); in testConstructor()
73 assertEquals(0, s.getState()); in testConstructor()
97 MySignature1 s = new MySignature1("ABC"); in testClone() local
99 s.clone(); in testClone()
120 MySignature1 s = new MySignature1("ABC"); in testGetProvider() local
122 assertEquals("state", MySignature1.UNINITIALIZED, s.getState()); in testGetProvider()
123 assertNull("provider", s.getProvider()); in testGetProvider()
133 MySignature1 s = new MySignature1("ABC"); in testGetAlgorithm() local
[all …]
DPermissions2Test.java72 char s = File.separatorChar; in test_addLjava_security_Permission() local
76 perm[2] = new FilePermission(s + "tmp" + s + "test" + s + "*", in test_addLjava_security_Permission()
78 perm[3] = new FilePermission(s + "tmp" + s + "test" + s in test_addLjava_security_Permission()
121 char s = File.separatorChar; in test_elements() local
125 perm[2] = new FilePermission(s + "tmp" + s + "test" + s + "*", in test_elements()
127 perm[3] = new FilePermission(s + "tmp" + s + "test" + s in test_elements()
160 char s = File.separatorChar; in test_impliesLjava_security_Permission() local
164 perm[2] = new FilePermission(s + "tmp" + s + "test" + s + "*", in test_impliesLjava_security_Permission()
166 perm[3] = new FilePermission(s + "tmp" + s + "test" + s in test_impliesLjava_security_Permission()
168 perm[4] = new FilePermission(s + "windows" + "*", "delete"); in test_impliesLjava_security_Permission()
[all …]
DProviderTest.java245 Set<Map.Entry<Object, Object>> s = p.entrySet(); in testEntrySet() local
247 s.clear(); in testEntrySet()
252 assertEquals("Incorrect set size", 8, s.size()); in testEntrySet()
254 for (Iterator<Entry<Object, Object>> it = s.iterator(); it.hasNext();) { in testEntrySet()
303 Set<Object> s = p.keySet(); in testKeySet() local
305 s.clear(); in testKeySet()
309 if ((s == s1) || s1.isEmpty()) { in testKeySet()
381 Provider.Service s = it.next(); in testPutObjectObject() local
382 if ("Type".equals(s.getType()) in testPutObjectObject()
383 && "Algorithm".equals(s.getAlgorithm()) in testPutObjectObject()
[all …]
/dalvik/libcore/security/src/test/java/tests/security/permissions/
DJavaIoFileTest.java94 TestSecurityManager s = new TestSecurityManager(); in test_File1() local
95 System.setSecurityManager(s); in test_File1()
97 s.reset(); in test_File1()
99 assertTrue("File.delete must call checkDelete on security manager", s.called); in test_File1()
100 assertEquals("Argument of checkDelete is not correct", filename, s.filename); in test_File1()
102 s.reset(); in test_File1()
104 assertTrue("File.deleteOnExit must call checkDelete on security manager", s.called); in test_File1()
105 assertEquals("Argument of checkDelete is not correct", filename, s.filename); in test_File1()
207 TestSecurityManager s = new TestSecurityManager(); in test_File2() local
208 System.setSecurityManager(s); in test_File2()
[all …]
DJavaLangSystemTest.java86 TestSecurityManager s = new TestSecurityManager(); in test_Properties() local
87 System.setSecurityManager(s); in test_Properties()
89 s.reset(); in test_Properties()
91 … assertTrue("System.getProperties must call checkPropertiesAccess on security manager", s.called); in test_Properties()
93 s.reset(); in test_Properties()
95 … assertTrue("System.setProperties must call checkPropertiesAccess on security manager", s.called); in test_Properties()
134 TestSecurityManager s = new TestSecurityManager(); in test_getProperty() local
135 System.setSecurityManager(s); in test_getProperty()
137 s.reset(); in test_getProperty()
139 … assertTrue("System.getProperty must call checkPropertyAccess on security manager", s.called); in test_getProperty()
[all …]
DJavaLangRuntimeTest.java98 TestSecurityManager s = new TestSecurityManager(); in test_exec() local
99 System.setSecurityManager(s); in test_exec()
101 s.reset(); in test_exec()
103 assertTrue("Runtime.exec must call checkExcec on security manager", s.called); in test_exec()
104 assertEquals("Argument of checkExec is not correct", cmd, s.cmd); in test_exec()
106 s.reset(); in test_exec()
108 assertTrue("Runtime.exec must call checkExcec on security manager", s.called); in test_exec()
109 assertEquals("Argument of checkExec is not correct", cmd, s.cmd); in test_exec()
111 s.reset(); in test_exec()
113 assertTrue("Runtime.exec must call checkExcec on security manager", s.called); in test_exec()
[all …]
DJavaNetSocketTest.java118 TestSecurityManager s = new TestSecurityManager(); in test_ctor() local
119 System.setSecurityManager(s); in test_ctor()
121 s.reset(); in test_ctor()
123 … assertTrue("java.net.ServerSocket ctor must call checkConnect on security permissions", s.called); in test_ctor()
124 assertEquals("Argument of checkConnect is not correct", hostAddress, s.host); in test_ctor()
125 assertEquals("Argument of checkConnect is not correct", port, s.port); in test_ctor()
127 s.reset(); in test_ctor()
129 … assertTrue("java.net.ServerSocket ctor must call checkConnect on security permissions", s.called); in test_ctor()
130 assertEquals("Argument of checkConnect is not correct", hostAddress, s.host); in test_ctor()
131 assertEquals("Argument of checkConnect is not correct", port, s.port); in test_ctor()
[all …]
DJavaIoObjectOutputStreamTest.java80 TestObjectOutputStream(OutputStream s) throws StreamCorruptedException, IOException { in test_ObjectOutputStream() argument
81 super(s); in test_ObjectOutputStream()
96 TestSecurityManager s = new TestSecurityManager(); in test_ObjectOutputStream() local
97 System.setSecurityManager(s); in test_ObjectOutputStream()
99 s.reset(); in test_ObjectOutputStream()
101 …utputStream.enableReplaceObject(boolean) must call checkPermission on security manager", s.called); in test_ObjectOutputStream()
102 …assertEquals("Name of SerializablePermission is not correct", "enableSubstitution", s.permission.g… in test_ObjectOutputStream()
135 TestObjectOutputStream(OutputStream s) throws StreamCorruptedException, IOException { in test_ObjecOutputStream2() argument
136 super(s); in test_ObjecOutputStream2()
141 … TestObjectOutputStream_putFields(OutputStream s) throws StreamCorruptedException, IOException { in test_ObjecOutputStream2() argument
[all …]
DJavaIoObjectInputStreamTest.java94 TestObjectInputStream(InputStream s) throws StreamCorruptedException, IOException { in test_ObjectInputStream() argument
95 super(s); in test_ObjectInputStream()
116 TestSecurityManager s = new TestSecurityManager(); in test_ObjectInputStream() local
117 System.setSecurityManager(s); in test_ObjectInputStream()
119 s.reset(); in test_ObjectInputStream()
121 …InputStream.enableResolveObject(boolean) must call checkPermission on security manager", s.called); in test_ObjectInputStream()
122 …assertEquals("Name of SerializablePermission is not correct", "enableSubstitution", s.permission.g… in test_ObjectInputStream()
157 TestObjectInputStream(InputStream s) throws StreamCorruptedException, IOException { in test_ObjectInputStream2() argument
158 super(s); in test_ObjectInputStream2()
163 … TestObjectInputStream_readFields(InputStream s) throws StreamCorruptedException, IOException { in test_ObjectInputStream2() argument
[all …]
DJavaSecuritySecurityTest.java80 TestSecurityManager s = new TestSecurityManager(); in test_getProperty() local
81 System.setSecurityManager(s); in test_getProperty()
83 s.reset(); in test_getProperty()
85 …java.security.Security.getProperty() must call checkSecurityAccess on security manager", s.called); in test_getProperty()
86 assertEquals("Argument of checkSecurityAccess is not correct", "getProperty.key", s.target); in test_getProperty()
114 TestSecurityManager s = new TestSecurityManager(); in test_setProperty() local
115 System.setSecurityManager(s); in test_setProperty()
117 s.reset(); in test_setProperty()
119 …java.security.Security.setProperty() must call checkSecurityAccess on security manager", s.called); in test_setProperty()
120 assertEquals("Argument of checkSecurityAccess is not correct", "setProperty.key", s.target); in test_setProperty()
[all …]
DJavaNetMulticastSocketTest.java96 TestSecurityManager s = new TestSecurityManager(); in test_ctor() local
97 System.setSecurityManager(s); in test_ctor()
101 s.reset(); in test_ctor()
103 …True("java.net.MulticastSocket(int) ctor must call checkListen on security permissions", s.called); in test_ctor()
104 assertEquals("Argument of checkListen is not correct", port, s.port); in test_ctor()
106 s.reset(); in test_ctor()
108 …ertTrue("java.net.MulticastSocket() ctor must call checkListen on security permissions", s.called); in test_ctor()
109 assertEquals("Argument of checkListen is not correct", 0, s.port); in test_ctor()
111 s.reset(); in test_ctor()
113 …ertTrue("java.net.MulticastSocket() ctor must call checkListen on security permissions", s.called); in test_ctor()
[all …]
DJavaNetServerSocketTest.java98 TestSecurityManager s = new TestSecurityManager(); in test_ctor() local
99 System.setSecurityManager(s); in test_ctor()
101 s.reset(); in test_ctor()
103 … assertTrue("java.net.ServerSocket ctor must call checkListen on security permissions", s.called); in test_ctor()
104 assertEquals("Argument of checkListen is not correct", 8888, s.port); in test_ctor()
107 s.reset(); in test_ctor()
109 … assertTrue("java.net.ServerSocket ctor must call checkListen on security permissions", s.called); in test_ctor()
110 assertEquals("Argument of checkListen is not correct", 8888, s.port); in test_ctor()
113 s.reset(); in test_ctor()
116 … assertTrue("java.net.ServerSocket ctor must call checkListen on security permissions", s.called); in test_ctor()
[all …]
DJavaIoFileOutputStreamTest.java119 TestSecurityManager s = new TestSecurityManager(); in test_FileOutputStream1() local
120 System.setSecurityManager(s); in test_FileOutputStream1()
122 s.reset(); in test_FileOutputStream1()
125 …rtTrue("FileOutputStream(FileDescriptor) ctor must call checkWrite on security manager", s.called); in test_FileOutputStream1()
126 assertEquals("Argument of checkWrite is not correct", fd, s.fd); in test_FileOutputStream1()
128 s.reset(); in test_FileOutputStream1()
130 … assertTrue("FileOutputStream(File) ctor must call checkWrite on security manager", s.called); in test_FileOutputStream1()
131 assertEquals("Argument of checkWrite is not correct", filename, s.file); in test_FileOutputStream1()
133 s.reset(); in test_FileOutputStream1()
135 … assertTrue("FileOutputStream(File) ctor must call checkWrite on security manager", s.called); in test_FileOutputStream1()
[all …]
/dalvik/libcore/luni/src/main/java/java/net/
DURIEncoderDecoder.java54 static void validate(String s, String legal) throws URISyntaxException { in validate() argument
55 for (int i = 0; i < s.length();) { in validate()
56 char ch = s.charAt(i); in validate()
59 if (i + 2 >= s.length()) { in validate()
60 throw new URISyntaxException(s, Msg.getString("K0313"), //$NON-NLS-1$ in validate()
63 int d1 = Character.digit(s.charAt(i + 1), 16); in validate()
64 int d2 = Character.digit(s.charAt(i + 2), 16); in validate()
66 throw new URISyntaxException(s, Msg.getString("K0314", //$NON-NLS-1$ in validate()
67 s.substring(i, i + 3)), i); in validate()
71 } while (i < s.length() && s.charAt(i) == '%'); in validate()
[all …]
DURLDecoder.java51 public static String decode(String s) { in decode() argument
52 return Util.decode(s, true); in decode()
75 public static String decode(String s, String enc) in decode() argument
88 StringBuffer result = new StringBuffer(s.length()); in decode()
90 for (int i = 0; i < s.length();) { in decode()
91 char c = s.charAt(i); in decode()
97 if (i + 2 >= s.length()) { in decode()
101 int d1 = Character.digit(s.charAt(i + 1), 16); in decode()
102 int d2 = Character.digit(s.charAt(i + 2), 16); in decode()
106 s.substring(i, i + 3), String.valueOf(i))); in decode()
[all …]
/dalvik/libcore/regex/src/test/java/org/apache/harmony/regex/tests/java/util/regex/
DPatternSyntaxExceptionTest.java69 String s = e.getMessage(); in testPatternSyntaxException() local
70 assertTrue(s.contains("Foo")); in testPatternSyntaxException()
71 assertTrue(s.contains("Bar")); in testPatternSyntaxException()
72 assertTrue(s.contains("0")); in testPatternSyntaxException()
80 s = e.getMessage(); in testPatternSyntaxException()
81 assertFalse(s.contains("Foo")); in testPatternSyntaxException()
82 assertTrue(s.contains("Bar")); in testPatternSyntaxException()
83 assertTrue(s.contains("0")); in testPatternSyntaxException()
91 s = e.getMessage(); in testPatternSyntaxException()
92 assertTrue(s.contains("Foo")); in testPatternSyntaxException()
[all …]
/dalvik/libcore/luni/src/main/java/java/util/
DMissingFormatWidthException.java29 private String s; field in MissingFormatWidthException
38 public MissingFormatWidthException(String s) { in MissingFormatWidthException() argument
39 if (null == s) { in MissingFormatWidthException()
42 this.s = s; in MissingFormatWidthException()
51 return s; in getFormatSpecifier()
61 return s; in getMessage()
DMissingFormatArgumentException.java32 private String s; field in MissingFormatArgumentException
41 public MissingFormatArgumentException(String s) { in MissingFormatArgumentException() argument
42 if (null == s) { in MissingFormatArgumentException()
45 this.s = s; in MissingFormatArgumentException()
54 return s; in getFormatSpecifier()
64 return Msg.getString("K0348", s); in getMessage()
/dalvik/tests/003-omnibus-opcodes/src/
DInternedString.java29 String s = "blah"; in testDeadInternedString() local
30 s = s + s; in testDeadInternedString()
31 WeakReference strRef = new WeakReference<String>(s.intern()); in testDeadInternedString()
33 s = CONST; in testDeadInternedString()
48 String s = CONST; in testImmortalInternedString() local
50 strRef = new WeakReference<String>(s.intern()); in testImmortalInternedString()
52 s = ""; in testImmortalInternedString()
/dalvik/libcore/x-net/src/test/java/tests/api/javax/net/
DSocketFactoryTest.java79 Socket s = sf.createSocket(); in test_createSocket_01() local
80 assertNotNull(s); in test_createSocket_01()
81 assertEquals(-1, s.getLocalPort()); in test_createSocket_01()
82 assertEquals(0, s.getPort()); in test_createSocket_01()
113 Socket s = sf.createSocket(InetAddress.getLocalHost().getHostName(), sport); in test_createSocket_02() local
114 assertNotNull(s); in test_createSocket_02()
115 assertTrue("Failed to create socket", s.getPort() == sport); in test_createSocket_02()
121 Socket s = sf.createSocket("bla-bla", sport); in test_createSocket_02() local
131 … Socket s = sf.createSocket(InetAddress.getLocalHost().getHostName(), invalidPorts[i]); in test_createSocket_02() local
141 Socket s = sf.createSocket(InetAddress.getLocalHost().getHostName(), portNumber); in test_createSocket_02() local
[all …]

12345678910>>...16