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 isComponentPresent_nativeComponentsDisabled() { ArezTestUtil.disableNativeComponents(); final ArezContext context = Arez.context(); final String type = ValueUtil.randomString(); final String id = ValueUtil.randomString(); assertInvariantFailure( () -> context.isComponentPresent( type, id ), "Arez-0135... | @OmitSymbol( unless = "arez.enable_native_components" ) public boolean isComponentPresent( @Nonnull final String type, @Nonnull final Object id ) { apiInvariant( Arez::areNativeComponentsEnabled, () -> "Arez-0135: ArezContext.isComponentPresent() invoked when Arez.areNativeComponentsEnabled() returns false." ); return ... | ArezContext { @OmitSymbol( unless = "arez.enable_native_components" ) public boolean isComponentPresent( @Nonnull final String type, @Nonnull final Object id ) { apiInvariant( Arez::areNativeComponentsEnabled, () -> "Arez-0135: ArezContext.isComponentPresent() invoked when Arez.areNativeComponentsEnabled() returns fals... | ArezContext { @OmitSymbol( unless = "arez.enable_native_components" ) public boolean isComponentPresent( @Nonnull final String type, @Nonnull final Object id ) { apiInvariant( Arez::areNativeComponentsEnabled, () -> "Arez-0135: ArezContext.isComponentPresent() invoked when Arez.areNativeComponentsEnabled() returns fals... | ArezContext { @OmitSymbol( unless = "arez.enable_native_components" ) public boolean isComponentPresent( @Nonnull final String type, @Nonnull final Object id ) { apiInvariant( Arez::areNativeComponentsEnabled, () -> "Arez-0135: ArezContext.isComponentPresent() invoked when Arez.areNativeComponentsEnabled() returns fals... | ArezContext { @OmitSymbol( unless = "arez.enable_native_components" ) public boolean isComponentPresent( @Nonnull final String type, @Nonnull final Object id ) { apiInvariant( Arez::areNativeComponentsEnabled, () -> "Arez-0135: ArezContext.isComponentPresent() invoked when Arez.areNativeComponentsEnabled() returns fals... |
@Test public void deregisterComponent_nativeComponentsDisabled() { ArezTestUtil.disableNativeComponents(); final ArezContext context = Arez.context(); final Component component = new Component( context, ValueUtil.randomString(), ValueUtil.randomString(), ValueUtil.randomString(), null, null ); assertInvariantFailure( (... | @OmitSymbol( unless = "arez.enable_native_components" ) void deregisterComponent( @Nonnull final Component component ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0006: ArezContext.deregisterComponent() invoked when Arez.areNativeComponentsEnabled() returns false." )... | ArezContext { @OmitSymbol( unless = "arez.enable_native_components" ) void deregisterComponent( @Nonnull final Component component ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0006: ArezContext.deregisterComponent() invoked when Arez.areNativeComponentsEnabled() ret... | ArezContext { @OmitSymbol( unless = "arez.enable_native_components" ) void deregisterComponent( @Nonnull final Component component ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0006: ArezContext.deregisterComponent() invoked when Arez.areNativeComponentsEnabled() ret... | ArezContext { @OmitSymbol( unless = "arez.enable_native_components" ) void deregisterComponent( @Nonnull final Component component ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0006: ArezContext.deregisterComponent() invoked when Arez.areNativeComponentsEnabled() ret... | ArezContext { @OmitSymbol( unless = "arez.enable_native_components" ) void deregisterComponent( @Nonnull final Component component ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0006: ArezContext.deregisterComponent() invoked when Arez.areNativeComponentsEnabled() ret... |
@Test public void findComponent_nativeComponentsDisabled() { ArezTestUtil.disableNativeComponents(); final ArezContext context = Arez.context(); final String type = ValueUtil.randomString(); final String id = ValueUtil.randomString(); assertInvariantFailure( () -> context.findComponent( type, id ), "Arez-0010: ArezCont... | @OmitSymbol( unless = "arez.enable_native_components" ) @Nullable Component findComponent( @Nonnull final String type, @Nonnull final Object id ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0010: ArezContext.findComponent() invoked when Arez.areNativeComponentsEnable... | ArezContext { @OmitSymbol( unless = "arez.enable_native_components" ) @Nullable Component findComponent( @Nonnull final String type, @Nonnull final Object id ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0010: ArezContext.findComponent() invoked when Arez.areNativeCo... | ArezContext { @OmitSymbol( unless = "arez.enable_native_components" ) @Nullable Component findComponent( @Nonnull final String type, @Nonnull final Object id ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0010: ArezContext.findComponent() invoked when Arez.areNativeCo... | ArezContext { @OmitSymbol( unless = "arez.enable_native_components" ) @Nullable Component findComponent( @Nonnull final String type, @Nonnull final Object id ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0010: ArezContext.findComponent() invoked when Arez.areNativeCo... | ArezContext { @OmitSymbol( unless = "arez.enable_native_components" ) @Nullable Component findComponent( @Nonnull final String type, @Nonnull final Object id ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0010: ArezContext.findComponent() invoked when Arez.areNativeCo... |
@Test public void findAllComponentsByType_nativeComponentsDisabled() { ArezTestUtil.disableNativeComponents(); final ArezContext context = Arez.context(); final String type = ValueUtil.randomString(); assertInvariantFailure( () -> context.findAllComponentsByType( type ), "Arez-0011: ArezContext.findAllComponentsByType(... | @OmitSymbol( unless = "arez.enable_native_components" ) @Nonnull Collection<Component> findAllComponentsByType( @Nonnull final String type ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0011: ArezContext.findAllComponentsByType() invoked when Arez.areNativeComponentsE... | ArezContext { @OmitSymbol( unless = "arez.enable_native_components" ) @Nonnull Collection<Component> findAllComponentsByType( @Nonnull final String type ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0011: ArezContext.findAllComponentsByType() invoked when Arez.areNat... | ArezContext { @OmitSymbol( unless = "arez.enable_native_components" ) @Nonnull Collection<Component> findAllComponentsByType( @Nonnull final String type ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0011: ArezContext.findAllComponentsByType() invoked when Arez.areNat... | ArezContext { @OmitSymbol( unless = "arez.enable_native_components" ) @Nonnull Collection<Component> findAllComponentsByType( @Nonnull final String type ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0011: ArezContext.findAllComponentsByType() invoked when Arez.areNat... | ArezContext { @OmitSymbol( unless = "arez.enable_native_components" ) @Nonnull Collection<Component> findAllComponentsByType( @Nonnull final String type ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0011: ArezContext.findAllComponentsByType() invoked when Arez.areNat... |
@Test public void locator() { final ArezContext context = Arez.context(); final Locator locator = context.locator(); assertNotNull( locator ); assertNull( locator.findById( String.class, "21" ) ); final TypeBasedLocator worker = new TypeBasedLocator(); worker.registerLookup( String.class, String::valueOf ); final Dispo... | @OmitSymbol( unless = "arez.enable_references" ) @Nonnull public Locator locator() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( Arez::areReferencesEnabled, () -> "Arez-0192: ArezContext.locator() invoked but Arez.areReferencesEnabled() returned false." ); } assert null != _locator; return _locator; } | ArezContext { @OmitSymbol( unless = "arez.enable_references" ) @Nonnull public Locator locator() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( Arez::areReferencesEnabled, () -> "Arez-0192: ArezContext.locator() invoked but Arez.areReferencesEnabled() returned false." ); } assert null != _locator; return _loc... | ArezContext { @OmitSymbol( unless = "arez.enable_references" ) @Nonnull public Locator locator() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( Arez::areReferencesEnabled, () -> "Arez-0192: ArezContext.locator() invoked but Arez.areReferencesEnabled() returned false." ); } assert null != _locator; return _loc... | ArezContext { @OmitSymbol( unless = "arez.enable_references" ) @Nonnull public Locator locator() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( Arez::areReferencesEnabled, () -> "Arez-0192: ArezContext.locator() invoked but Arez.areReferencesEnabled() returned false." ); } assert null != _locator; return _loc... | ArezContext { @OmitSymbol( unless = "arez.enable_references" ) @Nonnull public Locator locator() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( Arez::areReferencesEnabled, () -> "Arez-0192: ArezContext.locator() invoked but Arez.areReferencesEnabled() returned false." ); } assert null != _locator; return _loc... |
@Test public void locator_referencesDisabled() { ArezTestUtil.disableReferences(); assertInvariantFailure( () -> Arez.context().locator(), "Arez-0192: ArezContext.locator() invoked but Arez.areReferencesEnabled() returned false." ); } | @OmitSymbol( unless = "arez.enable_references" ) @Nonnull public Locator locator() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( Arez::areReferencesEnabled, () -> "Arez-0192: ArezContext.locator() invoked but Arez.areReferencesEnabled() returned false." ); } assert null != _locator; return _locator; } | ArezContext { @OmitSymbol( unless = "arez.enable_references" ) @Nonnull public Locator locator() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( Arez::areReferencesEnabled, () -> "Arez-0192: ArezContext.locator() invoked but Arez.areReferencesEnabled() returned false." ); } assert null != _locator; return _loc... | ArezContext { @OmitSymbol( unless = "arez.enable_references" ) @Nonnull public Locator locator() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( Arez::areReferencesEnabled, () -> "Arez-0192: ArezContext.locator() invoked but Arez.areReferencesEnabled() returned false." ); } assert null != _locator; return _loc... | ArezContext { @OmitSymbol( unless = "arez.enable_references" ) @Nonnull public Locator locator() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( Arez::areReferencesEnabled, () -> "Arez-0192: ArezContext.locator() invoked but Arez.areReferencesEnabled() returned false." ); } assert null != _locator; return _loc... | ArezContext { @OmitSymbol( unless = "arez.enable_references" ) @Nonnull public Locator locator() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( Arez::areReferencesEnabled, () -> "Arez-0192: ArezContext.locator() invoked but Arez.areReferencesEnabled() returned false." ); } assert null != _locator; return _loc... |
@Test public void registerLocator_referencesDisabled() { ArezTestUtil.disableReferences(); assertInvariantFailure( () -> Arez.context().registerLocator( new TypeBasedLocator() ), "Arez-0191: ArezContext.registerLocator invoked but Arez.areReferencesEnabled() returned false." ); } | @OmitSymbol( unless = "arez.enable_references" ) @Nonnull public Disposable registerLocator( @Nonnull final Locator locator ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( Arez::areReferencesEnabled, () -> "Arez-0191: ArezContext.registerLocator invoked but Arez.areReferencesEnabled() returned false." ); } a... | ArezContext { @OmitSymbol( unless = "arez.enable_references" ) @Nonnull public Disposable registerLocator( @Nonnull final Locator locator ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( Arez::areReferencesEnabled, () -> "Arez-0191: ArezContext.registerLocator invoked but Arez.areReferencesEnabled() returned ... | ArezContext { @OmitSymbol( unless = "arez.enable_references" ) @Nonnull public Disposable registerLocator( @Nonnull final Locator locator ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( Arez::areReferencesEnabled, () -> "Arez-0191: ArezContext.registerLocator invoked but Arez.areReferencesEnabled() returned ... | ArezContext { @OmitSymbol( unless = "arez.enable_references" ) @Nonnull public Disposable registerLocator( @Nonnull final Locator locator ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( Arez::areReferencesEnabled, () -> "Arez-0191: ArezContext.registerLocator invoked but Arez.areReferencesEnabled() returned ... | ArezContext { @OmitSymbol( unless = "arez.enable_references" ) @Nonnull public Disposable registerLocator( @Nonnull final Locator locator ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( Arez::areReferencesEnabled, () -> "Arez-0191: ArezContext.registerLocator invoked but Arez.areReferencesEnabled() returned ... |
@Test public void task() { final ArezContext context = Arez.context(); final AtomicInteger callCount = new AtomicInteger(); final String name = ValueUtil.randomString(); final TestSpyEventHandler handler = TestSpyEventHandler.subscribe( context ); final Task task = context.task( name, callCount::incrementAndGet, 0 ); a... | @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } | ArezContext { @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } } | ArezContext { @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } ArezContext( @Nullable final Zone zone ); } | ArezContext { @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } ArezContext( @Nullable final Zone zone ); @OmitSymbol( unless = "arez.enable_native_components" ) boolean isComponentPresent( @Nonnull final String type, @Nonnull final Object id ); @OmitSymbol( unless = "arez.en... | ArezContext { @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } ArezContext( @Nullable final Zone zone ); @OmitSymbol( unless = "arez.enable_native_components" ) boolean isComponentPresent( @Nonnull final String type, @Nonnull final Object id ); @OmitSymbol( unless = "arez.en... |
@Test public void task_throwsException() { final ArezContext context = Arez.context(); final AtomicInteger callCount = new AtomicInteger(); final String name = ValueUtil.randomString(); final TestSpyEventHandler handler = TestSpyEventHandler.subscribe( context ); final String errorMessage = "Blah Error!"; final SafePro... | @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } | ArezContext { @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } } | ArezContext { @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } ArezContext( @Nullable final Zone zone ); } | ArezContext { @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } ArezContext( @Nullable final Zone zone ); @OmitSymbol( unless = "arez.enable_native_components" ) boolean isComponentPresent( @Nonnull final String type, @Nonnull final Object id ); @OmitSymbol( unless = "arez.en... | ArezContext { @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } ArezContext( @Nullable final Zone zone ); @OmitSymbol( unless = "arez.enable_native_components" ) boolean isComponentPresent( @Nonnull final String type, @Nonnull final Object id ); @OmitSymbol( unless = "arez.en... |
@Test public void getTransactionComputing() { final ArezContext context = Arez.context(); final ComputableValue<String> computableValue = context.computable( () -> "" ); final Observer observer = computableValue.getObserver(); final Observer observer2 = context.observer( new CountAndObserveProcedure() ); computableValu... | @Nonnull Transaction getTransactionComputing() { assert _computableValue.isComputing(); final Transaction transaction = getTrackerTransaction( _computableValue.getObserver() ); if ( Arez.shouldCheckInvariants() ) { invariant( () -> transaction != null, () -> "Arez-0106: ComputableValue named '" + _computableValue.getNa... | ComputableValueInfoImpl implements ComputableValueInfo { @Nonnull Transaction getTransactionComputing() { assert _computableValue.isComputing(); final Transaction transaction = getTrackerTransaction( _computableValue.getObserver() ); if ( Arez.shouldCheckInvariants() ) { invariant( () -> transaction != null, () -> "Are... | ComputableValueInfoImpl implements ComputableValueInfo { @Nonnull Transaction getTransactionComputing() { assert _computableValue.isComputing(); final Transaction transaction = getTrackerTransaction( _computableValue.getObserver() ); if ( Arez.shouldCheckInvariants() ) { invariant( () -> transaction != null, () -> "Are... | ComputableValueInfoImpl implements ComputableValueInfo { @Nonnull Transaction getTransactionComputing() { assert _computableValue.isComputing(); final Transaction transaction = getTrackerTransaction( _computableValue.getObserver() ); if ( Arez.shouldCheckInvariants() ) { invariant( () -> transaction != null, () -> "Are... | ComputableValueInfoImpl implements ComputableValueInfo { @Nonnull Transaction getTransactionComputing() { assert _computableValue.isComputing(); final Transaction transaction = getTrackerTransaction( _computableValue.getObserver() ); if ( Arez.shouldCheckInvariants() ) { invariant( () -> transaction != null, () -> "Are... |
@Test public void task_minimalParameters() { final ArezContext context = Arez.context(); final AtomicInteger callCount = new AtomicInteger(); final TestSpyEventHandler handler = TestSpyEventHandler.subscribe( context ); final Task task = context.task( callCount::incrementAndGet ); final String name = "Task@1"; assertEq... | @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } | ArezContext { @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } } | ArezContext { @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } ArezContext( @Nullable final Zone zone ); } | ArezContext { @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } ArezContext( @Nullable final Zone zone ); @OmitSymbol( unless = "arez.enable_native_components" ) boolean isComponentPresent( @Nonnull final String type, @Nonnull final Object id ); @OmitSymbol( unless = "arez.en... | ArezContext { @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } ArezContext( @Nullable final Zone zone ); @OmitSymbol( unless = "arez.enable_native_components" ) boolean isComponentPresent( @Nonnull final String type, @Nonnull final Object id ); @OmitSymbol( unless = "arez.en... |
@SuppressWarnings( "MagicConstant" ) @Test public void task_bad_flags() { final ArezContext context = Arez.context(); assertInvariantFailure( () -> context.task( "MyTask", ValueUtil::randomString, ActionFlags.REQUIRE_NEW_TRANSACTION ), "Arez-0224: Task named 'MyTask' passed invalid flags: " + ActionFlags.REQUIRE_NEW_TR... | @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } | ArezContext { @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } } | ArezContext { @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } ArezContext( @Nullable final Zone zone ); } | ArezContext { @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } ArezContext( @Nullable final Zone zone ); @OmitSymbol( unless = "arez.enable_native_components" ) boolean isComponentPresent( @Nonnull final String type, @Nonnull final Object id ); @OmitSymbol( unless = "arez.en... | ArezContext { @Nonnull public Task task( @Nonnull final SafeProcedure work ) { return task( null, work ); } ArezContext( @Nullable final Zone zone ); @OmitSymbol( unless = "arez.enable_native_components" ) boolean isComponentPresent( @Nonnull final String type, @Nonnull final Object id ); @OmitSymbol( unless = "arez.en... |
@Test public void setTaskInterceptor_whenTaskInterceptorDisabled() { ArezTestUtil.disableTaskInterceptor(); final ArezContext context = Arez.context(); assertInvariantFailure( () -> context.setTaskInterceptor( SafeProcedure::call ), "Arez-0039: setTaskInterceptor() invoked but Arez.isTaskInterceptorEnabled() returns fa... | @OmitSymbol( unless = "arez.enable_task_interceptor" ) public void setTaskInterceptor( @Nullable final TaskInterceptor taskInterceptor ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::isTaskInterceptorEnabled, () -> "Arez-0039: setTaskInterceptor() invoked but Arez.isTaskInterceptorEnabled() returns false." )... | ArezContext { @OmitSymbol( unless = "arez.enable_task_interceptor" ) public void setTaskInterceptor( @Nullable final TaskInterceptor taskInterceptor ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::isTaskInterceptorEnabled, () -> "Arez-0039: setTaskInterceptor() invoked but Arez.isTaskInterceptorEnabled() ret... | ArezContext { @OmitSymbol( unless = "arez.enable_task_interceptor" ) public void setTaskInterceptor( @Nullable final TaskInterceptor taskInterceptor ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::isTaskInterceptorEnabled, () -> "Arez-0039: setTaskInterceptor() invoked but Arez.isTaskInterceptorEnabled() ret... | ArezContext { @OmitSymbol( unless = "arez.enable_task_interceptor" ) public void setTaskInterceptor( @Nullable final TaskInterceptor taskInterceptor ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::isTaskInterceptorEnabled, () -> "Arez-0039: setTaskInterceptor() invoked but Arez.isTaskInterceptorEnabled() ret... | ArezContext { @OmitSymbol( unless = "arez.enable_task_interceptor" ) public void setTaskInterceptor( @Nullable final TaskInterceptor taskInterceptor ) { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::isTaskInterceptorEnabled, () -> "Arez-0039: setTaskInterceptor() invoked but Arez.isTaskInterceptorEnabled() ret... |
@Test public void runNextTask() { final ArezContext context = Arez.context(); final TaskQueue taskQueue = context.getTaskQueue(); final RoundBasedTaskExecutor executor = new RoundBasedTaskExecutor( taskQueue, 2 ); final AtomicInteger task1CallCount = new AtomicInteger(); final AtomicInteger task2CallCount = new AtomicI... | boolean runNextTask() { if ( 0 == _remainingTasksInCurrentRound ) { final int pendingTaskCount = getPendingTaskCount(); if ( 0 == pendingTaskCount ) { _currentRound = 0; return false; } else if ( _currentRound + 1 > _maxRounds ) { _currentRound = 0; onRunawayTasksDetected(); return false; } else { _currentRound = _curr... | RoundBasedTaskExecutor { boolean runNextTask() { if ( 0 == _remainingTasksInCurrentRound ) { final int pendingTaskCount = getPendingTaskCount(); if ( 0 == pendingTaskCount ) { _currentRound = 0; return false; } else if ( _currentRound + 1 > _maxRounds ) { _currentRound = 0; onRunawayTasksDetected(); return false; } els... | RoundBasedTaskExecutor { boolean runNextTask() { if ( 0 == _remainingTasksInCurrentRound ) { final int pendingTaskCount = getPendingTaskCount(); if ( 0 == pendingTaskCount ) { _currentRound = 0; return false; } else if ( _currentRound + 1 > _maxRounds ) { _currentRound = 0; onRunawayTasksDetected(); return false; } els... | RoundBasedTaskExecutor { boolean runNextTask() { if ( 0 == _remainingTasksInCurrentRound ) { final int pendingTaskCount = getPendingTaskCount(); if ( 0 == pendingTaskCount ) { _currentRound = 0; return false; } else if ( _currentRound + 1 > _maxRounds ) { _currentRound = 0; onRunawayTasksDetected(); return false; } els... | RoundBasedTaskExecutor { boolean runNextTask() { if ( 0 == _remainingTasksInCurrentRound ) { final int pendingTaskCount = getPendingTaskCount(); if ( 0 == pendingTaskCount ) { _currentRound = 0; return false; } else if ( _currentRound + 1 > _maxRounds ) { _currentRound = 0; onRunawayTasksDetected(); return false; } els... |
@Test public void runTasks() { final ArezContext context = Arez.context(); final TaskQueue taskQueue = context.getTaskQueue(); final RoundBasedTaskExecutor executor = new RoundBasedTaskExecutor( taskQueue, 2 ); final AtomicInteger task1CallCount = new AtomicInteger(); final AtomicInteger task2CallCount = new AtomicInte... | void runTasks() { while ( true ) { if ( !runNextTask() ) { break; } } } | RoundBasedTaskExecutor { void runTasks() { while ( true ) { if ( !runNextTask() ) { break; } } } } | RoundBasedTaskExecutor { void runTasks() { while ( true ) { if ( !runNextTask() ) { break; } } } RoundBasedTaskExecutor( @Nonnull final TaskQueue taskQueue, final int maxRounds ); } | RoundBasedTaskExecutor { void runTasks() { while ( true ) { if ( !runNextTask() ) { break; } } } RoundBasedTaskExecutor( @Nonnull final TaskQueue taskQueue, final int maxRounds ); } | RoundBasedTaskExecutor { void runTasks() { while ( true ) { if ( !runNextTask() ) { break; } } } RoundBasedTaskExecutor( @Nonnull final TaskQueue taskQueue, final int maxRounds ); } |
@Test public void isTransactionActive() { final ArezContext context = Arez.context(); final Spy spy = context.getSpy(); assertFalse( spy.isTransactionActive() ); setupReadOnlyTransaction( context ); assertTrue( spy.isTransactionActive() ); } | @Override public boolean isTransactionActive() { return getContext().isTransactionActive(); } | SpyImpl implements Spy { @Override public boolean isTransactionActive() { return getContext().isTransactionActive(); } } | SpyImpl implements Spy { @Override public boolean isTransactionActive() { return getContext().isTransactionActive(); } SpyImpl( @Nullable final ArezContext context ); } | SpyImpl implements Spy { @Override public boolean isTransactionActive() { return getContext().isTransactionActive(); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Override void removeSpyEventHandler( @Nonnull final SpyEventHandler handler... | SpyImpl implements Spy { @Override public boolean isTransactionActive() { return getContext().isTransactionActive(); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Override void removeSpyEventHandler( @Nonnull final SpyEventHandler handler... |
@Test public void getTransaction() { final ArezContext context = Arez.context(); final Spy spy = context.getSpy(); final String name = ValueUtil.randomString(); context.safeAction( name, () -> { observeADependency(); assertEquals( spy.getTransaction().getName(), name ); } ); } | @Nonnull @Override public TransactionInfo getTransaction() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( this::isTransactionActive, () -> "Arez-0105: Spy.getTransaction() invoked but no transaction active." ); } return getContext().getTransaction().asInfo(); } | SpyImpl implements Spy { @Nonnull @Override public TransactionInfo getTransaction() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( this::isTransactionActive, () -> "Arez-0105: Spy.getTransaction() invoked but no transaction active." ); } return getContext().getTransaction().asInfo(); } } | SpyImpl implements Spy { @Nonnull @Override public TransactionInfo getTransaction() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( this::isTransactionActive, () -> "Arez-0105: Spy.getTransaction() invoked but no transaction active." ); } return getContext().getTransaction().asInfo(); } SpyImpl( @Nullable fina... | SpyImpl implements Spy { @Nonnull @Override public TransactionInfo getTransaction() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( this::isTransactionActive, () -> "Arez-0105: Spy.getTransaction() invoked but no transaction active." ); } return getContext().getTransaction().asInfo(); } SpyImpl( @Nullable fina... | SpyImpl implements Spy { @Nonnull @Override public TransactionInfo getTransaction() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( this::isTransactionActive, () -> "Arez-0105: Spy.getTransaction() invoked but no transaction active." ); } return getContext().getTransaction().asInfo(); } SpyImpl( @Nullable fina... |
@Test public void findComponent_nativeComponentsDisabled() { ArezTestUtil.disableNativeComponents(); final ArezContext context = Arez.context(); final Spy spy = context.getSpy(); final String type = ValueUtil.randomString(); final String id = ValueUtil.randomString(); assertInvariantFailure( () -> spy.findComponent( ty... | @Nullable @Override public ComponentInfo findComponent( @Nonnull final String type, @Nonnull final Object id ) { final Component component = getContext().findComponent( type, id ); return null != component ? component.asInfo() : null; } | SpyImpl implements Spy { @Nullable @Override public ComponentInfo findComponent( @Nonnull final String type, @Nonnull final Object id ) { final Component component = getContext().findComponent( type, id ); return null != component ? component.asInfo() : null; } } | SpyImpl implements Spy { @Nullable @Override public ComponentInfo findComponent( @Nonnull final String type, @Nonnull final Object id ) { final Component component = getContext().findComponent( type, id ); return null != component ? component.asInfo() : null; } SpyImpl( @Nullable final ArezContext context ); } | SpyImpl implements Spy { @Nullable @Override public ComponentInfo findComponent( @Nonnull final String type, @Nonnull final Object id ) { final Component component = getContext().findComponent( type, id ); return null != component ? component.asInfo() : null; } SpyImpl( @Nullable final ArezContext context ); @Override ... | SpyImpl implements Spy { @Nullable @Override public ComponentInfo findComponent( @Nonnull final String type, @Nonnull final Object id ) { final Component component = getContext().findComponent( type, id ); return null != component ? component.asInfo() : null; } SpyImpl( @Nullable final ArezContext context ); @Override ... |
@Test public void findAllComponentsByType_nativeComponentsDisabled() { ArezTestUtil.disableNativeComponents(); final ArezContext context = Arez.context(); final Spy spy = context.getSpy(); final String type = ValueUtil.randomString(); assertInvariantFailure( () -> spy.findAllComponentsByType( type ), "Arez-0011: ArezCo... | @Nonnull @Override public Collection<ComponentInfo> findAllComponentsByType( @Nonnull final String type ) { final List<ComponentInfo> infos = getContext().findAllComponentsByType( type ).stream(). map( Component::asInfo ). collect( Collectors.toList() ); return Collections.unmodifiableCollection( infos ); } | SpyImpl implements Spy { @Nonnull @Override public Collection<ComponentInfo> findAllComponentsByType( @Nonnull final String type ) { final List<ComponentInfo> infos = getContext().findAllComponentsByType( type ).stream(). map( Component::asInfo ). collect( Collectors.toList() ); return Collections.unmodifiableCollectio... | SpyImpl implements Spy { @Nonnull @Override public Collection<ComponentInfo> findAllComponentsByType( @Nonnull final String type ) { final List<ComponentInfo> infos = getContext().findAllComponentsByType( type ).stream(). map( Component::asInfo ). collect( Collectors.toList() ); return Collections.unmodifiableCollectio... | SpyImpl implements Spy { @Nonnull @Override public Collection<ComponentInfo> findAllComponentsByType( @Nonnull final String type ) { final List<ComponentInfo> infos = getContext().findAllComponentsByType( type ).stream(). map( Component::asInfo ). collect( Collectors.toList() ); return Collections.unmodifiableCollectio... | SpyImpl implements Spy { @Nonnull @Override public Collection<ComponentInfo> findAllComponentsByType( @Nonnull final String type ) { final List<ComponentInfo> infos = getContext().findAllComponentsByType( type ).stream(). map( Component::asInfo ). collect( Collectors.toList() ); return Collections.unmodifiableCollectio... |
@Test public void findAllTopLevelTasks() { final ArezContext context = Arez.context(); final Task task = context.task( ValueUtil::randomString ); final Spy spy = context.getSpy(); final Collection<TaskInfo> values = spy.findAllTopLevelTasks(); assertEquals( values.size(), 1 ); assertEquals( values.iterator().next().get... | @Nonnull @Override public Collection<TaskInfo> findAllTopLevelTasks() { return TaskInfoImpl.asUnmodifiableInfos( getContext().getTopLevelTasks().values() ); } | SpyImpl implements Spy { @Nonnull @Override public Collection<TaskInfo> findAllTopLevelTasks() { return TaskInfoImpl.asUnmodifiableInfos( getContext().getTopLevelTasks().values() ); } } | SpyImpl implements Spy { @Nonnull @Override public Collection<TaskInfo> findAllTopLevelTasks() { return TaskInfoImpl.asUnmodifiableInfos( getContext().getTopLevelTasks().values() ); } SpyImpl( @Nullable final ArezContext context ); } | SpyImpl implements Spy { @Nonnull @Override public Collection<TaskInfo> findAllTopLevelTasks() { return TaskInfoImpl.asUnmodifiableInfos( getContext().getTopLevelTasks().values() ); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Override v... | SpyImpl implements Spy { @Nonnull @Override public Collection<TaskInfo> findAllTopLevelTasks() { return TaskInfoImpl.asUnmodifiableInfos( getContext().getTopLevelTasks().values() ); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Override v... |
@Test public void getTransactionComputing_missingTracker() { final ArezContext context = Arez.context(); final ComputableValue<String> computableValue = context.computable( () -> "" ); computableValue.setComputing( true ); final ComputableValueInfoImpl info = (ComputableValueInfoImpl) computableValue.asInfo(); setupRea... | @Nonnull @Override public String getName() { return _computableValue.getName(); } | ComputableValueInfoImpl implements ComputableValueInfo { @Nonnull @Override public String getName() { return _computableValue.getName(); } } | ComputableValueInfoImpl implements ComputableValueInfo { @Nonnull @Override public String getName() { return _computableValue.getName(); } ComputableValueInfoImpl( @Nonnull final ComputableValue<?> computableValue ); } | ComputableValueInfoImpl implements ComputableValueInfo { @Nonnull @Override public String getName() { return _computableValue.getName(); } ComputableValueInfoImpl( @Nonnull final ComputableValue<?> computableValue ); @Nonnull @Override String getName(); @Override boolean isComputing(); @Nonnull @Override Priority getPr... | ComputableValueInfoImpl implements ComputableValueInfo { @Nonnull @Override public String getName() { return _computableValue.getName(); } ComputableValueInfoImpl( @Nonnull final ComputableValue<?> computableValue ); @Nonnull @Override String getName(); @Override boolean isComputing(); @Nonnull @Override Priority getPr... |
@Test public void findAllTopLevelObservables() { final ArezContext context = Arez.context(); final ObservableValue<String> observableValue = context.observable(); final Spy spy = context.getSpy(); final Collection<ObservableValueInfo> values = spy.findAllTopLevelObservableValues(); assertEquals( values.size(), 1 ); ass... | @Nonnull @Override public Collection<ObservableValueInfo> findAllTopLevelObservableValues() { return ObservableValueInfoImpl.asUnmodifiableInfos( getContext().getTopLevelObservables().values() ); } | SpyImpl implements Spy { @Nonnull @Override public Collection<ObservableValueInfo> findAllTopLevelObservableValues() { return ObservableValueInfoImpl.asUnmodifiableInfos( getContext().getTopLevelObservables().values() ); } } | SpyImpl implements Spy { @Nonnull @Override public Collection<ObservableValueInfo> findAllTopLevelObservableValues() { return ObservableValueInfoImpl.asUnmodifiableInfos( getContext().getTopLevelObservables().values() ); } SpyImpl( @Nullable final ArezContext context ); } | SpyImpl implements Spy { @Nonnull @Override public Collection<ObservableValueInfo> findAllTopLevelObservableValues() { return ObservableValueInfoImpl.asUnmodifiableInfos( getContext().getTopLevelObservables().values() ); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final... | SpyImpl implements Spy { @Nonnull @Override public Collection<ObservableValueInfo> findAllTopLevelObservableValues() { return ObservableValueInfoImpl.asUnmodifiableInfos( getContext().getTopLevelObservables().values() ); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final... |
@Test public void findAllTopLevelComputableValues() { final ArezContext context = Arez.context(); final ComputableValue<String> computableValue = context.computable( () -> "" ); final Spy spy = context.getSpy(); final Collection<ComputableValueInfo> values = spy.findAllTopLevelComputableValues(); assertEquals( values.s... | @Nonnull @Override public Collection<ComputableValueInfo> findAllTopLevelComputableValues() { return ComputableValueInfoImpl.asUnmodifiableInfos( getContext().getTopLevelComputableValues().values() ); } | SpyImpl implements Spy { @Nonnull @Override public Collection<ComputableValueInfo> findAllTopLevelComputableValues() { return ComputableValueInfoImpl.asUnmodifiableInfos( getContext().getTopLevelComputableValues().values() ); } } | SpyImpl implements Spy { @Nonnull @Override public Collection<ComputableValueInfo> findAllTopLevelComputableValues() { return ComputableValueInfoImpl.asUnmodifiableInfos( getContext().getTopLevelComputableValues().values() ); } SpyImpl( @Nullable final ArezContext context ); } | SpyImpl implements Spy { @Nonnull @Override public Collection<ComputableValueInfo> findAllTopLevelComputableValues() { return ComputableValueInfoImpl.asUnmodifiableInfos( getContext().getTopLevelComputableValues().values() ); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull ... | SpyImpl implements Spy { @Nonnull @Override public Collection<ComputableValueInfo> findAllTopLevelComputableValues() { return ComputableValueInfoImpl.asUnmodifiableInfos( getContext().getTopLevelComputableValues().values() ); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull ... |
@Test public void findAllTopLevelObservers() { final ArezContext context = Arez.context(); final Observer observer = context.observer( AbstractTest::observeADependency ); final Spy spy = context.getSpy(); final Collection<ObserverInfo> values = spy.findAllTopLevelObservers(); assertEquals( values.size(), 1 ); assertEqu... | @Nonnull @Override public Collection<ObserverInfo> findAllTopLevelObservers() { return ObserverInfoImpl.asUnmodifiableInfos( getContext().getTopLevelObservers().values() ); } | SpyImpl implements Spy { @Nonnull @Override public Collection<ObserverInfo> findAllTopLevelObservers() { return ObserverInfoImpl.asUnmodifiableInfos( getContext().getTopLevelObservers().values() ); } } | SpyImpl implements Spy { @Nonnull @Override public Collection<ObserverInfo> findAllTopLevelObservers() { return ObserverInfoImpl.asUnmodifiableInfos( getContext().getTopLevelObservers().values() ); } SpyImpl( @Nullable final ArezContext context ); } | SpyImpl implements Spy { @Nonnull @Override public Collection<ObserverInfo> findAllTopLevelObservers() { return ObserverInfoImpl.asUnmodifiableInfos( getContext().getTopLevelObservers().values() ); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handle... | SpyImpl implements Spy { @Nonnull @Override public Collection<ObserverInfo> findAllTopLevelObservers() { return ObserverInfoImpl.asUnmodifiableInfos( getContext().getTopLevelObservers().values() ); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handle... |
@Test public void observable_getValue_noAccessor() { final ArezContext context = Arez.context(); final Spy spy = context.getSpy(); final ObservableValue<Integer> observableValue = context.observable(); assertInvariantFailure( () -> context.action( () -> spy.asObservableValueInfo( observableValue ).getValue() ), "Arez-0... | @Nonnull @Override public <T> ObservableValueInfo asObservableValueInfo( @Nonnull final ObservableValue<T> observableValue ) { return observableValue.asInfo(); } | SpyImpl implements Spy { @Nonnull @Override public <T> ObservableValueInfo asObservableValueInfo( @Nonnull final ObservableValue<T> observableValue ) { return observableValue.asInfo(); } } | SpyImpl implements Spy { @Nonnull @Override public <T> ObservableValueInfo asObservableValueInfo( @Nonnull final ObservableValue<T> observableValue ) { return observableValue.asInfo(); } SpyImpl( @Nullable final ArezContext context ); } | SpyImpl implements Spy { @Nonnull @Override public <T> ObservableValueInfo asObservableValueInfo( @Nonnull final ObservableValue<T> observableValue ) { return observableValue.asInfo(); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Overrid... | SpyImpl implements Spy { @Nonnull @Override public <T> ObservableValueInfo asObservableValueInfo( @Nonnull final ObservableValue<T> observableValue ) { return observableValue.asInfo(); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Overrid... |
@Test public void asComponentInfo() { final ArezContext context = Arez.context(); final Component component = context.component( ValueUtil.randomString(), ValueUtil.randomString() ); final ComponentInfo info = context.getSpy().asComponentInfo( component ); assertEquals( info.getName(), component.getName() ); } | @Nonnull @Override public ComponentInfo asComponentInfo( @Nonnull final Component component ) { return component.asInfo(); } | SpyImpl implements Spy { @Nonnull @Override public ComponentInfo asComponentInfo( @Nonnull final Component component ) { return component.asInfo(); } } | SpyImpl implements Spy { @Nonnull @Override public ComponentInfo asComponentInfo( @Nonnull final Component component ) { return component.asInfo(); } SpyImpl( @Nullable final ArezContext context ); } | SpyImpl implements Spy { @Nonnull @Override public ComponentInfo asComponentInfo( @Nonnull final Component component ) { return component.asInfo(); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Override void removeSpyEventHandler( @Nonnul... | SpyImpl implements Spy { @Nonnull @Override public ComponentInfo asComponentInfo( @Nonnull final Component component ) { return component.asInfo(); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Override void removeSpyEventHandler( @Nonnul... |
@Test public void asObserverInfo() { final ArezContext context = Arez.context(); final Observer observer = context.observer( AbstractTest::observeADependency ); final ObserverInfo info = context.getSpy().asObserverInfo( observer ); assertEquals( info.getName(), observer.getName() ); } | @Nonnull @Override public ObserverInfo asObserverInfo( @Nonnull final Observer observer ) { return observer.asInfo(); } | SpyImpl implements Spy { @Nonnull @Override public ObserverInfo asObserverInfo( @Nonnull final Observer observer ) { return observer.asInfo(); } } | SpyImpl implements Spy { @Nonnull @Override public ObserverInfo asObserverInfo( @Nonnull final Observer observer ) { return observer.asInfo(); } SpyImpl( @Nullable final ArezContext context ); } | SpyImpl implements Spy { @Nonnull @Override public ObserverInfo asObserverInfo( @Nonnull final Observer observer ) { return observer.asInfo(); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Override void removeSpyEventHandler( @Nonnull fin... | SpyImpl implements Spy { @Nonnull @Override public ObserverInfo asObserverInfo( @Nonnull final Observer observer ) { return observer.asInfo(); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Override void removeSpyEventHandler( @Nonnull fin... |
@Test public void asTaskInfo() { final ArezContext context = Arez.context(); final Task task = context.task( ValueUtil::randomString ); final TaskInfo info = context.getSpy().asTaskInfo( task ); assertEquals( info.getName(), task.getName() ); } | @Nonnull @Override public TaskInfo asTaskInfo( @Nonnull final Task task ) { return task.asInfo(); } | SpyImpl implements Spy { @Nonnull @Override public TaskInfo asTaskInfo( @Nonnull final Task task ) { return task.asInfo(); } } | SpyImpl implements Spy { @Nonnull @Override public TaskInfo asTaskInfo( @Nonnull final Task task ) { return task.asInfo(); } SpyImpl( @Nullable final ArezContext context ); } | SpyImpl implements Spy { @Nonnull @Override public TaskInfo asTaskInfo( @Nonnull final Task task ) { return task.asInfo(); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Override void removeSpyEventHandler( @Nonnull final SpyEventHandler h... | SpyImpl implements Spy { @Nonnull @Override public TaskInfo asTaskInfo( @Nonnull final Task task ) { return task.asInfo(); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Override void removeSpyEventHandler( @Nonnull final SpyEventHandler h... |
@Test public void asObservableInfo() { final ArezContext context = Arez.context(); final ObservableValue<Object> observableValue = context.observable( ValueUtil.randomString() ); final ObservableValueInfo info = context.getSpy().asObservableValueInfo( observableValue ); assertEquals( info.getName(), observableValue.get... | @Nonnull @Override public <T> ObservableValueInfo asObservableValueInfo( @Nonnull final ObservableValue<T> observableValue ) { return observableValue.asInfo(); } | SpyImpl implements Spy { @Nonnull @Override public <T> ObservableValueInfo asObservableValueInfo( @Nonnull final ObservableValue<T> observableValue ) { return observableValue.asInfo(); } } | SpyImpl implements Spy { @Nonnull @Override public <T> ObservableValueInfo asObservableValueInfo( @Nonnull final ObservableValue<T> observableValue ) { return observableValue.asInfo(); } SpyImpl( @Nullable final ArezContext context ); } | SpyImpl implements Spy { @Nonnull @Override public <T> ObservableValueInfo asObservableValueInfo( @Nonnull final ObservableValue<T> observableValue ) { return observableValue.asInfo(); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Overrid... | SpyImpl implements Spy { @Nonnull @Override public <T> ObservableValueInfo asObservableValueInfo( @Nonnull final ObservableValue<T> observableValue ) { return observableValue.asInfo(); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Overrid... |
@Test public void asComputableValueInfo() { final ArezContext context = Arez.context(); final ComputableValue<String> computableValue = context.computable( () -> "" ); final ComputableValueInfo info = context.getSpy().asComputableValueInfo( computableValue ); assertEquals( info.getName(), computableValue.getName() ); } | @Nonnull @Override public <T> ComputableValueInfo asComputableValueInfo( @Nonnull final ComputableValue<T> computableValue ) { return computableValue.asInfo(); } | SpyImpl implements Spy { @Nonnull @Override public <T> ComputableValueInfo asComputableValueInfo( @Nonnull final ComputableValue<T> computableValue ) { return computableValue.asInfo(); } } | SpyImpl implements Spy { @Nonnull @Override public <T> ComputableValueInfo asComputableValueInfo( @Nonnull final ComputableValue<T> computableValue ) { return computableValue.asInfo(); } SpyImpl( @Nullable final ArezContext context ); } | SpyImpl implements Spy { @Nonnull @Override public <T> ComputableValueInfo asComputableValueInfo( @Nonnull final ComputableValue<T> computableValue ) { return computableValue.asInfo(); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Overrid... | SpyImpl implements Spy { @Nonnull @Override public <T> ComputableValueInfo asComputableValueInfo( @Nonnull final ComputableValue<T> computableValue ) { return computableValue.asInfo(); } SpyImpl( @Nullable final ArezContext context ); @Override void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Overrid... |
@Test public void addObserverErrorHandler_alreadyExists() { final ObserverErrorHandlerSupport support = new ObserverErrorHandlerSupport(); final ObserverErrorHandler handler = ( observerArg, errorArg, throwableArg ) -> { }; support.addObserverErrorHandler( handler ); assertInvariantFailure( () -> support.addObserverErr... | void addObserverErrorHandler( @Nonnull final ObserverErrorHandler handler ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_handlers.contains( handler ), () -> "Arez-0096: Attempting to add handler " + handler + " that is already in " + "the list of error handlers." ); } _handlers.add( Objects.requireN... | ObserverErrorHandlerSupport implements ObserverErrorHandler { void addObserverErrorHandler( @Nonnull final ObserverErrorHandler handler ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_handlers.contains( handler ), () -> "Arez-0096: Attempting to add handler " + handler + " that is already in " + "the... | ObserverErrorHandlerSupport implements ObserverErrorHandler { void addObserverErrorHandler( @Nonnull final ObserverErrorHandler handler ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_handlers.contains( handler ), () -> "Arez-0096: Attempting to add handler " + handler + " that is already in " + "the... | ObserverErrorHandlerSupport implements ObserverErrorHandler { void addObserverErrorHandler( @Nonnull final ObserverErrorHandler handler ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_handlers.contains( handler ), () -> "Arez-0096: Attempting to add handler " + handler + " that is already in " + "the... | ObserverErrorHandlerSupport implements ObserverErrorHandler { void addObserverErrorHandler( @Nonnull final ObserverErrorHandler handler ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_handlers.contains( handler ), () -> "Arez-0096: Attempting to add handler " + handler + " that is already in " + "the... |
@Test public void getDependencies() { final ArezContext context = Arez.context(); final ComputableValue<String> computableValue = context.computable( () -> "" ); final ComputableValueInfo info = computableValue.asInfo(); assertEquals( info.getDependencies().size(), 0 ); final ObservableValue<?> observableValue = contex... | @Nonnull @Override public List<ObservableValueInfo> getDependencies() { if ( _computableValue.isComputing() ) { final Transaction transaction = getTransactionComputing(); final List<ObservableValue<?>> observableValues = transaction.getObservableValues(); if ( null == observableValues ) { return Collections.emptyList()... | ComputableValueInfoImpl implements ComputableValueInfo { @Nonnull @Override public List<ObservableValueInfo> getDependencies() { if ( _computableValue.isComputing() ) { final Transaction transaction = getTransactionComputing(); final List<ObservableValue<?>> observableValues = transaction.getObservableValues(); if ( nu... | ComputableValueInfoImpl implements ComputableValueInfo { @Nonnull @Override public List<ObservableValueInfo> getDependencies() { if ( _computableValue.isComputing() ) { final Transaction transaction = getTransactionComputing(); final List<ObservableValue<?>> observableValues = transaction.getObservableValues(); if ( nu... | ComputableValueInfoImpl implements ComputableValueInfo { @Nonnull @Override public List<ObservableValueInfo> getDependencies() { if ( _computableValue.isComputing() ) { final Transaction transaction = getTransactionComputing(); final List<ObservableValue<?>> observableValues = transaction.getObservableValues(); if ( nu... | ComputableValueInfoImpl implements ComputableValueInfo { @Nonnull @Override public List<ObservableValueInfo> getDependencies() { if ( _computableValue.isComputing() ) { final Transaction transaction = getTransactionComputing(); final List<ObservableValue<?>> observableValues = transaction.getObservableValues(); if ( nu... |
@Test public void removeObserverErrorHandler_noExists() { final ObserverErrorHandlerSupport support = new ObserverErrorHandlerSupport(); final ObserverErrorHandler handler = ( observerArg, errorArg, throwableArg ) -> { }; assertInvariantFailure( () -> support.removeObserverErrorHandler( handler ), "Arez-0097: Attemptin... | void removeObserverErrorHandler( @Nonnull final ObserverErrorHandler handler ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> _handlers.contains( handler ), () -> "Arez-0097: Attempting to remove handler " + handler + " that is not in " + "the list of error handlers." ); } _handlers.remove( Objects.requ... | ObserverErrorHandlerSupport implements ObserverErrorHandler { void removeObserverErrorHandler( @Nonnull final ObserverErrorHandler handler ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> _handlers.contains( handler ), () -> "Arez-0097: Attempting to remove handler " + handler + " that is not in " + "th... | ObserverErrorHandlerSupport implements ObserverErrorHandler { void removeObserverErrorHandler( @Nonnull final ObserverErrorHandler handler ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> _handlers.contains( handler ), () -> "Arez-0097: Attempting to remove handler " + handler + " that is not in " + "th... | ObserverErrorHandlerSupport implements ObserverErrorHandler { void removeObserverErrorHandler( @Nonnull final ObserverErrorHandler handler ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> _handlers.contains( handler ), () -> "Arez-0097: Attempting to remove handler " + handler + " that is not in " + "th... | ObserverErrorHandlerSupport implements ObserverErrorHandler { void removeObserverErrorHandler( @Nonnull final ObserverErrorHandler handler ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> _handlers.contains( handler ), () -> "Arez-0097: Attempting to remove handler " + handler + " that is not in " + "th... |
@Test public void schedule() { final AtomicInteger callCount = new AtomicInteger(); final Task task = Arez.context().task( callCount::incrementAndGet ); assertEquals( callCount.get(), 1 ); assertTrue( task.isIdle() ); task.schedule(); assertEquals( callCount.get(), 2 ); } | public void schedule() { if ( isIdle() ) { queueTask(); } getContext().triggerScheduler(); } | Task extends Node { public void schedule() { if ( isIdle() ) { queueTask(); } getContext().triggerScheduler(); } } | Task extends Node { public void schedule() { if ( isIdle() ) { queueTask(); } getContext().triggerScheduler(); } Task( @Nullable final ArezContext context,
@Nullable final String name,
@Nonnull final SafeProcedure work,
final int flags ); } | Task extends Node { public void schedule() { if ( isIdle() ) { queueTask(); } getContext().triggerScheduler(); } Task( @Nullable final ArezContext context,
@Nullable final String name,
@Nonnull final SafeProcedure work,
final int flags ); void schedule(); @Override void dispose(); @Override bool... | Task extends Node { public void schedule() { if ( isIdle() ) { queueTask(); } getContext().triggerScheduler(); } Task( @Nullable final ArezContext context,
@Nullable final String name,
@Nonnull final SafeProcedure work,
final int flags ); void schedule(); @Override void dispose(); @Override bool... |
@Test public void markAsQueued_alreadyScheduled() { final Task task = new Task( Arez.context(), "X", ValueUtil::randomString, 0 ); task.markAsQueued(); assertInvariantFailure( task::markAsQueued, "Arez-0128: Attempting to queue task named 'X' when task is not idle." ); } | void markAsQueued() { if ( Arez.shouldCheckInvariants() ) { invariant( this::isIdle, () -> "Arez-0128: Attempting to queue task named '" + getName() + "' when task is not idle." ); } _flags = Flags.setState( _flags, Flags.STATE_QUEUED ); } | Task extends Node { void markAsQueued() { if ( Arez.shouldCheckInvariants() ) { invariant( this::isIdle, () -> "Arez-0128: Attempting to queue task named '" + getName() + "' when task is not idle." ); } _flags = Flags.setState( _flags, Flags.STATE_QUEUED ); } } | Task extends Node { void markAsQueued() { if ( Arez.shouldCheckInvariants() ) { invariant( this::isIdle, () -> "Arez-0128: Attempting to queue task named '" + getName() + "' when task is not idle." ); } _flags = Flags.setState( _flags, Flags.STATE_QUEUED ); } Task( @Nullable final ArezContext context,
@Nullable... | Task extends Node { void markAsQueued() { if ( Arez.shouldCheckInvariants() ) { invariant( this::isIdle, () -> "Arez-0128: Attempting to queue task named '" + getName() + "' when task is not idle." ); } _flags = Flags.setState( _flags, Flags.STATE_QUEUED ); } Task( @Nullable final ArezContext context,
@Nullable... | Task extends Node { void markAsQueued() { if ( Arez.shouldCheckInvariants() ) { invariant( this::isIdle, () -> "Arez-0128: Attempting to queue task named '" + getName() + "' when task is not idle." ); } _flags = Flags.setState( _flags, Flags.STATE_QUEUED ); } Task( @Nullable final ArezContext context,
@Nullable... |
@Test public void asInfo_spyDisabled() { ArezTestUtil.disableSpies(); final Task task = Arez.context().task( ValueUtil::randomString ); assertInvariantFailure( task::asInfo, "Arez-0130: Task.asInfo() invoked but Arez.areSpiesEnabled() returned false." ); } | Task( @Nullable final ArezContext context, @Nullable final String name, @Nonnull final SafeProcedure work, final int flags ) { super( context, name ); if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> ( ~Flags.CONFIG_FLAGS_MASK & flags ) == 0, () -> "Arez-0224: Task named '" + name + "' passed invalid flags:... | Task extends Node { Task( @Nullable final ArezContext context, @Nullable final String name, @Nonnull final SafeProcedure work, final int flags ) { super( context, name ); if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> ( ~Flags.CONFIG_FLAGS_MASK & flags ) == 0, () -> "Arez-0224: Task named '" + name + "' p... | Task extends Node { Task( @Nullable final ArezContext context, @Nullable final String name, @Nonnull final SafeProcedure work, final int flags ) { super( context, name ); if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> ( ~Flags.CONFIG_FLAGS_MASK & flags ) == 0, () -> "Arez-0224: Task named '" + name + "' p... | Task extends Node { Task( @Nullable final ArezContext context, @Nullable final String name, @Nonnull final SafeProcedure work, final int flags ) { super( context, name ); if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> ( ~Flags.CONFIG_FLAGS_MASK & flags ) == 0, () -> "Arez-0224: Task named '" + name + "' p... | Task extends Node { Task( @Nullable final ArezContext context, @Nullable final String name, @Nonnull final SafeProcedure work, final int flags ) { super( context, name ); if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> ( ~Flags.CONFIG_FLAGS_MASK & flags ) == 0, () -> "Arez-0224: Task named '" + name + "' p... |
@Test public void getPriority() { assertEquals( Task.Flags.getPriorityIndex( Task.Flags.PRIORITY_HIGHEST | Task.Flags.STATE_QUEUED ), 0 ); assertEquals( Task.Flags.getPriorityIndex( Task.Flags.PRIORITY_HIGH | Task.Flags.STATE_QUEUED ), 1 ); assertEquals( Task.Flags.getPriorityIndex( Task.Flags.PRIORITY_NORMAL | Task.Fl... | @Nonnull Priority getPriority() { return Priority.values()[ getPriorityIndex() ]; } | Task extends Node { @Nonnull Priority getPriority() { return Priority.values()[ getPriorityIndex() ]; } } | Task extends Node { @Nonnull Priority getPriority() { return Priority.values()[ getPriorityIndex() ]; } Task( @Nullable final ArezContext context,
@Nullable final String name,
@Nonnull final SafeProcedure work,
final int flags ); } | Task extends Node { @Nonnull Priority getPriority() { return Priority.values()[ getPriorityIndex() ]; } Task( @Nullable final ArezContext context,
@Nullable final String name,
@Nonnull final SafeProcedure work,
final int flags ); void schedule(); @Override void dispose(); @Override boolean isDis... | Task extends Node { @Nonnull Priority getPriority() { return Priority.values()[ getPriorityIndex() ]; } Task( @Nullable final ArezContext context,
@Nullable final String name,
@Nonnull final SafeProcedure work,
final int flags ); void schedule(); @Override void dispose(); @Override boolean isDis... |
@Test public void isVerifyActionRuleValid() { assertTrue( ActionFlags.isVerifyActionRuleValid( ActionFlags.VERIFY_ACTION_REQUIRED ) ); assertTrue( ActionFlags.isVerifyActionRuleValid( ActionFlags.NO_VERIFY_ACTION_REQUIRED ) ); assertFalse( ActionFlags.isVerifyActionRuleValid( 0 ) ); assertFalse( ActionFlags.isVerifyAct... | static boolean isVerifyActionRuleValid( final int flags ) { return VERIFY_ACTION_REQUIRED == ( flags & VERIFY_ACTION_MASK ) || NO_VERIFY_ACTION_REQUIRED == ( flags & VERIFY_ACTION_MASK ); } | ActionFlags { static boolean isVerifyActionRuleValid( final int flags ) { return VERIFY_ACTION_REQUIRED == ( flags & VERIFY_ACTION_MASK ) || NO_VERIFY_ACTION_REQUIRED == ( flags & VERIFY_ACTION_MASK ); } } | ActionFlags { static boolean isVerifyActionRuleValid( final int flags ) { return VERIFY_ACTION_REQUIRED == ( flags & VERIFY_ACTION_MASK ) || NO_VERIFY_ACTION_REQUIRED == ( flags & VERIFY_ACTION_MASK ); } private ActionFlags(); } | ActionFlags { static boolean isVerifyActionRuleValid( final int flags ) { return VERIFY_ACTION_REQUIRED == ( flags & VERIFY_ACTION_MASK ) || NO_VERIFY_ACTION_REQUIRED == ( flags & VERIFY_ACTION_MASK ); } private ActionFlags(); } | ActionFlags { static boolean isVerifyActionRuleValid( final int flags ) { return VERIFY_ACTION_REQUIRED == ( flags & VERIFY_ACTION_MASK ) || NO_VERIFY_ACTION_REQUIRED == ( flags & VERIFY_ACTION_MASK ); } private ActionFlags(); static final int READ_ONLY; static final int READ_WRITE; static final int NO_REPORT_RESULT;... |
@Test public void verifyActionRule() { assertEquals( ActionFlags.verifyActionRule( ActionFlags.VERIFY_ACTION_REQUIRED ), 0 ); assertEquals( ActionFlags.verifyActionRule( ActionFlags.NO_VERIFY_ACTION_REQUIRED ), 0 ); assertEquals( ActionFlags.verifyActionRule( 0 ), ActionFlags.VERIFY_ACTION_REQUIRED ); assertEquals( Act... | static int verifyActionRule( final int flags ) { return Arez.shouldCheckApiInvariants() ? 0 != ( flags & VERIFY_ACTION_MASK ) ? 0 : VERIFY_ACTION_REQUIRED : 0; } | ActionFlags { static int verifyActionRule( final int flags ) { return Arez.shouldCheckApiInvariants() ? 0 != ( flags & VERIFY_ACTION_MASK ) ? 0 : VERIFY_ACTION_REQUIRED : 0; } } | ActionFlags { static int verifyActionRule( final int flags ) { return Arez.shouldCheckApiInvariants() ? 0 != ( flags & VERIFY_ACTION_MASK ) ? 0 : VERIFY_ACTION_REQUIRED : 0; } private ActionFlags(); } | ActionFlags { static int verifyActionRule( final int flags ) { return Arez.shouldCheckApiInvariants() ? 0 != ( flags & VERIFY_ACTION_MASK ) ? 0 : VERIFY_ACTION_REQUIRED : 0; } private ActionFlags(); } | ActionFlags { static int verifyActionRule( final int flags ) { return Arez.shouldCheckApiInvariants() ? 0 != ( flags & VERIFY_ACTION_MASK ) ? 0 : VERIFY_ACTION_REQUIRED : 0; } private ActionFlags(); static final int READ_ONLY; static final int READ_WRITE; static final int NO_REPORT_RESULT; static final int REQUIRE_NE... |
@Test public void construction_whenSpyDisabled() { ArezTestUtil.disableSpies(); final Transaction transaction = new Transaction( Arez.context(), null, ValueUtil.randomString(), false, null, false ); ArezTestUtil.enableSpies(); assertEquals( transaction.getStartedAt(), 0 ); } | long getStartedAt() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areSpiesEnabled, () -> "Arez-0134: Transaction.getStartedAt() invoked when Arez.areSpiesEnabled() is false" ); } return _startedAt; } | Transaction { long getStartedAt() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areSpiesEnabled, () -> "Arez-0134: Transaction.getStartedAt() invoked when Arez.areSpiesEnabled() is false" ); } return _startedAt; } } | Transaction { long getStartedAt() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areSpiesEnabled, () -> "Arez-0134: Transaction.getStartedAt() invoked when Arez.areSpiesEnabled() is false" ); } return _startedAt; } Transaction( @Nullable final ArezContext context,
@Nullable final Transaction pr... | Transaction { long getStartedAt() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areSpiesEnabled, () -> "Arez-0134: Transaction.getStartedAt() invoked when Arez.areSpiesEnabled() is false" ); } return _startedAt; } Transaction( @Nullable final ArezContext context,
@Nullable final Transaction pr... | Transaction { long getStartedAt() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areSpiesEnabled, () -> "Arez-0134: Transaction.getStartedAt() invoked when Arez.areSpiesEnabled() is false" ); } return _startedAt; } Transaction( @Nullable final ArezContext context,
@Nullable final Transaction pr... |
@Test public void begin() { final ArezContext context = Arez.context(); final Observer tracker = context.computable( () -> "" ).getObserver(); final Transaction transaction = new Transaction( context, null, ValueUtil.randomString(), false, tracker, false ); Transaction.setTransaction( transaction ); assertEquals( track... | static Transaction begin( @Nonnull final ArezContext context, @Nullable final String name, final boolean mutation, @Nullable final Observer tracker ) { if ( Arez.shouldCheckApiInvariants() && Arez.shouldEnforceTransactionType() ) { if ( null != c_transaction ) { final boolean inComputableTransaction = null != tracker &... | Transaction { static Transaction begin( @Nonnull final ArezContext context, @Nullable final String name, final boolean mutation, @Nullable final Observer tracker ) { if ( Arez.shouldCheckApiInvariants() && Arez.shouldEnforceTransactionType() ) { if ( null != c_transaction ) { final boolean inComputableTransaction = nul... | Transaction { static Transaction begin( @Nonnull final ArezContext context, @Nullable final String name, final boolean mutation, @Nullable final Observer tracker ) { if ( Arez.shouldCheckApiInvariants() && Arez.shouldEnforceTransactionType() ) { if ( null != c_transaction ) { final boolean inComputableTransaction = nul... | Transaction { static Transaction begin( @Nonnull final ArezContext context, @Nullable final String name, final boolean mutation, @Nullable final Observer tracker ) { if ( Arez.shouldCheckApiInvariants() && Arez.shouldEnforceTransactionType() ) { if ( null != c_transaction ) { final boolean inComputableTransaction = nul... | Transaction { static Transaction begin( @Nonnull final ArezContext context, @Nullable final String name, final boolean mutation, @Nullable final Observer tracker ) { if ( Arez.shouldCheckApiInvariants() && Arez.shouldEnforceTransactionType() ) { if ( null != c_transaction ) { final boolean inComputableTransaction = nul... |
@Test public void commit() { final ArezContext context = Arez.context(); final ComputableValue<String> computableValue = context.computable( () -> "" ); final Observer tracker = computableValue.getObserver(); ensureDerivationHasObserver( tracker ); final Transaction transaction = new Transaction( context, null, ValueUt... | static void commit( @Nonnull final Transaction transaction ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> null != c_transaction, () -> "Arez-0122: Attempting to commit transaction named '" + transaction.getName() + "' but no transaction is active." ); assert null != c_transaction; invariant( () -> c_transac... | Transaction { static void commit( @Nonnull final Transaction transaction ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> null != c_transaction, () -> "Arez-0122: Attempting to commit transaction named '" + transaction.getName() + "' but no transaction is active." ); assert null != c_transaction; invariant( (... | Transaction { static void commit( @Nonnull final Transaction transaction ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> null != c_transaction, () -> "Arez-0122: Attempting to commit transaction named '" + transaction.getName() + "' but no transaction is active." ); assert null != c_transaction; invariant( (... | Transaction { static void commit( @Nonnull final Transaction transaction ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> null != c_transaction, () -> "Arez-0122: Attempting to commit transaction named '" + transaction.getName() + "' but no transaction is active." ); assert null != c_transaction; invariant( (... | Transaction { static void commit( @Nonnull final Transaction transaction ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> null != c_transaction, () -> "Arez-0122: Attempting to commit transaction named '" + transaction.getName() + "' but no transaction is active." ); assert null != c_transaction; invariant( (... |
@Test public void getComponent_ComputableValue_nativeComponentsDisabled() { ArezTestUtil.disableNativeComponents(); final ArezContext context = Arez.context(); final ComputableValue<Object> computableValue = context.computable( () -> "" ); assertInvariantFailure( () -> computableValue.asInfo().getComponent(), "Arez-010... | @Nullable @Override public ComponentInfo getComponent() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0109: Spy.getComponent invoked when Arez.areNativeComponentsEnabled() returns false." ); } final Component component = _computableValue.getComponent(); return null == ... | ComputableValueInfoImpl implements ComputableValueInfo { @Nullable @Override public ComponentInfo getComponent() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0109: Spy.getComponent invoked when Arez.areNativeComponentsEnabled() returns false." ); } final Component com... | ComputableValueInfoImpl implements ComputableValueInfo { @Nullable @Override public ComponentInfo getComponent() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0109: Spy.getComponent invoked when Arez.areNativeComponentsEnabled() returns false." ); } final Component com... | ComputableValueInfoImpl implements ComputableValueInfo { @Nullable @Override public ComponentInfo getComponent() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0109: Spy.getComponent invoked when Arez.areNativeComponentsEnabled() returns false." ); } final Component com... | ComputableValueInfoImpl implements ComputableValueInfo { @Nullable @Override public ComponentInfo getComponent() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0109: Spy.getComponent invoked when Arez.areNativeComponentsEnabled() returns false." ); } final Component com... |
@Test public void beginTracking() { final ArezContext context = Arez.context(); final Observer tracker = context.computable( () -> "" ).getObserver(); final Transaction transaction = new Transaction( context, null, ValueUtil.randomString(), false, tracker, false ); Transaction.setTransaction( transaction ); ensureDeriv... | void beginTracking() { if ( null != _tracker ) { if ( Arez.shouldCheckInvariants() ) { _tracker.invariantDependenciesBackLink( "Pre beginTracking" ); } if ( !_tracker.isDisposing() ) { _tracker.setState( Observer.Flags.STATE_UP_TO_DATE ); } _tracker.markDependenciesLeastStaleObserverAsUpToDate(); } } | Transaction { void beginTracking() { if ( null != _tracker ) { if ( Arez.shouldCheckInvariants() ) { _tracker.invariantDependenciesBackLink( "Pre beginTracking" ); } if ( !_tracker.isDisposing() ) { _tracker.setState( Observer.Flags.STATE_UP_TO_DATE ); } _tracker.markDependenciesLeastStaleObserverAsUpToDate(); } } } | Transaction { void beginTracking() { if ( null != _tracker ) { if ( Arez.shouldCheckInvariants() ) { _tracker.invariantDependenciesBackLink( "Pre beginTracking" ); } if ( !_tracker.isDisposing() ) { _tracker.setState( Observer.Flags.STATE_UP_TO_DATE ); } _tracker.markDependenciesLeastStaleObserverAsUpToDate(); } } Tran... | Transaction { void beginTracking() { if ( null != _tracker ) { if ( Arez.shouldCheckInvariants() ) { _tracker.invariantDependenciesBackLink( "Pre beginTracking" ); } if ( !_tracker.isDisposing() ) { _tracker.setState( Observer.Flags.STATE_UP_TO_DATE ); } _tracker.markDependenciesLeastStaleObserverAsUpToDate(); } } Tran... | Transaction { void beginTracking() { if ( null != _tracker ) { if ( Arez.shouldCheckInvariants() ) { _tracker.invariantDependenciesBackLink( "Pre beginTracking" ); } if ( !_tracker.isDisposing() ) { _tracker.setState( Observer.Flags.STATE_UP_TO_DATE ); } _tracker.markDependenciesLeastStaleObserverAsUpToDate(); } } Tran... |
@Test public void observe() { final ArezContext context = Arez.context(); final Observer tracker = context.computable( () -> "" ).getObserver(); final Transaction transaction = new Transaction( context, null, ValueUtil.randomString(), false, tracker, false ); Transaction.setTransaction( transaction ); transaction.begin... | void observe( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldCheckInvariants() ) { markTransactionAsUsed(); invariant( observableValue::isNotDisposed, () -> "Arez-0142: Invoked observe on transaction named '" + getName() + "' for observableValue " + "named '" + observableValue.getName() + "' wher... | Transaction { void observe( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldCheckInvariants() ) { markTransactionAsUsed(); invariant( observableValue::isNotDisposed, () -> "Arez-0142: Invoked observe on transaction named '" + getName() + "' for observableValue " + "named '" + observableValue.getNa... | Transaction { void observe( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldCheckInvariants() ) { markTransactionAsUsed(); invariant( observableValue::isNotDisposed, () -> "Arez-0142: Invoked observe on transaction named '" + getName() + "' for observableValue " + "named '" + observableValue.getNa... | Transaction { void observe( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldCheckInvariants() ) { markTransactionAsUsed(); invariant( observableValue::isNotDisposed, () -> "Arez-0142: Invoked observe on transaction named '" + getName() + "' for observableValue " + "named '" + observableValue.getNa... | Transaction { void observe( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldCheckInvariants() ) { markTransactionAsUsed(); invariant( observableValue::isNotDisposed, () -> "Arez-0142: Invoked observe on transaction named '" + getName() + "' for observableValue " + "named '" + observableValue.getNa... |
@Test public void processPendingDeactivations_calledOnNonRootTransaction() { final ArezContext context = Arez.context(); final Transaction transaction1 = new Transaction( context, null, ValueUtil.randomString(), false, null, false ); final Transaction transaction2 = new Transaction( context, transaction1, ValueUtil.ran... | @Nonnull String getName() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNamesEnabled, () -> "Arez-0133: Transaction.getName() invoked when Arez.areNamesEnabled() is false" ); } assert null != _name; return _name; } | Transaction { @Nonnull String getName() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNamesEnabled, () -> "Arez-0133: Transaction.getName() invoked when Arez.areNamesEnabled() is false" ); } assert null != _name; return _name; } } | Transaction { @Nonnull String getName() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNamesEnabled, () -> "Arez-0133: Transaction.getName() invoked when Arez.areNamesEnabled() is false" ); } assert null != _name; return _name; } Transaction( @Nullable final ArezContext context,
@Nullable fi... | Transaction { @Nonnull String getName() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNamesEnabled, () -> "Arez-0133: Transaction.getName() invoked when Arez.areNamesEnabled() is false" ); } assert null != _name; return _name; } Transaction( @Nullable final ArezContext context,
@Nullable fi... | Transaction { @Nonnull String getName() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNamesEnabled, () -> "Arez-0133: Transaction.getName() invoked when Arez.areNamesEnabled() is false" ); } assert null != _name; return _name; } Transaction( @Nullable final ArezContext context,
@Nullable fi... |
@Test public void verifyWriteAllowed_withReadOnlyTransaction_enforceTransactionType_set_to_false() { ArezTestUtil.noEnforceTransactionType(); final ArezContext context = Arez.context(); final Transaction transaction = new Transaction( context, null, ValueUtil.randomString(), false, null, false ); final ObservableValue<... | void verifyWriteAllowed( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldEnforceTransactionType() && Arez.shouldCheckInvariants() ) { if ( isComputableValueTracker() ) { invariant( () -> observableValue.isComputableValue() && observableValue.getObserver() == _tracker, () -> "Arez-0153: Transaction... | Transaction { void verifyWriteAllowed( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldEnforceTransactionType() && Arez.shouldCheckInvariants() ) { if ( isComputableValueTracker() ) { invariant( () -> observableValue.isComputableValue() && observableValue.getObserver() == _tracker, () -> "Arez-015... | Transaction { void verifyWriteAllowed( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldEnforceTransactionType() && Arez.shouldCheckInvariants() ) { if ( isComputableValueTracker() ) { invariant( () -> observableValue.isComputableValue() && observableValue.getObserver() == _tracker, () -> "Arez-015... | Transaction { void verifyWriteAllowed( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldEnforceTransactionType() && Arez.shouldCheckInvariants() ) { if ( isComputableValueTracker() ) { invariant( () -> observableValue.isComputableValue() && observableValue.getObserver() == _tracker, () -> "Arez-015... | Transaction { void verifyWriteAllowed( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldEnforceTransactionType() && Arez.shouldCheckInvariants() ) { if ( isComputableValueTracker() ) { invariant( () -> observableValue.isComputableValue() && observableValue.getObserver() == _tracker, () -> "Arez-015... |
@Test public void verifyWriteAllowed_withReadWriteTransaction() { final ArezContext context = Arez.context(); final Transaction transaction = new Transaction( context, null, ValueUtil.randomString(), true, null, false ); final ObservableValue<?> observableValue = context.observable(); transaction.verifyWriteAllowed( ob... | void verifyWriteAllowed( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldEnforceTransactionType() && Arez.shouldCheckInvariants() ) { if ( isComputableValueTracker() ) { invariant( () -> observableValue.isComputableValue() && observableValue.getObserver() == _tracker, () -> "Arez-0153: Transaction... | Transaction { void verifyWriteAllowed( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldEnforceTransactionType() && Arez.shouldCheckInvariants() ) { if ( isComputableValueTracker() ) { invariant( () -> observableValue.isComputableValue() && observableValue.getObserver() == _tracker, () -> "Arez-015... | Transaction { void verifyWriteAllowed( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldEnforceTransactionType() && Arez.shouldCheckInvariants() ) { if ( isComputableValueTracker() ) { invariant( () -> observableValue.isComputableValue() && observableValue.getObserver() == _tracker, () -> "Arez-015... | Transaction { void verifyWriteAllowed( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldEnforceTransactionType() && Arez.shouldCheckInvariants() ) { if ( isComputableValueTracker() ) { invariant( () -> observableValue.isComputableValue() && observableValue.getObserver() == _tracker, () -> "Arez-015... | Transaction { void verifyWriteAllowed( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldEnforceTransactionType() && Arez.shouldCheckInvariants() ) { if ( isComputableValueTracker() ) { invariant( () -> observableValue.isComputableValue() && observableValue.getObserver() == _tracker, () -> "Arez-015... |
@Test public void reportChangeConfirmed_singleUpToDateObserver() { final ArezContext context = Arez.context(); final Observer calculator = context.computable( () -> "" ).getObserver(); setCurrentTransaction( calculator ); calculator.setState( Observer.Flags.STATE_UP_TO_DATE ); final ObservableValue<?> observableValue =... | void reportChangeConfirmed( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldCheckInvariants() ) { invariant( observableValue::isNotDisposed, () -> "Arez-0149: Invoked reportChangeConfirmed on transaction named '" + getName() + "' for ObservableValue named '" + observableValue.getName() + "' where ... | Transaction { void reportChangeConfirmed( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldCheckInvariants() ) { invariant( observableValue::isNotDisposed, () -> "Arez-0149: Invoked reportChangeConfirmed on transaction named '" + getName() + "' for ObservableValue named '" + observableValue.getName... | Transaction { void reportChangeConfirmed( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldCheckInvariants() ) { invariant( observableValue::isNotDisposed, () -> "Arez-0149: Invoked reportChangeConfirmed on transaction named '" + getName() + "' for ObservableValue named '" + observableValue.getName... | Transaction { void reportChangeConfirmed( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldCheckInvariants() ) { invariant( observableValue::isNotDisposed, () -> "Arez-0149: Invoked reportChangeConfirmed on transaction named '" + getName() + "' for ObservableValue named '" + observableValue.getName... | Transaction { void reportChangeConfirmed( @Nonnull final ObservableValue<?> observableValue ) { if ( Arez.shouldCheckInvariants() ) { invariant( observableValue::isNotDisposed, () -> "Arez-0149: Invoked reportChangeConfirmed on transaction named '" + getName() + "' for ObservableValue named '" + observableValue.getName... |
@Test public void getPreviousInSameContext_zonesNotEnabled() { ArezTestUtil.disableZones(); final Transaction transaction = new Transaction( null, null, ValueUtil.randomString(), false, null, false ); assertInvariantFailure( transaction::getPreviousInSameContext, "Arez-0137: Attempted to invoke getPreviousInSameContext... | @Nonnull String getName() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNamesEnabled, () -> "Arez-0133: Transaction.getName() invoked when Arez.areNamesEnabled() is false" ); } assert null != _name; return _name; } | Transaction { @Nonnull String getName() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNamesEnabled, () -> "Arez-0133: Transaction.getName() invoked when Arez.areNamesEnabled() is false" ); } assert null != _name; return _name; } } | Transaction { @Nonnull String getName() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNamesEnabled, () -> "Arez-0133: Transaction.getName() invoked when Arez.areNamesEnabled() is false" ); } assert null != _name; return _name; } Transaction( @Nullable final ArezContext context,
@Nullable fi... | Transaction { @Nonnull String getName() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNamesEnabled, () -> "Arez-0133: Transaction.getName() invoked when Arez.areNamesEnabled() is false" ); } assert null != _name; return _name; } Transaction( @Nullable final ArezContext context,
@Nullable fi... | Transaction { @Nonnull String getName() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNamesEnabled, () -> "Arez-0133: Transaction.getName() invoked when Arez.areNamesEnabled() is false" ); } assert null != _name; return _name; } Transaction( @Nullable final ArezContext context,
@Nullable fi... |
@Test public void current() { final ArezContext context = Arez.context(); final Transaction transaction = new Transaction( context, null, ValueUtil.randomString(), false, null, false ); transaction.begin(); Transaction.setTransaction( transaction ); assertEquals( Transaction.current(), transaction ); } | @Nonnull static Transaction current() { if ( Arez.shouldCheckInvariants() ) { invariant( () -> null != c_transaction, () -> "Arez-0117: Attempting to get current transaction but no transaction is active." ); } assert null != c_transaction; return c_transaction; } | Transaction { @Nonnull static Transaction current() { if ( Arez.shouldCheckInvariants() ) { invariant( () -> null != c_transaction, () -> "Arez-0117: Attempting to get current transaction but no transaction is active." ); } assert null != c_transaction; return c_transaction; } } | Transaction { @Nonnull static Transaction current() { if ( Arez.shouldCheckInvariants() ) { invariant( () -> null != c_transaction, () -> "Arez-0117: Attempting to get current transaction but no transaction is active." ); } assert null != c_transaction; return c_transaction; } Transaction( @Nullable final ArezContext c... | Transaction { @Nonnull static Transaction current() { if ( Arez.shouldCheckInvariants() ) { invariant( () -> null != c_transaction, () -> "Arez-0117: Attempting to get current transaction but no transaction is active." ); } assert null != c_transaction; return c_transaction; } Transaction( @Nullable final ArezContext c... | Transaction { @Nonnull static Transaction current() { if ( Arez.shouldCheckInvariants() ) { invariant( () -> null != c_transaction, () -> "Arez-0117: Attempting to get current transaction but no transaction is active." ); } assert null != c_transaction; return c_transaction; } Transaction( @Nullable final ArezContext c... |
@Test public void isTransactionActive() { final ArezContext context = Arez.context(); final Transaction transaction = new Transaction( context, null, ValueUtil.randomString(), false, null, false ); transaction.begin(); assertFalse( Transaction.isTransactionActive( context ) ); Transaction.setTransaction( transaction );... | static boolean isTransactionActive( @Nonnull final ArezContext context ) { return null != c_transaction && ( !Arez.areZonesEnabled() || c_transaction.getContext() == context ); } | Transaction { static boolean isTransactionActive( @Nonnull final ArezContext context ) { return null != c_transaction && ( !Arez.areZonesEnabled() || c_transaction.getContext() == context ); } } | Transaction { static boolean isTransactionActive( @Nonnull final ArezContext context ) { return null != c_transaction && ( !Arez.areZonesEnabled() || c_transaction.getContext() == context ); } Transaction( @Nullable final ArezContext context,
@Nullable final Transaction previous,
@Nullable... | Transaction { static boolean isTransactionActive( @Nonnull final ArezContext context ) { return null != c_transaction && ( !Arez.areZonesEnabled() || c_transaction.getContext() == context ); } Transaction( @Nullable final ArezContext context,
@Nullable final Transaction previous,
@Nullable... | Transaction { static boolean isTransactionActive( @Nonnull final ArezContext context ) { return null != c_transaction && ( !Arez.areZonesEnabled() || c_transaction.getContext() == context ); } Transaction( @Nullable final ArezContext context,
@Nullable final Transaction previous,
@Nullable... |
@Test public void reportDispose() { final Transaction transaction = new Transaction( Arez.context(), null, ValueUtil.randomString(), true, null, false ); final MyDisposable node = new MyDisposable(); transaction.reportDispose( node ); node.dispose(); assertInvariantFailure( () -> transaction.reportDispose( node ), "Are... | void reportDispose( @Nonnull final Disposable disposable ) { if ( Arez.shouldCheckInvariants() ) { invariant( disposable::isNotDisposed, () -> "Arez-0176: Invoked reportDispose on transaction named '" + getName() + "' where the element is disposed." ); invariant( () -> !Arez.shouldEnforceTransactionType() || isMutation... | Transaction { void reportDispose( @Nonnull final Disposable disposable ) { if ( Arez.shouldCheckInvariants() ) { invariant( disposable::isNotDisposed, () -> "Arez-0176: Invoked reportDispose on transaction named '" + getName() + "' where the element is disposed." ); invariant( () -> !Arez.shouldEnforceTransactionType()... | Transaction { void reportDispose( @Nonnull final Disposable disposable ) { if ( Arez.shouldCheckInvariants() ) { invariant( disposable::isNotDisposed, () -> "Arez-0176: Invoked reportDispose on transaction named '" + getName() + "' where the element is disposed." ); invariant( () -> !Arez.shouldEnforceTransactionType()... | Transaction { void reportDispose( @Nonnull final Disposable disposable ) { if ( Arez.shouldCheckInvariants() ) { invariant( disposable::isNotDisposed, () -> "Arez-0176: Invoked reportDispose on transaction named '" + getName() + "' where the element is disposed." ); invariant( () -> !Arez.shouldEnforceTransactionType()... | Transaction { void reportDispose( @Nonnull final Disposable disposable ) { if ( Arez.shouldCheckInvariants() ) { invariant( disposable::isNotDisposed, () -> "Arez-0176: Invoked reportDispose on transaction named '" + getName() + "' where the element is disposed." ); invariant( () -> !Arez.shouldEnforceTransactionType()... |
@Test public void isActive() { final ArezContext context = Arez.context(); final Spy spy = context.getSpy(); final ComputableValue<String> computableValue = context.computable( () -> "" ); assertFalse( spy.asComputableValueInfo( computableValue ).isActive() ); setupReadOnlyTransaction( context ); computableValue.getObs... | @Override public boolean isActive() { return _computableValue.getObserver().isActive(); } | ComputableValueInfoImpl implements ComputableValueInfo { @Override public boolean isActive() { return _computableValue.getObserver().isActive(); } } | ComputableValueInfoImpl implements ComputableValueInfo { @Override public boolean isActive() { return _computableValue.getObserver().isActive(); } ComputableValueInfoImpl( @Nonnull final ComputableValue<?> computableValue ); } | ComputableValueInfoImpl implements ComputableValueInfo { @Override public boolean isActive() { return _computableValue.getObserver().isActive(); } ComputableValueInfoImpl( @Nonnull final ComputableValue<?> computableValue ); @Nonnull @Override String getName(); @Override boolean isComputing(); @Nonnull @Override Priori... | ComputableValueInfoImpl implements ComputableValueInfo { @Override public boolean isActive() { return _computableValue.getObserver().isActive(); } ComputableValueInfoImpl( @Nonnull final ComputableValue<?> computableValue ); @Nonnull @Override String getName(); @Override boolean isComputing(); @Nonnull @Override Priori... |
@Test public void context_when_zones_disabled() { ArezTestUtil.disableZones(); final ArezContext context1 = Arez.context(); assertNotNull( context1 ); final ArezContext context2 = Arez.context(); assertSame( context1, context2 ); } | @Nonnull public static ArezContext context() { return areZonesEnabled() ? ZoneHolder.context() : ArezContextHolder.context(); } | Arez { @Nonnull public static ArezContext context() { return areZonesEnabled() ? ZoneHolder.context() : ArezContextHolder.context(); } } | Arez { @Nonnull public static ArezContext context() { return areZonesEnabled() ? ZoneHolder.context() : ArezContextHolder.context(); } private Arez(); } | Arez { @Nonnull public static ArezContext context() { return areZonesEnabled() ? ZoneHolder.context() : ArezContextHolder.context(); } private Arez(); @OmitSymbol static boolean areZonesEnabled(); @OmitSymbol static boolean areNamesEnabled(); @OmitSymbol static boolean isVerifyEnabled(); @OmitSymbol static boolean are... | Arez { @Nonnull public static ArezContext context() { return areZonesEnabled() ? ZoneHolder.context() : ArezContextHolder.context(); } private Arez(); @OmitSymbol static boolean areZonesEnabled(); @OmitSymbol static boolean areNamesEnabled(); @OmitSymbol static boolean isVerifyEnabled(); @OmitSymbol static boolean are... |
@Test public void activateZone_whenZonesNotEnabled() { ArezTestUtil.disableZones(); assertInvariantFailure( () -> Arez.activateZone( new Zone() ), "Arez-0002: Invoked Arez.activateZone() but zones are not enabled." ); } | @OmitSymbol( unless = "arez.enable_zones" ) static void activateZone( @Nonnull final Zone zone ) { ZoneHolder.activateZone( zone ); } | Arez { @OmitSymbol( unless = "arez.enable_zones" ) static void activateZone( @Nonnull final Zone zone ) { ZoneHolder.activateZone( zone ); } } | Arez { @OmitSymbol( unless = "arez.enable_zones" ) static void activateZone( @Nonnull final Zone zone ) { ZoneHolder.activateZone( zone ); } private Arez(); } | Arez { @OmitSymbol( unless = "arez.enable_zones" ) static void activateZone( @Nonnull final Zone zone ) { ZoneHolder.activateZone( zone ); } private Arez(); @OmitSymbol static boolean areZonesEnabled(); @OmitSymbol static boolean areNamesEnabled(); @OmitSymbol static boolean isVerifyEnabled(); @OmitSymbol static boole... | Arez { @OmitSymbol( unless = "arez.enable_zones" ) static void activateZone( @Nonnull final Zone zone ) { ZoneHolder.activateZone( zone ); } private Arez(); @OmitSymbol static boolean areZonesEnabled(); @OmitSymbol static boolean areNamesEnabled(); @OmitSymbol static boolean isVerifyEnabled(); @OmitSymbol static boole... |
@Test public void deactivateZone_whenZonesNotEnabled() { ArezTestUtil.disableZones(); assertInvariantFailure( () -> Arez.deactivateZone( new Zone() ), "Arez-0003: Invoked Arez.deactivateZone() but zones are not enabled." ); } | @OmitSymbol( unless = "arez.enable_zones" ) static void deactivateZone( @Nonnull final Zone zone ) { ZoneHolder.deactivateZone( zone ); } | Arez { @OmitSymbol( unless = "arez.enable_zones" ) static void deactivateZone( @Nonnull final Zone zone ) { ZoneHolder.deactivateZone( zone ); } } | Arez { @OmitSymbol( unless = "arez.enable_zones" ) static void deactivateZone( @Nonnull final Zone zone ) { ZoneHolder.deactivateZone( zone ); } private Arez(); } | Arez { @OmitSymbol( unless = "arez.enable_zones" ) static void deactivateZone( @Nonnull final Zone zone ) { ZoneHolder.deactivateZone( zone ); } private Arez(); @OmitSymbol static boolean areZonesEnabled(); @OmitSymbol static boolean areNamesEnabled(); @OmitSymbol static boolean isVerifyEnabled(); @OmitSymbol static b... | Arez { @OmitSymbol( unless = "arez.enable_zones" ) static void deactivateZone( @Nonnull final Zone zone ) { ZoneHolder.deactivateZone( zone ); } private Arez(); @OmitSymbol static boolean areZonesEnabled(); @OmitSymbol static boolean areNamesEnabled(); @OmitSymbol static boolean isVerifyEnabled(); @OmitSymbol static b... |
@Test public void deactivateZone_whenNotActive() { ArezTestUtil.enableZones(); assertInvariantFailure( () -> Arez.deactivateZone( new Zone() ), "Arez-0004: Attempted to deactivate zone that is not active." ); } | @OmitSymbol( unless = "arez.enable_zones" ) static void deactivateZone( @Nonnull final Zone zone ) { ZoneHolder.deactivateZone( zone ); } | Arez { @OmitSymbol( unless = "arez.enable_zones" ) static void deactivateZone( @Nonnull final Zone zone ) { ZoneHolder.deactivateZone( zone ); } } | Arez { @OmitSymbol( unless = "arez.enable_zones" ) static void deactivateZone( @Nonnull final Zone zone ) { ZoneHolder.deactivateZone( zone ); } private Arez(); } | Arez { @OmitSymbol( unless = "arez.enable_zones" ) static void deactivateZone( @Nonnull final Zone zone ) { ZoneHolder.deactivateZone( zone ); } private Arez(); @OmitSymbol static boolean areZonesEnabled(); @OmitSymbol static boolean areNamesEnabled(); @OmitSymbol static boolean isVerifyEnabled(); @OmitSymbol static b... | Arez { @OmitSymbol( unless = "arez.enable_zones" ) static void deactivateZone( @Nonnull final Zone zone ) { ZoneHolder.deactivateZone( zone ); } private Arez(); @OmitSymbol static boolean areZonesEnabled(); @OmitSymbol static boolean areNamesEnabled(); @OmitSymbol static boolean isVerifyEnabled(); @OmitSymbol static b... |
@Test public void getTracker_whenNoTracker() { final ArezContext context = Arez.context(); final Transaction transaction = new Transaction( context, null, ValueUtil.randomString(), true, null, false ); final TransactionInfo info = transaction.asInfo(); assertInvariantFailure( info::getTracker, "Invoked getTracker on Tr... | @Nonnull @Override public String getName() { return getTransaction().getName(); } | TransactionInfoImpl implements TransactionInfo { @Nonnull @Override public String getName() { return getTransaction().getName(); } } | TransactionInfoImpl implements TransactionInfo { @Nonnull @Override public String getName() { return getTransaction().getName(); } TransactionInfoImpl( @Nonnull final Transaction transaction ); } | TransactionInfoImpl implements TransactionInfo { @Nonnull @Override public String getName() { return getTransaction().getName(); } TransactionInfoImpl( @Nonnull final Transaction transaction ); @Nonnull @Override String getName(); @Override boolean isReadOnly(); @Nullable @Override TransactionInfo getParent(); @Overrid... | TransactionInfoImpl implements TransactionInfo { @Nonnull @Override public String getName() { return getTransaction().getName(); } TransactionInfoImpl( @Nonnull final Transaction transaction ); @Nonnull @Override String getName(); @Override boolean isReadOnly(); @Nullable @Override TransactionInfo getParent(); @Overrid... |
@Test public void equalsAndHashCode() { final ArezContext context = Arez.context(); final Task task1 = context.task( ValueUtil::randomString ); final Task task2 = context.task( ValueUtil::randomString ); final TaskInfo info1a = task1.asInfo(); final TaskInfo info1b = new TaskInfoImpl( task1 ); final TaskInfo info2 = ta... | @Override public int hashCode() { return _task.hashCode(); } | TaskInfoImpl implements TaskInfo { @Override public int hashCode() { return _task.hashCode(); } } | TaskInfoImpl implements TaskInfo { @Override public int hashCode() { return _task.hashCode(); } TaskInfoImpl( @Nonnull final Task task ); } | TaskInfoImpl implements TaskInfo { @Override public int hashCode() { return _task.hashCode(); } TaskInfoImpl( @Nonnull final Task task ); @Nonnull @Override String getName(); @Override boolean isIdle(); @Override boolean isScheduled(); @Nonnull @Override Priority getPriority(); @Override boolean isDisposed(); @Override... | TaskInfoImpl implements TaskInfo { @Override public int hashCode() { return _task.hashCode(); } TaskInfoImpl( @Nonnull final Task task ); @Nonnull @Override String getName(); @Override boolean isIdle(); @Override boolean isScheduled(); @Nonnull @Override Priority getPriority(); @Override boolean isDisposed(); @Override... |
@Test public void asComputableValue() { final ArezContext context = Arez.context(); final String name = ValueUtil.randomString(); final ComputableValue<String> computableValue = context.computable( name, () -> "" ); final ObservableValue<String> observableValue = computableValue.getObservableValue(); final ObservableVa... | @Override public ComputableValueInfo asComputableValue() { return _observableValue.getObserver().getComputableValue().asInfo(); } | ObservableValueInfoImpl implements ObservableValueInfo { @Override public ComputableValueInfo asComputableValue() { return _observableValue.getObserver().getComputableValue().asInfo(); } } | ObservableValueInfoImpl implements ObservableValueInfo { @Override public ComputableValueInfo asComputableValue() { return _observableValue.getObserver().getComputableValue().asInfo(); } ObservableValueInfoImpl( @Nonnull final ObservableValue<?> observableValue ); } | ObservableValueInfoImpl implements ObservableValueInfo { @Override public ComputableValueInfo asComputableValue() { return _observableValue.getObserver().getComputableValue().asInfo(); } ObservableValueInfoImpl( @Nonnull final ObservableValue<?> observableValue ); @Nonnull @Override String getName(); @Override boolean ... | ObservableValueInfoImpl implements ObservableValueInfo { @Override public ComputableValueInfo asComputableValue() { return _observableValue.getObserver().getComputableValue().asInfo(); } ObservableValueInfoImpl( @Nonnull final ObservableValue<?> observableValue ); @Nonnull @Override String getName(); @Override boolean ... |
@SuppressWarnings( "EqualsWithItself" ) @Test public void equalsAndHashCode() { final ArezContext context = Arez.context(); final ObservableValue<Object> observableValue1 = context.observable(); final ObservableValue<Object> observableValue2 = context.observable(); final ObservableValueInfo info1a = observableValue1.as... | @Override public int hashCode() { return _observableValue.hashCode(); } | ObservableValueInfoImpl implements ObservableValueInfo { @Override public int hashCode() { return _observableValue.hashCode(); } } | ObservableValueInfoImpl implements ObservableValueInfo { @Override public int hashCode() { return _observableValue.hashCode(); } ObservableValueInfoImpl( @Nonnull final ObservableValue<?> observableValue ); } | ObservableValueInfoImpl implements ObservableValueInfo { @Override public int hashCode() { return _observableValue.hashCode(); } ObservableValueInfoImpl( @Nonnull final ObservableValue<?> observableValue ); @Nonnull @Override String getName(); @Override boolean isComputableValue(); @Override ComputableValueInfo asCompu... | ObservableValueInfoImpl implements ObservableValueInfo { @Override public int hashCode() { return _observableValue.hashCode(); } ObservableValueInfoImpl( @Nonnull final ObservableValue<?> observableValue ); @Nonnull @Override String getName(); @Override boolean isComputableValue(); @Override ComputableValueInfo asCompu... |
@Test public void isComputableValue() { final ArezContext context = Arez.context(); final Spy spy = context.getSpy(); assertTrue( spy.asObservableValueInfo( context.computable( () -> "" ).getObservableValue() ).isComputableValue() ); assertFalse( spy.asObservableValueInfo( context.observable() ).isComputableValue() ); ... | @Override public boolean isComputableValue() { return _observableValue.isComputableValue(); } | ObservableValueInfoImpl implements ObservableValueInfo { @Override public boolean isComputableValue() { return _observableValue.isComputableValue(); } } | ObservableValueInfoImpl implements ObservableValueInfo { @Override public boolean isComputableValue() { return _observableValue.isComputableValue(); } ObservableValueInfoImpl( @Nonnull final ObservableValue<?> observableValue ); } | ObservableValueInfoImpl implements ObservableValueInfo { @Override public boolean isComputableValue() { return _observableValue.isComputableValue(); } ObservableValueInfoImpl( @Nonnull final ObservableValue<?> observableValue ); @Nonnull @Override String getName(); @Override boolean isComputableValue(); @Override Compu... | ObservableValueInfoImpl implements ObservableValueInfo { @Override public boolean isComputableValue() { return _observableValue.isComputableValue(); } ObservableValueInfoImpl( @Nonnull final ObservableValue<?> observableValue ); @Nonnull @Override String getName(); @Override boolean isComputableValue(); @Override Compu... |
@Test public void getComponent_Observable_nativeComponentsDisabled() { ArezTestUtil.disableNativeComponents(); final ArezContext context = Arez.context(); final ObservableValue<Object> value = context.observable(); assertInvariantFailure( () -> value.asInfo().getComponent(), "Arez-0107: Spy.getComponent invoked when Ar... | @Nullable @Override public ComponentInfo getComponent() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0107: Spy.getComponent invoked when Arez.areNativeComponentsEnabled() returns false." ); } final Component component = _observableValue.getComponent(); return null == ... | ObservableValueInfoImpl implements ObservableValueInfo { @Nullable @Override public ComponentInfo getComponent() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0107: Spy.getComponent invoked when Arez.areNativeComponentsEnabled() returns false." ); } final Component com... | ObservableValueInfoImpl implements ObservableValueInfo { @Nullable @Override public ComponentInfo getComponent() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0107: Spy.getComponent invoked when Arez.areNativeComponentsEnabled() returns false." ); } final Component com... | ObservableValueInfoImpl implements ObservableValueInfo { @Nullable @Override public ComponentInfo getComponent() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0107: Spy.getComponent invoked when Arez.areNativeComponentsEnabled() returns false." ); } final Component com... | ObservableValueInfoImpl implements ObservableValueInfo { @Nullable @Override public ComponentInfo getComponent() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areNativeComponentsEnabled, () -> "Arez-0107: Spy.getComponent invoked when Arez.areNativeComponentsEnabled() returns false." ); } final Component com... |
@Test public void getObservers() { final ArezContext context = Arez.context(); final Spy spy = context.getSpy(); final ComputableValue<?> computableValue = context.computable( () -> "" ); assertEquals( spy.asComputableValueInfo( computableValue ).getObservers().size(), 0 ); final Observer observer = context.observer( n... | @Nonnull @Override public List<ObserverInfo> getObservers() { return ObserverInfoImpl.asUnmodifiableInfos( _computableValue.getObservableValue().getObservers() ); } | ComputableValueInfoImpl implements ComputableValueInfo { @Nonnull @Override public List<ObserverInfo> getObservers() { return ObserverInfoImpl.asUnmodifiableInfos( _computableValue.getObservableValue().getObservers() ); } } | ComputableValueInfoImpl implements ComputableValueInfo { @Nonnull @Override public List<ObserverInfo> getObservers() { return ObserverInfoImpl.asUnmodifiableInfos( _computableValue.getObservableValue().getObservers() ); } ComputableValueInfoImpl( @Nonnull final ComputableValue<?> computableValue ); } | ComputableValueInfoImpl implements ComputableValueInfo { @Nonnull @Override public List<ObserverInfo> getObservers() { return ObserverInfoImpl.asUnmodifiableInfos( _computableValue.getObservableValue().getObservers() ); } ComputableValueInfoImpl( @Nonnull final ComputableValue<?> computableValue ); @Nonnull @Override S... | ComputableValueInfoImpl implements ComputableValueInfo { @Nonnull @Override public List<ObserverInfo> getObservers() { return ObserverInfoImpl.asUnmodifiableInfos( _computableValue.getObservableValue().getObservers() ); } ComputableValueInfoImpl( @Nonnull final ComputableValue<?> computableValue ); @Nonnull @Override S... |
@Test public void removeSpyEventHandler_noExists() { final SpyEventHandlerSupport support = new SpyEventHandlerSupport(); final SpyEventHandler handler = new TestSpyEventHandler( Arez.context() ); assertInvariantFailure( () -> support.removeSpyEventHandler( handler ), "Arez-0103: Attempting to remove handler " + handle... | void removeSpyEventHandler( @Nonnull final SpyEventHandler handler ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> _spyEventHandlers.contains( handler ), () -> "Arez-0103: Attempting to remove handler " + handler + " that is not " + "in the list of spy handlers." ); } _spyEventHandlers.remove( Objects.... | SpyEventHandlerSupport { void removeSpyEventHandler( @Nonnull final SpyEventHandler handler ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> _spyEventHandlers.contains( handler ), () -> "Arez-0103: Attempting to remove handler " + handler + " that is not " + "in the list of spy handlers." ); } _spyEvent... | SpyEventHandlerSupport { void removeSpyEventHandler( @Nonnull final SpyEventHandler handler ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> _spyEventHandlers.contains( handler ), () -> "Arez-0103: Attempting to remove handler " + handler + " that is not " + "in the list of spy handlers." ); } _spyEvent... | SpyEventHandlerSupport { void removeSpyEventHandler( @Nonnull final SpyEventHandler handler ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> _spyEventHandlers.contains( handler ), () -> "Arez-0103: Attempting to remove handler " + handler + " that is not " + "in the list of spy handlers." ); } _spyEvent... | SpyEventHandlerSupport { void removeSpyEventHandler( @Nonnull final SpyEventHandler handler ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> _spyEventHandlers.contains( handler ), () -> "Arez-0103: Attempting to remove handler " + handler + " that is not " + "in the list of spy handlers." ); } _spyEvent... |
@Test public void observable_getValue_introspectorsDisabled() { ArezTestUtil.disablePropertyIntrospectors(); final ArezContext context = Arez.context(); final ObservableValue<Integer> computableValue1 = context.observable(); assertInvariantFailure( () -> context.action( () -> computableValue1.asInfo().getValue() ), "Ar... | @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0111: Spy.getValue invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } final PropertyAccessor<?> accessor = _observableValue.getAccesso... | ObservableValueInfoImpl implements ObservableValueInfo { @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0111: Spy.getValue invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } final P... | ObservableValueInfoImpl implements ObservableValueInfo { @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0111: Spy.getValue invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } final P... | ObservableValueInfoImpl implements ObservableValueInfo { @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0111: Spy.getValue invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } final P... | ObservableValueInfoImpl implements ObservableValueInfo { @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0111: Spy.getValue invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } final P... |
@Test public void observable_hasAccessor_introspectorsDisabled() { ArezTestUtil.disablePropertyIntrospectors(); final ArezContext context = Arez.context(); final ObservableValue<Integer> observableValue = context.observable(); assertInvariantFailure( () -> context.action( () -> observableValue.asInfo().hasAccessor() ),... | @Override public boolean hasAccessor() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0110: Spy.hasAccessor invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } return null != _observableValue.getAccessor(); } | ObservableValueInfoImpl implements ObservableValueInfo { @Override public boolean hasAccessor() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0110: Spy.hasAccessor invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } return null != _observableV... | ObservableValueInfoImpl implements ObservableValueInfo { @Override public boolean hasAccessor() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0110: Spy.hasAccessor invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } return null != _observableV... | ObservableValueInfoImpl implements ObservableValueInfo { @Override public boolean hasAccessor() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0110: Spy.hasAccessor invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } return null != _observableV... | ObservableValueInfoImpl implements ObservableValueInfo { @Override public boolean hasAccessor() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0110: Spy.hasAccessor invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } return null != _observableV... |
@Test public void observable_hasMutator_introspectorsDisabled() { ArezTestUtil.disablePropertyIntrospectors(); final ArezContext context = Arez.context(); final ObservableValue<Integer> observableValue = context.observable(); assertInvariantFailure( () -> context.action( () -> observableValue.asInfo().hasMutator() ), "... | @Override public boolean hasMutator() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0113: Spy.hasMutator invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } return null != _observableValue.getMutator(); } | ObservableValueInfoImpl implements ObservableValueInfo { @Override public boolean hasMutator() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0113: Spy.hasMutator invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } return null != _observableVal... | ObservableValueInfoImpl implements ObservableValueInfo { @Override public boolean hasMutator() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0113: Spy.hasMutator invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } return null != _observableVal... | ObservableValueInfoImpl implements ObservableValueInfo { @Override public boolean hasMutator() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0113: Spy.hasMutator invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } return null != _observableVal... | ObservableValueInfoImpl implements ObservableValueInfo { @Override public boolean hasMutator() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0113: Spy.hasMutator invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } return null != _observableVal... |
@Test public void observable_setValue_introspectorsDisabled() { ArezTestUtil.disablePropertyIntrospectors(); final ArezContext context = Arez.context(); final ObservableValue<Integer> observableValue = context.observable(); assertInvariantFailure( () -> context.action( () -> observableValue.asInfo().setValue( 44 ) ), "... | @SuppressWarnings( { "unchecked", "rawtypes" } ) @Override public void setValue( @Nullable final Object value ) throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0114: Spy.setValue invoked when Arez.arePropertyIntrospectorsEnabled() returns false." );... | ObservableValueInfoImpl implements ObservableValueInfo { @SuppressWarnings( { "unchecked", "rawtypes" } ) @Override public void setValue( @Nullable final Object value ) throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0114: Spy.setValue invoked when ... | ObservableValueInfoImpl implements ObservableValueInfo { @SuppressWarnings( { "unchecked", "rawtypes" } ) @Override public void setValue( @Nullable final Object value ) throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0114: Spy.setValue invoked when ... | ObservableValueInfoImpl implements ObservableValueInfo { @SuppressWarnings( { "unchecked", "rawtypes" } ) @Override public void setValue( @Nullable final Object value ) throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0114: Spy.setValue invoked when ... | ObservableValueInfoImpl implements ObservableValueInfo { @SuppressWarnings( { "unchecked", "rawtypes" } ) @Override public void setValue( @Nullable final Object value ) throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0114: Spy.setValue invoked when ... |
@Test public void highPriorityComputableValue() { final ComputableValue<String> computableValue = Arez.context().computable( () -> "", ComputableValue.Flags.PRIORITY_HIGH ); assertEquals( computableValue.getObserver().getTask().getPriority(), Priority.HIGH ); } | @Nonnull Observer getObserver() { return _observer; } | ComputableValue extends Node { @Nonnull Observer getObserver() { return _observer; } } | ComputableValue extends Node { @Nonnull Observer getObserver() { return _observer; } ComputableValue( @Nullable final ArezContext context,
@Nullable final Component component,
@Nullable final String name,
@Nonnull final SafeFunction<T> function,
... | ComputableValue extends Node { @Nonnull Observer getObserver() { return _observer; } ComputableValue( @Nullable final ArezContext context,
@Nullable final Component component,
@Nullable final String name,
@Nonnull final SafeFunction<T> function,
... | ComputableValue extends Node { @Nonnull Observer getObserver() { return _observer; } ComputableValue( @Nullable final ArezContext context,
@Nullable final Component component,
@Nullable final String name,
@Nonnull final SafeFunction<T> function,
... |
@Test public void computeValue() { final ArezContext context = Arez.context(); final AtomicReference<String> value = new AtomicReference<>(); final AtomicReference<ComputableValue<String>> ref = new AtomicReference<>(); value.set( "" ); final SafeFunction<String> function = () -> { observeADependency(); assertTrue( ref... | T computeValue() { if ( Arez.shouldCheckInvariants() ) { _computing = true; } try { return _function.call(); } finally { if ( Arez.shouldCheckInvariants() ) { _computing = false; } } } | ComputableValue extends Node { T computeValue() { if ( Arez.shouldCheckInvariants() ) { _computing = true; } try { return _function.call(); } finally { if ( Arez.shouldCheckInvariants() ) { _computing = false; } } } } | ComputableValue extends Node { T computeValue() { if ( Arez.shouldCheckInvariants() ) { _computing = true; } try { return _function.call(); } finally { if ( Arez.shouldCheckInvariants() ) { _computing = false; } } } ComputableValue( @Nullable final ArezContext context,
@Nullable final Component compo... | ComputableValue extends Node { T computeValue() { if ( Arez.shouldCheckInvariants() ) { _computing = true; } try { return _function.call(); } finally { if ( Arez.shouldCheckInvariants() ) { _computing = false; } } } ComputableValue( @Nullable final ArezContext context,
@Nullable final Component compo... | ComputableValue extends Node { T computeValue() { if ( Arez.shouldCheckInvariants() ) { _computing = true; } try { return _function.call(); } finally { if ( Arez.shouldCheckInvariants() ) { _computing = false; } } } ComputableValue( @Nullable final ArezContext context,
@Nullable final Component compo... |
@Test public void compute() { final ArezContext context = Arez.context(); final String name = ValueUtil.randomString(); final AtomicReference<String> value = new AtomicReference<>(); final String value1 = ValueUtil.randomString(); final String value2 = ValueUtil.randomString(); final SafeFunction<String> function = () ... | void compute() { final T oldValue = _value; try { final T newValue = computeValue(); if ( !Objects.equals( oldValue, newValue ) ) { _value = newValue; _error = null; getObservableValue().reportChangeConfirmed(); } if ( Arez.shouldCheckApiInvariants() ) { if ( getObserver().areArezDependenciesRequired() ) { final List<O... | ComputableValue extends Node { void compute() { final T oldValue = _value; try { final T newValue = computeValue(); if ( !Objects.equals( oldValue, newValue ) ) { _value = newValue; _error = null; getObservableValue().reportChangeConfirmed(); } if ( Arez.shouldCheckApiInvariants() ) { if ( getObserver().areArezDependen... | ComputableValue extends Node { void compute() { final T oldValue = _value; try { final T newValue = computeValue(); if ( !Objects.equals( oldValue, newValue ) ) { _value = newValue; _error = null; getObservableValue().reportChangeConfirmed(); } if ( Arez.shouldCheckApiInvariants() ) { if ( getObserver().areArezDependen... | ComputableValue extends Node { void compute() { final T oldValue = _value; try { final T newValue = computeValue(); if ( !Objects.equals( oldValue, newValue ) ) { _value = newValue; _error = null; getObservableValue().reportChangeConfirmed(); } if ( Arez.shouldCheckApiInvariants() ) { if ( getObserver().areArezDependen... | ComputableValue extends Node { void compute() { final T oldValue = _value; try { final T newValue = computeValue(); if ( !Objects.equals( oldValue, newValue ) ) { _value = newValue; _error = null; getObservableValue().reportChangeConfirmed(); } if ( Arez.shouldCheckApiInvariants() ) { if ( getObserver().areArezDependen... |
@Test public void compute_noDependencies() { ignoreObserverErrors(); final ArezContext context = Arez.context(); final ComputableValue<String> computableValue = context.computable( "XYZ", ValueUtil::randomString, ComputableValue.Flags.KEEPALIVE | ComputableValue.Flags.RUN_LATER ); assertInvariantFailure( () -> Arez.con... | public T get() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_computing, () -> "Arez-0049: Detected a cycle deriving ComputableValue named '" + getName() + "'." ); apiInvariant( _observer::isNotDisposed, () -> "Arez-0050: ComputableValue named '" + getName() + "' accessed after it has been disposed." ... | ComputableValue extends Node { public T get() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_computing, () -> "Arez-0049: Detected a cycle deriving ComputableValue named '" + getName() + "'." ); apiInvariant( _observer::isNotDisposed, () -> "Arez-0050: ComputableValue named '" + getName() + "' accesse... | ComputableValue extends Node { public T get() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_computing, () -> "Arez-0049: Detected a cycle deriving ComputableValue named '" + getName() + "'." ); apiInvariant( _observer::isNotDisposed, () -> "Arez-0050: ComputableValue named '" + getName() + "' accesse... | ComputableValue extends Node { public T get() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_computing, () -> "Arez-0049: Detected a cycle deriving ComputableValue named '" + getName() + "'." ); apiInvariant( _observer::isNotDisposed, () -> "Arez-0050: ComputableValue named '" + getName() + "' accesse... | ComputableValue extends Node { public T get() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_computing, () -> "Arez-0049: Detected a cycle deriving ComputableValue named '" + getName() + "'." ); apiInvariant( _observer::isNotDisposed, () -> "Arez-0050: ComputableValue named '" + getName() + "' accesse... |
@Test public void dispose() { final ArezContext context = Arez.context(); final ComputableValue<String> computableValue = context.computable( () -> "" ); final Observer observer = computableValue.getObserver(); setCurrentTransaction( observer ); observer.setState( Observer.Flags.STATE_UP_TO_DATE ); assertFalse( observe... | @Override public void dispose() { if ( isNotDisposed() ) { if ( Arez.shouldCheckInvariants() ) { getContext().safeAction( Arez.areNamesEnabled() ? getName() + ".dispose" : null, () -> getContext().getTransaction().reportDispose( this ), ActionFlags.NO_VERIFY_ACTION_REQUIRED ); } _disposed = true; _value = null; _error ... | ComputableValue extends Node { @Override public void dispose() { if ( isNotDisposed() ) { if ( Arez.shouldCheckInvariants() ) { getContext().safeAction( Arez.areNamesEnabled() ? getName() + ".dispose" : null, () -> getContext().getTransaction().reportDispose( this ), ActionFlags.NO_VERIFY_ACTION_REQUIRED ); } _disposed... | ComputableValue extends Node { @Override public void dispose() { if ( isNotDisposed() ) { if ( Arez.shouldCheckInvariants() ) { getContext().safeAction( Arez.areNamesEnabled() ? getName() + ".dispose" : null, () -> getContext().getTransaction().reportDispose( this ), ActionFlags.NO_VERIFY_ACTION_REQUIRED ); } _disposed... | ComputableValue extends Node { @Override public void dispose() { if ( isNotDisposed() ) { if ( Arez.shouldCheckInvariants() ) { getContext().safeAction( Arez.areNamesEnabled() ? getName() + ".dispose" : null, () -> getContext().getTransaction().reportDispose( this ), ActionFlags.NO_VERIFY_ACTION_REQUIRED ); } _disposed... | ComputableValue extends Node { @Override public void dispose() { if ( isNotDisposed() ) { if ( Arez.shouldCheckInvariants() ) { getContext().safeAction( Arez.areNamesEnabled() ? getName() + ".dispose" : null, () -> getContext().getTransaction().reportDispose( this ), ActionFlags.NO_VERIFY_ACTION_REQUIRED ); } _disposed... |
@Test public void reportPossiblyChanged_observerUpToDate() { final ArezContext context = Arez.context(); final AtomicInteger computedCallCount = new AtomicInteger(); final AtomicInteger autorunCallCount = new AtomicInteger(); final AtomicInteger result = new AtomicInteger(); final AtomicReference<String> expected = new... | public T get() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_computing, () -> "Arez-0049: Detected a cycle deriving ComputableValue named '" + getName() + "'." ); apiInvariant( _observer::isNotDisposed, () -> "Arez-0050: ComputableValue named '" + getName() + "' accessed after it has been disposed." ... | ComputableValue extends Node { public T get() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_computing, () -> "Arez-0049: Detected a cycle deriving ComputableValue named '" + getName() + "'." ); apiInvariant( _observer::isNotDisposed, () -> "Arez-0050: ComputableValue named '" + getName() + "' accesse... | ComputableValue extends Node { public T get() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_computing, () -> "Arez-0049: Detected a cycle deriving ComputableValue named '" + getName() + "'." ); apiInvariant( _observer::isNotDisposed, () -> "Arez-0050: ComputableValue named '" + getName() + "' accesse... | ComputableValue extends Node { public T get() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_computing, () -> "Arez-0049: Detected a cycle deriving ComputableValue named '" + getName() + "'." ); apiInvariant( _observer::isNotDisposed, () -> "Arez-0050: ComputableValue named '" + getName() + "' accesse... | ComputableValue extends Node { public T get() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_computing, () -> "Arez-0049: Detected a cycle deriving ComputableValue named '" + getName() + "'." ); apiInvariant( _observer::isNotDisposed, () -> "Arez-0050: ComputableValue named '" + getName() + "' accesse... |
@Test public void computableValue_introspection_noObservers() throws Throwable { final ArezContext context = Arez.context(); final ComputableValue<String> computableValue1 = context.computable( () -> { observeADependency(); return "42"; } ); assertNull( computableValue1.asInfo().getValue() ); } | @OmitSymbol( unless = "arez.enable_property_introspection" ) @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0116: Spy.getValue invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } fin... | ComputableValueInfoImpl implements ComputableValueInfo { @OmitSymbol( unless = "arez.enable_property_introspection" ) @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0116: Spy.getValue invoked when Arez.a... | ComputableValueInfoImpl implements ComputableValueInfo { @OmitSymbol( unless = "arez.enable_property_introspection" ) @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0116: Spy.getValue invoked when Arez.a... | ComputableValueInfoImpl implements ComputableValueInfo { @OmitSymbol( unless = "arez.enable_property_introspection" ) @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0116: Spy.getValue invoked when Arez.a... | ComputableValueInfoImpl implements ComputableValueInfo { @OmitSymbol( unless = "arez.enable_property_introspection" ) @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0116: Spy.getValue invoked when Arez.a... |
@Test public void reportPossiblyChanged_readOnlyTransaction() { final ArezContext context = Arez.context(); final AtomicInteger computedCallCount = new AtomicInteger(); final AtomicInteger autorunCallCount = new AtomicInteger(); final ObservableValue<Object> observableValue = context.observable(); final SafeFunction<St... | public T get() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_computing, () -> "Arez-0049: Detected a cycle deriving ComputableValue named '" + getName() + "'." ); apiInvariant( _observer::isNotDisposed, () -> "Arez-0050: ComputableValue named '" + getName() + "' accessed after it has been disposed." ... | ComputableValue extends Node { public T get() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_computing, () -> "Arez-0049: Detected a cycle deriving ComputableValue named '" + getName() + "'." ); apiInvariant( _observer::isNotDisposed, () -> "Arez-0050: ComputableValue named '" + getName() + "' accesse... | ComputableValue extends Node { public T get() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_computing, () -> "Arez-0049: Detected a cycle deriving ComputableValue named '" + getName() + "'." ); apiInvariant( _observer::isNotDisposed, () -> "Arez-0050: ComputableValue named '" + getName() + "' accesse... | ComputableValue extends Node { public T get() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_computing, () -> "Arez-0049: Detected a cycle deriving ComputableValue named '" + getName() + "'." ); apiInvariant( _observer::isNotDisposed, () -> "Arez-0050: ComputableValue named '" + getName() + "' accesse... | ComputableValue extends Node { public T get() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_computing, () -> "Arez-0049: Detected a cycle deriving ComputableValue named '" + getName() + "'." ); apiInvariant( _observer::isNotDisposed, () -> "Arez-0050: ComputableValue named '" + getName() + "' accesse... |
@Test public void asInfo() { final ArezContext context = Arez.context(); final SafeFunction<String> function = () -> { observeADependency(); return ""; }; final ComputableValue<String> computableValue = context.computable( function ); final ComputableValueInfo info = computableValue.asInfo(); assertEquals( info.getName... | @SuppressWarnings( "ConstantConditions" ) @OmitSymbol( unless = "arez.enable_spies" ) @Nonnull ComputableValueInfo asInfo() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areSpiesEnabled, () -> "Arez-0195: ComputableValue.asInfo() invoked but Arez.areSpiesEnabled() returned false." ); } if ( Arez.areSpiesEnab... | ComputableValue extends Node { @SuppressWarnings( "ConstantConditions" ) @OmitSymbol( unless = "arez.enable_spies" ) @Nonnull ComputableValueInfo asInfo() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areSpiesEnabled, () -> "Arez-0195: ComputableValue.asInfo() invoked but Arez.areSpiesEnabled() returned fals... | ComputableValue extends Node { @SuppressWarnings( "ConstantConditions" ) @OmitSymbol( unless = "arez.enable_spies" ) @Nonnull ComputableValueInfo asInfo() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areSpiesEnabled, () -> "Arez-0195: ComputableValue.asInfo() invoked but Arez.areSpiesEnabled() returned fals... | ComputableValue extends Node { @SuppressWarnings( "ConstantConditions" ) @OmitSymbol( unless = "arez.enable_spies" ) @Nonnull ComputableValueInfo asInfo() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areSpiesEnabled, () -> "Arez-0195: ComputableValue.asInfo() invoked but Arez.areSpiesEnabled() returned fals... | ComputableValue extends Node { @SuppressWarnings( "ConstantConditions" ) @OmitSymbol( unless = "arez.enable_spies" ) @Nonnull ComputableValueInfo asInfo() { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::areSpiesEnabled, () -> "Arez-0195: ComputableValue.asInfo() invoked but Arez.areSpiesEnabled() returned fals... |
@Test public void incrementKeepAliveRefCount() { final ArezContext context = Arez.context(); final ObservableValue<Object> observable = context.observable(); final AtomicInteger calls = new AtomicInteger(); final SafeFunction<String> function = () -> { observable.reportObserved(); calls.incrementAndGet(); return ""; };... | void incrementKeepAliveRefCount() { keepAliveInvariants(); _keepAliveRefCount++; if ( 1 == _keepAliveRefCount ) { final ObservableValue<T> observableValue = getObservableValue(); if ( !observableValue.isActive() ) { final ArezContext context = getContext(); if ( context.isTransactionActive() ) { get(); } else { context... | ComputableValue extends Node { void incrementKeepAliveRefCount() { keepAliveInvariants(); _keepAliveRefCount++; if ( 1 == _keepAliveRefCount ) { final ObservableValue<T> observableValue = getObservableValue(); if ( !observableValue.isActive() ) { final ArezContext context = getContext(); if ( context.isTransactionActiv... | ComputableValue extends Node { void incrementKeepAliveRefCount() { keepAliveInvariants(); _keepAliveRefCount++; if ( 1 == _keepAliveRefCount ) { final ObservableValue<T> observableValue = getObservableValue(); if ( !observableValue.isActive() ) { final ArezContext context = getContext(); if ( context.isTransactionActiv... | ComputableValue extends Node { void incrementKeepAliveRefCount() { keepAliveInvariants(); _keepAliveRefCount++; if ( 1 == _keepAliveRefCount ) { final ObservableValue<T> observableValue = getObservableValue(); if ( !observableValue.isActive() ) { final ArezContext context = getContext(); if ( context.isTransactionActiv... | ComputableValue extends Node { void incrementKeepAliveRefCount() { keepAliveInvariants(); _keepAliveRefCount++; if ( 1 == _keepAliveRefCount ) { final ObservableValue<T> observableValue = getObservableValue(); if ( !observableValue.isActive() ) { final ArezContext context = getContext(); if ( context.isTransactionActiv... |
@Test public void incrementKeepAliveRefCount_badInitialRefCount() { final ArezContext context = Arez.context(); final ObservableValue<Object> observable = context.observable(); final SafeFunction<String> function = () -> { observable.reportObserved(); return ""; }; final ComputableValue<String> computableValue = contex... | @OmitSymbol void setKeepAliveRefCount( final int keepAliveRefCount ) { _keepAliveRefCount = keepAliveRefCount; } | ComputableValue extends Node { @OmitSymbol void setKeepAliveRefCount( final int keepAliveRefCount ) { _keepAliveRefCount = keepAliveRefCount; } } | ComputableValue extends Node { @OmitSymbol void setKeepAliveRefCount( final int keepAliveRefCount ) { _keepAliveRefCount = keepAliveRefCount; } ComputableValue( @Nullable final ArezContext context,
@Nullable final Component component,
@Nullable final String name,
... | ComputableValue extends Node { @OmitSymbol void setKeepAliveRefCount( final int keepAliveRefCount ) { _keepAliveRefCount = keepAliveRefCount; } ComputableValue( @Nullable final ArezContext context,
@Nullable final Component component,
@Nullable final String name,
... | ComputableValue extends Node { @OmitSymbol void setKeepAliveRefCount( final int keepAliveRefCount ) { _keepAliveRefCount = keepAliveRefCount; } ComputableValue( @Nullable final ArezContext context,
@Nullable final Component component,
@Nullable final String name,
... |
@Test public void decrementKeepAliveRefCount() { final ArezContext context = Arez.context(); final ObservableValue<Object> observable = context.observable(); final AtomicInteger calls = new AtomicInteger(); final SafeFunction<String> function = () -> { observable.reportObserved(); calls.incrementAndGet(); return ""; };... | void decrementKeepAliveRefCount() { _keepAliveRefCount--; keepAliveInvariants(); if ( 0 == _keepAliveRefCount ) { final ObservableValue<T> observableValue = getObservableValue(); final ArezContext context = getContext(); if ( context.isTransactionActive() ) { if ( !observableValue.isPendingDeactivation() ) { context.ge... | ComputableValue extends Node { void decrementKeepAliveRefCount() { _keepAliveRefCount--; keepAliveInvariants(); if ( 0 == _keepAliveRefCount ) { final ObservableValue<T> observableValue = getObservableValue(); final ArezContext context = getContext(); if ( context.isTransactionActive() ) { if ( !observableValue.isPendi... | ComputableValue extends Node { void decrementKeepAliveRefCount() { _keepAliveRefCount--; keepAliveInvariants(); if ( 0 == _keepAliveRefCount ) { final ObservableValue<T> observableValue = getObservableValue(); final ArezContext context = getContext(); if ( context.isTransactionActive() ) { if ( !observableValue.isPendi... | ComputableValue extends Node { void decrementKeepAliveRefCount() { _keepAliveRefCount--; keepAliveInvariants(); if ( 0 == _keepAliveRefCount ) { final ObservableValue<T> observableValue = getObservableValue(); final ArezContext context = getContext(); if ( context.isTransactionActive() ) { if ( !observableValue.isPendi... | ComputableValue extends Node { void decrementKeepAliveRefCount() { _keepAliveRefCount--; keepAliveInvariants(); if ( 0 == _keepAliveRefCount ) { final ObservableValue<T> observableValue = getObservableValue(); final ArezContext context = getContext(); if ( context.isTransactionActive() ) { if ( !observableValue.isPendi... |
@Test public void keepAlive() { final ArezContext context = Arez.context(); final ObservableValue<Object> observable = context.observable(); final AtomicInteger calls = new AtomicInteger(); final SafeFunction<String> function = () -> { observable.reportObserved(); calls.incrementAndGet(); return ""; }; final Computable... | @Nonnull public Disposable keepAlive() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !getObserver().isKeepAlive(), () -> "Arez-0223: ComputableValue.keepAlive() was invoked on computable value named '" + getName() + "' but invoking this method when the computable value has been configured " + "with the... | ComputableValue extends Node { @Nonnull public Disposable keepAlive() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !getObserver().isKeepAlive(), () -> "Arez-0223: ComputableValue.keepAlive() was invoked on computable value named '" + getName() + "' but invoking this method when the computable value ha... | ComputableValue extends Node { @Nonnull public Disposable keepAlive() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !getObserver().isKeepAlive(), () -> "Arez-0223: ComputableValue.keepAlive() was invoked on computable value named '" + getName() + "' but invoking this method when the computable value ha... | ComputableValue extends Node { @Nonnull public Disposable keepAlive() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !getObserver().isKeepAlive(), () -> "Arez-0223: ComputableValue.keepAlive() was invoked on computable value named '" + getName() + "' but invoking this method when the computable value ha... | ComputableValue extends Node { @Nonnull public Disposable keepAlive() { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !getObserver().isKeepAlive(), () -> "Arez-0223: ComputableValue.keepAlive() was invoked on computable value named '" + getName() + "' but invoking this method when the computable value ha... |
@Test public void unresolvedComponent() { final JavaFileObject source1 = fixture( "unresolved/com/example/component/UnresolvedComponent.java" ); final List<JavaFileObject> inputs = Collections.singletonList( source1 ); assertFailedCompileResource( inputs, "ArezProcessor unable to process com.example.component.Unresolve... | @Nonnull @Override protected String getOptionPrefix() { return "arez"; } | ArezProcessor extends AbstractStandardProcessor { @Nonnull @Override protected String getOptionPrefix() { return "arez"; } } | ArezProcessor extends AbstractStandardProcessor { @Nonnull @Override protected String getOptionPrefix() { return "arez"; } } | ArezProcessor extends AbstractStandardProcessor { @Nonnull @Override protected String getOptionPrefix() { return "arez"; } @Override boolean process( @Nonnull final Set<? extends TypeElement> annotations, @Nonnull final RoundEnvironment env ); } | ArezProcessor extends AbstractStandardProcessor { @Nonnull @Override protected String getOptionPrefix() { return "arez"; } @Override boolean process( @Nonnull final Set<? extends TypeElement> annotations, @Nonnull final RoundEnvironment env ); } |
@Test public void computableValue_introspection() throws Throwable { final ArezContext context = Arez.context(); final SafeFunction<String> function = () -> { observeADependency(); return "42"; }; final ComputableValue<String> computableValue1 = context.computable( function ); context.observer( computableValue1::get );... | @OmitSymbol( unless = "arez.enable_property_introspection" ) @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0116: Spy.getValue invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } fin... | ComputableValueInfoImpl implements ComputableValueInfo { @OmitSymbol( unless = "arez.enable_property_introspection" ) @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0116: Spy.getValue invoked when Arez.a... | ComputableValueInfoImpl implements ComputableValueInfo { @OmitSymbol( unless = "arez.enable_property_introspection" ) @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0116: Spy.getValue invoked when Arez.a... | ComputableValueInfoImpl implements ComputableValueInfo { @OmitSymbol( unless = "arez.enable_property_introspection" ) @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0116: Spy.getValue invoked when Arez.a... | ComputableValueInfoImpl implements ComputableValueInfo { @OmitSymbol( unless = "arez.enable_property_introspection" ) @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0116: Spy.getValue invoked when Arez.a... |
@Test public void computableValue_getValue_introspectorsDisabled() { ArezTestUtil.disablePropertyIntrospectors(); final ArezContext context = Arez.context(); final ComputableValue<Integer> computableValue1 = context.computable( () -> 42 ); assertInvariantFailure( () -> context.action( () -> computableValue1.asInfo().ge... | @OmitSymbol( unless = "arez.enable_property_introspection" ) @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0116: Spy.getValue invoked when Arez.arePropertyIntrospectorsEnabled() returns false." ); } fin... | ComputableValueInfoImpl implements ComputableValueInfo { @OmitSymbol( unless = "arez.enable_property_introspection" ) @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0116: Spy.getValue invoked when Arez.a... | ComputableValueInfoImpl implements ComputableValueInfo { @OmitSymbol( unless = "arez.enable_property_introspection" ) @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0116: Spy.getValue invoked when Arez.a... | ComputableValueInfoImpl implements ComputableValueInfo { @OmitSymbol( unless = "arez.enable_property_introspection" ) @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0116: Spy.getValue invoked when Arez.a... | ComputableValueInfoImpl implements ComputableValueInfo { @OmitSymbol( unless = "arez.enable_property_introspection" ) @Nullable @Override public Object getValue() throws Throwable { if ( Arez.shouldCheckInvariants() ) { invariant( Arez::arePropertyIntrospectorsEnabled, () -> "Arez-0116: Spy.getValue invoked when Arez.a... |
@SuppressWarnings( "EqualsWithItself" ) @Test public void equalsAndHashCode() { final ArezContext context = Arez.context(); final ComputableValue<Object> computableValue1 = context.computable( () -> "1" ); final ComputableValue<Object> computableValue2 = context.computable( () -> "2" ); final ComputableValueInfo info1a... | @Override public int hashCode() { return _computableValue.hashCode(); } | ComputableValueInfoImpl implements ComputableValueInfo { @Override public int hashCode() { return _computableValue.hashCode(); } } | ComputableValueInfoImpl implements ComputableValueInfo { @Override public int hashCode() { return _computableValue.hashCode(); } ComputableValueInfoImpl( @Nonnull final ComputableValue<?> computableValue ); } | ComputableValueInfoImpl implements ComputableValueInfo { @Override public int hashCode() { return _computableValue.hashCode(); } ComputableValueInfoImpl( @Nonnull final ComputableValue<?> computableValue ); @Nonnull @Override String getName(); @Override boolean isComputing(); @Nonnull @Override Priority getPriority(); ... | ComputableValueInfoImpl implements ComputableValueInfo { @Override public int hashCode() { return _computableValue.hashCode(); } ComputableValueInfoImpl( @Nonnull final ComputableValue<?> computableValue ); @Nonnull @Override String getName(); @Override boolean isComputing(); @Nonnull @Override Priority getPriority(); ... |
@Test public void registerLookup_duplicate() { final TypeBasedLocator locator1 = new TypeBasedLocator(); final AggregateLocator locator = new AggregateLocator(); locator.registerLocator( locator1 ); assertInvariantFailure( () -> locator.registerLocator( locator1 ), "Arez-0189: Attempting to register locator " + locator... | @Nonnull Disposable registerLocator( @Nonnull final Locator locator ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_locators.contains( locator ), () -> "Arez-0189: Attempting to register locator " + locator + " when the " + "Locator is already present." ); } _locators.add( locator ); return new Locat... | AggregateLocator implements Locator { @Nonnull Disposable registerLocator( @Nonnull final Locator locator ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_locators.contains( locator ), () -> "Arez-0189: Attempting to register locator " + locator + " when the " + "Locator is already present." ); } _loc... | AggregateLocator implements Locator { @Nonnull Disposable registerLocator( @Nonnull final Locator locator ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_locators.contains( locator ), () -> "Arez-0189: Attempting to register locator " + locator + " when the " + "Locator is already present." ); } _loc... | AggregateLocator implements Locator { @Nonnull Disposable registerLocator( @Nonnull final Locator locator ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_locators.contains( locator ), () -> "Arez-0189: Attempting to register locator " + locator + " when the " + "Locator is already present." ); } _loc... | AggregateLocator implements Locator { @Nonnull Disposable registerLocator( @Nonnull final Locator locator ) { if ( Arez.shouldCheckApiInvariants() ) { apiInvariant( () -> !_locators.contains( locator ), () -> "Arez-0189: Attempting to register locator " + locator + " when the " + "Locator is already present." ); } _loc... |
@Test public void equalsAndHashCode() { final ArezContext context = Arez.context(); final Component component1 = context.component( ValueUtil.randomString(), ValueUtil.randomString() ); final Component component2 = context.component( ValueUtil.randomString(), ValueUtil.randomString() ); final ComponentInfo info1a = com... | @Override public int hashCode() { return _component.hashCode(); } | ComponentInfoImpl implements ComponentInfo { @Override public int hashCode() { return _component.hashCode(); } } | ComponentInfoImpl implements ComponentInfo { @Override public int hashCode() { return _component.hashCode(); } ComponentInfoImpl( @Nonnull final Component component ); } | ComponentInfoImpl implements ComponentInfo { @Override public int hashCode() { return _component.hashCode(); } ComponentInfoImpl( @Nonnull final Component component ); @Nonnull @Override String getType(); @Nonnull @Override Object getId(); @Nonnull @Override String getName(); @Override List<ObservableValueInfo> getObse... | ComponentInfoImpl implements ComponentInfo { @Override public int hashCode() { return _component.hashCode(); } ComponentInfoImpl( @Nonnull final Component component ); @Nonnull @Override String getType(); @Nonnull @Override Object getId(); @Nonnull @Override String getName(); @Override List<ObservableValueInfo> getObse... |
@Test public void queueTask_badPriority() { final TaskQueue queue = new TaskQueue( 3, 10 ); final ArezContext context = Arez.context(); assertInvariantFailure( () -> queue.queueTask( -1, context.task( "A", ValueUtil::randomString ) ), "Arez-0215: Attempting to queue task named 'A' but passed an invalid priority -1." );... | void queueTask( @Nonnull final Task task ) { queueTask( task.getPriorityIndex(), task ); } | TaskQueue { void queueTask( @Nonnull final Task task ) { queueTask( task.getPriorityIndex(), task ); } } | TaskQueue { void queueTask( @Nonnull final Task task ) { queueTask( task.getPriorityIndex(), task ); } @SuppressWarnings( { "unchecked", "rawtypes", "RedundantSuppression" } ) TaskQueue( final int priorityCount, final int initialCapacity ); } | TaskQueue { void queueTask( @Nonnull final Task task ) { queueTask( task.getPriorityIndex(), task ); } @SuppressWarnings( { "unchecked", "rawtypes", "RedundantSuppression" } ) TaskQueue( final int priorityCount, final int initialCapacity ); } | TaskQueue { void queueTask( @Nonnull final Task task ) { queueTask( task.getPriorityIndex(), task ); } @SuppressWarnings( { "unchecked", "rawtypes", "RedundantSuppression" } ) TaskQueue( final int priorityCount, final int initialCapacity ); } |
@Test public void queueTask_direct_alreadyQueued() { final TaskQueue queue = new TaskQueue( 3, 10 ); final ArezContext context = Arez.context(); final Task task = context.task( "A", ValueUtil::randomString, Task.Flags.RUN_LATER ); task.markAsIdle(); queue.queueTask( 0, task ); task.markAsIdle(); assertInvariantFailure(... | void queueTask( @Nonnull final Task task ) { queueTask( task.getPriorityIndex(), task ); } | TaskQueue { void queueTask( @Nonnull final Task task ) { queueTask( task.getPriorityIndex(), task ); } } | TaskQueue { void queueTask( @Nonnull final Task task ) { queueTask( task.getPriorityIndex(), task ); } @SuppressWarnings( { "unchecked", "rawtypes", "RedundantSuppression" } ) TaskQueue( final int priorityCount, final int initialCapacity ); } | TaskQueue { void queueTask( @Nonnull final Task task ) { queueTask( task.getPriorityIndex(), task ); } @SuppressWarnings( { "unchecked", "rawtypes", "RedundantSuppression" } ) TaskQueue( final int priorityCount, final int initialCapacity ); } | TaskQueue { void queueTask( @Nonnull final Task task ) { queueTask( task.getPriorityIndex(), task ); } @SuppressWarnings( { "unchecked", "rawtypes", "RedundantSuppression" } ) TaskQueue( final int priorityCount, final int initialCapacity ); } |
@Test public void queueTask_alreadyQueued() { final TaskQueue queue = new TaskQueue( 3, 10 ); final ArezContext context = Arez.context(); final Task task = context.task( "A", ValueUtil::randomString, Task.Flags.RUN_LATER ); assertInvariantFailure( () -> queue.queueTask( task ), "Arez-0128: Attempting to queue task name... | void queueTask( @Nonnull final Task task ) { queueTask( task.getPriorityIndex(), task ); } | TaskQueue { void queueTask( @Nonnull final Task task ) { queueTask( task.getPriorityIndex(), task ); } } | TaskQueue { void queueTask( @Nonnull final Task task ) { queueTask( task.getPriorityIndex(), task ); } @SuppressWarnings( { "unchecked", "rawtypes", "RedundantSuppression" } ) TaskQueue( final int priorityCount, final int initialCapacity ); } | TaskQueue { void queueTask( @Nonnull final Task task ) { queueTask( task.getPriorityIndex(), task ); } @SuppressWarnings( { "unchecked", "rawtypes", "RedundantSuppression" } ) TaskQueue( final int priorityCount, final int initialCapacity ); } | TaskQueue { void queueTask( @Nonnull final Task task ) { queueTask( task.getPriorityIndex(), task ); } @SuppressWarnings( { "unchecked", "rawtypes", "RedundantSuppression" } ) TaskQueue( final int priorityCount, final int initialCapacity ); } |
@Test public void clear() { final ArezContext context = Arez.context(); final TaskQueue queue = context.getTaskQueue(); context.task( "A", ValueUtil::randomString, Task.Flags.RUN_LATER | Task.Flags.PRIORITY_HIGHEST ); context.task( "B", ValueUtil::randomString, Task.Flags.RUN_LATER | Task.Flags.PRIORITY_HIGH ); context... | @Nonnull Collection<Task> clear() { final List<Task> tasks = new ArrayList<>(); for ( int i = 0; i < _buffers.length; i++ ) { final CircularBuffer<Task> buffer = _buffers[ i ]; Task task; while ( null != ( task = buffer.pop() ) ) { tasks.add( task ); task.markAsIdle(); } } return tasks; } | TaskQueue { @Nonnull Collection<Task> clear() { final List<Task> tasks = new ArrayList<>(); for ( int i = 0; i < _buffers.length; i++ ) { final CircularBuffer<Task> buffer = _buffers[ i ]; Task task; while ( null != ( task = buffer.pop() ) ) { tasks.add( task ); task.markAsIdle(); } } return tasks; } } | TaskQueue { @Nonnull Collection<Task> clear() { final List<Task> tasks = new ArrayList<>(); for ( int i = 0; i < _buffers.length; i++ ) { final CircularBuffer<Task> buffer = _buffers[ i ]; Task task; while ( null != ( task = buffer.pop() ) ) { tasks.add( task ); task.markAsIdle(); } } return tasks; } @SuppressWarnings(... | TaskQueue { @Nonnull Collection<Task> clear() { final List<Task> tasks = new ArrayList<>(); for ( int i = 0; i < _buffers.length; i++ ) { final CircularBuffer<Task> buffer = _buffers[ i ]; Task task; while ( null != ( task = buffer.pop() ) ) { tasks.add( task ); task.markAsIdle(); } } return tasks; } @SuppressWarnings(... | TaskQueue { @Nonnull Collection<Task> clear() { final List<Task> tasks = new ArrayList<>(); for ( int i = 0; i < _buffers.length; i++ ) { final CircularBuffer<Task> buffer = _buffers[ i ]; Task task; while ( null != ( task = buffer.pop() ) ) { tasks.add( task ); task.markAsIdle(); } } return tasks; } @SuppressWarnings(... |
@Test public void safeGetString() { assertEquals( ArezUtil.safeGetString( () -> "My String" ), "My String" ); } | @Nonnull @OmitSymbol( unless = "arez.enable_names" ) static String safeGetString( @Nonnull final Supplier<String> message ) { try { return message.get(); } catch ( final Throwable t ) { return "Exception generated whilst attempting to get supplied message.\n" + throwableToString( t ); } } | ArezUtil { @Nonnull @OmitSymbol( unless = "arez.enable_names" ) static String safeGetString( @Nonnull final Supplier<String> message ) { try { return message.get(); } catch ( final Throwable t ) { return "Exception generated whilst attempting to get supplied message.\n" + throwableToString( t ); } } } | ArezUtil { @Nonnull @OmitSymbol( unless = "arez.enable_names" ) static String safeGetString( @Nonnull final Supplier<String> message ) { try { return message.get(); } catch ( final Throwable t ) { return "Exception generated whilst attempting to get supplied message.\n" + throwableToString( t ); } } private ArezUtil()... | ArezUtil { @Nonnull @OmitSymbol( unless = "arez.enable_names" ) static String safeGetString( @Nonnull final Supplier<String> message ) { try { return message.get(); } catch ( final Throwable t ) { return "Exception generated whilst attempting to get supplied message.\n" + throwableToString( t ); } } private ArezUtil()... | ArezUtil { @Nonnull @OmitSymbol( unless = "arez.enable_names" ) static String safeGetString( @Nonnull final Supplier<String> message ) { try { return message.get(); } catch ( final Throwable t ) { return "Exception generated whilst attempting to get supplied message.\n" + throwableToString( t ); } } private ArezUtil()... |
@Test public void dispose() { final ArezContext context = Arez.context(); final ObservableValue<?> observableValue = context.observable(); final Observer observer = context.observer( new CountAndObserveProcedure() ); setCurrentTransaction( newReadWriteObserver( context ) ); observableValue.setLeastStaleObserverState( O... | @Override public void dispose() { if ( isNotDisposed() ) { getContext().safeAction( Arez.areNamesEnabled() ? getName() + ".dispose" : null, this::performDispose ); if ( isComputableValue() ) { getObserver().dispose(); } else { if ( willPropagateSpyEvents() ) { reportSpyEvent( new ObservableValueDisposeEvent( asInfo() )... | ObservableValue extends Node { @Override public void dispose() { if ( isNotDisposed() ) { getContext().safeAction( Arez.areNamesEnabled() ? getName() + ".dispose" : null, this::performDispose ); if ( isComputableValue() ) { getObserver().dispose(); } else { if ( willPropagateSpyEvents() ) { reportSpyEvent( new Observab... | ObservableValue extends Node { @Override public void dispose() { if ( isNotDisposed() ) { getContext().safeAction( Arez.areNamesEnabled() ? getName() + ".dispose" : null, this::performDispose ); if ( isComputableValue() ) { getObserver().dispose(); } else { if ( willPropagateSpyEvents() ) { reportSpyEvent( new Observab... | ObservableValue extends Node { @Override public void dispose() { if ( isNotDisposed() ) { getContext().safeAction( Arez.areNamesEnabled() ? getName() + ".dispose" : null, this::performDispose ); if ( isComputableValue() ) { getObserver().dispose(); } else { if ( willPropagateSpyEvents() ) { reportSpyEvent( new Observab... | ObservableValue extends Node { @Override public void dispose() { if ( isNotDisposed() ) { getContext().safeAction( Arez.areNamesEnabled() ? getName() + ".dispose" : null, this::performDispose ); if ( isComputableValue() ) { getObserver().dispose(); } else { if ( willPropagateSpyEvents() ) { reportSpyEvent( new Observab... |
@Test public void addObserver() { final ArezContext context = Arez.context(); final Observer observer = context.observer( new CountAndObserveProcedure() ); setCurrentTransaction( observer ); final ObservableValue<?> observableValue = context.observable(); assertEquals( observableValue.getObservers().size(), 0 ); assert... | void addObserver( @Nonnull final Observer observer ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0065: Attempt to invoke addObserver on ObservableValue named '" + getName() + "' when there is no active transaction." ); invariantObserversLinked(); invariant( (... | ObservableValue extends Node { void addObserver( @Nonnull final Observer observer ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0065: Attempt to invoke addObserver on ObservableValue named '" + getName() + "' when there is no active transaction." ); invariant... | ObservableValue extends Node { void addObserver( @Nonnull final Observer observer ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0065: Attempt to invoke addObserver on ObservableValue named '" + getName() + "' when there is no active transaction." ); invariant... | ObservableValue extends Node { void addObserver( @Nonnull final Observer observer ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0065: Attempt to invoke addObserver on ObservableValue named '" + getName() + "' when there is no active transaction." ); invariant... | ObservableValue extends Node { void addObserver( @Nonnull final Observer observer ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0065: Attempt to invoke addObserver on ObservableValue named '" + getName() + "' when there is no active transaction." ); invariant... |
@Test public void addObserver_whenObserverIsNotTrackerAssociatedWithTransaction() { final ArezContext context = Arez.context(); final Observer observer = context.observer( new CountAndObserveProcedure() ); final ObservableValue<?> observableValue = context.observable(); context.safeAction( () -> { assertInvariantFailur... | void addObserver( @Nonnull final Observer observer ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0065: Attempt to invoke addObserver on ObservableValue named '" + getName() + "' when there is no active transaction." ); invariantObserversLinked(); invariant( (... | ObservableValue extends Node { void addObserver( @Nonnull final Observer observer ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0065: Attempt to invoke addObserver on ObservableValue named '" + getName() + "' when there is no active transaction." ); invariant... | ObservableValue extends Node { void addObserver( @Nonnull final Observer observer ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0065: Attempt to invoke addObserver on ObservableValue named '" + getName() + "' when there is no active transaction." ); invariant... | ObservableValue extends Node { void addObserver( @Nonnull final Observer observer ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0065: Attempt to invoke addObserver on ObservableValue named '" + getName() + "' when there is no active transaction." ); invariant... | ObservableValue extends Node { void addObserver( @Nonnull final Observer observer ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0065: Attempt to invoke addObserver on ObservableValue named '" + getName() + "' when there is no active transaction." ); invariant... |
@Test public void removeObserver() { final ArezContext context = Arez.context(); final Observer observer = context.observer( new CountAndObserveProcedure() ); setCurrentTransaction( observer ); final ObservableValue<?> observableValue = context.observable(); assertEquals( observableValue.getObservers().size(), 0 ); ass... | void removeObserver( @Nonnull final Observer observer ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0069: Attempt to invoke removeObserver on ObservableValue named '" + getName() + "' " + "when there is no active transaction." ); invariantObserversLinked(); i... | ObservableValue extends Node { void removeObserver( @Nonnull final Observer observer ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0069: Attempt to invoke removeObserver on ObservableValue named '" + getName() + "' " + "when there is no active transaction." )... | ObservableValue extends Node { void removeObserver( @Nonnull final Observer observer ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0069: Attempt to invoke removeObserver on ObservableValue named '" + getName() + "' " + "when there is no active transaction." )... | ObservableValue extends Node { void removeObserver( @Nonnull final Observer observer ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0069: Attempt to invoke removeObserver on ObservableValue named '" + getName() + "' " + "when there is no active transaction." )... | ObservableValue extends Node { void removeObserver( @Nonnull final Observer observer ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0069: Attempt to invoke removeObserver on ObservableValue named '" + getName() + "' " + "when there is no active transaction." )... |
@Test public void setLeastStaleObserverState() { final ArezContext context = Arez.context(); final Observer observer = context.observer( new CountAndObserveProcedure() ); final ObservableValue<?> observableValue = context.observable(); setCurrentTransaction( observer ); assertEquals( observableValue.getLeastStaleObserv... | void setLeastStaleObserverState( final int leastStaleObserverState ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0074: Attempt to invoke setLeastStaleObserverState on ObservableValue named '" + getName() + "' when there is no active transaction." ); invariant... | ObservableValue extends Node { void setLeastStaleObserverState( final int leastStaleObserverState ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0074: Attempt to invoke setLeastStaleObserverState on ObservableValue named '" + getName() + "' when there is no ac... | ObservableValue extends Node { void setLeastStaleObserverState( final int leastStaleObserverState ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0074: Attempt to invoke setLeastStaleObserverState on ObservableValue named '" + getName() + "' when there is no ac... | ObservableValue extends Node { void setLeastStaleObserverState( final int leastStaleObserverState ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0074: Attempt to invoke setLeastStaleObserverState on ObservableValue named '" + getName() + "' when there is no ac... | ObservableValue extends Node { void setLeastStaleObserverState( final int leastStaleObserverState ) { if ( Arez.shouldCheckInvariants() ) { invariant( () -> getContext().isTransactionActive(), () -> "Arez-0074: Attempt to invoke setLeastStaleObserverState on ObservableValue named '" + getName() + "' when there is no ac... |
@Test public void invariantOwner_badObservableLink() { ArezTestUtil.disableRegistries(); final ArezContext context = Arez.context(); setupReadOnlyTransaction( context ); final Observer observer = context.computable( () -> "" ).getObserver(); final ObservableValue<?> observableValue = new ObservableValue<>( context, nul... | @Nonnull Observer getObserver() { assert null != _observer; return _observer; } | ObservableValue extends Node { @Nonnull Observer getObserver() { assert null != _observer; return _observer; } } | ObservableValue extends Node { @Nonnull Observer getObserver() { assert null != _observer; return _observer; } ObservableValue( @Nullable final ArezContext context,
@Nullable final Component component,
@Nullable final String name,
@Nullable final Observer observe... | ObservableValue extends Node { @Nonnull Observer getObserver() { assert null != _observer; return _observer; } ObservableValue( @Nullable final ArezContext context,
@Nullable final Component component,
@Nullable final String name,
@Nullable final Observer observe... | ObservableValue extends Node { @Nonnull Observer getObserver() { assert null != _observer; return _observer; } ObservableValue( @Nullable final ArezContext context,
@Nullable final Component component,
@Nullable final String name,
@Nullable final Observer observe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.