Skip to content

Commit

Permalink
Forgot to update test now that agg-map manager is not workspace scoped
Browse files Browse the repository at this point in the history
  • Loading branch information
Col-E committed Jan 4, 2025
1 parent 8f77e5c commit 33fdcaf
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions recaf-core/src/test/java/software/coley/recaf/BootstrapTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import software.coley.recaf.services.assembler.AssemblerPipelineManager;
import software.coley.recaf.services.inheritance.InheritanceGraph;
import software.coley.recaf.services.mapping.aggregate.AggregateMappingManager;
import software.coley.recaf.test.TestBase;
Expand Down Expand Up @@ -60,16 +61,16 @@ void testGetWorkspaceInstance() throws IOException {
void testGetWorkspaceScopedInstance() {
// Get the manager when one workspace is open.
workspaceManager.setCurrent(EmptyWorkspace.get());
AggregateMappingManager manager1 = unwrapProxy(recaf.get(AggregateMappingManager.class));
AggregateMappingManager manager2 = unwrapProxy(recaf.get(AggregateMappingManager.class));
assertSame(manager1, manager2, "Graph should be workspace-scoped, but values differ!");
AssemblerPipelineManager manager1 = unwrapProxy(recaf.get(AssemblerPipelineManager.class));
AssemblerPipelineManager manager2 = unwrapProxy(recaf.get(AssemblerPipelineManager.class));
assertSame(manager1, manager2, "Workspace-scoped values not shared during same workspace scope!");

// Assign a new workspace.
// The manager should be different since the prior workspace is closed.
workspaceManager.setCurrent(EmptyWorkspace.get());
AggregateMappingManager manager3 = unwrapProxy(recaf.get(AggregateMappingManager.class));
AggregateMappingManager manager4 = unwrapProxy(recaf.get(AggregateMappingManager.class));
assertSame(manager3, manager4, "Graph should be workspace-scoped, but values differ!");
assertNotSame(manager1, manager3, "Graph scope from before/after a new workspace yielded the same graph bean!");
AssemblerPipelineManager manager3 = unwrapProxy(recaf.get(AssemblerPipelineManager.class));
AssemblerPipelineManager manager4 = unwrapProxy(recaf.get(AssemblerPipelineManager.class));
assertSame(manager3, manager4, "Workspace-scoped values not shared during same workspace scope!");
assertNotSame(manager1, manager3, "Workspace-scoped values are shared during different workspace scopes!");
}
}

0 comments on commit 33fdcaf

Please sign in to comment.