target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void hasCorrectNumberField() { Field field = subject.getFields().get(4); assertEquals("GPA", field.getTitle()); assertEquals("3.7", field.getValue()); } | public List<Field> getFields() { return mFields; } | Metadata { public List<Field> getFields() { return mFields; } } | Metadata { public List<Field> getFields() { return mFields; } Metadata(List<String> displayOrder, Map<String, JsonObject> groups, Map<String, GroupDef> groupDefinitions, List<Field> fields); } | Metadata { public List<Field> getFields() { return mFields; } Metadata(List<String> displayOrder, Map<String, JsonObject> groups, Map<String, GroupDef> groupDefinitions, List<Field> fields); List<String> getDisplayOrder(); Map<String, JsonObject> getGroups(); Map<String, GroupDef> getGroupDefinitions(); List<Field> get... | Metadata { public List<Field> getFields() { return mFields; } Metadata(List<String> displayOrder, Map<String, JsonObject> groups, Map<String, GroupDef> groupDefinitions, List<Field> fields); List<String> getDisplayOrder(); Map<String, JsonObject> getGroups(); Map<String, GroupDef> getGroupDefinitions(); List<Field> get... |
@Test public void hasCorrectBooleanField() { Field field = subject.getFields().get(6); assertEquals("is this a boolean?", field.getTitle()); assertEquals("True", field.getValue()); } | public List<Field> getFields() { return mFields; } | Metadata { public List<Field> getFields() { return mFields; } } | Metadata { public List<Field> getFields() { return mFields; } Metadata(List<String> displayOrder, Map<String, JsonObject> groups, Map<String, GroupDef> groupDefinitions, List<Field> fields); } | Metadata { public List<Field> getFields() { return mFields; } Metadata(List<String> displayOrder, Map<String, JsonObject> groups, Map<String, GroupDef> groupDefinitions, List<Field> fields); List<String> getDisplayOrder(); Map<String, JsonObject> getGroups(); Map<String, GroupDef> getGroupDefinitions(); List<Field> get... | Metadata { public List<Field> getFields() { return mFields; } Metadata(List<String> displayOrder, Map<String, JsonObject> groups, Map<String, GroupDef> groupDefinitions, List<Field> fields); List<String> getDisplayOrder(); Map<String, JsonObject> getGroups(); Map<String, GroupDef> getGroupDefinitions(); List<Field> get... |
@Test public void testGenerateMnemonic() throws Exception { byte[] seedData = new byte[32]; String expectedMnemonic = ABANDON_ABANDON_ART; List<String> seedPhrase = BitcoinUtils.generateMnemonic(seedData); assertFalse(ListUtils.isEmpty(seedPhrase)); String mnemonic = StringUtils.join(" ", seedPhrase); assertFalse("Mnem... | public static List<String> generateMnemonic(byte[] seedData) { if (MnemonicCode.INSTANCE == null) { return null; } try { return MnemonicCode.INSTANCE.toMnemonic(seedData); } catch (MnemonicException.MnemonicLengthException e) { Timber.e(e, "Unable to create mnemonic from word list"); } return null; } | BitcoinUtils { public static List<String> generateMnemonic(byte[] seedData) { if (MnemonicCode.INSTANCE == null) { return null; } try { return MnemonicCode.INSTANCE.toMnemonic(seedData); } catch (MnemonicException.MnemonicLengthException e) { Timber.e(e, "Unable to create mnemonic from word list"); } return null; } } | BitcoinUtils { public static List<String> generateMnemonic(byte[] seedData) { if (MnemonicCode.INSTANCE == null) { return null; } try { return MnemonicCode.INSTANCE.toMnemonic(seedData); } catch (MnemonicException.MnemonicLengthException e) { Timber.e(e, "Unable to create mnemonic from word list"); } return null; } } | BitcoinUtils { public static List<String> generateMnemonic(byte[] seedData) { if (MnemonicCode.INSTANCE == null) { return null; } try { return MnemonicCode.INSTANCE.toMnemonic(seedData); } catch (MnemonicException.MnemonicLengthException e) { Timber.e(e, "Unable to create mnemonic from word list"); } return null; } st... | BitcoinUtils { public static List<String> generateMnemonic(byte[] seedData) { if (MnemonicCode.INSTANCE == null) { return null; } try { return MnemonicCode.INSTANCE.toMnemonic(seedData); } catch (MnemonicException.MnemonicLengthException e) { Timber.e(e, "Unable to create mnemonic from word list"); } return null; } st... |
@Test public void createWalletFromSeedPhrase() { String seedPhrase = ABANDON_ABANDON_ART; NetworkParameters params = MainNetParams.get(); Wallet wallet = BitcoinUtils.createWallet(params, seedPhrase); Address firstAddress = wallet.freshReceiveAddress(); Address secondAddress = wallet.freshReceiveAddress(); assertEquals... | public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWallet(params, entro... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... |
@Test public void createWalletFromEntropy() { byte[] entropy = new byte[32]; NetworkParameters params = MainNetParams.get(); Wallet wallet = BitcoinUtils.createWallet(params, entropy); Address firstAddress = wallet.freshReceiveAddress(); Address secondAddress = wallet.freshReceiveAddress(); assertEquals("1KBdbBJRVYffWH... | public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWallet(params, entro... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... |
@Test public void keychainSeedMatches() { String bip39seed = "408b285c123836004f4b8842c89324c1f01382450c0d439af345ba7fc49acf705489c6fc77dbd4e3dc1dd8cc6bc9f043db8ada1e243c4a0eafb290d399480840"; byte[] entropy = new byte[32]; NetworkParameters params = MainNetParams.get(); Wallet wallet = BitcoinUtils.createWallet(params... | public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWallet(params, entro... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... |
@Test public void detectsValidPassphrases() { String seedPhrase = ABANDON_ABANDON_ART; assertTrue("This should be a valid phrase", BitcoinUtils.isValidPassphrase(seedPhrase)); } | public static boolean isValidPassphrase(String passphrase) { try { byte[] entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(passphrase.split(" "))); return entropy.length > 0; } catch (MnemonicException e) { Timber.e(e, "Invalid passphrase"); return false; } } | BitcoinUtils { public static boolean isValidPassphrase(String passphrase) { try { byte[] entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(passphrase.split(" "))); return entropy.length > 0; } catch (MnemonicException e) { Timber.e(e, "Invalid passphrase"); return false; } } } | BitcoinUtils { public static boolean isValidPassphrase(String passphrase) { try { byte[] entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(passphrase.split(" "))); return entropy.length > 0; } catch (MnemonicException e) { Timber.e(e, "Invalid passphrase"); return false; } } } | BitcoinUtils { public static boolean isValidPassphrase(String passphrase) { try { byte[] entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(passphrase.split(" "))); return entropy.length > 0; } catch (MnemonicException e) { Timber.e(e, "Invalid passphrase"); return false; } } static void init(Context context); st... | BitcoinUtils { public static boolean isValidPassphrase(String passphrase) { try { byte[] entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(passphrase.split(" "))); return entropy.length > 0; } catch (MnemonicException e) { Timber.e(e, "Invalid passphrase"); return false; } } static void init(Context context); st... |
@Test public void nullLaunchUrlLaunchesOnboarding() { LaunchData launchData = SplashUrlDecoder.getLaunchType(null); assertEquals(ONBOARDING, launchData.getLaunchType()); } | public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCertificateUri(launch... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... |
@Test public void detectsInvalidPassphrases() { String seedPhrase = "This phrase is too short and not random enough"; assertFalse("This should be an invalid phrase", BitcoinUtils.isValidPassphrase(seedPhrase)); } | public static boolean isValidPassphrase(String passphrase) { try { byte[] entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(passphrase.split(" "))); return entropy.length > 0; } catch (MnemonicException e) { Timber.e(e, "Invalid passphrase"); return false; } } | BitcoinUtils { public static boolean isValidPassphrase(String passphrase) { try { byte[] entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(passphrase.split(" "))); return entropy.length > 0; } catch (MnemonicException e) { Timber.e(e, "Invalid passphrase"); return false; } } } | BitcoinUtils { public static boolean isValidPassphrase(String passphrase) { try { byte[] entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(passphrase.split(" "))); return entropy.length > 0; } catch (MnemonicException e) { Timber.e(e, "Invalid passphrase"); return false; } } } | BitcoinUtils { public static boolean isValidPassphrase(String passphrase) { try { byte[] entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(passphrase.split(" "))); return entropy.length > 0; } catch (MnemonicException e) { Timber.e(e, "Invalid passphrase"); return false; } } static void init(Context context); st... | BitcoinUtils { public static boolean isValidPassphrase(String passphrase) { try { byte[] entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(passphrase.split(" "))); return entropy.length > 0; } catch (MnemonicException e) { Timber.e(e, "Invalid passphrase"); return false; } } static void init(Context context); st... |
@Test public void pubKeyOwnershipConfirmed() { String pubKeyString = "03f5b5836e454ac540c912371d44b4bed1123be954644876a72571dc679f8e89d0"; byte[] pubKey = Utils.HEX.decode(pubKeyString); String seedPhrase = ABANDON_ABANDON_ART; NetworkParameters params = MainNetParams.get(); Wallet wallet = BitcoinUtils.createWallet(pa... | public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWallet(params, entro... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... |
@Test public void pubKeyNonOwnershipDetected() { String pubKeyString = "444444444444444444444444444444444444444444444444444444444444444444"; byte[] pubKey = Utils.HEX.decode(pubKeyString); String seedPhrase = ABANDON_ABANDON_ART; NetworkParameters params = MainNetParams.get(); Wallet wallet = BitcoinUtils.createWallet(... | public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWallet(params, entro... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... |
@Test public void previousReceiveAddressesOwnershipVerified() { String seedPhrase = ABANDON_ABANDON_ART; NetworkParameters params = MainNetParams.get(); Wallet wallet = BitcoinUtils.createWallet(params, seedPhrase); Address address1 = wallet.freshReceiveAddress(); Address address2 = wallet.freshReceiveAddress(); Addres... | public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWallet(params, entro... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... |
@Test public void savedWalletResumesFreshReceiveAddresses() throws IOException, UnreadableWalletException { String seedPhrase = ABANDON_ABANDON_ART; NetworkParameters params = MainNetParams.get(); Wallet wallet = BitcoinUtils.createWallet(params, seedPhrase); File tempFile = File.createTempFile("temp", "wallet"); Addre... | public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWallet(params, entro... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... | BitcoinUtils { public static Wallet createWallet(NetworkParameters params, String seedPhrase) { byte[] entropy; try { entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(seedPhrase.split(" "))); } catch (MnemonicException e) { Timber.e(e, "Could not convert passphrase to entropy"); return null; } return createWalle... |
@Test public void issuerUrlLaunchesIssuerFlow() { LaunchData launchData = SplashUrlDecoder.getLaunchType(ADD_ISSUER_URL); assertEquals(ADD_ISSUER, launchData.getLaunchType()); assertEquals("https: assertEquals("a*bcd", launchData.getNonce()); } | public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCertificateUri(launch... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... |
@Test public void shortIssuerUrlLaunchesDefault() { LaunchData launchData = SplashUrlDecoder.getLaunchType("https: assertEquals(ONBOARDING, launchData.getLaunchType()); } | public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCertificateUri(launch... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... |
@Test public void longIssuerUrlLaunchesIssuerFlow() { LaunchData launchData = SplashUrlDecoder.getLaunchType(ADD_ISSUER_URL + "/extra"); assertEquals(ADD_ISSUER, launchData.getLaunchType()); assertEquals("https: assertEquals("a*bcd", launchData.getNonce()); } | public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCertificateUri(launch... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... |
@Test public void certificateUrlLaunchesCertificateFlow() { LaunchData launchData = SplashUrlDecoder.getLaunchType(ADD_CERTIFICATE_URL); assertEquals(ADD_CERTIFICATE, launchData.getLaunchType()); assertEquals("https: } | public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCertificateUri(launch... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... |
@Test public void shortCertificateUrlLaunchesDefault() { LaunchData launchData = SplashUrlDecoder.getLaunchType("https: assertEquals(ONBOARDING, launchData.getLaunchType()); } | public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCertificateUri(launch... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... |
@Test public void blockcertsAddIssuerUrlLaunchesIssuerFlow() { LaunchData launchData = SplashUrlDecoder.getLaunchType(BLOCKCERTS_ADD_ISSUER_URL); assertEquals(ADD_ISSUER, launchData.getLaunchType()); assertEquals("https: assertEquals("a*bcd", launchData.getNonce()); } | public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCertificateUri(launch... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... |
@Test public void blockcertsCertificateUrlLaunchesCertificateFlow() { LaunchData launchData = SplashUrlDecoder.getLaunchType(BLOCKCERTS_ADD_CERTIFICATE_URL); assertEquals(ADD_CERTIFICATE, launchData.getLaunchType()); assertEquals("https: } | public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCertificateUri(launch... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... |
@Test public void blockcertsDirectAddIssuerUrlLaunchesIssuerFlow() { LaunchData launchData = SplashUrlDecoder.getLaunchType(BLOCKCERTS_DIRECT_ADD_ISSUER_URL); assertEquals(ADD_ISSUER, launchData.getLaunchType()); assertEquals("https: assertEquals("a*bcd", launchData.getNonce()); } | public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCertificateUri(launch... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... | SplashUrlDecoder { public static LaunchData getLaunchType(String launchUri) { if (launchUri == null) { launchUri = ""; } LaunchData data; if (launchUri.contains(ADD_ISSUER_PATH)) { data = handleAddIssuerUri(launchUri); if (data != null) { return data; } } else if (launchUri.contains(ADD_CERT_PATH)) { data = handleAddCe... |
@Test public void testPacketsCreationFile() { Cloud cloud = new Cloud(); cloud.createPacketsFile(); File file = new File(cloud.getSharedDir(), "Packets.txt"); try (BufferedReader inputStream = new BufferedReader(new FileReader(file))) { List<String> lines = inputStream.lines().collect(Collectors.toList()); for (int i =... | public void createPacketsFile() { File packetsFile = new File(this.sharedDir, "Packets.txt"); if (packetsFile.exists()) { try { packetsFile.createNewFile(); } catch (IOException e) { log.error("Cannot create", e); } } try (PrintWriter writer = new PrintWriter(new FileOutputStream(packetsFile))) { for (Class<? extends P... | Cloud { public void createPacketsFile() { File packetsFile = new File(this.sharedDir, "Packets.txt"); if (packetsFile.exists()) { try { packetsFile.createNewFile(); } catch (IOException e) { log.error("Cannot create", e); } } try (PrintWriter writer = new PrintWriter(new FileOutputStream(packetsFile))) { for (Class<? e... | Cloud { public void createPacketsFile() { File packetsFile = new File(this.sharedDir, "Packets.txt"); if (packetsFile.exists()) { try { packetsFile.createNewFile(); } catch (IOException e) { log.error("Cannot create", e); } } try (PrintWriter writer = new PrintWriter(new FileOutputStream(packetsFile))) { for (Class<? e... | Cloud { public void createPacketsFile() { File packetsFile = new File(this.sharedDir, "Packets.txt"); if (packetsFile.exists()) { try { packetsFile.createNewFile(); } catch (IOException e) { log.error("Cannot create", e); } } try (PrintWriter writer = new PrintWriter(new FileOutputStream(packetsFile))) { for (Class<? e... | Cloud { public void createPacketsFile() { File packetsFile = new File(this.sharedDir, "Packets.txt"); if (packetsFile.exists()) { try { packetsFile.createNewFile(); } catch (IOException e) { log.error("Cannot create", e); } } try (PrintWriter writer = new PrintWriter(new FileOutputStream(packetsFile))) { for (Class<? e... |
@Test public void loadQuestions_ShouldReturnCache_IfItIsAvailable() { repository.caches.addAll(questions); repository.loadQuestions(false).subscribe(questionsTestSubscriber); verifyZeroInteractions(localDataSource); verifyZeroInteractions(remoteDataSource); questionsTestSubscriber.assertValue(questions); } | @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { if (forceRemote) { return refreshData(); } else { if (caches.size() > 0) { return Flowable.just(caches); } else { return localDataSource.loadQuestions(false) .take(1) .flatMap(Flowable::fromIterable) .doOnNext(question -> caches.add(question... | QuestionRepository implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { if (forceRemote) { return refreshData(); } else { if (caches.size() > 0) { return Flowable.just(caches); } else { return localDataSource.loadQuestions(false) .take(1) .flatMap(Flowable::from... | QuestionRepository implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { if (forceRemote) { return refreshData(); } else { if (caches.size() > 0) { return Flowable.just(caches); } else { return localDataSource.loadQuestions(false) .take(1) .flatMap(Flowable::from... | QuestionRepository implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { if (forceRemote) { return refreshData(); } else { if (caches.size() > 0) { return Flowable.just(caches); } else { return localDataSource.loadQuestions(false) .take(1) .flatMap(Flowable::from... | QuestionRepository implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { if (forceRemote) { return refreshData(); } else { if (caches.size() > 0) { return Flowable.just(caches); } else { return localDataSource.loadQuestions(false) .take(1) .flatMap(Flowable::from... |
@Test(expected = UnsupportedOperationException.class) public void clearData_NoThingToDoWithRemoteService() { remoteDataSource.clearData(); then(questionService).shouldHaveZeroInteractions(); } | @Override public void clearData() { throw new UnsupportedOperationException("Unsupported operation"); } | QuestionRemoteDataSource implements QuestionDataSource { @Override public void clearData() { throw new UnsupportedOperationException("Unsupported operation"); } } | QuestionRemoteDataSource implements QuestionDataSource { @Override public void clearData() { throw new UnsupportedOperationException("Unsupported operation"); } @Inject QuestionRemoteDataSource(QuestionService questionService); } | QuestionRemoteDataSource implements QuestionDataSource { @Override public void clearData() { throw new UnsupportedOperationException("Unsupported operation"); } @Inject QuestionRemoteDataSource(QuestionService questionService); @Override Flowable<List<Question>> loadQuestions(boolean forceRemote); @Override void addQu... | QuestionRemoteDataSource implements QuestionDataSource { @Override public void clearData() { throw new UnsupportedOperationException("Unsupported operation"); } @Inject QuestionRemoteDataSource(QuestionService questionService); @Override Flowable<List<Question>> loadQuestions(boolean forceRemote); @Override void addQu... |
@Test public void loadQuestions_ShouldReturnFromLocal_IfCacheIsNotAvailable() { doReturn(Flowable.just(questions)).when(localDataSource).loadQuestions(false); doReturn(Flowable.just(questions)).when(remoteDataSource).loadQuestions(true); repository.loadQuestions(false).subscribe(questionsTestSubscriber); verify(localDa... | @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { if (forceRemote) { return refreshData(); } else { if (caches.size() > 0) { return Flowable.just(caches); } else { return localDataSource.loadQuestions(false) .take(1) .flatMap(Flowable::fromIterable) .doOnNext(question -> caches.add(question... | QuestionRepository implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { if (forceRemote) { return refreshData(); } else { if (caches.size() > 0) { return Flowable.just(caches); } else { return localDataSource.loadQuestions(false) .take(1) .flatMap(Flowable::from... | QuestionRepository implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { if (forceRemote) { return refreshData(); } else { if (caches.size() > 0) { return Flowable.just(caches); } else { return localDataSource.loadQuestions(false) .take(1) .flatMap(Flowable::from... | QuestionRepository implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { if (forceRemote) { return refreshData(); } else { if (caches.size() > 0) { return Flowable.just(caches); } else { return localDataSource.loadQuestions(false) .take(1) .flatMap(Flowable::from... | QuestionRepository implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { if (forceRemote) { return refreshData(); } else { if (caches.size() > 0) { return Flowable.just(caches); } else { return localDataSource.loadQuestions(false) .take(1) .flatMap(Flowable::from... |
@Test public void getQuestion_ShouldReturnFromCache() { question1.setId(1); question2.setId(2); question3.setId(3); repository.caches.addAll(questions); TestSubscriber<Question> subscriber = new TestSubscriber<>(); repository.getQuestion(1).subscribe(subscriber); then(localDataSource).shouldHaveZeroInteractions(); then... | public Flowable<Question> getQuestion(long questionId) { return Flowable.fromIterable(caches).filter(question -> question.getId() == questionId); } | QuestionRepository implements QuestionDataSource { public Flowable<Question> getQuestion(long questionId) { return Flowable.fromIterable(caches).filter(question -> question.getId() == questionId); } } | QuestionRepository implements QuestionDataSource { public Flowable<Question> getQuestion(long questionId) { return Flowable.fromIterable(caches).filter(question -> question.getId() == questionId); } @Inject QuestionRepository(@Local QuestionDataSource localDataSource,
@Remote QuestionDataSource remoteDataSource)... | QuestionRepository implements QuestionDataSource { public Flowable<Question> getQuestion(long questionId) { return Flowable.fromIterable(caches).filter(question -> question.getId() == questionId); } @Inject QuestionRepository(@Local QuestionDataSource localDataSource,
@Remote QuestionDataSource remoteDataSource)... | QuestionRepository implements QuestionDataSource { public Flowable<Question> getQuestion(long questionId) { return Flowable.fromIterable(caches).filter(question -> question.getId() == questionId); } @Inject QuestionRepository(@Local QuestionDataSource localDataSource,
@Remote QuestionDataSource remoteDataSource)... |
@Test public void clearData_ShouldClearCachesAndLocalData() { repository.caches.addAll(questions); repository.clearData(); assertThat(repository.caches, empty()); then(localDataSource).should().clearData(); } | @Override public void clearData() { caches.clear(); localDataSource.clearData(); } | QuestionRepository implements QuestionDataSource { @Override public void clearData() { caches.clear(); localDataSource.clearData(); } } | QuestionRepository implements QuestionDataSource { @Override public void clearData() { caches.clear(); localDataSource.clearData(); } @Inject QuestionRepository(@Local QuestionDataSource localDataSource,
@Remote QuestionDataSource remoteDataSource); } | QuestionRepository implements QuestionDataSource { @Override public void clearData() { caches.clear(); localDataSource.clearData(); } @Inject QuestionRepository(@Local QuestionDataSource localDataSource,
@Remote QuestionDataSource remoteDataSource); @Override Flowable<List<Question>> loadQuestions(boolean forceR... | QuestionRepository implements QuestionDataSource { @Override public void clearData() { caches.clear(); localDataSource.clearData(); } @Inject QuestionRepository(@Local QuestionDataSource localDataSource,
@Remote QuestionDataSource remoteDataSource); @Override Flowable<List<Question>> loadQuestions(boolean forceR... |
@Test(expected = UnsupportedOperationException.class) public void addQuestion_ShouldThrowException() { repository.addQuestion(question1); } | @Override public void addQuestion(Question question) { throw new UnsupportedOperationException("Unsupported operation"); } | QuestionRepository implements QuestionDataSource { @Override public void addQuestion(Question question) { throw new UnsupportedOperationException("Unsupported operation"); } } | QuestionRepository implements QuestionDataSource { @Override public void addQuestion(Question question) { throw new UnsupportedOperationException("Unsupported operation"); } @Inject QuestionRepository(@Local QuestionDataSource localDataSource,
@Remote QuestionDataSource remoteDataSource); } | QuestionRepository implements QuestionDataSource { @Override public void addQuestion(Question question) { throw new UnsupportedOperationException("Unsupported operation"); } @Inject QuestionRepository(@Local QuestionDataSource localDataSource,
@Remote QuestionDataSource remoteDataSource); @Override Flowable<List... | QuestionRepository implements QuestionDataSource { @Override public void addQuestion(Question question) { throw new UnsupportedOperationException("Unsupported operation"); } @Inject QuestionRepository(@Local QuestionDataSource localDataSource,
@Remote QuestionDataSource remoteDataSource); @Override Flowable<List... |
@Test public void loadQuestions_ShouldReturnFromDatabase() { List<Question> questions = Arrays.asList(new Question(), new Question()); TestSubscriber<List<Question>> subscriber = new TestSubscriber<>(); given(questionDao.getAllQuestions()).willReturn(Flowable.just(questions)); localDataSource.loadQuestions(false).subsc... | @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { return questionDao.getAllQuestions(); } | QuestionLocalDataSource implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { return questionDao.getAllQuestions(); } } | QuestionLocalDataSource implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { return questionDao.getAllQuestions(); } @Inject QuestionLocalDataSource(QuestionDao questionDao); } | QuestionLocalDataSource implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { return questionDao.getAllQuestions(); } @Inject QuestionLocalDataSource(QuestionDao questionDao); @Override Flowable<List<Question>> loadQuestions(boolean forceRemote); @Override void ... | QuestionLocalDataSource implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { return questionDao.getAllQuestions(); } @Inject QuestionLocalDataSource(QuestionDao questionDao); @Override Flowable<List<Question>> loadQuestions(boolean forceRemote); @Override void ... |
@Test public void addQuestion_ShouldInsertToDatabase() { Question question = new Question(); localDataSource.addQuestion(question); then(questionDao).should().insert(question); } | @Override public void addQuestion(Question question) { questionDao.insert(question); } | QuestionLocalDataSource implements QuestionDataSource { @Override public void addQuestion(Question question) { questionDao.insert(question); } } | QuestionLocalDataSource implements QuestionDataSource { @Override public void addQuestion(Question question) { questionDao.insert(question); } @Inject QuestionLocalDataSource(QuestionDao questionDao); } | QuestionLocalDataSource implements QuestionDataSource { @Override public void addQuestion(Question question) { questionDao.insert(question); } @Inject QuestionLocalDataSource(QuestionDao questionDao); @Override Flowable<List<Question>> loadQuestions(boolean forceRemote); @Override void addQuestion(Question question); ... | QuestionLocalDataSource implements QuestionDataSource { @Override public void addQuestion(Question question) { questionDao.insert(question); } @Inject QuestionLocalDataSource(QuestionDao questionDao); @Override Flowable<List<Question>> loadQuestions(boolean forceRemote); @Override void addQuestion(Question question); ... |
@Test public void clearData_ShouldDeleteAllDataInDatabase() { localDataSource.clearData(); then(questionDao).should().deleteAll(); } | @Override public void clearData() { questionDao.deleteAll(); } | QuestionLocalDataSource implements QuestionDataSource { @Override public void clearData() { questionDao.deleteAll(); } } | QuestionLocalDataSource implements QuestionDataSource { @Override public void clearData() { questionDao.deleteAll(); } @Inject QuestionLocalDataSource(QuestionDao questionDao); } | QuestionLocalDataSource implements QuestionDataSource { @Override public void clearData() { questionDao.deleteAll(); } @Inject QuestionLocalDataSource(QuestionDao questionDao); @Override Flowable<List<Question>> loadQuestions(boolean forceRemote); @Override void addQuestion(Question question); @Override void clearData... | QuestionLocalDataSource implements QuestionDataSource { @Override public void clearData() { questionDao.deleteAll(); } @Inject QuestionLocalDataSource(QuestionDao questionDao); @Override Flowable<List<Question>> loadQuestions(boolean forceRemote); @Override void addQuestion(Question question); @Override void clearData... |
@Test public void loadQuestions_ShouldReturnFromRemoteService() { QuestionResponse questionResponse = new QuestionResponse(); TestSubscriber<List<Question>> subscriber = new TestSubscriber<>(); given(questionService.loadQuestionsByTag(Config.ANDROID_QUESTION_TAG)).willReturn(Flowable.just(questionResponse)); remoteData... | @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { return questionService.loadQuestionsByTag(Config.ANDROID_QUESTION_TAG).map(QuestionResponse::getQuestions); } | QuestionRemoteDataSource implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { return questionService.loadQuestionsByTag(Config.ANDROID_QUESTION_TAG).map(QuestionResponse::getQuestions); } } | QuestionRemoteDataSource implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { return questionService.loadQuestionsByTag(Config.ANDROID_QUESTION_TAG).map(QuestionResponse::getQuestions); } @Inject QuestionRemoteDataSource(QuestionService questionService); } | QuestionRemoteDataSource implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { return questionService.loadQuestionsByTag(Config.ANDROID_QUESTION_TAG).map(QuestionResponse::getQuestions); } @Inject QuestionRemoteDataSource(QuestionService questionService); @Overr... | QuestionRemoteDataSource implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { return questionService.loadQuestionsByTag(Config.ANDROID_QUESTION_TAG).map(QuestionResponse::getQuestions); } @Inject QuestionRemoteDataSource(QuestionService questionService); @Overr... |
@Test(expected = UnsupportedOperationException.class) public void addQuestion_NoThingToDoWithRemoteService() { Question question = mock(Question.class); remoteDataSource.addQuestion(question); then(questionService).shouldHaveZeroInteractions(); } | @Override public void addQuestion(Question question) { throw new UnsupportedOperationException("Unsupported operation"); } | QuestionRemoteDataSource implements QuestionDataSource { @Override public void addQuestion(Question question) { throw new UnsupportedOperationException("Unsupported operation"); } } | QuestionRemoteDataSource implements QuestionDataSource { @Override public void addQuestion(Question question) { throw new UnsupportedOperationException("Unsupported operation"); } @Inject QuestionRemoteDataSource(QuestionService questionService); } | QuestionRemoteDataSource implements QuestionDataSource { @Override public void addQuestion(Question question) { throw new UnsupportedOperationException("Unsupported operation"); } @Inject QuestionRemoteDataSource(QuestionService questionService); @Override Flowable<List<Question>> loadQuestions(boolean forceRemote); @... | QuestionRemoteDataSource implements QuestionDataSource { @Override public void addQuestion(Question question) { throw new UnsupportedOperationException("Unsupported operation"); } @Inject QuestionRemoteDataSource(QuestionService questionService); @Override Flowable<List<Question>> loadQuestions(boolean forceRemote); @... |
@Test public void pathUtilTest1() { File[] roots = File.listRoots(); if (roots.length > 1) { File basePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar + "test.txt"); File relativePath = new File(roots[1] + "some" + File.separatorChar + "dir" + File.separatorChar + "test.txt"); String ... | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest11() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some"); File relativePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar + "dir2"); String path = PathUtil.getRelativeFileInternal(basePath, relativePath); Assert.assertEquals(path,... | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest12() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some" + File.separatorChar); File relativePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar + "dir2" + File.separatorChar); String path = PathUtil.getRelativeFileInternal(basePath... | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest13() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some"); File relativePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar + "dir2" + File.separatorChar); String path = PathUtil.getRelativeFileInternal(basePath, relativePath); Asse... | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest14() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some" + File.separatorChar); File relativePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar + "dir2"); String path = PathUtil.getRelativeFileInternal(basePath, relativePath); Asse... | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest15() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some" + File.separatorChar + "dir3"); File relativePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar + "dir2"); String path = PathUtil.getRelativeFileInternal(basePath, relativePa... | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest16() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some2" + File.separatorChar + "dir3"); File relativePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar + "dir2"); String path = PathUtil.getRelativeFileInternal(basePath, relativeP... | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest17() { File[] roots = File.listRoots(); File basePath = new File(roots[0].getPath()); File relativePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar + "dir2"); String path = PathUtil.getRelativeFileInternal(basePath, relativePath); Assert.assertEquals(path... | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest18() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some" + File.separatorChar + "dir"); File relativePath = new File(roots[0] + "some"); String path = PathUtil.getRelativeFileInternal(basePath, relativePath); Assert.assertEquals(path, ".."); } | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest19() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar + "dir2"); File relativePath = new File(roots[0] + "some"); String path = PathUtil.getRelativeFileInternal(basePath, relativePath); Assert.assertEquals(path,... | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest2() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar + "test.txt"); File relativePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar + "test.txt"); String path = PathUtil.getRelat... | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest3() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar); File relativePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar); String path = PathUtil.getRelativeFileInternal(basePath, ... | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest4() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some" + File.separatorChar + "dir"); File relativePath = new File(roots[0] + "some" + File.separatorChar + "dir"); String path = PathUtil.getRelativeFileInternal(basePath, relativePath); Assert.assertEquals(path, "... | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest5() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some" + File.separatorChar + "dir"); File relativePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar); String path = PathUtil.getRelativeFileInternal(basePath, relativePath); Assert... | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest6() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar); File relativePath = new File(roots[0] + "some" + File.separatorChar + "dir"); String path = PathUtil.getRelativeFileInternal(basePath, relativePath); Assert... | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest7() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some"); File relativePath = new File(roots[0] + "some" + File.separatorChar + "dir"); String path = PathUtil.getRelativeFileInternal(basePath, relativePath); Assert.assertEquals(path, "dir"); } | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest8() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some" + File.separatorChar); File relativePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar); String path = PathUtil.getRelativeFileInternal(basePath, relativePath); Assert.assertE... | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest9() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some"); File relativePath = new File(roots[0] + "some" + File.separatorChar + "dir" + File.separatorChar); String path = PathUtil.getRelativeFileInternal(basePath, relativePath); Assert.assertEquals(path, "dir"); } | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void pathUtilTest10() { File[] roots = File.listRoots(); File basePath = new File(roots[0] + "some" + File.separatorChar); File relativePath = new File(roots[0] + "some" + File.separatorChar + "dir"); String path = PathUtil.getRelativeFileInternal(basePath, relativePath); Assert.assertEquals(path, "dir"); ... | static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return canonicalFi... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... | PathUtil { static String getRelativeFileInternal(File canonicalBaseFile, File canonicalFileToRelativize) { ArrayList<String> basePath = getPathComponents(canonicalBaseFile); ArrayList<String> pathToRelativize = getPathComponents(canonicalFileToRelativize); if (!basePath.get(0).equals(pathToRelativize.get(0))) { return ... |
@Test public void testArrayParser() { IsClass clsArray = service.toClass("java.lang.Class[]"); Assert.assertNotNull(clsArray); } | @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls = classes.get(binaryName); return cls.toArray(arrayCount); } | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... |
@Test public void testUserToStringNamed() { ToStringUserInterface ui = X_AutoUi.makeUi(MODEL, UserViewNamed.class, ToStringUserInterface.class); Assert.assertEquals("email: email,\nname: name,\nid: id", ui.toString()); } | @Override public String toString() { return b.toString(); } | ToStringUserInterface extends AbstractUserInterface implements Appendable { @Override public String toString() { return b.toString(); } } | ToStringUserInterface extends AbstractUserInterface implements Appendable { @Override public String toString() { return b.toString(); } } | ToStringUserInterface extends AbstractUserInterface implements Appendable { @Override public String toString() { return b.toString(); } @Override int hashCode(); @Override String toString(); @Override boolean equals(Object obj); @Override Appendable append(CharSequence csq); @Override Appendable append(CharSequence cs... | ToStringUserInterface extends AbstractUserInterface implements Appendable { @Override public String toString() { return b.toString(); } @Override int hashCode(); @Override String toString(); @Override boolean equals(Object obj); @Override Appendable append(CharSequence csq); @Override Appendable append(CharSequence cs... |
@Test public void testAnnotationLexer() { final short[] success = new short[1]; final String annoBody = "name=\"one \\\"\\\"two\\\"\\\" three\\\\\", " + "{1, 2.0, false}, values={1, \"string\", com.test.Class.class}"; JavaLexer.visitAnnotation(new AnnotationVisitor<Void>(){ @Override public AnnotationMemberVisitor<Void... | public static <R> int visitAnnotation (final AnnotationVisitor<R> visitor, final R receiver, final CharSequence chars, int pos) { pos = eatWhitespace(chars, pos); if (pos == chars.length()) { return pos; } int start = pos; try { while(chars.charAt(pos) == '@') { pos = eatJavaname(chars, pos + 1); final String annoName ... | JavaLexer { public static <R> int visitAnnotation (final AnnotationVisitor<R> visitor, final R receiver, final CharSequence chars, int pos) { pos = eatWhitespace(chars, pos); if (pos == chars.length()) { return pos; } int start = pos; try { while(chars.charAt(pos) == '@') { pos = eatJavaname(chars, pos + 1); final Stri... | JavaLexer { public static <R> int visitAnnotation (final AnnotationVisitor<R> visitor, final R receiver, final CharSequence chars, int pos) { pos = eatWhitespace(chars, pos); if (pos == chars.length()) { return pos; } int start = pos; try { while(chars.charAt(pos) == '@') { pos = eatJavaname(chars, pos + 1); final Stri... | JavaLexer { public static <R> int visitAnnotation (final AnnotationVisitor<R> visitor, final R receiver, final CharSequence chars, int pos) { pos = eatWhitespace(chars, pos); if (pos == chars.length()) { return pos; } int start = pos; try { while(chars.charAt(pos) == '@') { pos = eatJavaname(chars, pos + 1); final Stri... | JavaLexer { public static <R> int visitAnnotation (final AnnotationVisitor<R> visitor, final R receiver, final CharSequence chars, int pos) { pos = eatWhitespace(chars, pos); if (pos == chars.length()) { return pos; } int start = pos; try { while(chars.charAt(pos) == '@') { pos = eatJavaname(chars, pos + 1); final Stri... |
@Test public void testTypeLexer() { String type = "java.lang.Class"; TypeData data = JavaLexer.extractType(type, 0); Assert.assertEquals("java.lang", data.pkgName); Assert.assertEquals("Class", data.clsName); Assert.assertEquals("Class", data.simpleName); Assert.assertEquals(type, data.toString()); String generics = "<... | public static TypeDef extractType(final CharSequence chars, int pos) { int start = pos = eatWhitespace(chars, pos); int lastPeriod = -1; final int max = chars.length()-1; boolean doneParsing = false; final StringBuilder pkg = new StringBuilder(); package_loop: if (Character.isLowerCase(chars.charAt(pos))) { while(true)... | JavaLexer { public static TypeDef extractType(final CharSequence chars, int pos) { int start = pos = eatWhitespace(chars, pos); int lastPeriod = -1; final int max = chars.length()-1; boolean doneParsing = false; final StringBuilder pkg = new StringBuilder(); package_loop: if (Character.isLowerCase(chars.charAt(pos))) {... | JavaLexer { public static TypeDef extractType(final CharSequence chars, int pos) { int start = pos = eatWhitespace(chars, pos); int lastPeriod = -1; final int max = chars.length()-1; boolean doneParsing = false; final StringBuilder pkg = new StringBuilder(); package_loop: if (Character.isLowerCase(chars.charAt(pos))) {... | JavaLexer { public static TypeDef extractType(final CharSequence chars, int pos) { int start = pos = eatWhitespace(chars, pos); int lastPeriod = -1; final int max = chars.length()-1; boolean doneParsing = false; final StringBuilder pkg = new StringBuilder(); package_loop: if (Character.isLowerCase(chars.charAt(pos))) {... | JavaLexer { public static TypeDef extractType(final CharSequence chars, int pos) { int start = pos = eatWhitespace(chars, pos); int lastPeriod = -1; final int max = chars.length()-1; boolean doneParsing = false; final StringBuilder pkg = new StringBuilder(); package_loop: if (Character.isLowerCase(chars.charAt(pos))) {... |
@Test public void testMethodLexer() { final String methodGeneric = "<Complex, Generic extends Signature & More<Stuff>>"; final String modifiers = "public static final"; final String returnType = "Type"; final String returnGeneric = "<With<Generics>>"; final String methodName = "methodName"; final String paramGeneric = ... | public static <R> int visitMethodSignature (final MethodVisitor<R> visitor, final R receiver, final CharSequence chars, int pos) { pos = eatWhitespace(chars, pos); if (pos == chars.length()) { return pos; } pos = visitAnnotation(visitor, receiver, chars, pos); pos = visitModifier(visitor, receiver, chars, pos); pos = v... | JavaLexer { public static <R> int visitMethodSignature (final MethodVisitor<R> visitor, final R receiver, final CharSequence chars, int pos) { pos = eatWhitespace(chars, pos); if (pos == chars.length()) { return pos; } pos = visitAnnotation(visitor, receiver, chars, pos); pos = visitModifier(visitor, receiver, chars, p... | JavaLexer { public static <R> int visitMethodSignature (final MethodVisitor<R> visitor, final R receiver, final CharSequence chars, int pos) { pos = eatWhitespace(chars, pos); if (pos == chars.length()) { return pos; } pos = visitAnnotation(visitor, receiver, chars, pos); pos = visitModifier(visitor, receiver, chars, p... | JavaLexer { public static <R> int visitMethodSignature (final MethodVisitor<R> visitor, final R receiver, final CharSequence chars, int pos) { pos = eatWhitespace(chars, pos); if (pos == chars.length()) { return pos; } pos = visitAnnotation(visitor, receiver, chars, pos); pos = visitModifier(visitor, receiver, chars, p... | JavaLexer { public static <R> int visitMethodSignature (final MethodVisitor<R> visitor, final R receiver, final CharSequence chars, int pos) { pos = eatWhitespace(chars, pos); if (pos == chars.length()) { return pos; } pos = visitAnnotation(visitor, receiver, chars, pos); pos = visitModifier(visitor, receiver, chars, p... |
@Test public void testDefaultLogging() throws Throwable { final String msg = "Success! " + hashCode(); borrowSout( ()-> LogInjector.DEFAULT.log(LogLevel.INFO, msg) , lines-> Assert.assertEquals("[INFO] " + msg, lines.first()) ); assertTrue("Failed", !failed); Log.defaultLogger().log(LogInjectorTest.class, "Default Logg... | public Log defaultLogger() { return (level, debug) -> (level == LogLevel.ERROR ? SYS_ERR : SYS_OUT) .print(level, debug); } | LogInjector { public Log defaultLogger() { return (level, debug) -> (level == LogLevel.ERROR ? SYS_ERR : SYS_OUT) .print(level, debug); } } | LogInjector { public Log defaultLogger() { return (level, debug) -> (level == LogLevel.ERROR ? SYS_ERR : SYS_OUT) .print(level, debug); } } | LogInjector { public Log defaultLogger() { return (level, debug) -> (level == LogLevel.ERROR ? SYS_ERR : SYS_OUT) .print(level, debug); } Log defaultLogger(); } | LogInjector { public Log defaultLogger() { return (level, debug) -> (level == LogLevel.ERROR ? SYS_ERR : SYS_OUT) .print(level, debug); } Log defaultLogger(); } |
@Test public void testAnnoNoArgs() { IsClass asClass = service.toClass(OuterTestClass.NoTargetAnno.class.getName()); IsAnnotation anno = asClass.getAnnotation(Target.class.getName()); IsAnnotationValue empty = anno.getValue(anno.getMethod("value")); Assert.assertTrue(empty.isArray()); Assert.assertEquals(0, Array.getLe... | @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls = classes.get(binaryName); return cls.toArray(arrayCount); } | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... |
@Test public void testTestClass() { Class<?> cls = getTestClass(); IsClass asClass = service.toClass(cls.getName()); Assert.assertEquals(asClass.getPackage(), cls.getPackage().getName()); Assert.assertEquals(asClass.getEnclosedName(), X_Source.classToEnclosedSourceName(cls)); Assert.assertEquals(asClass.getModifier(), ... | @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls = classes.get(binaryName); return cls.toArray(arrayCount); } | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... |
@Test public void testTestClass_Methods() { Class<?> cls = getTestClass(); IsClass asClass = service.toClass(cls.getName()); for (Method method : cls.getMethods()) { IsMethod imethod = asClass.getMethod(method.getName(), true, method.getParameterTypes()); String testCase = imethod.getQualifiedName() +" != "+method.getN... | @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls = classes.get(binaryName); return cls.toArray(arrayCount); } | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... |
@Test public void testTestClass_Fields() { Class<?> cls = getTestClass(); IsClass asClass = service.toClass(cls.getName()); for (Field field : cls.getFields()) { IsField ifield = asClass.getField(field.getName()); Assert.assertNotNull(field.getName(), ifield); Assert.assertEquals(field.getName(), ifield.getName()); Ass... | @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls = classes.get(binaryName); return cls.toArray(arrayCount); } | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... | BytecodeAdapterService implements
SourceAdapterService<String, CtMethod, CtField, Annotation> { @Override public IsClass toClass(String binaryName) { int arrayCount = 0; while (binaryName.matches(".*" + X_Util.arrayRegex)) { arrayCount += 1; binaryName = binaryName.replaceFirst(X_Util.arrayRegex, ""); } IsClass cls... |
@Test public void testAllSlidesCanRender() throws IOException, ParseException { items.forAll(item->{ SlideRenderer renderer = new SlideRenderer(); final DomBuffer into = new DomBuffer() .setNewLine(true) .setTrimWhitespace(false); renderer.renderSlide(into, item.out2()); X_Log.info(X_Source.pathToLogLink(item.out1().ge... | public void renderSlide(DomBuffer into, UiContainerExpr slide) { final DomBuffer out; if ("xapi-slide".equals(into.getTagName())) { out = into; } else { out = into.makeTag("xapi-slide"); } slide.getAttribute("id") .mapNullSafe(UiAttrExpr::getExpression) .mapNullSafe(ASTHelper::extractStringValue) .readIfPresent(out::se... | SlideRenderer { public void renderSlide(DomBuffer into, UiContainerExpr slide) { final DomBuffer out; if ("xapi-slide".equals(into.getTagName())) { out = into; } else { out = into.makeTag("xapi-slide"); } slide.getAttribute("id") .mapNullSafe(UiAttrExpr::getExpression) .mapNullSafe(ASTHelper::extractStringValue) .readI... | SlideRenderer { public void renderSlide(DomBuffer into, UiContainerExpr slide) { final DomBuffer out; if ("xapi-slide".equals(into.getTagName())) { out = into; } else { out = into.makeTag("xapi-slide"); } slide.getAttribute("id") .mapNullSafe(UiAttrExpr::getExpression) .mapNullSafe(ASTHelper::extractStringValue) .readI... | SlideRenderer { public void renderSlide(DomBuffer into, UiContainerExpr slide) { final DomBuffer out; if ("xapi-slide".equals(into.getTagName())) { out = into; } else { out = into.makeTag("xapi-slide"); } slide.getAttribute("id") .mapNullSafe(UiAttrExpr::getExpression) .mapNullSafe(ASTHelper::extractStringValue) .readI... | SlideRenderer { public void renderSlide(DomBuffer into, UiContainerExpr slide) { final DomBuffer out; if ("xapi-slide".equals(into.getTagName())) { out = into; } else { out = into.makeTag("xapi-slide"); } slide.getAttribute("id") .mapNullSafe(UiAttrExpr::getExpression) .mapNullSafe(ASTHelper::extractStringValue) .readI... |
@Test public void testInsertAtEdges() { int cnt = 0; RangePool<Integer> pool = new RangePool<>(); assertPoolStructure(pool, new Coord[]{coord(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY)} ); pool.insert(coord(-2, 2), cnt++); assertPoolStructure(pool, new Coord[]{coord(Double.NEGATIVE_INFINITY, -2), coord(2, Doub... | public boolean insert(Coord coord, T value) { ReservedNode<T> newNode = new ReservedNode<>(coord, value); if (highest.getRange().contains(coord)) { if (highest.getRange().getX() == coord.getX()) { highest.attachBelow(newNode); } else { final UnreservedNode<T> newSpace = highest.split(newNode, RangeDirection.Higher); if... | RangePool { public boolean insert(Coord coord, T value) { ReservedNode<T> newNode = new ReservedNode<>(coord, value); if (highest.getRange().contains(coord)) { if (highest.getRange().getX() == coord.getX()) { highest.attachBelow(newNode); } else { final UnreservedNode<T> newSpace = highest.split(newNode, RangeDirection... | RangePool { public boolean insert(Coord coord, T value) { ReservedNode<T> newNode = new ReservedNode<>(coord, value); if (highest.getRange().contains(coord)) { if (highest.getRange().getX() == coord.getX()) { highest.attachBelow(newNode); } else { final UnreservedNode<T> newSpace = highest.split(newNode, RangeDirection... | RangePool { public boolean insert(Coord coord, T value) { ReservedNode<T> newNode = new ReservedNode<>(coord, value); if (highest.getRange().contains(coord)) { if (highest.getRange().getX() == coord.getX()) { highest.attachBelow(newNode); } else { final UnreservedNode<T> newSpace = highest.split(newNode, RangeDirection... | RangePool { public boolean insert(Coord coord, T value) { ReservedNode<T> newNode = new ReservedNode<>(coord, value); if (highest.getRange().contains(coord)) { if (highest.getRange().getX() == coord.getX()) { highest.attachBelow(newNode); } else { final UnreservedNode<T> newSpace = highest.split(newNode, RangeDirection... |
@Test public void testInsertAtContainedEdges() { int cnt = 0; RangePool<Integer> pool = new RangePool<>(); assertPoolStructure(pool, new Coord[]{coord(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY)} ); pool.insert(coord(8, 16), cnt++); assertPoolStructure(pool, new Coord[]{ coord(Double.NEGATIVE_INFINITY, 8), coor... | public boolean insert(Coord coord, T value) { ReservedNode<T> newNode = new ReservedNode<>(coord, value); if (highest.getRange().contains(coord)) { if (highest.getRange().getX() == coord.getX()) { highest.attachBelow(newNode); } else { final UnreservedNode<T> newSpace = highest.split(newNode, RangeDirection.Higher); if... | RangePool { public boolean insert(Coord coord, T value) { ReservedNode<T> newNode = new ReservedNode<>(coord, value); if (highest.getRange().contains(coord)) { if (highest.getRange().getX() == coord.getX()) { highest.attachBelow(newNode); } else { final UnreservedNode<T> newSpace = highest.split(newNode, RangeDirection... | RangePool { public boolean insert(Coord coord, T value) { ReservedNode<T> newNode = new ReservedNode<>(coord, value); if (highest.getRange().contains(coord)) { if (highest.getRange().getX() == coord.getX()) { highest.attachBelow(newNode); } else { final UnreservedNode<T> newSpace = highest.split(newNode, RangeDirection... | RangePool { public boolean insert(Coord coord, T value) { ReservedNode<T> newNode = new ReservedNode<>(coord, value); if (highest.getRange().contains(coord)) { if (highest.getRange().getX() == coord.getX()) { highest.attachBelow(newNode); } else { final UnreservedNode<T> newSpace = highest.split(newNode, RangeDirection... | RangePool { public boolean insert(Coord coord, T value) { ReservedNode<T> newNode = new ReservedNode<>(coord, value); if (highest.getRange().contains(coord)) { if (highest.getRange().getX() == coord.getX()) { highest.attachBelow(newNode); } else { final UnreservedNode<T> newSpace = highest.split(newNode, RangeDirection... |
@Test public void testRangeSplit() { int cnt = 0; RangePool<Integer> pool = new RangePool<>(); assertPoolStructure(pool, new Coord[]{coord(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY)} ); pool.insert(coord(8, 16), cnt++); assertPoolStructure(pool, new Coord[]{coord(Double.NEGATIVE_INFINITY, 8), coord(16, Double.... | public boolean insert(Coord coord, T value) { ReservedNode<T> newNode = new ReservedNode<>(coord, value); if (highest.getRange().contains(coord)) { if (highest.getRange().getX() == coord.getX()) { highest.attachBelow(newNode); } else { final UnreservedNode<T> newSpace = highest.split(newNode, RangeDirection.Higher); if... | RangePool { public boolean insert(Coord coord, T value) { ReservedNode<T> newNode = new ReservedNode<>(coord, value); if (highest.getRange().contains(coord)) { if (highest.getRange().getX() == coord.getX()) { highest.attachBelow(newNode); } else { final UnreservedNode<T> newSpace = highest.split(newNode, RangeDirection... | RangePool { public boolean insert(Coord coord, T value) { ReservedNode<T> newNode = new ReservedNode<>(coord, value); if (highest.getRange().contains(coord)) { if (highest.getRange().getX() == coord.getX()) { highest.attachBelow(newNode); } else { final UnreservedNode<T> newSpace = highest.split(newNode, RangeDirection... | RangePool { public boolean insert(Coord coord, T value) { ReservedNode<T> newNode = new ReservedNode<>(coord, value); if (highest.getRange().contains(coord)) { if (highest.getRange().getX() == coord.getX()) { highest.attachBelow(newNode); } else { final UnreservedNode<T> newSpace = highest.split(newNode, RangeDirection... | RangePool { public boolean insert(Coord coord, T value) { ReservedNode<T> newNode = new ReservedNode<>(coord, value); if (highest.getRange().contains(coord)) { if (highest.getRange().getX() == coord.getX()) { highest.attachBelow(newNode); } else { final UnreservedNode<T> newSpace = highest.split(newNode, RangeDirection... |
@Test public void testUserToStringWrapped() { UserInterface<User> ui = X_AutoUi.makeUi(MODEL, UserViewWrapped.class, ToStringUserInterface.class); Assert.assertEquals("email: email,\nname: name,\nid: id,\n", ui.toString()); } | @Override public String toString() { return b.toString(); } | ToStringUserInterface extends AbstractUserInterface implements Appendable { @Override public String toString() { return b.toString(); } } | ToStringUserInterface extends AbstractUserInterface implements Appendable { @Override public String toString() { return b.toString(); } } | ToStringUserInterface extends AbstractUserInterface implements Appendable { @Override public String toString() { return b.toString(); } @Override int hashCode(); @Override String toString(); @Override boolean equals(Object obj); @Override Appendable append(CharSequence csq); @Override Appendable append(CharSequence cs... | ToStringUserInterface extends AbstractUserInterface implements Appendable { @Override public String toString() { return b.toString(); } @Override int hashCode(); @Override String toString(); @Override boolean equals(Object obj); @Override Appendable append(CharSequence csq); @Override Appendable append(CharSequence cs... |
@Test public void getBytes() throws Exception { Assert.assertEquals(mString, new String(mCacheUtils1.getBytes("bytes1"))); Assert.assertEquals(mString, new String(mCacheUtils1.getBytes("bytes1", null))); Assert.assertNull(mCacheUtils1.getBytes("bytes2", null)); Assert.assertEquals(mString, new String(mCacheUtils2.getBy... | public byte[] getBytes(@NonNull String key) { return getBytes(key, null); } | CacheUtils { public byte[] getBytes(@NonNull String key) { return getBytes(key, null); } } | CacheUtils { public byte[] getBytes(@NonNull String key) { return getBytes(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); } | CacheUtils { public byte[] getBytes(@NonNull String key) { return getBytes(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static CacheUtils... | CacheUtils { public byte[] getBytes(@NonNull String key) { return getBytes(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static CacheUtils... |
@Test public void getString() throws Exception { Assert.assertEquals(mString, mCacheUtils1.getString("string1")); Assert.assertEquals(mString, mCacheUtils1.getString("string1", null)); Assert.assertNull(mCacheUtils1.getString("string2", null)); Assert.assertEquals(mString, mCacheUtils2.getString("string2")); Assert.ass... | public String getString(@NonNull String key) { return getString(key, null); } | CacheUtils { public String getString(@NonNull String key) { return getString(key, null); } } | CacheUtils { public String getString(@NonNull String key) { return getString(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); } | CacheUtils { public String getString(@NonNull String key) { return getString(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static CacheUti... | CacheUtils { public String getString(@NonNull String key) { return getString(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static CacheUti... |
@Test public void getJSONObject() throws Exception { Assert.assertEquals(mJSONObject.toString(), mCacheUtils1.getJSONObject("jsonObject1").toString()); Assert.assertEquals(mJSONObject.toString(), mCacheUtils1.getJSONObject("jsonObject1", null).toString()); Assert.assertNull(mCacheUtils1.getJSONObject("jsonObject2", nul... | public JSONObject getJSONObject(@NonNull String key) { return getJSONObject(key, null); } | CacheUtils { public JSONObject getJSONObject(@NonNull String key) { return getJSONObject(key, null); } } | CacheUtils { public JSONObject getJSONObject(@NonNull String key) { return getJSONObject(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); } | CacheUtils { public JSONObject getJSONObject(@NonNull String key) { return getJSONObject(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); sta... | CacheUtils { public JSONObject getJSONObject(@NonNull String key) { return getJSONObject(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); sta... |
@Test public void getJSONArray() throws Exception { Assert.assertEquals(mJSONArray.toString(), mCacheUtils1.getJSONArray("jsonArray1").toString()); Assert.assertEquals(mJSONArray.toString(), mCacheUtils1.getJSONArray("jsonArray1", null).toString()); Assert.assertNull(mCacheUtils1.getJSONArray("jsonArray2", null)); Asse... | public JSONArray getJSONArray(@NonNull String key) { return getJSONArray(key, null); } | CacheUtils { public JSONArray getJSONArray(@NonNull String key) { return getJSONArray(key, null); } } | CacheUtils { public JSONArray getJSONArray(@NonNull String key) { return getJSONArray(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); } | CacheUtils { public JSONArray getJSONArray(@NonNull String key) { return getJSONArray(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static... | CacheUtils { public JSONArray getJSONArray(@NonNull String key) { return getJSONArray(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static... |
@Test public void getBitmap() throws Exception { Assert.assertTrue(mCacheUtils1.getString("bitmap1").equals("Bitmap (100 x 100) compressed as PNG with quality 100")); Assert.assertTrue(mCacheUtils1.getString("bitmap1", null).equals("Bitmap (100 x 100) compressed as PNG with quality 100")); Assert.assertNull(mCacheUtils... | public Bitmap getBitmap(@NonNull String key) { return getBitmap(key, null); } | CacheUtils { public Bitmap getBitmap(@NonNull String key) { return getBitmap(key, null); } } | CacheUtils { public Bitmap getBitmap(@NonNull String key) { return getBitmap(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); } | CacheUtils { public Bitmap getBitmap(@NonNull String key) { return getBitmap(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static CacheUti... | CacheUtils { public Bitmap getBitmap(@NonNull String key) { return getBitmap(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static CacheUti... |
@Test public void getDrawable() throws Exception { Assert.assertTrue(mCacheUtils1.getString("drawable1").equals("Bitmap (100 x 100) compressed as PNG with quality 100")); Assert.assertTrue(mCacheUtils1.getString("drawable1", null).equals("Bitmap (100 x 100) compressed as PNG with quality 100")); Assert.assertNull(mCach... | public Drawable getDrawable(@NonNull String key) { return getDrawable(key, null); } | CacheUtils { public Drawable getDrawable(@NonNull String key) { return getDrawable(key, null); } } | CacheUtils { public Drawable getDrawable(@NonNull String key) { return getDrawable(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); } | CacheUtils { public Drawable getDrawable(@NonNull String key) { return getDrawable(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static Ca... | CacheUtils { public Drawable getDrawable(@NonNull String key) { return getDrawable(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static Ca... |
@Test public void getParcel() throws Exception { Assert.assertTrue(mCacheUtils1.getParcelable("parcelable1", ParcelableTest.CREATOR).equals(mParcelableTest)); Assert.assertTrue(mCacheUtils1.getParcelable("parcelable1", ParcelableTest.CREATOR, null).equals(mParcelableTest)); Assert.assertNull(mCacheUtils1.getParcelable(... | public <T> T getParcelable(@NonNull String key, @NonNull Parcelable.Creator<T> creator) { return getParcelable(key, creator, null); } | CacheUtils { public <T> T getParcelable(@NonNull String key, @NonNull Parcelable.Creator<T> creator) { return getParcelable(key, creator, null); } } | CacheUtils { public <T> T getParcelable(@NonNull String key, @NonNull Parcelable.Creator<T> creator) { return getParcelable(key, creator, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); } | CacheUtils { public <T> T getParcelable(@NonNull String key, @NonNull Parcelable.Creator<T> creator) { return getParcelable(key, creator, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils ... | CacheUtils { public <T> T getParcelable(@NonNull String key, @NonNull Parcelable.Creator<T> creator) { return getParcelable(key, creator, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils ... |
@Test public void getSerializable() throws Exception { Assert.assertTrue(mCacheUtils1.getSerializable("serializable1").equals(mSerializableTest)); Assert.assertTrue(mCacheUtils1.getSerializable("serializable1", null).equals(mSerializableTest)); Assert.assertNull(mCacheUtils1.getSerializable("parcelable2", null)); Asser... | public Object getSerializable(@NonNull String key) { return getSerializable(key, null); } | CacheUtils { public Object getSerializable(@NonNull String key) { return getSerializable(key, null); } } | CacheUtils { public Object getSerializable(@NonNull String key) { return getSerializable(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); } | CacheUtils { public Object getSerializable(@NonNull String key) { return getSerializable(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); sta... | CacheUtils { public Object getSerializable(@NonNull String key) { return getSerializable(key, null); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); sta... |
@Test public void getCacheSize() throws Exception { Assert.assertEquals(FileUtils.getDirLength(file1), mCacheUtils1.getCacheSize()); Assert.assertEquals(FileUtils.getDirLength(file2), mCacheUtils2.getCacheSize()); } | public long getCacheSize() { return mCacheManager.getCacheSize(); } | CacheUtils { public long getCacheSize() { return mCacheManager.getCacheSize(); } } | CacheUtils { public long getCacheSize() { return mCacheManager.getCacheSize(); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); } | CacheUtils { public long getCacheSize() { return mCacheManager.getCacheSize(); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static CacheUtils getInst... | CacheUtils { public long getCacheSize() { return mCacheManager.getCacheSize(); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static CacheUtils getInst... |
@Test public void getCacheCount() throws Exception { Assert.assertEquals(8, mCacheUtils1.getCacheCount()); Assert.assertEquals(8, mCacheUtils2.getCacheCount()); } | public int getCacheCount() { return mCacheManager.getCacheCount(); } | CacheUtils { public int getCacheCount() { return mCacheManager.getCacheCount(); } } | CacheUtils { public int getCacheCount() { return mCacheManager.getCacheCount(); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); } | CacheUtils { public int getCacheCount() { return mCacheManager.getCacheCount(); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static CacheUtils getIns... | CacheUtils { public int getCacheCount() { return mCacheManager.getCacheCount(); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static CacheUtils getIns... |
@Test public void remove() throws Exception { Assert.assertNotNull(mCacheUtils1.getString("string1")); mCacheUtils1.remove("string1"); Assert.assertNull(mCacheUtils1.getString("string1")); Assert.assertNotNull(mCacheUtils2.getString("string2")); mCacheUtils2.remove("string2"); Assert.assertNull(mCacheUtils2.getString("... | public boolean remove(@NonNull String key) { return mCacheManager.removeByKey(key); } | CacheUtils { public boolean remove(@NonNull String key) { return mCacheManager.removeByKey(key); } } | CacheUtils { public boolean remove(@NonNull String key) { return mCacheManager.removeByKey(key); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); } | CacheUtils { public boolean remove(@NonNull String key) { return mCacheManager.removeByKey(key); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static ... | CacheUtils { public boolean remove(@NonNull String key) { return mCacheManager.removeByKey(key); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static ... |
@Test public void clear() throws Exception { Assert.assertNotNull(mCacheUtils1.getBytes("bytes1")); Assert.assertNotNull(mCacheUtils1.getString("string1")); Assert.assertNotNull(mCacheUtils1.getJSONObject("jsonObject1")); Assert.assertNotNull(mCacheUtils1.getJSONArray("jsonArray1")); Assert.assertNotNull(mCacheUtils1.g... | public boolean clear() { return mCacheManager.clear(); } | CacheUtils { public boolean clear() { return mCacheManager.clear(); } } | CacheUtils { public boolean clear() { return mCacheManager.clear(); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); } | CacheUtils { public boolean clear() { return mCacheManager.clear(); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static CacheUtils getInstance(String... | CacheUtils { public boolean clear() { return mCacheManager.clear(); } private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount); static CacheUtils getInstance(); static CacheUtils getInstance(String cacheName); static CacheUtils getInstance(long maxSize, int maxCount); static CacheUtils getInstance(String... |
@Test public void getString() throws Exception { Assert.assertEquals("stringVal1", spUtils1.getString("stringKey1")); Assert.assertEquals("stringVal", spUtils1.getString("stringKey", "stringVal")); Assert.assertEquals("", spUtils1.getString("stringKey")); Assert.assertEquals("stringVal2", spUtils2.getString("stringKey2... | public String getString(@NonNull String key) { return getString(key, ""); } | SPUtils { public String getString(@NonNull String key) { return getString(key, ""); } } | SPUtils { public String getString(@NonNull String key) { return getString(key, ""); } private SPUtils(String spName); } | SPUtils { public String getString(@NonNull String key) { return getString(key, ""); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String ke... | SPUtils { public String getString(@NonNull String key) { return getString(key, ""); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String ke... |
@Test public void getInt() throws Exception { Assert.assertEquals(1, spUtils1.getInt("intKey1")); Assert.assertEquals(2048, spUtils1.getInt("intKey", 2048)); Assert.assertEquals(-1, spUtils1.getInt("intKey")); Assert.assertEquals(2, spUtils2.getInt("intKey2")); Assert.assertEquals(2048, spUtils2.getInt("intKey", 2048))... | public int getInt(@NonNull String key) { return getInt(key, -1); } | SPUtils { public int getInt(@NonNull String key) { return getInt(key, -1); } } | SPUtils { public int getInt(@NonNull String key) { return getInt(key, -1); } private SPUtils(String spName); } | SPUtils { public int getInt(@NonNull String key) { return getInt(key, -1); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String key, @NonNu... | SPUtils { public int getInt(@NonNull String key) { return getInt(key, -1); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String key, @NonNu... |
@Test public void getLong() throws Exception { Assert.assertEquals(1L, spUtils1.getLong("longKey1")); Assert.assertEquals(2048L, spUtils1.getLong("longKey", 2048)); Assert.assertEquals(-1L, spUtils1.getLong("longKey")); Assert.assertEquals(2L, spUtils2.getLong("longKey2")); Assert.assertEquals(2048L, spUtils2.getLong("... | public long getLong(@NonNull String key) { return getLong(key, -1L); } | SPUtils { public long getLong(@NonNull String key) { return getLong(key, -1L); } } | SPUtils { public long getLong(@NonNull String key) { return getLong(key, -1L); } private SPUtils(String spName); } | SPUtils { public long getLong(@NonNull String key) { return getLong(key, -1L); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String key, @N... | SPUtils { public long getLong(@NonNull String key) { return getLong(key, -1L); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String key, @N... |
@Test public void getFloat() throws Exception { Assert.assertEquals(1f, spUtils1.getFloat("floatKey1"), 0f); Assert.assertEquals(2048f, spUtils1.getFloat("floatKey", 2048f), 0f); Assert.assertEquals(-1f, spUtils1.getFloat("floatKey"), 0f); Assert.assertEquals(2f, spUtils2.getFloat("floatKey2"), 0f); Assert.assertEquals... | public float getFloat(@NonNull String key) { return getFloat(key, -1f); } | SPUtils { public float getFloat(@NonNull String key) { return getFloat(key, -1f); } } | SPUtils { public float getFloat(@NonNull String key) { return getFloat(key, -1f); } private SPUtils(String spName); } | SPUtils { public float getFloat(@NonNull String key) { return getFloat(key, -1f); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String key,... | SPUtils { public float getFloat(@NonNull String key) { return getFloat(key, -1f); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String key,... |
@Test public void getBoolean() throws Exception { Assert.assertTrue(spUtils1.getBoolean("booleanKey1")); Assert.assertTrue(spUtils1.getBoolean("booleanKey", true)); Assert.assertFalse(spUtils1.getBoolean("booleanKey")); Assert.assertTrue(spUtils2.getBoolean("booleanKey2")); Assert.assertTrue(spUtils2.getBoolean("boolea... | public boolean getBoolean(@NonNull String key) { return getBoolean(key, false); } | SPUtils { public boolean getBoolean(@NonNull String key) { return getBoolean(key, false); } } | SPUtils { public boolean getBoolean(@NonNull String key) { return getBoolean(key, false); } private SPUtils(String spName); } | SPUtils { public boolean getBoolean(@NonNull String key) { return getBoolean(key, false); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull Str... | SPUtils { public boolean getBoolean(@NonNull String key) { return getBoolean(key, false); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull Str... |
@Test public void getAll() throws Exception { Map<String, ?> map; System.out.println("sp1 {"); map = spUtils1.getAll(); for (Map.Entry<String, ?> entry : map.entrySet()) { System.out.println(" " + entry.getKey() + ": " + entry.getValue()); } System.out.println("}"); System.out.println("sp2 {"); map = spUtils2.getAll();... | public Map<String, ?> getAll() { return sp.getAll(); } | SPUtils { public Map<String, ?> getAll() { return sp.getAll(); } } | SPUtils { public Map<String, ?> getAll() { return sp.getAll(); } private SPUtils(String spName); } | SPUtils { public Map<String, ?> getAll() { return sp.getAll(); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String key, @NonNull String de... | SPUtils { public Map<String, ?> getAll() { return sp.getAll(); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String key, @NonNull String de... |
@Test public void testRemove() throws Exception { Assert.assertEquals("stringVal1", spUtils1.getString("stringKey1")); spUtils1.remove("stringKey1"); Assert.assertEquals("", spUtils1.getString("stringKey1")); Assert.assertEquals("stringVal2", spUtils2.getString("stringKey2")); spUtils2.remove("stringKey2"); Assert.asse... | public void remove(@NonNull String key) { sp.edit().remove(key).apply(); } | SPUtils { public void remove(@NonNull String key) { sp.edit().remove(key).apply(); } } | SPUtils { public void remove(@NonNull String key) { sp.edit().remove(key).apply(); } private SPUtils(String spName); } | SPUtils { public void remove(@NonNull String key) { sp.edit().remove(key).apply(); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String key... | SPUtils { public void remove(@NonNull String key) { sp.edit().remove(key).apply(); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String key... |
@Test public void testContains() throws Exception { Assert.assertTrue(spUtils1.contains("stringKey1")); Assert.assertFalse(spUtils1.contains("stringKey")); Assert.assertTrue(spUtils2.contains("stringKey2")); Assert.assertFalse(spUtils2.contains("stringKey")); } | public boolean contains(@NonNull String key) { return sp.contains(key); } | SPUtils { public boolean contains(@NonNull String key) { return sp.contains(key); } } | SPUtils { public boolean contains(@NonNull String key) { return sp.contains(key); } private SPUtils(String spName); } | SPUtils { public boolean contains(@NonNull String key) { return sp.contains(key); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String key,... | SPUtils { public boolean contains(@NonNull String key) { return sp.contains(key); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String key,... |
@Test public void clear() throws Exception { spUtils1.clear(); Assert.assertEquals("", spUtils1.getString("stringKey1")); Assert.assertEquals(-1, spUtils1.getInt("intKey1")); Assert.assertEquals(-1L, spUtils1.getLong("longKey1")); Assert.assertEquals(-1f, spUtils1.getFloat("floatKey1"), 0f); Assert.assertFalse(spUtils1... | public void clear() { sp.edit().clear().apply(); } | SPUtils { public void clear() { sp.edit().clear().apply(); } } | SPUtils { public void clear() { sp.edit().clear().apply(); } private SPUtils(String spName); } | SPUtils { public void clear() { sp.edit().clear().apply(); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String key, @NonNull String defaul... | SPUtils { public void clear() { sp.edit().clear().apply(); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String key, @NonNull String defaul... |
@Test public void proxySettingsObtainedInOrder() { Properties properties = givenDefaultProperties(); environmentVariables.set("HTTP_PROXY", "http: ProxyConfig proxyConfig = new ProxyConfig(new DefaultPropertyLoader(properties)); assertThat(proxyConfig.getProxyHost(), is("proxyhost3")); System.setProperty("http.proxyHos... | public String getProxyHost() { return proxyHost; } | ProxyConfig { public String getProxyHost() { return proxyHost; } } | ProxyConfig { public String getProxyHost() { return proxyHost; } ProxyConfig(PropertyLoader propertyLoader); } | ProxyConfig { public String getProxyHost() { return proxyHost; } ProxyConfig(PropertyLoader propertyLoader); boolean isProxyRequired(); String getProxyType(); String getProxyHost(); int getProxyPort(); String getProxyAddress(); String getProxyUsername(); String getProxyPassword(); String getNonProxyHosts(); } | ProxyConfig { public String getProxyHost() { return proxyHost; } ProxyConfig(PropertyLoader propertyLoader); boolean isProxyRequired(); String getProxyType(); String getProxyHost(); int getProxyPort(); String getProxyAddress(); String getProxyUsername(); String getProxyPassword(); String getNonProxyHosts(); } |
@Test public void closesMultipleDriversForSingleBrowserProvider() throws IOException { BrowserProvider mockProvider = mock(BrowserProvider.class); WebDriver mockDriver = mock(WebDriver.class); when(mockProvider.createDriver()).thenReturn(mockDriver); Browser browser1 = test1.getBrowser("A", mockProvider); browser1.getD... | @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } | ConcordionBrowserFixture extends ConcordionFixture implements BrowserBasedTest { @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } } | ConcordionBrowserFixture extends ConcordionFixture implements BrowserBasedTest { @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } } | ConcordionBrowserFixture extends ConcordionFixture implements BrowserBasedTest { @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } static void setScreenshotTakerClass(Class<? extends ScreenshotTaker> screenshotTaker); @Override Browser getBrowser(); Browser getBrowser(String key); Bro... | ConcordionBrowserFixture extends ConcordionFixture implements BrowserBasedTest { @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } static void setScreenshotTakerClass(Class<? extends ScreenshotTaker> screenshotTaker); @Override Browser getBrowser(); Browser getBrowser(String key); Bro... |
@Test public void closesMultipleDriversAndBrowserProviders() throws IOException { BrowserProvider mockProvider1 = mock(BrowserProvider.class); WebDriver mockDriver1 = mock(WebDriver.class); when(mockProvider1.createDriver()).thenReturn(mockDriver1); BrowserProvider mockProvider2 = mock(BrowserProvider.class); WebDriver... | @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } | ConcordionBrowserFixture extends ConcordionFixture implements BrowserBasedTest { @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } } | ConcordionBrowserFixture extends ConcordionFixture implements BrowserBasedTest { @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } } | ConcordionBrowserFixture extends ConcordionFixture implements BrowserBasedTest { @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } static void setScreenshotTakerClass(Class<? extends ScreenshotTaker> screenshotTaker); @Override Browser getBrowser(); Browser getBrowser(String key); Bro... | ConcordionBrowserFixture extends ConcordionFixture implements BrowserBasedTest { @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } static void setScreenshotTakerClass(Class<? extends ScreenshotTaker> screenshotTaker); @Override Browser getBrowser(); Browser getBrowser(String key); Bro... |
@Test public void runningTestsAsSeparateSuites_browsersAreNotReused() { BrowserProvider mockProvider = mock(BrowserProvider.class); ConcordionBrowserFixture test = this.test1; Browser browser1 = test.getBrowser("X", mockProvider); afterSuite(test); ConcordionBrowserFixture test2 = new ConcordionBrowserFixture() {}; Bro... | @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } | ConcordionBrowserFixture extends ConcordionFixture implements BrowserBasedTest { @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } } | ConcordionBrowserFixture extends ConcordionFixture implements BrowserBasedTest { @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } } | ConcordionBrowserFixture extends ConcordionFixture implements BrowserBasedTest { @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } static void setScreenshotTakerClass(Class<? extends ScreenshotTaker> screenshotTaker); @Override Browser getBrowser(); Browser getBrowser(String key); Bro... | ConcordionBrowserFixture extends ConcordionFixture implements BrowserBasedTest { @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } static void setScreenshotTakerClass(Class<? extends ScreenshotTaker> screenshotTaker); @Override Browser getBrowser(); Browser getBrowser(String key); Bro... |
@Test public void canCreateInstanceOfPageObjectUsingBBTOnly() { PageHelper tpo = setUpMocks(); TestPageObject testPageObject = tpo.newInstance(TestPageObject.class); assertNotNull("Should not be null when constructing instance of " + TestPageObject.class.getName(), testPageObject); } | public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstructor(construct... | PageHelper { public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstruc... | PageHelper { public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstruc... | PageHelper { public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstruc... | PageHelper { public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstruc... |
@Test public void canCreateInstanceOfPageObjectUsingBBTPlusMultipleParams() { PageHelper tpo = setUpMocks(); TestPageObject testPageObject = tpo.newInstance(TestPageObject.class, "HelloWorld", 1); assertNotNull("Should not be null when constructing instance of " + TestPageObject.class.getName() + " and optional paramet... | public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstructor(construct... | PageHelper { public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstruc... | PageHelper { public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstruc... | PageHelper { public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstruc... | PageHelper { public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstruc... |
@Test public void shouldFailAsNoParamsConstructorForPageObject() { PageHelper tpo = setUpMocks(); thrown.expect(RuntimeException.class); thrown.expectCause(allOf( instanceOf(NoSuchMethodException.class), hasProperty("message", is("org.concordion.cubano.driver.web.TestPageObjectNoParams.<init>(org.concordion.cubano.driv... | public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstructor(construct... | PageHelper { public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstruc... | PageHelper { public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstruc... | PageHelper { public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstruc... | PageHelper { public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstruc... |
@Test public void canCreateInstanceOfPageObjectWhichOnlyHasBBTConstructor() { PageHelper tpo = setUpMocks(); TestPageObjectNoParams testPageObjectNoParams = tpo.newInstance(TestPageObjectNoParams.class); assertNotNull("Should not be null when constructing instance of " + TestPageObjectNoParams.class.getName() + " and c... | public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstructor(construct... | PageHelper { public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstruc... | PageHelper { public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstruc... | PageHelper { public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstruc... | PageHelper { public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) { try { if (params.length > 0) { Class<?>[] constructorArguments = new Class<?>[2]; constructorArguments[0] = BrowserBasedTest.class; constructorArguments[1] = Object[].class; return expectedPage.getDeclaredConstruc... |
@Test public void propertyKeyOriginalCaseIsAvailalbe() { Properties properties = new CaselessProperties(); properties.put("a.SETTING", "value"); @SuppressWarnings("unchecked") Enumeration<String> en = (Enumeration<String>) properties.propertyNames(); String propName = en.nextElement(); assertThat(propName, is("a.SETTIN... | @Override public synchronized Object put(Object key, Object value) { lookup.put(((String) key), (String) key); return super.put(key, value); } | CaselessProperties extends Properties { @Override public synchronized Object put(Object key, Object value) { lookup.put(((String) key), (String) key); return super.put(key, value); } } | CaselessProperties extends Properties { @Override public synchronized Object put(Object key, Object value) { lookup.put(((String) key), (String) key); return super.put(key, value); } } | CaselessProperties extends Properties { @Override public synchronized Object put(Object key, Object value) { lookup.put(((String) key), (String) key); return super.put(key, value); } @Override synchronized Object put(Object key, Object value); @Override String getProperty(String key); @Override String getProperty(Stri... | CaselessProperties extends Properties { @Override public synchronized Object put(Object key, Object value) { lookup.put(((String) key), (String) key); return super.put(key, value); } @Override synchronized Object put(Object key, Object value); @Override String getProperty(String key); @Override String getProperty(Stri... |
@Test public void environmentPropertiesOverrideDefaultProperties() { Properties properties = givenDefaultProperties(); given(properties.getProperty("a.setting")).willReturn("false"); given(properties.getProperty("SIT.a.setting")).willReturn("true"); DefaultPropertyLoader loader = new DefaultPropertyLoader(properties); ... | @Override public String getProperty(String key) { String value = retrieveProperty(key); if (value.isEmpty()) { throw new IllegalArgumentException(String.format("Unable to find property %s", key)); } return value; } | DefaultPropertyLoader implements PropertyLoader { @Override public String getProperty(String key) { String value = retrieveProperty(key); if (value.isEmpty()) { throw new IllegalArgumentException(String.format("Unable to find property %s", key)); } return value; } } | DefaultPropertyLoader implements PropertyLoader { @Override public String getProperty(String key) { String value = retrieveProperty(key); if (value.isEmpty()) { throw new IllegalArgumentException(String.format("Unable to find property %s", key)); } return value; } DefaultPropertyLoader(Properties properties); } | DefaultPropertyLoader implements PropertyLoader { @Override public String getProperty(String key) { String value = retrieveProperty(key); if (value.isEmpty()) { throw new IllegalArgumentException(String.format("Unable to find property %s", key)); } return value; } DefaultPropertyLoader(Properties properties); String ge... | DefaultPropertyLoader implements PropertyLoader { @Override public String getProperty(String key) { String value = retrieveProperty(key); if (value.isEmpty()) { throw new IllegalArgumentException(String.format("Unable to find property %s", key)); } return value; } DefaultPropertyLoader(Properties properties); String ge... |
@Test public void systemPropertyWillOverrideEnvironment() throws Exception { Properties properties = givenDefaultProperties(); System.setProperty("environment", "SIT"); DefaultPropertyLoader loader = new DefaultPropertyLoader(properties); assertThat(loader.getEnvironment(), is("SIT")); } | public String getEnvironment() { return environment; } | DefaultPropertyLoader implements PropertyLoader { public String getEnvironment() { return environment; } } | DefaultPropertyLoader implements PropertyLoader { public String getEnvironment() { return environment; } DefaultPropertyLoader(Properties properties); } | DefaultPropertyLoader implements PropertyLoader { public String getEnvironment() { return environment; } DefaultPropertyLoader(Properties properties); String getEnvironment(); @Override String getProperty(String key); @Override String getProperty(String key, String defaultValue); @Override boolean getPropertyAsBoolean(... | DefaultPropertyLoader implements PropertyLoader { public String getEnvironment() { return environment; } DefaultPropertyLoader(Properties properties); String getEnvironment(); @Override String getProperty(String key); @Override String getProperty(String key, String defaultValue); @Override boolean getPropertyAsBoolean(... |
@Test public void canSearchForPopertiesWithPrefixMatchingCase() throws IOException { Properties properties = givenDefaultSearchProperties(); DefaultPropertyLoader loader = new DefaultPropertyLoader(properties); Map<String, String> found = loader.getPropertiesStartingWith("a.setting."); assertThat(found.values().size(),... | @Override public Map<String, String> getPropertiesStartingWith(String keyPrefix) { return getPropertiesStartingWith(keyPrefix, false); } | DefaultPropertyLoader implements PropertyLoader { @Override public Map<String, String> getPropertiesStartingWith(String keyPrefix) { return getPropertiesStartingWith(keyPrefix, false); } } | DefaultPropertyLoader implements PropertyLoader { @Override public Map<String, String> getPropertiesStartingWith(String keyPrefix) { return getPropertiesStartingWith(keyPrefix, false); } DefaultPropertyLoader(Properties properties); } | DefaultPropertyLoader implements PropertyLoader { @Override public Map<String, String> getPropertiesStartingWith(String keyPrefix) { return getPropertiesStartingWith(keyPrefix, false); } DefaultPropertyLoader(Properties properties); String getEnvironment(); @Override String getProperty(String key); @Override String get... | DefaultPropertyLoader implements PropertyLoader { @Override public Map<String, String> getPropertiesStartingWith(String keyPrefix) { return getPropertiesStartingWith(keyPrefix, false); } DefaultPropertyLoader(Properties properties); String getEnvironment(); @Override String getProperty(String key); @Override String get... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.