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 testDuration() throws Exception { assertEquals("PT17M28.577S", _resolver.resolve(LARGEST_POSITIVE_VALUE_STAT_NAME + ":" + FormattingStatisticsResolver.DURATION, null)); assertEquals("PT0S", _resolver.resolve(ZERO_VALUE_STAT_NAME + ":" + FormattingStatisticsResolver.DURATION, null)); assertEquals("-", ... | @Override public String resolve(String statNameWithFormatSpecifier, final Resolver unused) { String[] split = statNameWithFormatSpecifier.split(":", 2); String statName = split[0]; Object statisticValue = _statistics.get(statName); if (split.length > 1) { String formatterName = split[1].toLowerCase(); if (statisticValu... | FormattingStatisticsResolver implements Resolver { @Override public String resolve(String statNameWithFormatSpecifier, final Resolver unused) { String[] split = statNameWithFormatSpecifier.split(":", 2); String statName = split[0]; Object statisticValue = _statistics.get(statName); if (split.length > 1) { String format... | FormattingStatisticsResolver implements Resolver { @Override public String resolve(String statNameWithFormatSpecifier, final Resolver unused) { String[] split = statNameWithFormatSpecifier.split(":", 2); String statName = split[0]; Object statisticValue = _statistics.get(statName); if (split.length > 1) { String format... | FormattingStatisticsResolver implements Resolver { @Override public String resolve(String statNameWithFormatSpecifier, final Resolver unused) { String[] split = statNameWithFormatSpecifier.split(":", 2); String statName = split[0]; Object statisticValue = _statistics.get(statName); if (split.length > 1) { String format... | FormattingStatisticsResolver implements Resolver { @Override public String resolve(String statNameWithFormatSpecifier, final Resolver unused) { String[] split = statNameWithFormatSpecifier.split(":", 2); String statName = split[0]; Object statisticValue = _statistics.get(statName); if (split.length > 1) { String format... |
@Test public void testDateTime() throws Exception { assertEquals("1970-01-01T00:00:00Z", _resolver.resolve(ZERO_VALUE_STAT_NAME + ":" + FormattingStatisticsResolver.DATETIME, null)); assertEquals("1970-01-01T00:00:00Z", _resolver.resolve(EPOCH_DATE_STAT_NAME + ":" + FormattingStatisticsResolver.DATETIME, null)); assert... | @Override public String resolve(String statNameWithFormatSpecifier, final Resolver unused) { String[] split = statNameWithFormatSpecifier.split(":", 2); String statName = split[0]; Object statisticValue = _statistics.get(statName); if (split.length > 1) { String formatterName = split[1].toLowerCase(); if (statisticValu... | FormattingStatisticsResolver implements Resolver { @Override public String resolve(String statNameWithFormatSpecifier, final Resolver unused) { String[] split = statNameWithFormatSpecifier.split(":", 2); String statName = split[0]; Object statisticValue = _statistics.get(statName); if (split.length > 1) { String format... | FormattingStatisticsResolver implements Resolver { @Override public String resolve(String statNameWithFormatSpecifier, final Resolver unused) { String[] split = statNameWithFormatSpecifier.split(":", 2); String statName = split[0]; Object statisticValue = _statistics.get(statName); if (split.length > 1) { String format... | FormattingStatisticsResolver implements Resolver { @Override public String resolve(String statNameWithFormatSpecifier, final Resolver unused) { String[] split = statNameWithFormatSpecifier.split(":", 2); String statName = split[0]; Object statisticValue = _statistics.get(statName); if (split.length > 1) { String format... | FormattingStatisticsResolver implements Resolver { @Override public String resolve(String statNameWithFormatSpecifier, final Resolver unused) { String[] split = statNameWithFormatSpecifier.split(":", 2); String statName = split[0]; Object statisticValue = _statistics.get(statName); if (split.length > 1) { String format... |
@Test public void testIEC80000BinaryPrefixed() throws Exception { NumberFormat formatter = NumberFormat.getInstance(); formatter.setMinimumFractionDigits(1); String ONE_POINT_ZERO = formatter.format(1L); assertEquals(ONE_POINT_ZERO + " MiB", _resolver.resolve(LARGEST_POSITIVE_VALUE_STAT_NAME + ":" + FormattingStatistic... | @Override public String resolve(String statNameWithFormatSpecifier, final Resolver unused) { String[] split = statNameWithFormatSpecifier.split(":", 2); String statName = split[0]; Object statisticValue = _statistics.get(statName); if (split.length > 1) { String formatterName = split[1].toLowerCase(); if (statisticValu... | FormattingStatisticsResolver implements Resolver { @Override public String resolve(String statNameWithFormatSpecifier, final Resolver unused) { String[] split = statNameWithFormatSpecifier.split(":", 2); String statName = split[0]; Object statisticValue = _statistics.get(statName); if (split.length > 1) { String format... | FormattingStatisticsResolver implements Resolver { @Override public String resolve(String statNameWithFormatSpecifier, final Resolver unused) { String[] split = statNameWithFormatSpecifier.split(":", 2); String statName = split[0]; Object statisticValue = _statistics.get(statName); if (split.length > 1) { String format... | FormattingStatisticsResolver implements Resolver { @Override public String resolve(String statNameWithFormatSpecifier, final Resolver unused) { String[] split = statNameWithFormatSpecifier.split(":", 2); String statName = split[0]; Object statisticValue = _statistics.get(statName); if (split.length > 1) { String format... | FormattingStatisticsResolver implements Resolver { @Override public String resolve(String statNameWithFormatSpecifier, final Resolver unused) { String[] split = statNameWithFormatSpecifier.split(":", 2); String statName = split[0]; Object statisticValue = _statistics.get(statName); if (split.length > 1) { String format... |
@Test public void testPerformUpgrade() throws Exception { UpgradeFrom8To9 upgrade = new UpgradeFrom8To9(); upgrade.performUpgrade(_environment, UpgradeInteractionHandler.DEFAULT_HANDLER, getVirtualHost()); assertDatabaseRecordCount(PREFERENCES_DB_NAME, 0); assertDatabaseRecordCount(PREFERENCES_VERSION_DB_NAME, 1); List... | @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, final ConfiguredObject<?> parent) { reportStarting(environment, 8); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAllowCreate(true); final Transaction transaction =... | UpgradeFrom8To9 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, final ConfiguredObject<?> parent) { reportStarting(environment, 8); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAll... | UpgradeFrom8To9 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, final ConfiguredObject<?> parent) { reportStarting(environment, 8); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAll... | UpgradeFrom8To9 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, final ConfiguredObject<?> parent) { reportStarting(environment, 8); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAll... | UpgradeFrom8To9 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, final ConfiguredObject<?> parent) { reportStarting(environment, 8); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAll... |
@Test public void testPerformUpgrade() throws Exception { UpgradeFrom5To6 upgrade = new UpgradeFrom5To6(); upgrade.performUpgrade(_environment, UpgradeInteractionHandler.DEFAULT_HANDLER, getVirtualHost()); assertDatabaseRecordCounts(); assertContent(); assertConfiguredObjects(); assertQueueEntries(); } | @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, parent.getName()); renameDatabases(environment, ... | UpgradeFrom5To6 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, p... | UpgradeFrom5To6 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, p... | UpgradeFrom5To6 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, p... | UpgradeFrom5To6 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, p... |
@Test public void testPerformUpgradeWithMissingMessageChunkKeepsIncompleteMessage() throws Exception { corruptDatabase(); UpgradeFrom5To6 upgrade = new UpgradeFrom5To6(); upgrade.performUpgrade(_environment, new StaticAnswerHandler(UpgradeInteractionResponse.YES), getVirtualHost()); assertDatabaseRecordCounts(); assert... | @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, parent.getName()); renameDatabases(environment, ... | UpgradeFrom5To6 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, p... | UpgradeFrom5To6 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, p... | UpgradeFrom5To6 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, p... | UpgradeFrom5To6 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, p... |
@Test public void testPerformUpgradeWithMissingMessageChunkDiscardsIncompleteMessage() throws Exception { corruptDatabase(); UpgradeFrom5To6 upgrade = new UpgradeFrom5To6(); UpgradeInteractionHandler discardMessageInteractionHandler = new StaticAnswerHandler(UpgradeInteractionResponse.NO); upgrade.performUpgrade(_envir... | @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, parent.getName()); renameDatabases(environment, ... | UpgradeFrom5To6 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, p... | UpgradeFrom5To6 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, p... | UpgradeFrom5To6 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, p... | UpgradeFrom5To6 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, p... |
@Test public void testPerformXidUpgrade() throws Exception { File storeLocation = new File(TMP_FOLDER, getTestName()); storeLocation.mkdirs(); Environment environment = createEnvironment(storeLocation); try { populateOldXidEntries(environment); UpgradeFrom5To6 upgrade = new UpgradeFrom5To6(); upgrade.performUpgrade(env... | @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, parent.getName()); renameDatabases(environment, ... | UpgradeFrom5To6 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, p... | UpgradeFrom5To6 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, p... | UpgradeFrom5To6 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, p... | UpgradeFrom5To6 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 5); upgradeMessages(environment, handler); upgradeConfiguredObjectsAndDependencies(environment, handler, p... |
@Test public void testUpgrade() throws Exception { assertEquals("Unexpected store version", -1, getStoreVersion(_environment)); _upgrader.upgradeIfNecessary(); assertEquals("Unexpected store version", BDBConfigurationStore.VERSION, getStoreVersion(_environment)); assertContent(); } | void upgrade(final int fromVersion, final int toVersion) throws StoreException { try { @SuppressWarnings("unchecked") Class<StoreUpgrade> upgradeClass = (Class<StoreUpgrade>) Class.forName("org.apache.qpid.server.store.berkeleydb.upgrade." + "UpgradeFrom"+fromVersion+"To"+toVersion); Constructor<StoreUpgrade> ctr = upg... | Upgrader { void upgrade(final int fromVersion, final int toVersion) throws StoreException { try { @SuppressWarnings("unchecked") Class<StoreUpgrade> upgradeClass = (Class<StoreUpgrade>) Class.forName("org.apache.qpid.server.store.berkeleydb.upgrade." + "UpgradeFrom"+fromVersion+"To"+toVersion); Constructor<StoreUpgrade... | Upgrader { void upgrade(final int fromVersion, final int toVersion) throws StoreException { try { @SuppressWarnings("unchecked") Class<StoreUpgrade> upgradeClass = (Class<StoreUpgrade>) Class.forName("org.apache.qpid.server.store.berkeleydb.upgrade." + "UpgradeFrom"+fromVersion+"To"+toVersion); Constructor<StoreUpgrade... | Upgrader { void upgrade(final int fromVersion, final int toVersion) throws StoreException { try { @SuppressWarnings("unchecked") Class<StoreUpgrade> upgradeClass = (Class<StoreUpgrade>) Class.forName("org.apache.qpid.server.store.berkeleydb.upgrade." + "UpgradeFrom"+fromVersion+"To"+toVersion); Constructor<StoreUpgrade... | Upgrader { void upgrade(final int fromVersion, final int toVersion) throws StoreException { try { @SuppressWarnings("unchecked") Class<StoreUpgrade> upgradeClass = (Class<StoreUpgrade>) Class.forName("org.apache.qpid.server.store.berkeleydb.upgrade." + "UpgradeFrom"+fromVersion+"To"+toVersion); Constructor<StoreUpgrade... |
@Test public void testDecideWithNoRule() { CompositeFilter compositeFilter = new CompositeFilter(); FilterReply reply = compositeFilter.decide(mock(ILoggingEvent.class)); assertEquals("Unexpected reply with no rule added", FilterReply.DENY, reply); } | @Override public FilterReply decide(ILoggingEvent event) { FilterReply reply = DENY; for(Filter<ILoggingEvent> filter : _filterList) { FilterReply filterReply = filter.decide(event); if (filterReply == DENY) { reply = filterReply; break; } if (filterReply == ACCEPT) { reply = filterReply; } } if(reply == ACCEPT) { swit... | CompositeFilter extends Filter<ILoggingEvent> { @Override public FilterReply decide(ILoggingEvent event) { FilterReply reply = DENY; for(Filter<ILoggingEvent> filter : _filterList) { FilterReply filterReply = filter.decide(event); if (filterReply == DENY) { reply = filterReply; break; } if (filterReply == ACCEPT) { rep... | CompositeFilter extends Filter<ILoggingEvent> { @Override public FilterReply decide(ILoggingEvent event) { FilterReply reply = DENY; for(Filter<ILoggingEvent> filter : _filterList) { FilterReply filterReply = filter.decide(event); if (filterReply == DENY) { reply = filterReply; break; } if (filterReply == ACCEPT) { rep... | CompositeFilter extends Filter<ILoggingEvent> { @Override public FilterReply decide(ILoggingEvent event) { FilterReply reply = DENY; for(Filter<ILoggingEvent> filter : _filterList) { FilterReply filterReply = filter.decide(event); if (filterReply == DENY) { reply = filterReply; break; } if (filterReply == ACCEPT) { rep... | CompositeFilter extends Filter<ILoggingEvent> { @Override public FilterReply decide(ILoggingEvent event) { FilterReply reply = DENY; for(Filter<ILoggingEvent> filter : _filterList) { FilterReply filterReply = filter.decide(event); if (filterReply == DENY) { reply = filterReply; break; } if (filterReply == ACCEPT) { rep... |
@Test public void testEmptyDatabaseUpgradeDoesNothing() throws Exception { File nonExistentStoreLocation = new File(TMP_FOLDER, getTestName()); deleteDirectoryIfExists(nonExistentStoreLocation); nonExistentStoreLocation.mkdir(); Environment emptyEnvironment = createEnvironment(nonExistentStoreLocation); try { _upgrader... | public void upgradeIfNecessary() { boolean isEmpty = _environment.getDatabaseNames().isEmpty(); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAllowCreate(true); Database versionDb = null; try { versionDb = _environment.openDatabase(null, VERSION_DB_NAME, dbConfig); if(vers... | Upgrader { public void upgradeIfNecessary() { boolean isEmpty = _environment.getDatabaseNames().isEmpty(); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAllowCreate(true); Database versionDb = null; try { versionDb = _environment.openDatabase(null, VERSION_DB_NAME, dbConfi... | Upgrader { public void upgradeIfNecessary() { boolean isEmpty = _environment.getDatabaseNames().isEmpty(); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAllowCreate(true); Database versionDb = null; try { versionDb = _environment.openDatabase(null, VERSION_DB_NAME, dbConfi... | Upgrader { public void upgradeIfNecessary() { boolean isEmpty = _environment.getDatabaseNames().isEmpty(); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAllowCreate(true); Database versionDb = null; try { versionDb = _environment.openDatabase(null, VERSION_DB_NAME, dbConfi... | Upgrader { public void upgradeIfNecessary() { boolean isEmpty = _environment.getDatabaseNames().isEmpty(); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAllowCreate(true); Database versionDb = null; try { versionDb = _environment.openDatabase(null, VERSION_DB_NAME, dbConfi... |
@Test public void testPerformUpgradeWithHandlerAnsweringYes() throws Exception { UpgradeFrom4To5 upgrade = new UpgradeFrom4To5(); upgrade.performUpgrade(_environment, new StaticAnswerHandler(UpgradeInteractionResponse.YES), getVirtualHost()); assertQueues(new HashSet<String>(Arrays.asList(QUEUE_NAMES))); assertDatabase... | @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { Transaction transaction = null; reportStarting(environment, 4); transaction = environment.beginTransaction(null, null); final List<AMQShortString> potentialDurableSubs = findPotenti... | UpgradeFrom4To5 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { Transaction transaction = null; reportStarting(environment, 4); transaction = environment.beginTransaction(null, null); final List<AMQ... | UpgradeFrom4To5 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { Transaction transaction = null; reportStarting(environment, 4); transaction = environment.beginTransaction(null, null); final List<AMQ... | UpgradeFrom4To5 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { Transaction transaction = null; reportStarting(environment, 4); transaction = environment.beginTransaction(null, null); final List<AMQ... | UpgradeFrom4To5 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { Transaction transaction = null; reportStarting(environment, 4); transaction = environment.beginTransaction(null, null); final List<AMQ... |
@Test public void testPerformUpgradeWithHandlerAnsweringNo() throws Exception { UpgradeFrom4To5 upgrade = new UpgradeFrom4To5(); upgrade.performUpgrade(_environment, new StaticAnswerHandler(UpgradeInteractionResponse.NO), getVirtualHost()); HashSet<String> queues = new HashSet<String>(Arrays.asList(QUEUE_NAMES)); asser... | @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { Transaction transaction = null; reportStarting(environment, 4); transaction = environment.beginTransaction(null, null); final List<AMQShortString> potentialDurableSubs = findPotenti... | UpgradeFrom4To5 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { Transaction transaction = null; reportStarting(environment, 4); transaction = environment.beginTransaction(null, null); final List<AMQ... | UpgradeFrom4To5 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { Transaction transaction = null; reportStarting(environment, 4); transaction = environment.beginTransaction(null, null); final List<AMQ... | UpgradeFrom4To5 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { Transaction transaction = null; reportStarting(environment, 4); transaction = environment.beginTransaction(null, null); final List<AMQ... | UpgradeFrom4To5 extends AbstractStoreUpgrade { @Override public void performUpgrade(final Environment environment, final UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { Transaction transaction = null; reportStarting(environment, 4); transaction = environment.beginTransaction(null, null); final List<AMQ... |
@Test public void testExecuteWithTwoDatabases() { String targetDatabaseName = "targetDatabase"; Database targetDatabase = mock(Database.class); Transaction txn = mock(Transaction.class); when(_environment.openDatabase(same(txn), same(targetDatabaseName), isA(DatabaseConfig.class))) .thenReturn(targetDatabase); Database... | public void run(DatabaseRunnable databaseRunnable) { DatabaseCallable<Void> callable = runnableToCallable(databaseRunnable); call(callable); } | DatabaseTemplate { public void run(DatabaseRunnable databaseRunnable) { DatabaseCallable<Void> callable = runnableToCallable(databaseRunnable); call(callable); } } | DatabaseTemplate { public void run(DatabaseRunnable databaseRunnable) { DatabaseCallable<Void> callable = runnableToCallable(databaseRunnable); call(callable); } DatabaseTemplate(Environment environment, String sourceDatabaseName, Transaction transaction); DatabaseTemplate(Environment environment, String sourceDatabas... | DatabaseTemplate { public void run(DatabaseRunnable databaseRunnable) { DatabaseCallable<Void> callable = runnableToCallable(databaseRunnable); call(callable); } DatabaseTemplate(Environment environment, String sourceDatabaseName, Transaction transaction); DatabaseTemplate(Environment environment, String sourceDatabas... | DatabaseTemplate { public void run(DatabaseRunnable databaseRunnable) { DatabaseCallable<Void> callable = runnableToCallable(databaseRunnable); call(callable); } DatabaseTemplate(Environment environment, String sourceDatabaseName, Transaction transaction); DatabaseTemplate(Environment environment, String sourceDatabas... |
@Test public void testExecuteWithOneDatabases() { DatabaseTemplate databaseTemplate = new DatabaseTemplate(_environment, SOURCE_DATABASE, null, null); DatabaseRunnable databaseOperation = mock(DatabaseRunnable.class); databaseTemplate.run(databaseOperation); verify(databaseOperation).run(eq(_sourceDatabase), isNull(), ... | public void run(DatabaseRunnable databaseRunnable) { DatabaseCallable<Void> callable = runnableToCallable(databaseRunnable); call(callable); } | DatabaseTemplate { public void run(DatabaseRunnable databaseRunnable) { DatabaseCallable<Void> callable = runnableToCallable(databaseRunnable); call(callable); } } | DatabaseTemplate { public void run(DatabaseRunnable databaseRunnable) { DatabaseCallable<Void> callable = runnableToCallable(databaseRunnable); call(callable); } DatabaseTemplate(Environment environment, String sourceDatabaseName, Transaction transaction); DatabaseTemplate(Environment environment, String sourceDatabas... | DatabaseTemplate { public void run(DatabaseRunnable databaseRunnable) { DatabaseCallable<Void> callable = runnableToCallable(databaseRunnable); call(callable); } DatabaseTemplate(Environment environment, String sourceDatabaseName, Transaction transaction); DatabaseTemplate(Environment environment, String sourceDatabas... | DatabaseTemplate { public void run(DatabaseRunnable databaseRunnable) { DatabaseCallable<Void> callable = runnableToCallable(databaseRunnable); call(callable); } DatabaseTemplate(Environment environment, String sourceDatabaseName, Transaction transaction); DatabaseTemplate(Environment environment, String sourceDatabas... |
@Test public void testPerformUpgrade() throws Exception { UpgradeFrom7To8 upgrade = new UpgradeFrom7To8(); upgrade.performUpgrade(_environment, UpgradeInteractionHandler.DEFAULT_HANDLER, getVirtualHost()); assertDatabaseRecordCount(CONFIGURED_OBJECTS_DB_NAME, 11); assertDatabaseRecordCount(CONFIGURED_OBJECT_HIERARCHY_D... | @Override public void performUpgrade(Environment environment, UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 7); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAllowCreate(true); Database hierarchyDb = environment.openDatabase(n... | UpgradeFrom7To8 extends AbstractStoreUpgrade { @Override public void performUpgrade(Environment environment, UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 7); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAllowCreate(true); Da... | UpgradeFrom7To8 extends AbstractStoreUpgrade { @Override public void performUpgrade(Environment environment, UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 7); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAllowCreate(true); Da... | UpgradeFrom7To8 extends AbstractStoreUpgrade { @Override public void performUpgrade(Environment environment, UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 7); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAllowCreate(true); Da... | UpgradeFrom7To8 extends AbstractStoreUpgrade { @Override public void performUpgrade(Environment environment, UpgradeInteractionHandler handler, ConfiguredObject<?> parent) { reportStarting(environment, 7); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAllowCreate(true); Da... |
@Test public void testVersionAfterUpgrade() throws Exception { FileUtils.delete(_storeFile, true); _storeFile.mkdirs(); ModelVersion storeVersion = new ModelVersion(BrokerModel.MODEL_MAJOR_VERSION - 1, BrokerModel.MODEL_MINOR_VERSION); populateTestData(_testInitialRecords, storeVersion.toString()); _preferenceStore.ope... | @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalStateException("PreferenceStore is already opened"); } _e... | BDBPreferenceStore extends AbstractBDBPreferenceStore { @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalS... | BDBPreferenceStore extends AbstractBDBPreferenceStore { @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalS... | BDBPreferenceStore extends AbstractBDBPreferenceStore { @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalS... | BDBPreferenceStore extends AbstractBDBPreferenceStore { @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalS... |
@Test public void testOpenAndLoad() throws Exception { Collection<PreferenceRecord> recovered = _preferenceStore.openAndLoad(_updater); assertEquals("Unexpected store state", AbstractBDBPreferenceStore.StoreState.OPENED, _preferenceStore.getStoreState()); assertNotNull("Store was not properly opened", _preferenceStore.... | @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalStateException("PreferenceStore is already opened"); } _e... | BDBPreferenceStore extends AbstractBDBPreferenceStore { @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalS... | BDBPreferenceStore extends AbstractBDBPreferenceStore { @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalS... | BDBPreferenceStore extends AbstractBDBPreferenceStore { @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalS... | BDBPreferenceStore extends AbstractBDBPreferenceStore { @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalS... |
@Test public void testUpdateOrCreate() throws Exception { _preferenceStore.openAndLoad(_updater); PreferenceRecord oldRecord = _testInitialRecords.get(0); Collection<PreferenceRecord> records = Arrays.<PreferenceRecord>asList( new PreferenceRecordImpl(oldRecord.getId(), Collections.<String, Object>singletonMap("name", ... | @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalStateException("PreferenceStore is already opened"); } _e... | BDBPreferenceStore extends AbstractBDBPreferenceStore { @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalS... | BDBPreferenceStore extends AbstractBDBPreferenceStore { @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalS... | BDBPreferenceStore extends AbstractBDBPreferenceStore { @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalS... | BDBPreferenceStore extends AbstractBDBPreferenceStore { @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalS... |
@Test public void testReplace() throws Exception { _preferenceStore.openAndLoad(_updater); PreferenceRecord oldRecord1 = _testInitialRecords.get(0); PreferenceRecord oldRecord2 = _testInitialRecords.get(1); Collection<UUID> recordsToRemove = Collections.singleton(oldRecord1.getId()); Collection<PreferenceRecord> record... | @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalStateException("PreferenceStore is already opened"); } _e... | BDBPreferenceStore extends AbstractBDBPreferenceStore { @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalS... | BDBPreferenceStore extends AbstractBDBPreferenceStore { @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalS... | BDBPreferenceStore extends AbstractBDBPreferenceStore { @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalS... | BDBPreferenceStore extends AbstractBDBPreferenceStore { @Override public Collection<PreferenceRecord> openAndLoad(final PreferenceStoreUpdater updater) throws StoreException { StoreState storeState = getStoreState(); if (StoreState.OPENED.equals(storeState) || StoreState.OPENING.equals(storeState)) { throw new IllegalS... |
@Test public void testRemoveLogInclusionRule() { CompositeFilter compositeFilter = new CompositeFilter(); LogBackLogInclusionRule neutral = createRule(FilterReply.NEUTRAL, "neutral"); compositeFilter.addLogInclusionRule(neutral); LogBackLogInclusionRule deny = createRule(FilterReply.DENY, "deny"); compositeFilter.addLo... | public void removeLogInclusionRule(LogBackLogInclusionRule logInclusionRule) { Iterator<Filter<ILoggingEvent>> it = _filterList.iterator(); while(it.hasNext()) { Filter f = it.next(); if (f.getName().equals(logInclusionRule.getName())) { _filterList.remove(f); break; } } } | CompositeFilter extends Filter<ILoggingEvent> { public void removeLogInclusionRule(LogBackLogInclusionRule logInclusionRule) { Iterator<Filter<ILoggingEvent>> it = _filterList.iterator(); while(it.hasNext()) { Filter f = it.next(); if (f.getName().equals(logInclusionRule.getName())) { _filterList.remove(f); break; } } ... | CompositeFilter extends Filter<ILoggingEvent> { public void removeLogInclusionRule(LogBackLogInclusionRule logInclusionRule) { Iterator<Filter<ILoggingEvent>> it = _filterList.iterator(); while(it.hasNext()) { Filter f = it.next(); if (f.getName().equals(logInclusionRule.getName())) { _filterList.remove(f); break; } } ... | CompositeFilter extends Filter<ILoggingEvent> { public void removeLogInclusionRule(LogBackLogInclusionRule logInclusionRule) { Iterator<Filter<ILoggingEvent>> it = _filterList.iterator(); while(it.hasNext()) { Filter f = it.next(); if (f.getName().equals(logInclusionRule.getName())) { _filterList.remove(f); break; } } ... | CompositeFilter extends Filter<ILoggingEvent> { public void removeLogInclusionRule(LogBackLogInclusionRule logInclusionRule) { Iterator<Filter<ILoggingEvent>> it = _filterList.iterator(); while(it.hasNext()) { Filter f = it.next(); if (f.getName().equals(logInclusionRule.getName())) { _filterList.remove(f); break; } } ... |
@Test public void testAmqpValueWithNullWithMapMessageAnnotation() throws Exception { final Object expected = null; final AmqpValue amqpValue = new AmqpValue(expected); Message_1_0 sourceMessage = createTestMessage(MAP_MESSAGE_MESSAGE_ANNOTATION, amqpValue.createEncodingRetainingSection()); final InternalMessage convert... | @Override public InternalMessage convert(Message_1_0 serverMessage, NamedAddressSpace addressSpace) { Object bodyObject = MessageConverter_from_1_0.convertBodyToObject(serverMessage); final AMQMessageHeader convertHeader = convertHeader(serverMessage, addressSpace, bodyObject); return InternalMessage.convert(serverMess... | MessageConverter_v1_0_to_Internal implements MessageConverter<Message_1_0, InternalMessage> { @Override public InternalMessage convert(Message_1_0 serverMessage, NamedAddressSpace addressSpace) { Object bodyObject = MessageConverter_from_1_0.convertBodyToObject(serverMessage); final AMQMessageHeader convertHeader = con... | MessageConverter_v1_0_to_Internal implements MessageConverter<Message_1_0, InternalMessage> { @Override public InternalMessage convert(Message_1_0 serverMessage, NamedAddressSpace addressSpace) { Object bodyObject = MessageConverter_from_1_0.convertBodyToObject(serverMessage); final AMQMessageHeader convertHeader = con... | MessageConverter_v1_0_to_Internal implements MessageConverter<Message_1_0, InternalMessage> { @Override public InternalMessage convert(Message_1_0 serverMessage, NamedAddressSpace addressSpace) { Object bodyObject = MessageConverter_from_1_0.convertBodyToObject(serverMessage); final AMQMessageHeader convertHeader = con... | MessageConverter_v1_0_to_Internal implements MessageConverter<Message_1_0, InternalMessage> { @Override public InternalMessage convert(Message_1_0 serverMessage, NamedAddressSpace addressSpace) { Object bodyObject = MessageConverter_from_1_0.convertBodyToObject(serverMessage); final AMQMessageHeader convertHeader = con... |
@Test public void testCreateObjectMapper() { ObjectMapper actualCreateObjectMapperResult = Exporter.createObjectMapper(); DeserializationConfig deserializationConfig = actualCreateObjectMapperResult.getDeserializationConfig(); assertTrue(actualCreateObjectMapperResult .getSerializerFactory() instanceof com.fasterxml.ja... | public static ObjectMapper createObjectMapper() { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.setVisibility( objectMapper.getSerializationConfig().getDefaultVisibilityChecker() .withFieldVisibility(JsonAutoDetect.Visibility.ANY) .withGetterVisibility(JsonAutoDetect.Visibility.NONE) .withIsGetterVisibil... | Exporter { public static ObjectMapper createObjectMapper() { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.setVisibility( objectMapper.getSerializationConfig().getDefaultVisibilityChecker() .withFieldVisibility(JsonAutoDetect.Visibility.ANY) .withGetterVisibility(JsonAutoDetect.Visibility.NONE) .withIsGe... | Exporter { public static ObjectMapper createObjectMapper() { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.setVisibility( objectMapper.getSerializationConfig().getDefaultVisibilityChecker() .withFieldVisibility(JsonAutoDetect.Visibility.ANY) .withGetterVisibility(JsonAutoDetect.Visibility.NONE) .withIsGe... | Exporter { public static ObjectMapper createObjectMapper() { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.setVisibility( objectMapper.getSerializationConfig().getDefaultVisibilityChecker() .withFieldVisibility(JsonAutoDetect.Visibility.ANY) .withGetterVisibility(JsonAutoDetect.Visibility.NONE) .withIsGe... | Exporter { public static ObjectMapper createObjectMapper() { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.setVisibility( objectMapper.getSerializationConfig().getDefaultVisibilityChecker() .withFieldVisibility(JsonAutoDetect.Visibility.ANY) .withGetterVisibility(JsonAutoDetect.Visibility.NONE) .withIsGe... |
@Test public void testDeepEquals() { assertFalse(ObjectUtils.deepEquals("o1", "o2")); assertFalse(ObjectUtils.deepEquals(null, "o2")); assertFalse(ObjectUtils.deepEquals(new AnnotatedMethodMap(), "o2")); assertTrue(ObjectUtils.deepEquals(null, null)); assertFalse(ObjectUtils.deepEquals(new MutableByte(), "o2")); assert... | @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) { return false... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... |
@Test public void testDeepEquals2() { CharArraySet makeStopSetResult = StopFilter.makeStopSet(new String[]{"foo", "foo", "foo"}, true); makeStopSetResult.add((Object) "foo"); assertFalse(ObjectUtils.deepEquals(makeStopSetResult, new AnnotatedMethodMap())); } | @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) { return false... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... |
@Test public void testDeepEquals3() { MutableByte o1 = new MutableByte(); assertFalse(ObjectUtils.deepEquals(o1, new MutableDouble())); } | @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) { return false... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... |
@Test public void testDeepEquals4() { JUnit4TestAdapterCache o1 = new JUnit4TestAdapterCache(); assertTrue(ObjectUtils.deepEquals(o1, new JUnit4TestAdapterCache())); } | @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) { return false... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... |
@Test public void testDeepEquals5() { MutableByte o1 = new MutableByte(); assertTrue(ObjectUtils.deepEquals(o1, new MutableByte())); } | @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) { return false... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... |
@Test public void testDeepEquals6() { CharArraySet makeStopSetResult = StopFilter.makeStopSet(new String[]{"foo", "foo", "foo"}, true); makeStopSetResult.add((Object) "foo"); CharArraySet makeStopSetResult1 = StopFilter.makeStopSet(new String[]{"foo", "foo", "foo"}, true); makeStopSetResult1.add((Object) "foo"); assert... | @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) { return false... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... |
@Test public void testDeepEquals7() { AnnotatedMethodMap o1 = new AnnotatedMethodMap(); assertTrue(ObjectUtils.deepEquals(o1, new AnnotatedMethodMap())); } | @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) { return false... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... |
@Test public void testDeepEquals8() { MutableByte o2 = new MutableByte((byte) 65); assertFalse(ObjectUtils.deepEquals(new MutableByte(), o2)); } | @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) { return false... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... | ObjectUtils { @SuppressWarnings("rawtypes") public static boolean deepEquals(Object o1, Object o2) { if (o1 == null && o2 == null) { return true; } else if (o1 == null || o2 == null) { return false; } if (o1 == o2) { return true; } if (o1 instanceof Number && o2 instanceof Number) { if (o1.getClass() != o2.getClass()) ... |
@Test public void testNewInstance() { EnclosingType type = newInstance(EnclosingType.class, true); System.out.println(type); } | @SuppressWarnings({"unchecked", "rawtypes"}) public static <T> T newInstance(Class<T> type, boolean createSkeleton) { try { if (type.isPrimitive() || type.isArray() || type == String.class) { return defaultValue(type); } ObjectInstantiator instantiator = getInstantiatorOf(type); T item = (T) instantiator.newInstance();... | ObjectUtils { @SuppressWarnings({"unchecked", "rawtypes"}) public static <T> T newInstance(Class<T> type, boolean createSkeleton) { try { if (type.isPrimitive() || type.isArray() || type == String.class) { return defaultValue(type); } ObjectInstantiator instantiator = getInstantiatorOf(type); T item = (T) instantiator.... | ObjectUtils { @SuppressWarnings({"unchecked", "rawtypes"}) public static <T> T newInstance(Class<T> type, boolean createSkeleton) { try { if (type.isPrimitive() || type.isArray() || type == String.class) { return defaultValue(type); } ObjectInstantiator instantiator = getInstantiatorOf(type); T item = (T) instantiator.... | ObjectUtils { @SuppressWarnings({"unchecked", "rawtypes"}) public static <T> T newInstance(Class<T> type, boolean createSkeleton) { try { if (type.isPrimitive() || type.isArray() || type == String.class) { return defaultValue(type); } ObjectInstantiator instantiator = getInstantiatorOf(type); T item = (T) instantiator.... | ObjectUtils { @SuppressWarnings({"unchecked", "rawtypes"}) public static <T> T newInstance(Class<T> type, boolean createSkeleton) { try { if (type.isPrimitive() || type.isArray() || type == String.class) { return defaultValue(type); } ObjectInstantiator instantiator = getInstantiatorOf(type); T item = (T) instantiator.... |
@Test public void testIsValueType() { assertFalse(ObjectUtils.isValueType(Object.class)); } | public static boolean isValueType(Class<?> retType) { if (retType.isPrimitive() && retType != void.class) return true; if (Number.class.isAssignableFrom(retType)) return true; if (Boolean.class == retType) return true; if (Character.class == retType) return true; if (String.class == retType) return true; if (byte[].cla... | ObjectUtils { public static boolean isValueType(Class<?> retType) { if (retType.isPrimitive() && retType != void.class) return true; if (Number.class.isAssignableFrom(retType)) return true; if (Boolean.class == retType) return true; if (Character.class == retType) return true; if (String.class == retType) return true; ... | ObjectUtils { public static boolean isValueType(Class<?> retType) { if (retType.isPrimitive() && retType != void.class) return true; if (Number.class.isAssignableFrom(retType)) return true; if (Boolean.class == retType) return true; if (Character.class == retType) return true; if (String.class == retType) return true; ... | ObjectUtils { public static boolean isValueType(Class<?> retType) { if (retType.isPrimitive() && retType != void.class) return true; if (Number.class.isAssignableFrom(retType)) return true; if (Boolean.class == retType) return true; if (Character.class == retType) return true; if (String.class == retType) return true; ... | ObjectUtils { public static boolean isValueType(Class<?> retType) { if (retType.isPrimitive() && retType != void.class) return true; if (Number.class.isAssignableFrom(retType)) return true; if (Boolean.class == retType) return true; if (Character.class == retType) return true; if (String.class == retType) return true; ... |
@Test public void testOpenOrCreate() { Nitrite actualOpenOrCreateResult = Nitrite.builder().openOrCreate("janedoe", "iloveyou"); PluginManager pluginManager = actualOpenOrCreateResult.getConfig().getPluginManager(); NitriteStore<?> store = actualOpenOrCreateResult.getStore(); assertFalse(actualOpenOrCreateResult.isClos... | public Nitrite openOrCreate() { this.nitriteConfig.autoConfigure(); return new NitriteDatabase(nitriteConfig); } | NitriteBuilder { public Nitrite openOrCreate() { this.nitriteConfig.autoConfigure(); return new NitriteDatabase(nitriteConfig); } } | NitriteBuilder { public Nitrite openOrCreate() { this.nitriteConfig.autoConfigure(); return new NitriteDatabase(nitriteConfig); } NitriteBuilder(); } | NitriteBuilder { public Nitrite openOrCreate() { this.nitriteConfig.autoConfigure(); return new NitriteDatabase(nitriteConfig); } NitriteBuilder(); NitriteBuilder fieldSeparator(String separator); NitriteBuilder loadModule(NitriteModule module); NitriteBuilder addMigrations(Migration... migrations); NitriteBuilder sche... | NitriteBuilder { public Nitrite openOrCreate() { this.nitriteConfig.autoConfigure(); return new NitriteDatabase(nitriteConfig); } NitriteBuilder(); NitriteBuilder fieldSeparator(String separator); NitriteBuilder loadModule(NitriteModule module); NitriteBuilder addMigrations(Migration... migrations); NitriteBuilder sche... |
@Test public void testIsCompatibleTypes() { Class<?> type1 = Object.class; assertTrue(ObjectUtils.isCompatibleTypes(type1, Object.class)); } | public static boolean isCompatibleTypes(Class<?> type1, Class<?> type2) { if (type1.equals(type2)) return true; if (type1.isAssignableFrom(type2)) return true; if (type1.isPrimitive()) { Class<?> wrapperType = toWrapperType(type1); return isCompatibleTypes(wrapperType, type2); } else if (type2.isPrimitive()) { Class<?>... | ObjectUtils { public static boolean isCompatibleTypes(Class<?> type1, Class<?> type2) { if (type1.equals(type2)) return true; if (type1.isAssignableFrom(type2)) return true; if (type1.isPrimitive()) { Class<?> wrapperType = toWrapperType(type1); return isCompatibleTypes(wrapperType, type2); } else if (type2.isPrimitive... | ObjectUtils { public static boolean isCompatibleTypes(Class<?> type1, Class<?> type2) { if (type1.equals(type2)) return true; if (type1.isAssignableFrom(type2)) return true; if (type1.isPrimitive()) { Class<?> wrapperType = toWrapperType(type1); return isCompatibleTypes(wrapperType, type2); } else if (type2.isPrimitive... | ObjectUtils { public static boolean isCompatibleTypes(Class<?> type1, Class<?> type2) { if (type1.equals(type2)) return true; if (type1.isAssignableFrom(type2)) return true; if (type1.isPrimitive()) { Class<?> wrapperType = toWrapperType(type1); return isCompatibleTypes(wrapperType, type2); } else if (type2.isPrimitive... | ObjectUtils { public static boolean isCompatibleTypes(Class<?> type1, Class<?> type2) { if (type1.equals(type2)) return true; if (type1.isAssignableFrom(type2)) return true; if (type1.isPrimitive()) { Class<?> wrapperType = toWrapperType(type1); return isCompatibleTypes(wrapperType, type2); } else if (type2.isPrimitive... |
@Test public void testDeepCopy() { assertNull(ObjectUtils.deepCopy(null)); assertEquals(NitriteId.createId("42"), ObjectUtils.deepCopy(NitriteId.createId("42"))); assertNotEquals(NitriteId.createId("41"), ObjectUtils.deepCopy(NitriteId.createId("42"))); assertEquals(Document.createDocument("foo", "foo"), ObjectUtils.de... | @SuppressWarnings("unchecked") public static <T extends Serializable> T deepCopy(T oldObj) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try (ObjectOutputStream oos = new ObjectOutputStream(bos)) { oos.writeObject(oldObj); oos.flush(); try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputSt... | ObjectUtils { @SuppressWarnings("unchecked") public static <T extends Serializable> T deepCopy(T oldObj) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try (ObjectOutputStream oos = new ObjectOutputStream(bos)) { oos.writeObject(oldObj); oos.flush(); try (ObjectInputStream ois = new ObjectInputStream(new By... | ObjectUtils { @SuppressWarnings("unchecked") public static <T extends Serializable> T deepCopy(T oldObj) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try (ObjectOutputStream oos = new ObjectOutputStream(bos)) { oos.writeObject(oldObj); oos.flush(); try (ObjectInputStream ois = new ObjectInputStream(new By... | ObjectUtils { @SuppressWarnings("unchecked") public static <T extends Serializable> T deepCopy(T oldObj) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try (ObjectOutputStream oos = new ObjectOutputStream(bos)) { oos.writeObject(oldObj); oos.flush(); try (ObjectInputStream ois = new ObjectInputStream(new By... | ObjectUtils { @SuppressWarnings("unchecked") public static <T extends Serializable> T deepCopy(T oldObj) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try (ObjectOutputStream oos = new ObjectOutputStream(bos)) { oos.writeObject(oldObj); oos.flush(); try (ObjectInputStream ois = new ObjectInputStream(new By... |
@Test(expected = ValidationException.class) public void testInvalidEntity1() { ObjectUtils.getEntityName(InvalidEntity1.class); } | public static <T> String getEntityName(Class<T> type) { if (type.isAnnotationPresent(Entity.class)) { Entity entity = type.getAnnotation(Entity.class); String name = entity.value(); if (name.contains(KEY_OBJ_SEPARATOR)) { throw new ValidationException(name + " is not a valid entity name"); } if (!StringUtils.isNullOrEm... | ObjectUtils { public static <T> String getEntityName(Class<T> type) { if (type.isAnnotationPresent(Entity.class)) { Entity entity = type.getAnnotation(Entity.class); String name = entity.value(); if (name.contains(KEY_OBJ_SEPARATOR)) { throw new ValidationException(name + " is not a valid entity name"); } if (!StringUt... | ObjectUtils { public static <T> String getEntityName(Class<T> type) { if (type.isAnnotationPresent(Entity.class)) { Entity entity = type.getAnnotation(Entity.class); String name = entity.value(); if (name.contains(KEY_OBJ_SEPARATOR)) { throw new ValidationException(name + " is not a valid entity name"); } if (!StringUt... | ObjectUtils { public static <T> String getEntityName(Class<T> type) { if (type.isAnnotationPresent(Entity.class)) { Entity entity = type.getAnnotation(Entity.class); String name = entity.value(); if (name.contains(KEY_OBJ_SEPARATOR)) { throw new ValidationException(name + " is not a valid entity name"); } if (!StringUt... | ObjectUtils { public static <T> String getEntityName(Class<T> type) { if (type.isAnnotationPresent(Entity.class)) { Entity entity = type.getAnnotation(Entity.class); String name = entity.value(); if (name.contains(KEY_OBJ_SEPARATOR)) { throw new ValidationException(name + " is not a valid entity name"); } if (!StringUt... |
@Test(expected = ValidationException.class) public void testInvalidEntity2() { ObjectUtils.getEntityName(InvalidEntity2.class); } | public static <T> String getEntityName(Class<T> type) { if (type.isAnnotationPresent(Entity.class)) { Entity entity = type.getAnnotation(Entity.class); String name = entity.value(); if (name.contains(KEY_OBJ_SEPARATOR)) { throw new ValidationException(name + " is not a valid entity name"); } if (!StringUtils.isNullOrEm... | ObjectUtils { public static <T> String getEntityName(Class<T> type) { if (type.isAnnotationPresent(Entity.class)) { Entity entity = type.getAnnotation(Entity.class); String name = entity.value(); if (name.contains(KEY_OBJ_SEPARATOR)) { throw new ValidationException(name + " is not a valid entity name"); } if (!StringUt... | ObjectUtils { public static <T> String getEntityName(Class<T> type) { if (type.isAnnotationPresent(Entity.class)) { Entity entity = type.getAnnotation(Entity.class); String name = entity.value(); if (name.contains(KEY_OBJ_SEPARATOR)) { throw new ValidationException(name + " is not a valid entity name"); } if (!StringUt... | ObjectUtils { public static <T> String getEntityName(Class<T> type) { if (type.isAnnotationPresent(Entity.class)) { Entity entity = type.getAnnotation(Entity.class); String name = entity.value(); if (name.contains(KEY_OBJ_SEPARATOR)) { throw new ValidationException(name + " is not a valid entity name"); } if (!StringUt... | ObjectUtils { public static <T> String getEntityName(Class<T> type) { if (type.isAnnotationPresent(Entity.class)) { Entity entity = type.getAnnotation(Entity.class); String name = entity.value(); if (name.contains(KEY_OBJ_SEPARATOR)) { throw new ValidationException(name + " is not a valid entity name"); } if (!StringUt... |
@Test public void testValidEntity() { assertEquals("org.dizitart.no2.common.util.ObjectUtilsTest$ValidEntity3", ObjectUtils.getEntityName(ValidEntity3.class)); assertEquals("org.dizitart.no2.common.util.ObjectUtilsTest$ValidEntity4", ObjectUtils.getEntityName(ValidEntity4.class)); assertEquals("org.dizitart.no2.common.... | public static <T> String getEntityName(Class<T> type) { if (type.isAnnotationPresent(Entity.class)) { Entity entity = type.getAnnotation(Entity.class); String name = entity.value(); if (name.contains(KEY_OBJ_SEPARATOR)) { throw new ValidationException(name + " is not a valid entity name"); } if (!StringUtils.isNullOrEm... | ObjectUtils { public static <T> String getEntityName(Class<T> type) { if (type.isAnnotationPresent(Entity.class)) { Entity entity = type.getAnnotation(Entity.class); String name = entity.value(); if (name.contains(KEY_OBJ_SEPARATOR)) { throw new ValidationException(name + " is not a valid entity name"); } if (!StringUt... | ObjectUtils { public static <T> String getEntityName(Class<T> type) { if (type.isAnnotationPresent(Entity.class)) { Entity entity = type.getAnnotation(Entity.class); String name = entity.value(); if (name.contains(KEY_OBJ_SEPARATOR)) { throw new ValidationException(name + " is not a valid entity name"); } if (!StringUt... | ObjectUtils { public static <T> String getEntityName(Class<T> type) { if (type.isAnnotationPresent(Entity.class)) { Entity entity = type.getAnnotation(Entity.class); String name = entity.value(); if (name.contains(KEY_OBJ_SEPARATOR)) { throw new ValidationException(name + " is not a valid entity name"); } if (!StringUt... | ObjectUtils { public static <T> String getEntityName(Class<T> type) { if (type.isAnnotationPresent(Entity.class)) { Entity entity = type.getAnnotation(Entity.class); String name = entity.value(); if (name.contains(KEY_OBJ_SEPARATOR)) { throw new ValidationException(name + " is not a valid entity name"); } if (!StringUt... |
@Test public void testCompare() { assertEquals(compare(x, y), result); } | public static int compare(Number x, Number y) { if (isSpecial(x) || isSpecial(y)) { return Double.compare(x.doubleValue(), y.doubleValue()); } else { return toBigDecimal(x).compareTo(toBigDecimal(y)); } } | Numbers { public static int compare(Number x, Number y) { if (isSpecial(x) || isSpecial(y)) { return Double.compare(x.doubleValue(), y.doubleValue()); } else { return toBigDecimal(x).compareTo(toBigDecimal(y)); } } } | Numbers { public static int compare(Number x, Number y) { if (isSpecial(x) || isSpecial(y)) { return Double.compare(x.doubleValue(), y.doubleValue()); } else { return toBigDecimal(x).compareTo(toBigDecimal(y)); } } private Numbers(); } | Numbers { public static int compare(Number x, Number y) { if (isSpecial(x) || isSpecial(y)) { return Double.compare(x.doubleValue(), y.doubleValue()); } else { return toBigDecimal(x).compareTo(toBigDecimal(y)); } } private Numbers(); static int compare(Number x, Number y); static Object castNumber(Object value, Class<... | Numbers { public static int compare(Number x, Number y) { if (isSpecial(x) || isSpecial(y)) { return Double.compare(x.doubleValue(), y.doubleValue()); } else { return toBigDecimal(x).compareTo(toBigDecimal(y)); } } private Numbers(); static int compare(Number x, Number y); static Object castNumber(Object value, Class<... |
@Test public void testCompare2() { Integer x = new Integer(1); assertEquals(0, Numbers.compare(x, new Integer(1))); } | public static int compare(Number x, Number y) { if (isSpecial(x) || isSpecial(y)) { return Double.compare(x.doubleValue(), y.doubleValue()); } else { return toBigDecimal(x).compareTo(toBigDecimal(y)); } } | Numbers { public static int compare(Number x, Number y) { if (isSpecial(x) || isSpecial(y)) { return Double.compare(x.doubleValue(), y.doubleValue()); } else { return toBigDecimal(x).compareTo(toBigDecimal(y)); } } } | Numbers { public static int compare(Number x, Number y) { if (isSpecial(x) || isSpecial(y)) { return Double.compare(x.doubleValue(), y.doubleValue()); } else { return toBigDecimal(x).compareTo(toBigDecimal(y)); } } private Numbers(); } | Numbers { public static int compare(Number x, Number y) { if (isSpecial(x) || isSpecial(y)) { return Double.compare(x.doubleValue(), y.doubleValue()); } else { return toBigDecimal(x).compareTo(toBigDecimal(y)); } } private Numbers(); static int compare(Number x, Number y); static Object castNumber(Object value, Class<... | Numbers { public static int compare(Number x, Number y) { if (isSpecial(x) || isSpecial(y)) { return Double.compare(x.doubleValue(), y.doubleValue()); } else { return toBigDecimal(x).compareTo(toBigDecimal(y)); } } private Numbers(); static int compare(Number x, Number y); static Object castNumber(Object value, Class<... |
@Test public void testIsRecent() throws InterruptedException { Document first = createDocument("key1", "value1"); Thread.sleep(500); Document second = createDocument("key1", "value2"); assertTrue(isRecent(second, first)); second = first.clone(); second.put(DOC_REVISION, 1); first.put("key2", "value3"); first.put(DOC_RE... | public static boolean isRecent(Document recent, Document older) { if (Objects.deepEquals(recent.getRevision(), older.getRevision())) { return recent.getLastModifiedSinceEpoch() >= older.getLastModifiedSinceEpoch(); } return recent.getRevision() > older.getRevision(); } | DocumentUtils { public static boolean isRecent(Document recent, Document older) { if (Objects.deepEquals(recent.getRevision(), older.getRevision())) { return recent.getLastModifiedSinceEpoch() >= older.getLastModifiedSinceEpoch(); } return recent.getRevision() > older.getRevision(); } } | DocumentUtils { public static boolean isRecent(Document recent, Document older) { if (Objects.deepEquals(recent.getRevision(), older.getRevision())) { return recent.getLastModifiedSinceEpoch() >= older.getLastModifiedSinceEpoch(); } return recent.getRevision() > older.getRevision(); } private DocumentUtils(); } | DocumentUtils { public static boolean isRecent(Document recent, Document older) { if (Objects.deepEquals(recent.getRevision(), older.getRevision())) { return recent.getLastModifiedSinceEpoch() >= older.getLastModifiedSinceEpoch(); } return recent.getRevision() > older.getRevision(); } private DocumentUtils(); static b... | DocumentUtils { public static boolean isRecent(Document recent, Document older) { if (Objects.deepEquals(recent.getRevision(), older.getRevision())) { return recent.getLastModifiedSinceEpoch() >= older.getLastModifiedSinceEpoch(); } return recent.getRevision() > older.getRevision(); } private DocumentUtils(); static b... |
@Test public void testIsRecent2() { Document recent = Document.createDocument(); assertTrue(DocumentUtils.isRecent(recent, Document.createDocument())); } | public static boolean isRecent(Document recent, Document older) { if (Objects.deepEquals(recent.getRevision(), older.getRevision())) { return recent.getLastModifiedSinceEpoch() >= older.getLastModifiedSinceEpoch(); } return recent.getRevision() > older.getRevision(); } | DocumentUtils { public static boolean isRecent(Document recent, Document older) { if (Objects.deepEquals(recent.getRevision(), older.getRevision())) { return recent.getLastModifiedSinceEpoch() >= older.getLastModifiedSinceEpoch(); } return recent.getRevision() > older.getRevision(); } } | DocumentUtils { public static boolean isRecent(Document recent, Document older) { if (Objects.deepEquals(recent.getRevision(), older.getRevision())) { return recent.getLastModifiedSinceEpoch() >= older.getLastModifiedSinceEpoch(); } return recent.getRevision() > older.getRevision(); } private DocumentUtils(); } | DocumentUtils { public static boolean isRecent(Document recent, Document older) { if (Objects.deepEquals(recent.getRevision(), older.getRevision())) { return recent.getLastModifiedSinceEpoch() >= older.getLastModifiedSinceEpoch(); } return recent.getRevision() > older.getRevision(); } private DocumentUtils(); static b... | DocumentUtils { public static boolean isRecent(Document recent, Document older) { if (Objects.deepEquals(recent.getRevision(), older.getRevision())) { return recent.getLastModifiedSinceEpoch() >= older.getLastModifiedSinceEpoch(); } return recent.getRevision() > older.getRevision(); } private DocumentUtils(); static b... |
@Test public void testCreateUniqueFilter() { Document doc = createDocument("score", 1034) .put("location", createDocument("state", "NY") .put("city", "New York") .put("address", createDocument("line1", "40") .put("line2", "ABC Street") .put("house", new String[]{"1", "2", "3"}))) .put("category", new String[]{"food", "... | public static Filter createUniqueFilter(Document document) { return Filter.byId(document.getId()); } | DocumentUtils { public static Filter createUniqueFilter(Document document) { return Filter.byId(document.getId()); } } | DocumentUtils { public static Filter createUniqueFilter(Document document) { return Filter.byId(document.getId()); } private DocumentUtils(); } | DocumentUtils { public static Filter createUniqueFilter(Document document) { return Filter.byId(document.getId()); } private DocumentUtils(); static boolean isRecent(Document recent, Document older); static Filter createUniqueFilter(Document document); static Document skeletonDocument(NitriteMapper nitriteMapper, Clas... | DocumentUtils { public static Filter createUniqueFilter(Document document) { return Filter.byId(document.getId()); } private DocumentUtils(); static boolean isRecent(Document recent, Document older); static Filter createUniqueFilter(Document document); static Document skeletonDocument(NitriteMapper nitriteMapper, Clas... |
@Test(expected = SecurityException.class) public void testOpenOrCreate2() { NitriteBuilder builderResult = Nitrite.builder(); builderResult.openOrCreate("", "iloveyou"); NitriteConfig nitriteConfig = builderResult.getNitriteConfig(); PluginManager pluginManager = nitriteConfig.getPluginManager(); NitriteStore<?> nitrit... | public Nitrite openOrCreate() { this.nitriteConfig.autoConfigure(); return new NitriteDatabase(nitriteConfig); } | NitriteBuilder { public Nitrite openOrCreate() { this.nitriteConfig.autoConfigure(); return new NitriteDatabase(nitriteConfig); } } | NitriteBuilder { public Nitrite openOrCreate() { this.nitriteConfig.autoConfigure(); return new NitriteDatabase(nitriteConfig); } NitriteBuilder(); } | NitriteBuilder { public Nitrite openOrCreate() { this.nitriteConfig.autoConfigure(); return new NitriteDatabase(nitriteConfig); } NitriteBuilder(); NitriteBuilder fieldSeparator(String separator); NitriteBuilder loadModule(NitriteModule module); NitriteBuilder addMigrations(Migration... migrations); NitriteBuilder sche... | NitriteBuilder { public Nitrite openOrCreate() { this.nitriteConfig.autoConfigure(); return new NitriteDatabase(nitriteConfig); } NitriteBuilder(); NitriteBuilder fieldSeparator(String separator); NitriteBuilder loadModule(NitriteModule module); NitriteBuilder addMigrations(Migration... migrations); NitriteBuilder sche... |
@Test public void testSkeletonDocument() { Class type = Object.class; assertNull(DocumentUtils.skeletonDocument(new NitriteBuilderTest.CustomNitriteMapper(), type)); } | public static <T> Document skeletonDocument(NitriteMapper nitriteMapper, Class<T> type) { if (nitriteMapper.isValueType(type)) { return Document.createDocument(); } T dummy = newInstance(type, true); Document document = nitriteMapper.convert(dummy, Document.class); return removeValues(document); } | DocumentUtils { public static <T> Document skeletonDocument(NitriteMapper nitriteMapper, Class<T> type) { if (nitriteMapper.isValueType(type)) { return Document.createDocument(); } T dummy = newInstance(type, true); Document document = nitriteMapper.convert(dummy, Document.class); return removeValues(document); } } | DocumentUtils { public static <T> Document skeletonDocument(NitriteMapper nitriteMapper, Class<T> type) { if (nitriteMapper.isValueType(type)) { return Document.createDocument(); } T dummy = newInstance(type, true); Document document = nitriteMapper.convert(dummy, Document.class); return removeValues(document); } priva... | DocumentUtils { public static <T> Document skeletonDocument(NitriteMapper nitriteMapper, Class<T> type) { if (nitriteMapper.isValueType(type)) { return Document.createDocument(); } T dummy = newInstance(type, true); Document document = nitriteMapper.convert(dummy, Document.class); return removeValues(document); } priva... | DocumentUtils { public static <T> Document skeletonDocument(NitriteMapper nitriteMapper, Class<T> type) { if (nitriteMapper.isValueType(type)) { return Document.createDocument(); } T dummy = newInstance(type, true); Document document = nitriteMapper.convert(dummy, Document.class); return removeValues(document); } priva... |
@Test public void testSkeletonDocument2() { Class<?> forNameResult = Object.class; Class<?> forNameResult1 = Object.class; MappableMapper nitriteMapper = new MappableMapper(forNameResult, forNameResult1, Object.class); assertEquals(0, DocumentUtils.skeletonDocument(nitriteMapper, Object.class).size()); } | public static <T> Document skeletonDocument(NitriteMapper nitriteMapper, Class<T> type) { if (nitriteMapper.isValueType(type)) { return Document.createDocument(); } T dummy = newInstance(type, true); Document document = nitriteMapper.convert(dummy, Document.class); return removeValues(document); } | DocumentUtils { public static <T> Document skeletonDocument(NitriteMapper nitriteMapper, Class<T> type) { if (nitriteMapper.isValueType(type)) { return Document.createDocument(); } T dummy = newInstance(type, true); Document document = nitriteMapper.convert(dummy, Document.class); return removeValues(document); } } | DocumentUtils { public static <T> Document skeletonDocument(NitriteMapper nitriteMapper, Class<T> type) { if (nitriteMapper.isValueType(type)) { return Document.createDocument(); } T dummy = newInstance(type, true); Document document = nitriteMapper.convert(dummy, Document.class); return removeValues(document); } priva... | DocumentUtils { public static <T> Document skeletonDocument(NitriteMapper nitriteMapper, Class<T> type) { if (nitriteMapper.isValueType(type)) { return Document.createDocument(); } T dummy = newInstance(type, true); Document document = nitriteMapper.convert(dummy, Document.class); return removeValues(document); } priva... | DocumentUtils { public static <T> Document skeletonDocument(NitriteMapper nitriteMapper, Class<T> type) { if (nitriteMapper.isValueType(type)) { return Document.createDocument(); } T dummy = newInstance(type, true); Document document = nitriteMapper.convert(dummy, Document.class); return removeValues(document); } priva... |
@Test public void testIsSimilar() { assertFalse(DocumentUtils.isSimilar(null, Document.createDocument(), "fields")); assertFalse(DocumentUtils.isSimilar(null, Document.createDocument(), (String) null)); assertTrue(DocumentUtils.isSimilar(null, null, "fields")); assertFalse(DocumentUtils.isSimilar(Document.createDocumen... | public static boolean isSimilar(Document document, Document other, String... fields) { boolean result = true; if (document == null && other != null) return false; if (document != null && other == null) return false; if (document == null) return true; for (String field : fields) { result = result && Objects.deepEquals(d... | DocumentUtils { public static boolean isSimilar(Document document, Document other, String... fields) { boolean result = true; if (document == null && other != null) return false; if (document != null && other == null) return false; if (document == null) return true; for (String field : fields) { result = result && Obje... | DocumentUtils { public static boolean isSimilar(Document document, Document other, String... fields) { boolean result = true; if (document == null && other != null) return false; if (document != null && other == null) return false; if (document == null) return true; for (String field : fields) { result = result && Obje... | DocumentUtils { public static boolean isSimilar(Document document, Document other, String... fields) { boolean result = true; if (document == null && other != null) return false; if (document != null && other == null) return false; if (document == null) return true; for (String field : fields) { result = result && Obje... | DocumentUtils { public static boolean isSimilar(Document document, Document other, String... fields) { boolean result = true; if (document == null && other != null) return false; if (document != null && other == null) return false; if (document == null) return true; for (String field : fields) { result = result && Obje... |
@Test public void testIsSimilar2() { Document document = Document.createDocument(); assertTrue(DocumentUtils.isSimilar(document, Document.createDocument(), "fields")); } | public static boolean isSimilar(Document document, Document other, String... fields) { boolean result = true; if (document == null && other != null) return false; if (document != null && other == null) return false; if (document == null) return true; for (String field : fields) { result = result && Objects.deepEquals(d... | DocumentUtils { public static boolean isSimilar(Document document, Document other, String... fields) { boolean result = true; if (document == null && other != null) return false; if (document != null && other == null) return false; if (document == null) return true; for (String field : fields) { result = result && Obje... | DocumentUtils { public static boolean isSimilar(Document document, Document other, String... fields) { boolean result = true; if (document == null && other != null) return false; if (document != null && other == null) return false; if (document == null) return true; for (String field : fields) { result = result && Obje... | DocumentUtils { public static boolean isSimilar(Document document, Document other, String... fields) { boolean result = true; if (document == null && other != null) return false; if (document != null && other == null) return false; if (document == null) return true; for (String field : fields) { result = result && Obje... | DocumentUtils { public static boolean isSimilar(Document document, Document other, String... fields) { boolean result = true; if (document == null && other != null) return false; if (document != null && other == null) return false; if (document == null) return true; for (String field : fields) { result = result && Obje... |
@Test public void testDummyDocument() { NitriteMapper nitriteMapper = new MappableMapper(); Document document = skeletonDocument(nitriteMapper, DummyTest.class); assertTrue(document.containsKey("first")); assertTrue(document.containsKey("second")); assertNull(document.get("first")); assertNull(document.get("second")); ... | public static <T> Document skeletonDocument(NitriteMapper nitriteMapper, Class<T> type) { if (nitriteMapper.isValueType(type)) { return Document.createDocument(); } T dummy = newInstance(type, true); Document document = nitriteMapper.convert(dummy, Document.class); return removeValues(document); } | DocumentUtils { public static <T> Document skeletonDocument(NitriteMapper nitriteMapper, Class<T> type) { if (nitriteMapper.isValueType(type)) { return Document.createDocument(); } T dummy = newInstance(type, true); Document document = nitriteMapper.convert(dummy, Document.class); return removeValues(document); } } | DocumentUtils { public static <T> Document skeletonDocument(NitriteMapper nitriteMapper, Class<T> type) { if (nitriteMapper.isValueType(type)) { return Document.createDocument(); } T dummy = newInstance(type, true); Document document = nitriteMapper.convert(dummy, Document.class); return removeValues(document); } priva... | DocumentUtils { public static <T> Document skeletonDocument(NitriteMapper nitriteMapper, Class<T> type) { if (nitriteMapper.isValueType(type)) { return Document.createDocument(); } T dummy = newInstance(type, true); Document document = nitriteMapper.convert(dummy, Document.class); return removeValues(document); } priva... | DocumentUtils { public static <T> Document skeletonDocument(NitriteMapper nitriteMapper, Class<T> type) { if (nitriteMapper.isValueType(type)) { return Document.createDocument(); } T dummy = newInstance(type, true); Document document = nitriteMapper.convert(dummy, Document.class); return removeValues(document); } priva... |
@Test public void testGetThreadPool() { assertTrue(ThreadPoolManager.getThreadPool(3, "threadName") instanceof java.util.concurrent.ThreadPoolExecutor); } | public static ExecutorService getThreadPool(int size, String threadName) { ExecutorService threadPool = Executors.newFixedThreadPool(size, threadFactory(threadName)); threadPools.add(threadPool); return threadPool; } | ThreadPoolManager { public static ExecutorService getThreadPool(int size, String threadName) { ExecutorService threadPool = Executors.newFixedThreadPool(size, threadFactory(threadName)); threadPools.add(threadPool); return threadPool; } } | ThreadPoolManager { public static ExecutorService getThreadPool(int size, String threadName) { ExecutorService threadPool = Executors.newFixedThreadPool(size, threadFactory(threadName)); threadPools.add(threadPool); return threadPool; } } | ThreadPoolManager { public static ExecutorService getThreadPool(int size, String threadName) { ExecutorService threadPool = Executors.newFixedThreadPool(size, threadFactory(threadName)); threadPools.add(threadPool); return threadPool; } static ExecutorService workerPool(); static ExecutorService getThreadPool(int size... | ThreadPoolManager { public static ExecutorService getThreadPool(int size, String threadName) { ExecutorService threadPool = Executors.newFixedThreadPool(size, threadFactory(threadName)); threadPools.add(threadPool); return threadPool; } static ExecutorService workerPool(); static ExecutorService getThreadPool(int size... |
@Test public void testGetReadLock() { assertTrue( (new LockService()).getReadLock("name") instanceof java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock); } | public synchronized Lock getReadLock(String name) { if (lockRegistry.containsKey(name)) { ReentrantReadWriteLock rwLock = lockRegistry.get(name); return rwLock.readLock(); } ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock(); lockRegistry.put(name, rwLock); return rwLock.readLock(); } | LockService { public synchronized Lock getReadLock(String name) { if (lockRegistry.containsKey(name)) { ReentrantReadWriteLock rwLock = lockRegistry.get(name); return rwLock.readLock(); } ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock(); lockRegistry.put(name, rwLock); return rwLock.readLock(); } } | LockService { public synchronized Lock getReadLock(String name) { if (lockRegistry.containsKey(name)) { ReentrantReadWriteLock rwLock = lockRegistry.get(name); return rwLock.readLock(); } ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock(); lockRegistry.put(name, rwLock); return rwLock.readLock(); } LockServic... | LockService { public synchronized Lock getReadLock(String name) { if (lockRegistry.containsKey(name)) { ReentrantReadWriteLock rwLock = lockRegistry.get(name); return rwLock.readLock(); } ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock(); lockRegistry.put(name, rwLock); return rwLock.readLock(); } LockServic... | LockService { public synchronized Lock getReadLock(String name) { if (lockRegistry.containsKey(name)) { ReentrantReadWriteLock rwLock = lockRegistry.get(name); return rwLock.readLock(); } ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock(); lockRegistry.put(name, rwLock); return rwLock.readLock(); } LockServic... |
@Test public void testGetWriteLock() { assertTrue((new LockService()) .getWriteLock("name") instanceof java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock); } | public synchronized Lock getWriteLock(String name) { if (lockRegistry.containsKey(name)) { ReentrantReadWriteLock rwLock = lockRegistry.get(name); return rwLock.writeLock(); } ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock(); lockRegistry.put(name, rwLock); return rwLock.writeLock(); } | LockService { public synchronized Lock getWriteLock(String name) { if (lockRegistry.containsKey(name)) { ReentrantReadWriteLock rwLock = lockRegistry.get(name); return rwLock.writeLock(); } ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock(); lockRegistry.put(name, rwLock); return rwLock.writeLock(); } } | LockService { public synchronized Lock getWriteLock(String name) { if (lockRegistry.containsKey(name)) { ReentrantReadWriteLock rwLock = lockRegistry.get(name); return rwLock.writeLock(); } ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock(); lockRegistry.put(name, rwLock); return rwLock.writeLock(); } LockSer... | LockService { public synchronized Lock getWriteLock(String name) { if (lockRegistry.containsKey(name)) { ReentrantReadWriteLock rwLock = lockRegistry.get(name); return rwLock.writeLock(); } ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock(); lockRegistry.put(name, rwLock); return rwLock.writeLock(); } LockSer... | LockService { public synchronized Lock getWriteLock(String name) { if (lockRegistry.containsKey(name)) { ReentrantReadWriteLock rwLock = lockRegistry.get(name); return rwLock.writeLock(); } ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock(); lockRegistry.put(name, rwLock); return rwLock.writeLock(); } LockSer... |
@Test public void testFindIndexedIdSet() { NotEqualsFilter notEqualsFilter = new NotEqualsFilter("field", null); notEqualsFilter.setIsFieldIndexed(true); assertThrows(FilterException.class, () -> notEqualsFilter.findIndexedIdSet()); } | @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { ComparableIndexer comparableIndexer = (ComparableI... | NotEqualsFilter extends IndexAwareFilter { @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { Compara... | NotEqualsFilter extends IndexAwareFilter { @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { Compara... | NotEqualsFilter extends IndexAwareFilter { @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { Compara... | NotEqualsFilter extends IndexAwareFilter { @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { Compara... |
@Test public void testFindIndexedIdSet2() { assertEquals(0, (new NotEqualsFilter("field", "value")).findIndexedIdSet().size()); } | @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { ComparableIndexer comparableIndexer = (ComparableI... | NotEqualsFilter extends IndexAwareFilter { @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { Compara... | NotEqualsFilter extends IndexAwareFilter { @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { Compara... | NotEqualsFilter extends IndexAwareFilter { @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { Compara... | NotEqualsFilter extends IndexAwareFilter { @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { Compara... |
@Test(expected = SecurityException.class) public void testOpenOrCreateNullPassword() { NitriteBuilder builder = Nitrite.builder(); builder.openOrCreate("abcd", null); } | public Nitrite openOrCreate() { this.nitriteConfig.autoConfigure(); return new NitriteDatabase(nitriteConfig); } | NitriteBuilder { public Nitrite openOrCreate() { this.nitriteConfig.autoConfigure(); return new NitriteDatabase(nitriteConfig); } } | NitriteBuilder { public Nitrite openOrCreate() { this.nitriteConfig.autoConfigure(); return new NitriteDatabase(nitriteConfig); } NitriteBuilder(); } | NitriteBuilder { public Nitrite openOrCreate() { this.nitriteConfig.autoConfigure(); return new NitriteDatabase(nitriteConfig); } NitriteBuilder(); NitriteBuilder fieldSeparator(String separator); NitriteBuilder loadModule(NitriteModule module); NitriteBuilder addMigrations(Migration... migrations); NitriteBuilder sche... | NitriteBuilder { public Nitrite openOrCreate() { this.nitriteConfig.autoConfigure(); return new NitriteDatabase(nitriteConfig); } NitriteBuilder(); NitriteBuilder fieldSeparator(String separator); NitriteBuilder loadModule(NitriteModule module); NitriteBuilder addMigrations(Migration... migrations); NitriteBuilder sche... |
@Test public void testFindIdSet() { NotEqualsFilter notEqualsFilter = new NotEqualsFilter("field", "value"); assertEquals(0, notEqualsFilter.findIdSet(new InMemoryMap<NitriteId, Document>("mapName", null)).size()); } | @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (!collection.containsKey(nitriteId)) { idSet.add(nitriteId); } ... | NotEqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (!collection.contain... | NotEqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (!collection.contain... | NotEqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (!collection.contain... | NotEqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (!collection.contain... |
@Test public void testFindIdSet2() { NotEqualsFilter notEqualsFilter = new NotEqualsFilter("field", 42); notEqualsFilter.setOnIdField(true); assertEquals(0, notEqualsFilter.findIdSet(new InMemoryMap<>("mapName", null)).size()); assertTrue(notEqualsFilter.getValue() instanceof Integer); } | @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (!collection.containsKey(nitriteId)) { idSet.add(nitriteId); } ... | NotEqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (!collection.contain... | NotEqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (!collection.contain... | NotEqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (!collection.contain... | NotEqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (!collection.contain... |
@Test(expected = InvalidIdException.class) public void testFindIdSet3() { NotEqualsFilter notEqualsFilter = new NotEqualsFilter("field", "value"); notEqualsFilter.setOnIdField(true); notEqualsFilter.findIdSet(new InMemoryMap<>("mapName", null)); assertTrue(notEqualsFilter.getValue() instanceof String); } | @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (!collection.containsKey(nitriteId)) { idSet.add(nitriteId); } ... | NotEqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (!collection.contain... | NotEqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (!collection.contain... | NotEqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (!collection.contain... | NotEqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (!collection.contain... |
@Test public void testApply() { NotEqualsFilter notEqualsFilter = new NotEqualsFilter("field", "value"); NitriteId first = NitriteId.newId(); assertTrue(notEqualsFilter.apply(new Pair<>(first, Document.createDocument()))); assertTrue(notEqualsFilter.getValue() instanceof String); } | @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return !deepEquals(fieldValue, getValue()); } | NotEqualsFilter extends IndexAwareFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return !deepEquals(fieldValue, getValue()); } } | NotEqualsFilter extends IndexAwareFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return !deepEquals(fieldValue, getValue()); } protected NotEqualsFilter(String field, Object value); } | NotEqualsFilter extends IndexAwareFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return !deepEquals(fieldValue, getValue()); } protected NotEqualsFilter(String field, Object value); @Override boolean ap... | NotEqualsFilter extends IndexAwareFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return !deepEquals(fieldValue, getValue()); } protected NotEqualsFilter(String field, Object value); @Override boolean ap... |
@Test public void testApply2() { NotEqualsFilter notEqualsFilter = new NotEqualsFilter("field", "value"); Pair<NitriteId, Document> pair = new Pair<>(); pair.setSecond(Document.createDocument()); assertTrue(notEqualsFilter.apply(pair)); assertTrue(notEqualsFilter.getValue() instanceof String); } | @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return !deepEquals(fieldValue, getValue()); } | NotEqualsFilter extends IndexAwareFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return !deepEquals(fieldValue, getValue()); } } | NotEqualsFilter extends IndexAwareFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return !deepEquals(fieldValue, getValue()); } protected NotEqualsFilter(String field, Object value); } | NotEqualsFilter extends IndexAwareFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return !deepEquals(fieldValue, getValue()); } protected NotEqualsFilter(String field, Object value); @Override boolean ap... | NotEqualsFilter extends IndexAwareFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return !deepEquals(fieldValue, getValue()); } protected NotEqualsFilter(String field, Object value); @Override boolean ap... |
@Test public void testSetIsFieldIndexed() { NotEqualsFilter notEqualsFilter = new NotEqualsFilter("field", 42); notEqualsFilter.setIndexer(new NitriteTextIndexer()); notEqualsFilter.setIsFieldIndexed(true); assertTrue(notEqualsFilter.getValue() instanceof Integer); assertTrue(notEqualsFilter.getIsFieldIndexed()); } | @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } | NotEqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } } | NotEqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } protected NotEqualsFilter(String field, Object value); } | NotEqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } protected NotEqualsFilter(String field, Object value); @Override boolean apply(Pair<Nit... | NotEqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } protected NotEqualsFilter(String field, Object value); @Override boolean apply(Pair<Nit... |
@Test public void testSetIsFieldIndexed2() { NotEqualsFilter notEqualsFilter = new NotEqualsFilter("field", 42); notEqualsFilter.setObjectFilter(true); notEqualsFilter.setIndexer(null); notEqualsFilter.setIsFieldIndexed(true); assertTrue(notEqualsFilter.getIsFieldIndexed()); } | @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } | NotEqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } } | NotEqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } protected NotEqualsFilter(String field, Object value); } | NotEqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } protected NotEqualsFilter(String field, Object value); @Override boolean apply(Pair<Nit... | NotEqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } protected NotEqualsFilter(String field, Object value); @Override boolean apply(Pair<Nit... |
@Test public void testSetIsFieldIndexed3() { NotEqualsFilter notEqualsFilter = new NotEqualsFilter("field", "value"); notEqualsFilter.setIsFieldIndexed(true); assertTrue(notEqualsFilter.getIsFieldIndexed()); } | @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } | NotEqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } } | NotEqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } protected NotEqualsFilter(String field, Object value); } | NotEqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } protected NotEqualsFilter(String field, Object value); @Override boolean apply(Pair<Nit... | NotEqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } protected NotEqualsFilter(String field, Object value); @Override boolean apply(Pair<Nit... |
@Test public void testSetIsFieldIndexed4() { NotEqualsFilter notEqualsFilter = new NotEqualsFilter("field", "value"); notEqualsFilter.setIndexer(new NitriteTextIndexer()); notEqualsFilter.setIsFieldIndexed(true); assertTrue(notEqualsFilter.getValue() instanceof String); } | @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } | NotEqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } } | NotEqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } protected NotEqualsFilter(String field, Object value); } | NotEqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } protected NotEqualsFilter(String field, Object value); @Override boolean apply(Pair<Nit... | NotEqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } protected NotEqualsFilter(String field, Object value); @Override boolean apply(Pair<Nit... |
@Test public void testApply() { RegexFilter regexFilter = new RegexFilter("field", "value"); Pair<NitriteId, Document> pair = new Pair<NitriteId, Document>(); pair.setSecond(Document.createDocument()); assertFalse(regexFilter.apply(pair)); } | @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); if (fieldValue != null) { if (fieldValue instanceof String) { Matcher matcher = pattern.matcher((String) fieldValue); if (matcher.find()) { return true; } matcher.re... | RegexFilter extends FieldBasedFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); if (fieldValue != null) { if (fieldValue instanceof String) { Matcher matcher = pattern.matcher((String) fieldValue); if (matc... | RegexFilter extends FieldBasedFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); if (fieldValue != null) { if (fieldValue instanceof String) { Matcher matcher = pattern.matcher((String) fieldValue); if (matc... | RegexFilter extends FieldBasedFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); if (fieldValue != null) { if (fieldValue instanceof String) { Matcher matcher = pattern.matcher((String) fieldValue); if (matc... | RegexFilter extends FieldBasedFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); if (fieldValue != null) { if (fieldValue instanceof String) { Matcher matcher = pattern.matcher((String) fieldValue); if (matc... |
@Test public void testFieldSeparator() { db = Nitrite.builder() .fieldSeparator("::") .openOrCreate(); Document document = createDocument("firstName", "John") .put("colorCodes", new Document[]{createDocument("color", "Red"), createDocument("color", "Green")}) .put("address", createDocument("street", "ABCD Road")); Stri... | public NitriteBuilder fieldSeparator(String separator) { this.nitriteConfig.fieldSeparator(separator); return this; } | NitriteBuilder { public NitriteBuilder fieldSeparator(String separator) { this.nitriteConfig.fieldSeparator(separator); return this; } } | NitriteBuilder { public NitriteBuilder fieldSeparator(String separator) { this.nitriteConfig.fieldSeparator(separator); return this; } NitriteBuilder(); } | NitriteBuilder { public NitriteBuilder fieldSeparator(String separator) { this.nitriteConfig.fieldSeparator(separator); return this; } NitriteBuilder(); NitriteBuilder fieldSeparator(String separator); NitriteBuilder loadModule(NitriteModule module); NitriteBuilder addMigrations(Migration... migrations); NitriteBuilder... | NitriteBuilder { public NitriteBuilder fieldSeparator(String separator) { this.nitriteConfig.fieldSeparator(separator); return this; } NitriteBuilder(); NitriteBuilder fieldSeparator(String separator); NitriteBuilder loadModule(NitriteModule module); NitriteBuilder addMigrations(Migration... migrations); NitriteBuilder... |
@Test public void testApply2() { RegexFilter regexFilter = new RegexFilter("field", "value"); NitriteId first = NitriteId.newId(); assertFalse(regexFilter.apply(new Pair<NitriteId, Document>(first, Document.createDocument()))); } | @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); if (fieldValue != null) { if (fieldValue instanceof String) { Matcher matcher = pattern.matcher((String) fieldValue); if (matcher.find()) { return true; } matcher.re... | RegexFilter extends FieldBasedFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); if (fieldValue != null) { if (fieldValue instanceof String) { Matcher matcher = pattern.matcher((String) fieldValue); if (matc... | RegexFilter extends FieldBasedFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); if (fieldValue != null) { if (fieldValue instanceof String) { Matcher matcher = pattern.matcher((String) fieldValue); if (matc... | RegexFilter extends FieldBasedFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); if (fieldValue != null) { if (fieldValue instanceof String) { Matcher matcher = pattern.matcher((String) fieldValue); if (matc... | RegexFilter extends FieldBasedFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); if (fieldValue != null) { if (fieldValue instanceof String) { Matcher matcher = pattern.matcher((String) fieldValue); if (matc... |
@Test public void testEq() { assertFalse(((EqualsFilter) FluentFilter.where("field").eq("value")).getOnIdField()); assertTrue(((EqualsFilter) FluentFilter.where("field").eq("value")).getValue() instanceof String); assertFalse(((EqualsFilter) FluentFilter.where("field").eq("value")).getObjectFilter()); assertFalse(((Equ... | public Filter eq(Object value) { return new EqualsFilter(field, value); } | FluentFilter { public Filter eq(Object value) { return new EqualsFilter(field, value); } } | FluentFilter { public Filter eq(Object value) { return new EqualsFilter(field, value); } private FluentFilter(); } | FluentFilter { public Filter eq(Object value) { return new EqualsFilter(field, value); } private FluentFilter(); static FluentFilter where("$"); static FluentFilter where(String field); Filter eq(Object value); Filter notEq(Object value); Filter gt(Comparable<?> value); Filter gte(Comparable<?> value); Filter lt(Compa... | FluentFilter { public Filter eq(Object value) { return new EqualsFilter(field, value); } private FluentFilter(); static FluentFilter where("$"); static FluentFilter where(String field); Filter eq(Object value); Filter notEq(Object value); Filter gt(Comparable<?> value); Filter gte(Comparable<?> value); Filter lt(Compa... |
@Test public void testNotEq() { assertFalse(((NotEqualsFilter) FluentFilter.where("field").notEq("value")).getOnIdField()); assertTrue(((NotEqualsFilter) FluentFilter.where("field").notEq("value")).getValue() instanceof String); assertFalse(((NotEqualsFilter) FluentFilter.where("field").notEq("value")).getObjectFilter(... | public Filter notEq(Object value) { return new NotEqualsFilter(field, value); } | FluentFilter { public Filter notEq(Object value) { return new NotEqualsFilter(field, value); } } | FluentFilter { public Filter notEq(Object value) { return new NotEqualsFilter(field, value); } private FluentFilter(); } | FluentFilter { public Filter notEq(Object value) { return new NotEqualsFilter(field, value); } private FluentFilter(); static FluentFilter where("$"); static FluentFilter where(String field); Filter eq(Object value); Filter notEq(Object value); Filter gt(Comparable<?> value); Filter gte(Comparable<?> value); Filter lt... | FluentFilter { public Filter notEq(Object value) { return new NotEqualsFilter(field, value); } private FluentFilter(); static FluentFilter where("$"); static FluentFilter where(String field); Filter eq(Object value); Filter notEq(Object value); Filter gt(Comparable<?> value); Filter gte(Comparable<?> value); Filter lt... |
@Test public void testText() { assertEquals("value", ((TextFilter) FluentFilter.where("field").text("value")).getStringValue()); assertFalse(((TextFilter) FluentFilter.where("field").text("value")).getOnIdField()); assertFalse(((TextFilter) FluentFilter.where("field").text("value")).getObjectFilter()); assertFalse(((Te... | public Filter text(String value) { return new TextFilter(field, value); } | FluentFilter { public Filter text(String value) { return new TextFilter(field, value); } } | FluentFilter { public Filter text(String value) { return new TextFilter(field, value); } private FluentFilter(); } | FluentFilter { public Filter text(String value) { return new TextFilter(field, value); } private FluentFilter(); static FluentFilter where("$"); static FluentFilter where(String field); Filter eq(Object value); Filter notEq(Object value); Filter gt(Comparable<?> value); Filter gte(Comparable<?> value); Filter lt(Compa... | FluentFilter { public Filter text(String value) { return new TextFilter(field, value); } private FluentFilter(); static FluentFilter where("$"); static FluentFilter where(String field); Filter eq(Object value); Filter notEq(Object value); Filter gt(Comparable<?> value); Filter gte(Comparable<?> value); Filter lt(Compa... |
@Test public void testRegex() { assertEquals("field", ((RegexFilter) FluentFilter.where("field").regex("value")).getField()); assertFalse(((RegexFilter) FluentFilter.where("field").regex("value")).getObjectFilter()); assertEquals("FieldBasedFilter(field=field, value=value, processed=true)", ((RegexFilter) FluentFilter.... | public Filter regex(String value) { return new RegexFilter(field, value); } | FluentFilter { public Filter regex(String value) { return new RegexFilter(field, value); } } | FluentFilter { public Filter regex(String value) { return new RegexFilter(field, value); } private FluentFilter(); } | FluentFilter { public Filter regex(String value) { return new RegexFilter(field, value); } private FluentFilter(); static FluentFilter where("$"); static FluentFilter where(String field); Filter eq(Object value); Filter notEq(Object value); Filter gt(Comparable<?> value); Filter gte(Comparable<?> value); Filter lt(Com... | FluentFilter { public Filter regex(String value) { return new RegexFilter(field, value); } private FluentFilter(); static FluentFilter where("$"); static FluentFilter where(String field); Filter eq(Object value); Filter notEq(Object value); Filter gt(Comparable<?> value); Filter gte(Comparable<?> value); Filter lt(Com... |
@Test public void testFindIndexedIdSet() { assertEquals(0, (new TextFilter("field", "value")).findIndexedIdSet().size()); } | @Override protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getIndexer() instanceof TextIndexer) { TextIndexer textIndexer = (TextIndexer) getIndexer(); idSet = textIndexer.findText(getCollectionName(), getField(), getStringValue()); } else { thro... | TextFilter extends StringFilter { @Override protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getIndexer() instanceof TextIndexer) { TextIndexer textIndexer = (TextIndexer) getIndexer(); idSet = textIndexer.findText(getCollectionName(), getField()... | TextFilter extends StringFilter { @Override protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getIndexer() instanceof TextIndexer) { TextIndexer textIndexer = (TextIndexer) getIndexer(); idSet = textIndexer.findText(getCollectionName(), getField()... | TextFilter extends StringFilter { @Override protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getIndexer() instanceof TextIndexer) { TextIndexer textIndexer = (TextIndexer) getIndexer(); idSet = textIndexer.findText(getCollectionName(), getField()... | TextFilter extends StringFilter { @Override protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getIndexer() instanceof TextIndexer) { TextIndexer textIndexer = (TextIndexer) getIndexer(); idSet = textIndexer.findText(getCollectionName(), getField()... |
@Test public void testFindIndexedIdSet2() { TextFilter textFilter = new TextFilter("field", "value"); textFilter.setIndexer(null); textFilter.setIsFieldIndexed(true); assertThrows(FilterException.class, () -> textFilter.findIndexedIdSet()); } | @Override protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getIndexer() instanceof TextIndexer) { TextIndexer textIndexer = (TextIndexer) getIndexer(); idSet = textIndexer.findText(getCollectionName(), getField(), getStringValue()); } else { thro... | TextFilter extends StringFilter { @Override protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getIndexer() instanceof TextIndexer) { TextIndexer textIndexer = (TextIndexer) getIndexer(); idSet = textIndexer.findText(getCollectionName(), getField()... | TextFilter extends StringFilter { @Override protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getIndexer() instanceof TextIndexer) { TextIndexer textIndexer = (TextIndexer) getIndexer(); idSet = textIndexer.findText(getCollectionName(), getField()... | TextFilter extends StringFilter { @Override protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getIndexer() instanceof TextIndexer) { TextIndexer textIndexer = (TextIndexer) getIndexer(); idSet = textIndexer.findText(getCollectionName(), getField()... | TextFilter extends StringFilter { @Override protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getIndexer() instanceof TextIndexer) { TextIndexer textIndexer = (TextIndexer) getIndexer(); idSet = textIndexer.findText(getCollectionName(), getField()... |
@Test public void testFindIndexedIdSet3() { TextFilter textFilter = new TextFilter("field", "value"); textFilter.setIsFieldIndexed(true); assertThrows(FilterException.class, () -> textFilter.findIndexedIdSet()); } | @Override protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getIndexer() instanceof TextIndexer) { TextIndexer textIndexer = (TextIndexer) getIndexer(); idSet = textIndexer.findText(getCollectionName(), getField(), getStringValue()); } else { thro... | TextFilter extends StringFilter { @Override protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getIndexer() instanceof TextIndexer) { TextIndexer textIndexer = (TextIndexer) getIndexer(); idSet = textIndexer.findText(getCollectionName(), getField()... | TextFilter extends StringFilter { @Override protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getIndexer() instanceof TextIndexer) { TextIndexer textIndexer = (TextIndexer) getIndexer(); idSet = textIndexer.findText(getCollectionName(), getField()... | TextFilter extends StringFilter { @Override protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getIndexer() instanceof TextIndexer) { TextIndexer textIndexer = (TextIndexer) getIndexer(); idSet = textIndexer.findText(getCollectionName(), getField()... | TextFilter extends StringFilter { @Override protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getIndexer() instanceof TextIndexer) { TextIndexer textIndexer = (TextIndexer) getIndexer(); idSet = textIndexer.findText(getCollectionName(), getField()... |
@Test public void testFindIndexedIdSet() { EqualsFilter equalsFilter = new EqualsFilter("field", "value"); equalsFilter.setIndexer(new NitriteTextIndexer()); equalsFilter.setIsFieldIndexed(null); assertEquals(0, equalsFilter.findIndexedIdSet().size()); } | @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { ComparableIndexer comparableIndexer = (ComparableI... | EqualsFilter extends IndexAwareFilter { @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { Comparable... | EqualsFilter extends IndexAwareFilter { @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { Comparable... | EqualsFilter extends IndexAwareFilter { @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { Comparable... | EqualsFilter extends IndexAwareFilter { @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { Comparable... |
@Test public void testFindIndexedIdSet6() { assertEquals(0, (new EqualsFilter("field", "value")).findIndexedIdSet().size()); } | @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { ComparableIndexer comparableIndexer = (ComparableI... | EqualsFilter extends IndexAwareFilter { @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { Comparable... | EqualsFilter extends IndexAwareFilter { @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { Comparable... | EqualsFilter extends IndexAwareFilter { @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { Comparable... | EqualsFilter extends IndexAwareFilter { @Override @SuppressWarnings("rawtypes") protected Set<NitriteId> findIndexedIdSet() { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getIsFieldIndexed()) { if (getValue() == null || getValue() instanceof Comparable) { if (getIndexer() instanceof ComparableIndexer) { Comparable... |
@Test public void testConvert() { MappableMapper mappableMapper = new MappableMapper(null); assertEquals(0, ((Integer) mappableMapper.<Object, Object>convert(0, Object.class)).intValue()); } | @Override @SuppressWarnings("unchecked") public <Source, Target> Target convert(Source source, Class<Target> type) { if (source == null) { return null; } if (isValue(source)) { return (Target) source; } else { if (Document.class.isAssignableFrom(type)) { return (Target) convertToDocument(source); } else if (source inst... | MappableMapper implements NitriteMapper { @Override @SuppressWarnings("unchecked") public <Source, Target> Target convert(Source source, Class<Target> type) { if (source == null) { return null; } if (isValue(source)) { return (Target) source; } else { if (Document.class.isAssignableFrom(type)) { return (Target) convert... | MappableMapper implements NitriteMapper { @Override @SuppressWarnings("unchecked") public <Source, Target> Target convert(Source source, Class<Target> type) { if (source == null) { return null; } if (isValue(source)) { return (Target) source; } else { if (Document.class.isAssignableFrom(type)) { return (Target) convert... | MappableMapper implements NitriteMapper { @Override @SuppressWarnings("unchecked") public <Source, Target> Target convert(Source source, Class<Target> type) { if (source == null) { return null; } if (isValue(source)) { return (Target) source; } else { if (Document.class.isAssignableFrom(type)) { return (Target) convert... | MappableMapper implements NitriteMapper { @Override @SuppressWarnings("unchecked") public <Source, Target> Target convert(Source source, Class<Target> type) { if (source == null) { return null; } if (isValue(source)) { return (Target) source; } else { if (Document.class.isAssignableFrom(type)) { return (Target) convert... |
@Test public void testFindIdSet() { EqualsFilter equalsFilter = new EqualsFilter("field", "value"); assertEquals(0, equalsFilter.findIdSet(new InMemoryMap<NitriteId, Document>("mapName", null)).size()); } | @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (collection.containsKey(nitriteId)) { idSet.add(nitriteId); } }... | EqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (collection.containsKey... | EqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (collection.containsKey... | EqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (collection.containsKey... | EqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (collection.containsKey... |
@Test(expected = InvalidIdException.class) public void testFindIdSet2() { EqualsFilter equalsFilter = new EqualsFilter("field", "value"); equalsFilter.setOnIdField(true); equalsFilter.findIdSet(new InMemoryMap<>("mapName", null)); assertTrue(equalsFilter.getValue() instanceof String); } | @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (collection.containsKey(nitriteId)) { idSet.add(nitriteId); } }... | EqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (collection.containsKey... | EqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (collection.containsKey... | EqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (collection.containsKey... | EqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (collection.containsKey... |
@Test public void testFindIdSet3() { EqualsFilter equalsFilter = new EqualsFilter("field", 42); equalsFilter.setOnIdField(true); assertEquals(0, equalsFilter.findIdSet(new InMemoryMap<NitriteId, Document>("mapName", null)).size()); assertTrue(equalsFilter.getValue() instanceof Integer); } | @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (collection.containsKey(nitriteId)) { idSet.add(nitriteId); } }... | EqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (collection.containsKey... | EqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (collection.containsKey... | EqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (collection.containsKey... | EqualsFilter extends IndexAwareFilter { @Override protected Set<NitriteId> findIdSet(NitriteMap<NitriteId, Document> collection) { Set<NitriteId> idSet = new LinkedHashSet<>(); if (getOnIdField() && getValue() instanceof String) { NitriteId nitriteId = NitriteId.createId((String) getValue()); if (collection.containsKey... |
@Test public void testApply() { EqualsFilter equalsFilter = new EqualsFilter("field", "value"); Pair<NitriteId, Document> pair = new Pair<NitriteId, Document>(); pair.setSecond(Document.createDocument()); assertFalse(equalsFilter.apply(pair)); assertTrue(equalsFilter.getValue() instanceof String); } | @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return deepEquals(fieldValue, getValue()); } | EqualsFilter extends IndexAwareFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return deepEquals(fieldValue, getValue()); } } | EqualsFilter extends IndexAwareFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return deepEquals(fieldValue, getValue()); } EqualsFilter(String field, Object value); } | EqualsFilter extends IndexAwareFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return deepEquals(fieldValue, getValue()); } EqualsFilter(String field, Object value); @Override boolean apply(Pair<NitriteId... | EqualsFilter extends IndexAwareFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return deepEquals(fieldValue, getValue()); } EqualsFilter(String field, Object value); @Override boolean apply(Pair<NitriteId... |
@Test public void testApply2() { EqualsFilter equalsFilter = new EqualsFilter("field", "value"); NitriteId first = NitriteId.newId(); assertFalse(equalsFilter.apply(new Pair<NitriteId, Document>(first, Document.createDocument()))); assertTrue(equalsFilter.getValue() instanceof String); } | @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return deepEquals(fieldValue, getValue()); } | EqualsFilter extends IndexAwareFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return deepEquals(fieldValue, getValue()); } } | EqualsFilter extends IndexAwareFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return deepEquals(fieldValue, getValue()); } EqualsFilter(String field, Object value); } | EqualsFilter extends IndexAwareFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return deepEquals(fieldValue, getValue()); } EqualsFilter(String field, Object value); @Override boolean apply(Pair<NitriteId... | EqualsFilter extends IndexAwareFilter { @Override public boolean apply(Pair<NitriteId, Document> element) { Document document = element.getSecond(); Object fieldValue = document.get(getField()); return deepEquals(fieldValue, getValue()); } EqualsFilter(String field, Object value); @Override boolean apply(Pair<NitriteId... |
@Test public void testSetIsFieldIndexed() { EqualsFilter equalsFilter = new EqualsFilter("field", "value"); equalsFilter.setIsFieldIndexed(true); assertTrue(equalsFilter.getIsFieldIndexed()); } | @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } | EqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } } | EqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } EqualsFilter(String field, Object value); } | EqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } EqualsFilter(String field, Object value); @Override boolean apply(Pair<NitriteId, Document>... | EqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } EqualsFilter(String field, Object value); @Override boolean apply(Pair<NitriteId, Document>... |
@Test public void testSetIsFieldIndexed2() { EqualsFilter equalsFilter = new EqualsFilter("field", 42); equalsFilter.setObjectFilter(true); equalsFilter.setIndexer(null); equalsFilter.setIsFieldIndexed(true); assertTrue(equalsFilter.getIsFieldIndexed()); } | @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } | EqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } } | EqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } EqualsFilter(String field, Object value); } | EqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } EqualsFilter(String field, Object value); @Override boolean apply(Pair<NitriteId, Document>... | EqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } EqualsFilter(String field, Object value); @Override boolean apply(Pair<NitriteId, Document>... |
@Test public void testSetIsFieldIndexed3() { EqualsFilter equalsFilter = new EqualsFilter("field", 42); equalsFilter.setIndexer(new NitriteTextIndexer()); equalsFilter.setIsFieldIndexed(true); assertTrue(equalsFilter.getValue() instanceof Integer); assertTrue(equalsFilter.getIsFieldIndexed()); } | @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } | EqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } } | EqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } EqualsFilter(String field, Object value); } | EqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } EqualsFilter(String field, Object value); @Override boolean apply(Pair<NitriteId, Document>... | EqualsFilter extends IndexAwareFilter { @Override public void setIsFieldIndexed(Boolean isFieldIndexed) { if (!(getIndexer() instanceof TextIndexer && getValue() instanceof String)) { super.setIsFieldIndexed(isFieldIndexed); } } EqualsFilter(String field, Object value); @Override boolean apply(Pair<NitriteId, Document>... |
@Test public void testUpdateOptions() { UpdateOptions actualUpdateOptionsResult = UpdateOptions.updateOptions(true, true); assertTrue(actualUpdateOptionsResult.isInsertIfAbsent()); assertTrue(actualUpdateOptionsResult.isJustOnce()); } | public static UpdateOptions updateOptions(boolean insertIfAbsent) { UpdateOptions options = new UpdateOptions(); options.setInsertIfAbsent(insertIfAbsent); return options; } | UpdateOptions { public static UpdateOptions updateOptions(boolean insertIfAbsent) { UpdateOptions options = new UpdateOptions(); options.setInsertIfAbsent(insertIfAbsent); return options; } } | UpdateOptions { public static UpdateOptions updateOptions(boolean insertIfAbsent) { UpdateOptions options = new UpdateOptions(); options.setInsertIfAbsent(insertIfAbsent); return options; } } | UpdateOptions { public static UpdateOptions updateOptions(boolean insertIfAbsent) { UpdateOptions options = new UpdateOptions(); options.setInsertIfAbsent(insertIfAbsent); return options; } static UpdateOptions updateOptions(boolean insertIfAbsent); static UpdateOptions updateOptions(boolean insertIfAbsent, boolean ju... | UpdateOptions { public static UpdateOptions updateOptions(boolean insertIfAbsent) { UpdateOptions options = new UpdateOptions(); options.setInsertIfAbsent(insertIfAbsent); return options; } static UpdateOptions updateOptions(boolean insertIfAbsent); static UpdateOptions updateOptions(boolean insertIfAbsent, boolean ju... |
@Test public void testUpdateOptions2() { assertTrue(UpdateOptions.updateOptions(true).isInsertIfAbsent()); } | public static UpdateOptions updateOptions(boolean insertIfAbsent) { UpdateOptions options = new UpdateOptions(); options.setInsertIfAbsent(insertIfAbsent); return options; } | UpdateOptions { public static UpdateOptions updateOptions(boolean insertIfAbsent) { UpdateOptions options = new UpdateOptions(); options.setInsertIfAbsent(insertIfAbsent); return options; } } | UpdateOptions { public static UpdateOptions updateOptions(boolean insertIfAbsent) { UpdateOptions options = new UpdateOptions(); options.setInsertIfAbsent(insertIfAbsent); return options; } } | UpdateOptions { public static UpdateOptions updateOptions(boolean insertIfAbsent) { UpdateOptions options = new UpdateOptions(); options.setInsertIfAbsent(insertIfAbsent); return options; } static UpdateOptions updateOptions(boolean insertIfAbsent); static UpdateOptions updateOptions(boolean insertIfAbsent, boolean ju... | UpdateOptions { public static UpdateOptions updateOptions(boolean insertIfAbsent) { UpdateOptions options = new UpdateOptions(); options.setInsertIfAbsent(insertIfAbsent); return options; } static UpdateOptions updateOptions(boolean insertIfAbsent); static UpdateOptions updateOptions(boolean insertIfAbsent, boolean ju... |
@Test public void testConvert2() { Class<?> forNameResult = Object.class; Class<?> forNameResult1 = Object.class; MappableMapper mappableMapper = new MappableMapper(forNameResult, forNameResult1, Object.class); assertEquals("source", mappableMapper.<Object, Object>convert("source", Object.class)); } | @Override @SuppressWarnings("unchecked") public <Source, Target> Target convert(Source source, Class<Target> type) { if (source == null) { return null; } if (isValue(source)) { return (Target) source; } else { if (Document.class.isAssignableFrom(type)) { return (Target) convertToDocument(source); } else if (source inst... | MappableMapper implements NitriteMapper { @Override @SuppressWarnings("unchecked") public <Source, Target> Target convert(Source source, Class<Target> type) { if (source == null) { return null; } if (isValue(source)) { return (Target) source; } else { if (Document.class.isAssignableFrom(type)) { return (Target) convert... | MappableMapper implements NitriteMapper { @Override @SuppressWarnings("unchecked") public <Source, Target> Target convert(Source source, Class<Target> type) { if (source == null) { return null; } if (isValue(source)) { return (Target) source; } else { if (Document.class.isAssignableFrom(type)) { return (Target) convert... | MappableMapper implements NitriteMapper { @Override @SuppressWarnings("unchecked") public <Source, Target> Target convert(Source source, Class<Target> type) { if (source == null) { return null; } if (isValue(source)) { return (Target) source; } else { if (Document.class.isAssignableFrom(type)) { return (Target) convert... | MappableMapper implements NitriteMapper { @Override @SuppressWarnings("unchecked") public <Source, Target> Target convert(Source source, Class<Target> type) { if (source == null) { return null; } if (isValue(source)) { return (Target) source; } else { if (Document.class.isAssignableFrom(type)) { return (Target) convert... |
@Test(expected = ValidationException.class) public void testGetCollectionMapStoreNull() { CollectionFactory factory = new CollectionFactory(new LockService()); assertNotNull(factory); NitriteConfig config = new NitriteConfig(); factory.getCollection(null, config, true); } | public NitriteCollection getCollection(String name, NitriteConfig nitriteConfig, boolean writeCatalogue) { notNull(nitriteConfig, "configuration is null while creating collection"); notEmpty(name, "collection name is null or empty"); Lock lock = lockService.getWriteLock(this.getClass().getName()); try { lock.lock(); if... | CollectionFactory { public NitriteCollection getCollection(String name, NitriteConfig nitriteConfig, boolean writeCatalogue) { notNull(nitriteConfig, "configuration is null while creating collection"); notEmpty(name, "collection name is null or empty"); Lock lock = lockService.getWriteLock(this.getClass().getName()); t... | CollectionFactory { public NitriteCollection getCollection(String name, NitriteConfig nitriteConfig, boolean writeCatalogue) { notNull(nitriteConfig, "configuration is null while creating collection"); notEmpty(name, "collection name is null or empty"); Lock lock = lockService.getWriteLock(this.getClass().getName()); t... | CollectionFactory { public NitriteCollection getCollection(String name, NitriteConfig nitriteConfig, boolean writeCatalogue) { notNull(nitriteConfig, "configuration is null while creating collection"); notEmpty(name, "collection name is null or empty"); Lock lock = lockService.getWriteLock(this.getClass().getName()); t... | CollectionFactory { public NitriteCollection getCollection(String name, NitriteConfig nitriteConfig, boolean writeCatalogue) { notNull(nitriteConfig, "configuration is null while creating collection"); notEmpty(name, "collection name is null or empty"); Lock lock = lockService.getWriteLock(this.getClass().getName()); t... |
@Test(expected = ValidationException.class) public void testGetCollectionContextNull() { CollectionFactory factory = new CollectionFactory(new LockService()); factory.getCollection("test", null, false); } | public NitriteCollection getCollection(String name, NitriteConfig nitriteConfig, boolean writeCatalogue) { notNull(nitriteConfig, "configuration is null while creating collection"); notEmpty(name, "collection name is null or empty"); Lock lock = lockService.getWriteLock(this.getClass().getName()); try { lock.lock(); if... | CollectionFactory { public NitriteCollection getCollection(String name, NitriteConfig nitriteConfig, boolean writeCatalogue) { notNull(nitriteConfig, "configuration is null while creating collection"); notEmpty(name, "collection name is null or empty"); Lock lock = lockService.getWriteLock(this.getClass().getName()); t... | CollectionFactory { public NitriteCollection getCollection(String name, NitriteConfig nitriteConfig, boolean writeCatalogue) { notNull(nitriteConfig, "configuration is null while creating collection"); notEmpty(name, "collection name is null or empty"); Lock lock = lockService.getWriteLock(this.getClass().getName()); t... | CollectionFactory { public NitriteCollection getCollection(String name, NitriteConfig nitriteConfig, boolean writeCatalogue) { notNull(nitriteConfig, "configuration is null while creating collection"); notEmpty(name, "collection name is null or empty"); Lock lock = lockService.getWriteLock(this.getClass().getName()); t... | CollectionFactory { public NitriteCollection getCollection(String name, NitriteConfig nitriteConfig, boolean writeCatalogue) { notNull(nitriteConfig, "configuration is null while creating collection"); notEmpty(name, "collection name is null or empty"); Lock lock = lockService.getWriteLock(this.getClass().getName()); t... |
@Test public void testUpdate() { InMemoryMap<NitriteId, Document> nitriteMap = new InMemoryMap<NitriteId, Document>("mapName", null); ReadOperations readOperations = new ReadOperations("collectionName", new NitriteConfig(), nitriteMap, null); WriteOperations writeOperations = new WriteOperations(null, readOperations, n... | WriteResult update(Filter filter, Document update, UpdateOptions updateOptions) { DocumentCursor cursor; if (filter == null || filter == Filter.ALL) { cursor = readOperations.find(); } else { cursor = readOperations.find(filter); } WriteResultImpl writeResult = new WriteResultImpl(); Document document = update.clone();... | WriteOperations { WriteResult update(Filter filter, Document update, UpdateOptions updateOptions) { DocumentCursor cursor; if (filter == null || filter == Filter.ALL) { cursor = readOperations.find(); } else { cursor = readOperations.find(filter); } WriteResultImpl writeResult = new WriteResultImpl(); Document document... | WriteOperations { WriteResult update(Filter filter, Document update, UpdateOptions updateOptions) { DocumentCursor cursor; if (filter == null || filter == Filter.ALL) { cursor = readOperations.find(); } else { cursor = readOperations.find(filter); } WriteResultImpl writeResult = new WriteResultImpl(); Document document... | WriteOperations { WriteResult update(Filter filter, Document update, UpdateOptions updateOptions) { DocumentCursor cursor; if (filter == null || filter == Filter.ALL) { cursor = readOperations.find(); } else { cursor = readOperations.find(filter); } WriteResultImpl writeResult = new WriteResultImpl(); Document document... | WriteOperations { WriteResult update(Filter filter, Document update, UpdateOptions updateOptions) { DocumentCursor cursor; if (filter == null || filter == Filter.ALL) { cursor = readOperations.find(); } else { cursor = readOperations.find(filter); } WriteResultImpl writeResult = new WriteResultImpl(); Document document... |
@Test public void testRemove() { InMemoryMap<NitriteId, Document> nitriteMap = new InMemoryMap<NitriteId, Document>("mapName", null); ReadOperations readOperations = new ReadOperations("collectionName", new NitriteConfig(), nitriteMap, null); assertTrue((new WriteOperations(null, readOperations, new InMemoryMap<Nitrite... | WriteResult remove(Filter filter, boolean justOnce) { DocumentCursor cursor; if (filter == null || filter == Filter.ALL) { cursor = readOperations.find(); } else { cursor = readOperations.find(filter); } WriteResultImpl result = new WriteResultImpl(); long count = 0; for (Document document : cursor) { if (document != n... | WriteOperations { WriteResult remove(Filter filter, boolean justOnce) { DocumentCursor cursor; if (filter == null || filter == Filter.ALL) { cursor = readOperations.find(); } else { cursor = readOperations.find(filter); } WriteResultImpl result = new WriteResultImpl(); long count = 0; for (Document document : cursor) {... | WriteOperations { WriteResult remove(Filter filter, boolean justOnce) { DocumentCursor cursor; if (filter == null || filter == Filter.ALL) { cursor = readOperations.find(); } else { cursor = readOperations.find(filter); } WriteResultImpl result = new WriteResultImpl(); long count = 0; for (Document document : cursor) {... | WriteOperations { WriteResult remove(Filter filter, boolean justOnce) { DocumentCursor cursor; if (filter == null || filter == Filter.ALL) { cursor = readOperations.find(); } else { cursor = readOperations.find(filter); } WriteResultImpl result = new WriteResultImpl(); long count = 0; for (Document document : cursor) {... | WriteOperations { WriteResult remove(Filter filter, boolean justOnce) { DocumentCursor cursor; if (filter == null || filter == Filter.ALL) { cursor = readOperations.find(); } else { cursor = readOperations.find(filter); } WriteResultImpl result = new WriteResultImpl(); long count = 0; for (Document document : cursor) {... |
@Test public void testFind() { InMemoryMap<NitriteId, Document> nitriteMap = new InMemoryMap<NitriteId, Document>("mapName", null); assertTrue((new ReadOperations("collectionName", new NitriteConfig(), nitriteMap, null)).find().isEmpty()); } | public DocumentCursor find() { RecordStream<Pair<NitriteId, Document>> recordStream = nitriteMap.entries(); return new DocumentCursorImpl(recordStream); } | ReadOperations { public DocumentCursor find() { RecordStream<Pair<NitriteId, Document>> recordStream = nitriteMap.entries(); return new DocumentCursorImpl(recordStream); } } | ReadOperations { public DocumentCursor find() { RecordStream<Pair<NitriteId, Document>> recordStream = nitriteMap.entries(); return new DocumentCursorImpl(recordStream); } ReadOperations(String collectionName,
NitriteConfig nitriteConfig,
NitriteMap<NitriteId, Document> nitriteMap,... | ReadOperations { public DocumentCursor find() { RecordStream<Pair<NitriteId, Document>> recordStream = nitriteMap.entries(); return new DocumentCursorImpl(recordStream); } ReadOperations(String collectionName,
NitriteConfig nitriteConfig,
NitriteMap<NitriteId, Document> nitriteMap,... | ReadOperations { public DocumentCursor find() { RecordStream<Pair<NitriteId, Document>> recordStream = nitriteMap.entries(); return new DocumentCursorImpl(recordStream); } ReadOperations(String collectionName,
NitriteConfig nitriteConfig,
NitriteMap<NitriteId, Document> nitriteMap,... |
@Test public void testFind2() { InMemoryMap<NitriteId, Document> nitriteMap = new InMemoryMap<NitriteId, Document>("mapName", null); assertTrue((new ReadOperations("collectionName", new NitriteConfig(), nitriteMap, null)).find(null).isEmpty()); } | public DocumentCursor find() { RecordStream<Pair<NitriteId, Document>> recordStream = nitriteMap.entries(); return new DocumentCursorImpl(recordStream); } | ReadOperations { public DocumentCursor find() { RecordStream<Pair<NitriteId, Document>> recordStream = nitriteMap.entries(); return new DocumentCursorImpl(recordStream); } } | ReadOperations { public DocumentCursor find() { RecordStream<Pair<NitriteId, Document>> recordStream = nitriteMap.entries(); return new DocumentCursorImpl(recordStream); } ReadOperations(String collectionName,
NitriteConfig nitriteConfig,
NitriteMap<NitriteId, Document> nitriteMap,... | ReadOperations { public DocumentCursor find() { RecordStream<Pair<NitriteId, Document>> recordStream = nitriteMap.entries(); return new DocumentCursorImpl(recordStream); } ReadOperations(String collectionName,
NitriteConfig nitriteConfig,
NitriteMap<NitriteId, Document> nitriteMap,... | ReadOperations { public DocumentCursor find() { RecordStream<Pair<NitriteId, Document>> recordStream = nitriteMap.entries(); return new DocumentCursorImpl(recordStream); } ReadOperations(String collectionName,
NitriteConfig nitriteConfig,
NitriteMap<NitriteId, Document> nitriteMap,... |
@Test public void testGetById() { InMemoryMap<NitriteId, Document> nitriteMap = new InMemoryMap<NitriteId, Document>("mapName", null); ReadOperations readOperations = new ReadOperations("collectionName", new NitriteConfig(), nitriteMap, null); assertNull(readOperations.getById(NitriteId.newId())); } | Document getById(NitriteId nitriteId) { return nitriteMap.get(nitriteId); } | ReadOperations { Document getById(NitriteId nitriteId) { return nitriteMap.get(nitriteId); } } | ReadOperations { Document getById(NitriteId nitriteId) { return nitriteMap.get(nitriteId); } ReadOperations(String collectionName,
NitriteConfig nitriteConfig,
NitriteMap<NitriteId, Document> nitriteMap,
IndexOperations indexOperations); } | ReadOperations { Document getById(NitriteId nitriteId) { return nitriteMap.get(nitriteId); } ReadOperations(String collectionName,
NitriteConfig nitriteConfig,
NitriteMap<NitriteId, Document> nitriteMap,
IndexOperations indexOperations); DocumentCursor find(); Do... | ReadOperations { Document getById(NitriteId nitriteId) { return nitriteMap.get(nitriteId); } ReadOperations(String collectionName,
NitriteConfig nitriteConfig,
NitriteMap<NitriteId, Document> nitriteMap,
IndexOperations indexOperations); DocumentCursor find(); Do... |
@Test public void testIterator() { assertFalse( (new SortedDocumentCursor("field", SortOrder.Ascending, null, NullOrder.First, null)).iterator().hasNext()); } | @Override public Iterator<Pair<NitriteId, Document>> iterator() { Iterator<Pair<NitriteId, Document>> iterator = recordStream == null ? Collections.emptyIterator() : recordStream.iterator(); return new SortedDocumentIterator(field, sortOrder, collator, nullOrder, iterator); } | SortedDocumentCursor implements RecordStream<Pair<NitriteId, Document>> { @Override public Iterator<Pair<NitriteId, Document>> iterator() { Iterator<Pair<NitriteId, Document>> iterator = recordStream == null ? Collections.emptyIterator() : recordStream.iterator(); return new SortedDocumentIterator(field, sortOrder, col... | SortedDocumentCursor implements RecordStream<Pair<NitriteId, Document>> { @Override public Iterator<Pair<NitriteId, Document>> iterator() { Iterator<Pair<NitriteId, Document>> iterator = recordStream == null ? Collections.emptyIterator() : recordStream.iterator(); return new SortedDocumentIterator(field, sortOrder, col... | SortedDocumentCursor implements RecordStream<Pair<NitriteId, Document>> { @Override public Iterator<Pair<NitriteId, Document>> iterator() { Iterator<Pair<NitriteId, Document>> iterator = recordStream == null ? Collections.emptyIterator() : recordStream.iterator(); return new SortedDocumentIterator(field, sortOrder, col... | SortedDocumentCursor implements RecordStream<Pair<NitriteId, Document>> { @Override public Iterator<Pair<NitriteId, Document>> iterator() { Iterator<Pair<NitriteId, Document>> iterator = recordStream == null ? Collections.emptyIterator() : recordStream.iterator(); return new SortedDocumentIterator(field, sortOrder, col... |
@Test public void testIterator2() { FilteredRecordStream recordStream = new FilteredRecordStream(null, null); FilteredRecordStream recordStream1 = new FilteredRecordStream(recordStream, Filter.byId(NitriteId.newId())); assertFalse((new SortedDocumentCursor("field", SortOrder.Ascending, null, NullOrder.First, new Filter... | @Override public Iterator<Pair<NitriteId, Document>> iterator() { Iterator<Pair<NitriteId, Document>> iterator = recordStream == null ? Collections.emptyIterator() : recordStream.iterator(); return new SortedDocumentIterator(field, sortOrder, collator, nullOrder, iterator); } | SortedDocumentCursor implements RecordStream<Pair<NitriteId, Document>> { @Override public Iterator<Pair<NitriteId, Document>> iterator() { Iterator<Pair<NitriteId, Document>> iterator = recordStream == null ? Collections.emptyIterator() : recordStream.iterator(); return new SortedDocumentIterator(field, sortOrder, col... | SortedDocumentCursor implements RecordStream<Pair<NitriteId, Document>> { @Override public Iterator<Pair<NitriteId, Document>> iterator() { Iterator<Pair<NitriteId, Document>> iterator = recordStream == null ? Collections.emptyIterator() : recordStream.iterator(); return new SortedDocumentIterator(field, sortOrder, col... | SortedDocumentCursor implements RecordStream<Pair<NitriteId, Document>> { @Override public Iterator<Pair<NitriteId, Document>> iterator() { Iterator<Pair<NitriteId, Document>> iterator = recordStream == null ? Collections.emptyIterator() : recordStream.iterator(); return new SortedDocumentIterator(field, sortOrder, col... | SortedDocumentCursor implements RecordStream<Pair<NitriteId, Document>> { @Override public Iterator<Pair<NitriteId, Document>> iterator() { Iterator<Pair<NitriteId, Document>> iterator = recordStream == null ? Collections.emptyIterator() : recordStream.iterator(); return new SortedDocumentIterator(field, sortOrder, col... |
@Test public void testHasNext() { FilteredRecordStream recordStream = new FilteredRecordStream(null, null); FilteredRecordStream recordStream1 = new FilteredRecordStream(recordStream, Filter.byId(NitriteId.newId())); FilteredRecordStream lhsStream = new FilteredRecordStream(recordStream1, Filter.byId(NitriteId.newId())... | @Override public boolean hasNext() { return nextItemSet || setNextEntry(); } | UnionStreamIterator implements Iterator<Pair<NitriteId, Document>> { @Override public boolean hasNext() { return nextItemSet || setNextEntry(); } } | UnionStreamIterator implements Iterator<Pair<NitriteId, Document>> { @Override public boolean hasNext() { return nextItemSet || setNextEntry(); } UnionStreamIterator(RecordStream<Pair<NitriteId, Document>> lhsStream,
RecordStream<Pair<NitriteId, Document>> rhsStream); } | UnionStreamIterator implements Iterator<Pair<NitriteId, Document>> { @Override public boolean hasNext() { return nextItemSet || setNextEntry(); } UnionStreamIterator(RecordStream<Pair<NitriteId, Document>> lhsStream,
RecordStream<Pair<NitriteId, Document>> rhsStream); @Override boolean ha... | UnionStreamIterator implements Iterator<Pair<NitriteId, Document>> { @Override public boolean hasNext() { return nextItemSet || setNextEntry(); } UnionStreamIterator(RecordStream<Pair<NitriteId, Document>> lhsStream,
RecordStream<Pair<NitriteId, Document>> rhsStream); @Override boolean ha... |
@Test public void testConvert3() { Class<?> forNameResult = Object.class; Class<?> forNameResult1 = Object.class; MappableMapper mappableMapper = new MappableMapper(forNameResult, forNameResult1, Object.class); assertEquals(0, ((Integer) mappableMapper.<Object, Object>convert(0, Object.class)).intValue()); } | @Override @SuppressWarnings("unchecked") public <Source, Target> Target convert(Source source, Class<Target> type) { if (source == null) { return null; } if (isValue(source)) { return (Target) source; } else { if (Document.class.isAssignableFrom(type)) { return (Target) convertToDocument(source); } else if (source inst... | MappableMapper implements NitriteMapper { @Override @SuppressWarnings("unchecked") public <Source, Target> Target convert(Source source, Class<Target> type) { if (source == null) { return null; } if (isValue(source)) { return (Target) source; } else { if (Document.class.isAssignableFrom(type)) { return (Target) convert... | MappableMapper implements NitriteMapper { @Override @SuppressWarnings("unchecked") public <Source, Target> Target convert(Source source, Class<Target> type) { if (source == null) { return null; } if (isValue(source)) { return (Target) source; } else { if (Document.class.isAssignableFrom(type)) { return (Target) convert... | MappableMapper implements NitriteMapper { @Override @SuppressWarnings("unchecked") public <Source, Target> Target convert(Source source, Class<Target> type) { if (source == null) { return null; } if (isValue(source)) { return (Target) source; } else { if (Document.class.isAssignableFrom(type)) { return (Target) convert... | MappableMapper implements NitriteMapper { @Override @SuppressWarnings("unchecked") public <Source, Target> Target convert(Source source, Class<Target> type) { if (source == null) { return null; } if (isValue(source)) { return (Target) source; } else { if (Document.class.isAssignableFrom(type)) { return (Target) convert... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.