Fix problems with unit tests.
| | |
| | | while((nodeID = dn2id.get(null, dn, LockMode.DEFAULT)) == null) { |
| | | try { |
| | | Thread.sleep(50); |
| | | if(i == 3) { |
| | | if(i == 10) { |
| | | return null; |
| | | } |
| | | i++; |
| | |
| | | return type.getPrimaryName() + "." + |
| | | StaticUtils.toLowerCase(indexType.name()); |
| | | } |
| | | |
| | | /** |
| | | * Returns a previously allocated byte array having sub-string length size |
| | | * if the index key is a sub-string index and the desired size is equal to |
| | | * sub-string size. This is a performance hack for sub-string indexes only. |
| | | * |
| | | * @param size The size of byte array desired. |
| | | * @return Either a previously allocated byte array, or a freshly created |
| | | * one using the size parameter. |
| | | */ |
| | | public byte[] getKeyBytes(int size) |
| | | { |
| | | if(keyBytes != null) |
| | | { |
| | | if(size == keyBytes.length) |
| | | { |
| | | return this.keyBytes; |
| | | } |
| | | else |
| | | { |
| | | return new byte[size]; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return new byte[size]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | int recOffset = getIntValue(x * 4); |
| | | int keyLen = getIntValue(recOffset + 4); |
| | | byte[] keyBytes = indexKey.getKeyBytes(keyLen); |
| | | byte[] keyBytes = new byte[keyLen]; |
| | | System.arraycopy(buffer, recOffset + 8, keyBytes, 0, keyLen); |
| | | return keyBytes; |
| | | } |
| | |
| | | try { |
| | | Thread.sleep(50); |
| | | if(i == 10) { |
| | | System.out.println("Timed out waiting for: " + parentDN.toString()); |
| | | return null; |
| | | } |
| | | i++; |
| | | } catch (Exception e) { |
| | | System.out.println("Exception: " + parentDN.toString()); |
| | | return null; |
| | | } |
| | | } |
| | |
| | | } |
| | | parentIDMap.put(parentDN, parentID); |
| | | } |
| | | } else { |
| | | System.out.println("parent not found: " + parentDN.toString()); |
| | | } |
| | | return parentID; |
| | | } |
| | |
| | | * @param taskEntry The task entry. |
| | | * @param expectedState The expected completion state of the task. |
| | | */ |
| | | // @Test(dataProvider = "importexport", groups = "slow") |
| | | @Test(enabled=false) |
| | | @Test(dataProvider = "importexport", groups = "slow") |
| | | public void testImportExport(Entry taskEntry, TaskState expectedState) |
| | | throws Exception |
| | | { |