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 then() { Integer result = parseInteger().then(plus(7)).apply("11"); assertThat(result).as("parseInt('11') then adding 7").isEqualTo(18); }
public <U> ChainableFunction<F, U> then(final Function<? super T, ? extends U> function) { return new ChainableFunction<F, U>() { @Override public U apply(F input) { return function.apply(ChainableFunction.this.apply(input)); } }; }
ChainableFunction implements Function<F, T> { public <U> ChainableFunction<F, U> then(final Function<? super T, ? extends U> function) { return new ChainableFunction<F, U>() { @Override public U apply(F input) { return function.apply(ChainableFunction.this.apply(input)); } }; } }
ChainableFunction implements Function<F, T> { public <U> ChainableFunction<F, U> then(final Function<? super T, ? extends U> function) { return new ChainableFunction<F, U>() { @Override public U apply(F input) { return function.apply(ChainableFunction.this.apply(input)); } }; } }
ChainableFunction implements Function<F, T> { public <U> ChainableFunction<F, U> then(final Function<? super T, ? extends U> function) { return new ChainableFunction<F, U>() { @Override public U apply(F input) { return function.apply(ChainableFunction.this.apply(input)); } }; } ChainableFunction<E, T> after(final Func...
ChainableFunction implements Function<F, T> { public <U> ChainableFunction<F, U> then(final Function<? super T, ? extends U> function) { return new ChainableFunction<F, U>() { @Override public U apply(F input) { return function.apply(ChainableFunction.this.apply(input)); } }; } ChainableFunction<E, T> after(final Func...
@Test public void is() { assertThat(parseInteger().is(greaterThan(7))) .rejects("7") .accepts("8"); }
public DescribedPredicate<F> is(DescribedPredicate<? super T> predicate) { return predicate.onResultOf(this); }
ChainableFunction implements Function<F, T> { public DescribedPredicate<F> is(DescribedPredicate<? super T> predicate) { return predicate.onResultOf(this); } }
ChainableFunction implements Function<F, T> { public DescribedPredicate<F> is(DescribedPredicate<? super T> predicate) { return predicate.onResultOf(this); } }
ChainableFunction implements Function<F, T> { public DescribedPredicate<F> is(DescribedPredicate<? super T> predicate) { return predicate.onResultOf(this); } ChainableFunction<E, T> after(final Function<? super E, ? extends F> function); ChainableFunction<F, U> then(final Function<? super T, ? extends U> function); De...
ChainableFunction implements Function<F, T> { public DescribedPredicate<F> is(DescribedPredicate<? super T> predicate) { return predicate.onResultOf(this); } ChainableFunction<E, T> after(final Function<? super E, ? extends F> function); ChainableFunction<F, U> then(final Function<? super T, ? extends U> function); De...
@Test public void multiple_cycles_are_detected() { Graph<String, String> graph = new Graph<>(); Cycle<String, String> threeElements = randomCycle(3); Cycle<String, String> fourElements = randomCycle(4); Cycle<String, String> fiveElements = randomCycle(5); addCycles(graph, threeElements, fourElements, fiveElements); add...
Cycles<T, ATTACHMENT> findCycles() { Map<Integer, Map<Integer, Edge<T, ATTACHMENT>>> edgesByTargetIndexByOriginIndex = indexEdgesByTargetIndexByOriginIndex(nodes, outgoingEdges); JohnsonCycleFinder johnsonCycleFinder = new JohnsonCycleFinder(createPrimitiveGraph()); ImmutableList.Builder<Cycle<T, ATTACHMENT>> result = ...
Graph { Cycles<T, ATTACHMENT> findCycles() { Map<Integer, Map<Integer, Edge<T, ATTACHMENT>>> edgesByTargetIndexByOriginIndex = indexEdgesByTargetIndexByOriginIndex(nodes, outgoingEdges); JohnsonCycleFinder johnsonCycleFinder = new JohnsonCycleFinder(createPrimitiveGraph()); ImmutableList.Builder<Cycle<T, ATTACHMENT>> r...
Graph { Cycles<T, ATTACHMENT> findCycles() { Map<Integer, Map<Integer, Edge<T, ATTACHMENT>>> edgesByTargetIndexByOriginIndex = indexEdgesByTargetIndexByOriginIndex(nodes, outgoingEdges); JohnsonCycleFinder johnsonCycleFinder = new JohnsonCycleFinder(createPrimitiveGraph()); ImmutableList.Builder<Cycle<T, ATTACHMENT>> r...
Graph { Cycles<T, ATTACHMENT> findCycles() { Map<Integer, Map<Integer, Edge<T, ATTACHMENT>>> edgesByTargetIndexByOriginIndex = indexEdgesByTargetIndexByOriginIndex(nodes, outgoingEdges); JohnsonCycleFinder johnsonCycleFinder = new JohnsonCycleFinder(createPrimitiveGraph()); ImmutableList.Builder<Cycle<T, ATTACHMENT>> r...
Graph { Cycles<T, ATTACHMENT> findCycles() { Map<Integer, Map<Integer, Edge<T, ATTACHMENT>>> edgesByTargetIndexByOriginIndex = indexEdgesByTargetIndexByOriginIndex(nodes, outgoingEdges); JohnsonCycleFinder johnsonCycleFinder = new JohnsonCycleFinder(createPrimitiveGraph()); ImmutableList.Builder<Cycle<T, ATTACHMENT>> r...
@Test public void complete_graph() { Graph<Integer, Integer> completeGraph = createCompleteGraph(3); Iterable<Cycle<Integer, Integer>> cycles = completeGraph.findCycles(); assertThat(cycles).containsOnly(createCycle(ImmutableList.of(0, 1, 2, 0)), createCycle(ImmutableList.of(0, 2, 1, 0)), createCycle(ImmutableList.of(0...
Cycles<T, ATTACHMENT> findCycles() { Map<Integer, Map<Integer, Edge<T, ATTACHMENT>>> edgesByTargetIndexByOriginIndex = indexEdgesByTargetIndexByOriginIndex(nodes, outgoingEdges); JohnsonCycleFinder johnsonCycleFinder = new JohnsonCycleFinder(createPrimitiveGraph()); ImmutableList.Builder<Cycle<T, ATTACHMENT>> result = ...
Graph { Cycles<T, ATTACHMENT> findCycles() { Map<Integer, Map<Integer, Edge<T, ATTACHMENT>>> edgesByTargetIndexByOriginIndex = indexEdgesByTargetIndexByOriginIndex(nodes, outgoingEdges); JohnsonCycleFinder johnsonCycleFinder = new JohnsonCycleFinder(createPrimitiveGraph()); ImmutableList.Builder<Cycle<T, ATTACHMENT>> r...
Graph { Cycles<T, ATTACHMENT> findCycles() { Map<Integer, Map<Integer, Edge<T, ATTACHMENT>>> edgesByTargetIndexByOriginIndex = indexEdgesByTargetIndexByOriginIndex(nodes, outgoingEdges); JohnsonCycleFinder johnsonCycleFinder = new JohnsonCycleFinder(createPrimitiveGraph()); ImmutableList.Builder<Cycle<T, ATTACHMENT>> r...
Graph { Cycles<T, ATTACHMENT> findCycles() { Map<Integer, Map<Integer, Edge<T, ATTACHMENT>>> edgesByTargetIndexByOriginIndex = indexEdgesByTargetIndexByOriginIndex(nodes, outgoingEdges); JohnsonCycleFinder johnsonCycleFinder = new JohnsonCycleFinder(createPrimitiveGraph()); ImmutableList.Builder<Cycle<T, ATTACHMENT>> r...
Graph { Cycles<T, ATTACHMENT> findCycles() { Map<Integer, Map<Integer, Edge<T, ATTACHMENT>>> edgesByTargetIndexByOriginIndex = indexEdgesByTargetIndexByOriginIndex(nodes, outgoingEdges); JohnsonCycleFinder johnsonCycleFinder = new JohnsonCycleFinder(createPrimitiveGraph()); ImmutableList.Builder<Cycle<T, ATTACHMENT>> r...
@Test public void finds_cycles_in_real_life_graph() { Graph<Integer, Object> graph = RealLifeGraph.get(); int expectedNumberOfCycles = 10000; ArchConfiguration.get().setProperty(MAX_NUMBER_OF_CYCLES_TO_DETECT_PROPERTY_NAME, String.valueOf(expectedNumberOfCycles)); Cycles<Integer, Object> cycles = graph.findCycles(); as...
Cycles<T, ATTACHMENT> findCycles() { Map<Integer, Map<Integer, Edge<T, ATTACHMENT>>> edgesByTargetIndexByOriginIndex = indexEdgesByTargetIndexByOriginIndex(nodes, outgoingEdges); JohnsonCycleFinder johnsonCycleFinder = new JohnsonCycleFinder(createPrimitiveGraph()); ImmutableList.Builder<Cycle<T, ATTACHMENT>> result = ...
Graph { Cycles<T, ATTACHMENT> findCycles() { Map<Integer, Map<Integer, Edge<T, ATTACHMENT>>> edgesByTargetIndexByOriginIndex = indexEdgesByTargetIndexByOriginIndex(nodes, outgoingEdges); JohnsonCycleFinder johnsonCycleFinder = new JohnsonCycleFinder(createPrimitiveGraph()); ImmutableList.Builder<Cycle<T, ATTACHMENT>> r...
Graph { Cycles<T, ATTACHMENT> findCycles() { Map<Integer, Map<Integer, Edge<T, ATTACHMENT>>> edgesByTargetIndexByOriginIndex = indexEdgesByTargetIndexByOriginIndex(nodes, outgoingEdges); JohnsonCycleFinder johnsonCycleFinder = new JohnsonCycleFinder(createPrimitiveGraph()); ImmutableList.Builder<Cycle<T, ATTACHMENT>> r...
Graph { Cycles<T, ATTACHMENT> findCycles() { Map<Integer, Map<Integer, Edge<T, ATTACHMENT>>> edgesByTargetIndexByOriginIndex = indexEdgesByTargetIndexByOriginIndex(nodes, outgoingEdges); JohnsonCycleFinder johnsonCycleFinder = new JohnsonCycleFinder(createPrimitiveGraph()); ImmutableList.Builder<Cycle<T, ATTACHMENT>> r...
Graph { Cycles<T, ATTACHMENT> findCycles() { Map<Integer, Map<Integer, Edge<T, ATTACHMENT>>> edgesByTargetIndexByOriginIndex = indexEdgesByTargetIndexByOriginIndex(nodes, outgoingEdges); JohnsonCycleFinder johnsonCycleFinder = new JohnsonCycleFinder(createPrimitiveGraph()); ImmutableList.Builder<Cycle<T, ATTACHMENT>> r...
@Test public void matches_slices() { JavaClasses classes = importClassesWithContext(Object.class, String.class, List.class, Set.class, Pattern.class); assertThat(Slices.matching("java.(*)..").transform(classes)).hasSize(2); assertThat(Slices.matching("(**)").transform(classes)).hasSize(3); assertThat(Slices.matching("j...
@PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceIdentifier.getDescription(); return new Transformer(sliceIdentifier, descriptio...
Slices implements DescribedIterable<Slice>, CanOverrideDescription<Slices> { @PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceId...
Slices implements DescribedIterable<Slice>, CanOverrideDescription<Slices> { @PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceId...
Slices implements DescribedIterable<Slice>, CanOverrideDescription<Slices> { @PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceId...
Slices implements DescribedIterable<Slice>, CanOverrideDescription<Slices> { @PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceId...
@Test public void default_naming_slices() { JavaClasses classes = importClassesWithContext(Object.class, String.class, Pattern.class); DescribedIterable<Slice> slices = Slices.matching("java.(*)..").transform(classes); assertThat(slices).extractingResultOf("getDescription").containsOnly("Slice lang", "Slice util"); }
@PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceIdentifier.getDescription(); return new Transformer(sliceIdentifier, descriptio...
Slices implements DescribedIterable<Slice>, CanOverrideDescription<Slices> { @PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceId...
Slices implements DescribedIterable<Slice>, CanOverrideDescription<Slices> { @PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceId...
Slices implements DescribedIterable<Slice>, CanOverrideDescription<Slices> { @PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceId...
Slices implements DescribedIterable<Slice>, CanOverrideDescription<Slices> { @PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceId...
@Test public void evaluated_rules_are_dispatched_to_all_extensions() { TestExtension extensionOne = enabled(new TestExtension("one")); TestExtension extensionTwo = enabled(new TestExtension("two")); when(extensionLoader.getAll()).thenReturn(ImmutableSet.<ArchUnitExtension>of(extensionOne, extensionTwo)); extensions.dis...
public void dispatch(EvaluatedRule evaluatedRule) { for (ArchUnitExtension extension : extensionLoader.getAll()) { dispatch(evaluatedRule, extension); } }
ArchUnitExtensions { public void dispatch(EvaluatedRule evaluatedRule) { for (ArchUnitExtension extension : extensionLoader.getAll()) { dispatch(evaluatedRule, extension); } } }
ArchUnitExtensions { public void dispatch(EvaluatedRule evaluatedRule) { for (ArchUnitExtension extension : extensionLoader.getAll()) { dispatch(evaluatedRule, extension); } } ArchUnitExtensions(); private ArchUnitExtensions(ArchUnitExtensionLoader extensionLoader); }
ArchUnitExtensions { public void dispatch(EvaluatedRule evaluatedRule) { for (ArchUnitExtension extension : extensionLoader.getAll()) { dispatch(evaluatedRule, extension); } } ArchUnitExtensions(); private ArchUnitExtensions(ArchUnitExtensionLoader extensionLoader); void dispatch(EvaluatedRule evaluatedRule); }
ArchUnitExtensions { public void dispatch(EvaluatedRule evaluatedRule) { for (ArchUnitExtension extension : extensionLoader.getAll()) { dispatch(evaluatedRule, extension); } } ArchUnitExtensions(); private ArchUnitExtensions(ArchUnitExtensionLoader extensionLoader); void dispatch(EvaluatedRule evaluatedRule); }
@Test public void name_parts_are_resolved_correctly() { JavaClasses classes = importClassesWithContext(Object.class); DescribedIterable<Slice> slices = Slices.matching("(*).(*)..").transform(classes); assertThat(getOnlyElement(slices).getNamePart(1)).isEqualTo("java"); assertThat(getOnlyElement(slices).getNamePart(2))....
@PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceIdentifier.getDescription(); return new Transformer(sliceIdentifier, descriptio...
Slices implements DescribedIterable<Slice>, CanOverrideDescription<Slices> { @PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceId...
Slices implements DescribedIterable<Slice>, CanOverrideDescription<Slices> { @PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceId...
Slices implements DescribedIterable<Slice>, CanOverrideDescription<Slices> { @PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceId...
Slices implements DescribedIterable<Slice>, CanOverrideDescription<Slices> { @PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceId...
@Test public void slices_of_dependencies() { JavaMethod methodThatCallsJavaUtil = TestUtils.importClassWithContext(Object.class).getMethod("toString"); JavaMethod methodThatCallsJavaLang = TestUtils.importClassWithContext(Map.class).getMethod("put", Object.class, Object.class); simulateCall().from(methodThatCallsJavaUt...
@PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceIdentifier.getDescription(); return new Transformer(sliceIdentifier, descriptio...
Slices implements DescribedIterable<Slice>, CanOverrideDescription<Slices> { @PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceId...
Slices implements DescribedIterable<Slice>, CanOverrideDescription<Slices> { @PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceId...
Slices implements DescribedIterable<Slice>, CanOverrideDescription<Slices> { @PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceId...
Slices implements DescribedIterable<Slice>, CanOverrideDescription<Slices> { @PublicAPI(usage = ACCESS) public static Transformer matching(String packageIdentifier) { PackageMatchingSliceIdentifier sliceIdentifier = new PackageMatchingSliceIdentifier(packageIdentifier); String description = "slices matching " + sliceId...
@Test public void minimal_nontrivial_cycle() { String nodeA = "Node-A"; String nodeB = "Node-B"; Cycle<String, ?> cycle = new Cycle<>(asList(stringEdge(nodeA, nodeB), stringEdge(nodeB, nodeA))); assertThat(cycle.getEdges()).hasSize(2); }
List<Edge<T, ATTACHMENT>> getEdges() { return path.getEdges(); }
Cycle { List<Edge<T, ATTACHMENT>> getEdges() { return path.getEdges(); } }
Cycle { List<Edge<T, ATTACHMENT>> getEdges() { return path.getEdges(); } Cycle(List<Edge<T, ATTACHMENT>> edges); Cycle(Path<T, ATTACHMENT> path); }
Cycle { List<Edge<T, ATTACHMENT>> getEdges() { return path.getEdges(); } Cycle(List<Edge<T, ATTACHMENT>> edges); Cycle(Path<T, ATTACHMENT> path); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static Cycle<T, ATTACHMENT> from(Path<T, ATTACHMENT> path); }
Cycle { List<Edge<T, ATTACHMENT>> getEdges() { return path.getEdges(); } Cycle(List<Edge<T, ATTACHMENT>> edges); Cycle(Path<T, ATTACHMENT> path); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static Cycle<T, ATTACHMENT> from(Path<T, ATTACHMENT> path); }
@Test public void rejects_null() { thrown.expect(NullPointerException.class); SliceIdentifier.of((String[]) null); }
@PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); }
SliceIdentifier { @PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); } }
SliceIdentifier { @PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); } private SliceIdentifier(List<String> parts); }
SliceIdentifier { @PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); } private SliceIdentifier(List<String> parts); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @PublicAPI(usage = ACCESS) static SliceIde...
SliceIdentifier { @PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); } private SliceIdentifier(List<String> parts); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @PublicAPI(usage = ACCESS) static SliceIde...
@Test public void rejects_null_list() { thrown.expect(NullPointerException.class); SliceIdentifier.of((List<String>) null); }
@PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); }
SliceIdentifier { @PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); } }
SliceIdentifier { @PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); } private SliceIdentifier(List<String> parts); }
SliceIdentifier { @PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); } private SliceIdentifier(List<String> parts); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @PublicAPI(usage = ACCESS) static SliceIde...
SliceIdentifier { @PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); } private SliceIdentifier(List<String> parts); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @PublicAPI(usage = ACCESS) static SliceIde...
@Test public void rejects_empty_parts() { expectEmptyPartsException(); SliceIdentifier.of(); }
@PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); }
SliceIdentifier { @PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); } }
SliceIdentifier { @PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); } private SliceIdentifier(List<String> parts); }
SliceIdentifier { @PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); } private SliceIdentifier(List<String> parts); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @PublicAPI(usage = ACCESS) static SliceIde...
SliceIdentifier { @PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); } private SliceIdentifier(List<String> parts); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @PublicAPI(usage = ACCESS) static SliceIde...
@Test public void rejects_empty_parts_list() { expectEmptyPartsException(); SliceIdentifier.of(Collections.<String>emptyList()); }
@PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); }
SliceIdentifier { @PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); } }
SliceIdentifier { @PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); } private SliceIdentifier(List<String> parts); }
SliceIdentifier { @PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); } private SliceIdentifier(List<String> parts); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @PublicAPI(usage = ACCESS) static SliceIde...
SliceIdentifier { @PublicAPI(usage = ACCESS) public static SliceIdentifier of(String... parts) { return of(ImmutableList.copyOf(parts)); } private SliceIdentifier(List<String> parts); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @PublicAPI(usage = ACCESS) static SliceIde...
@Test public void dependencies_from_self() { Slice slice = getSlice(slicesOfTestClasses(), "first"); assertThatDependencies(slice.getDependenciesFromSelf()).containOnly( from(FirstAnyPkgClass.class).to(Object.class) .from(FirstAnyPkgClass.class).to(SomePkgSubClass.class) .from(FirstAnyPkgClass.class).to(SecondThreeAnyC...
@PublicAPI(usage = ACCESS) public Set<Dependency> getDependenciesFromSelf() { ImmutableSet.Builder<Dependency> result = ImmutableSet.builder(); for (JavaClass javaClass : this) { for (Dependency dependency : javaClass.getDirectDependenciesFromSelf()) { if (isNotAssignedToOwnSlice(dependency.getTargetClass())) { result....
Slice extends ForwardingSet<JavaClass> implements HasDescription, CanOverrideDescription<Slice> { @PublicAPI(usage = ACCESS) public Set<Dependency> getDependenciesFromSelf() { ImmutableSet.Builder<Dependency> result = ImmutableSet.builder(); for (JavaClass javaClass : this) { for (Dependency dependency : javaClass.getD...
Slice extends ForwardingSet<JavaClass> implements HasDescription, CanOverrideDescription<Slice> { @PublicAPI(usage = ACCESS) public Set<Dependency> getDependenciesFromSelf() { ImmutableSet.Builder<Dependency> result = ImmutableSet.builder(); for (JavaClass javaClass : this) { for (Dependency dependency : javaClass.getD...
Slice extends ForwardingSet<JavaClass> implements HasDescription, CanOverrideDescription<Slice> { @PublicAPI(usage = ACCESS) public Set<Dependency> getDependenciesFromSelf() { ImmutableSet.Builder<Dependency> result = ImmutableSet.builder(); for (JavaClass javaClass : this) { for (Dependency dependency : javaClass.getD...
Slice extends ForwardingSet<JavaClass> implements HasDescription, CanOverrideDescription<Slice> { @PublicAPI(usage = ACCESS) public Set<Dependency> getDependenciesFromSelf() { ImmutableSet.Builder<Dependency> result = ImmutableSet.builder(); for (JavaClass javaClass : this) { for (Dependency dependency : javaClass.getD...
@Test public void dependencies_to_self() { Slice slice = getSlice(slicesOfTestClasses(), "first"); assertThatDependencies(slice.getDependenciesToSelf()).containOnly( from(SecondAnyClass.class).to(FirstAnyPkgClass.class) .from(SomePkgSubClass.class).to(FirstAnyPkgClass.class) ); }
@PublicAPI(usage = ACCESS) public Set<Dependency> getDependenciesToSelf() { ImmutableSet.Builder<Dependency> result = ImmutableSet.builder(); for (JavaClass javaClass : this) { for (Dependency dependency : javaClass.getDirectDependenciesToSelf()) { if (isNotAssignedToOwnSlice(dependency.getOriginClass())) { result.add(...
Slice extends ForwardingSet<JavaClass> implements HasDescription, CanOverrideDescription<Slice> { @PublicAPI(usage = ACCESS) public Set<Dependency> getDependenciesToSelf() { ImmutableSet.Builder<Dependency> result = ImmutableSet.builder(); for (JavaClass javaClass : this) { for (Dependency dependency : javaClass.getDir...
Slice extends ForwardingSet<JavaClass> implements HasDescription, CanOverrideDescription<Slice> { @PublicAPI(usage = ACCESS) public Set<Dependency> getDependenciesToSelf() { ImmutableSet.Builder<Dependency> result = ImmutableSet.builder(); for (JavaClass javaClass : this) { for (Dependency dependency : javaClass.getDir...
Slice extends ForwardingSet<JavaClass> implements HasDescription, CanOverrideDescription<Slice> { @PublicAPI(usage = ACCESS) public Set<Dependency> getDependenciesToSelf() { ImmutableSet.Builder<Dependency> result = ImmutableSet.builder(); for (JavaClass javaClass : this) { for (Dependency dependency : javaClass.getDir...
Slice extends ForwardingSet<JavaClass> implements HasDescription, CanOverrideDescription<Slice> { @PublicAPI(usage = ACCESS) public Set<Dependency> getDependenciesToSelf() { ImmutableSet.Builder<Dependency> result = ImmutableSet.builder(); for (JavaClass javaClass : this) { for (Dependency dependency : javaClass.getDir...
@Test public void hashCode_of_two_equal_edges_is_equal() { Edge<Object, Object> equalEdge = new Edge<>(from, to, singletonList(new Object())); assertThat(new Edge<>(from, to, emptySet()).hashCode()).isEqualTo(equalEdge.hashCode()); }
@Override public int hashCode() { return hashCode; }
Edge { @Override public int hashCode() { return hashCode; } }
Edge { @Override public int hashCode() { return hashCode; } Edge(T from, T to, Collection<ATTACHMENT> attachments); }
Edge { @Override public int hashCode() { return hashCode; } Edge(T from, T to, Collection<ATTACHMENT> attachments); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
Edge { @Override public int hashCode() { return hashCode; } Edge(T from, T to, Collection<ATTACHMENT> attachments); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
@Test public void only_dispatches_to_enabled_extensions() { TestExtension extensionOne = newExtensionWithEnabled("one", false); TestExtension extensionTwo = newExtensionWithEnabled("two", true); when(extensionLoader.getAll()).thenReturn(ImmutableSet.<ArchUnitExtension>of(extensionOne, extensionTwo)); logTestRule.watch(...
public void dispatch(EvaluatedRule evaluatedRule) { for (ArchUnitExtension extension : extensionLoader.getAll()) { dispatch(evaluatedRule, extension); } }
ArchUnitExtensions { public void dispatch(EvaluatedRule evaluatedRule) { for (ArchUnitExtension extension : extensionLoader.getAll()) { dispatch(evaluatedRule, extension); } } }
ArchUnitExtensions { public void dispatch(EvaluatedRule evaluatedRule) { for (ArchUnitExtension extension : extensionLoader.getAll()) { dispatch(evaluatedRule, extension); } } ArchUnitExtensions(); private ArchUnitExtensions(ArchUnitExtensionLoader extensionLoader); }
ArchUnitExtensions { public void dispatch(EvaluatedRule evaluatedRule) { for (ArchUnitExtension extension : extensionLoader.getAll()) { dispatch(evaluatedRule, extension); } } ArchUnitExtensions(); private ArchUnitExtensions(ArchUnitExtensionLoader extensionLoader); void dispatch(EvaluatedRule evaluatedRule); }
ArchUnitExtensions { public void dispatch(EvaluatedRule evaluatedRule) { for (ArchUnitExtension extension : extensionLoader.getAll()) { dispatch(evaluatedRule, extension); } } ArchUnitExtensions(); private ArchUnitExtensions(ArchUnitExtensionLoader extensionLoader); void dispatch(EvaluatedRule evaluatedRule); }
@Test public void layered_architecture_overridden_description() { LayeredArchitecture architecture = layeredArchitecture() .layer("One").definedBy("some.pkg..") .whereLayer("One").mayNotBeAccessedByAnyLayer() .as("overridden"); assertThat(architecture.getDescription()).isEqualTo("overridden"); }
@PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
@Test public void layered_architecture_because_clause() { ArchRule architecture = layeredArchitecture() .layer("One").definedBy("some.pkg..") .whereLayer("One").mayNotBeAccessedByAnyLayer() .as("overridden") .because("some reason"); assertThat(architecture.getDescription()).isEqualTo("overridden, because some reason");...
@PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
@Test public void layered_architecture_defining_constraint_on_non_existing_target_layer_is_rejected() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("no layer"); thrown.expectMessage("NotThere"); layeredArchitecture() .layer("Some").definedBy("any") .whereLayer("NotThere").mayNotBeAccessedByAnyLa...
@PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
@Test public void layered_architecture_defining_constraint_on_non_existing_origin_is_rejected() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("no layer"); thrown.expectMessage("NotThere"); layeredArchitecture() .layer("Some").definedBy("any") .whereLayer("Some").mayOnlyBeAccessedByLayers("NotThe...
@PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
@Test public void layered_architecture_allows_individual_empty_optionalLayer() { LayeredArchitecture architecture = layeredArchitecture() .optionalLayer("can be absent").definedBy(absolute("should.not.be.found..")); JavaClasses classes = new ClassFileImporter().importPackages(absolute("")); EvaluationResult result = ar...
@PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
@Test public void layered_architecture_combines_multiple_ignores() { JavaClasses classes = new ClassFileImporter().importClasses( FirstAnyPkgClass.class, SomePkgSubClass.class, SecondThreeAnyClass.class, SomePkgClass.class); LayeredArchitecture layeredArchitecture = layeredArchitecture() .layer("One").definedBy(absolut...
@PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static LayeredArchitecture layeredArchitecture() { return new LayeredArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
@Test public void onion_architecture_description() { OnionArchitecture architecture = onionArchitecture() .domainModels("onionarchitecture.domain.model..") .domainServices("onionarchitecture.domain.service..") .applicationServices("onionarchitecture.application..") .adapter("cli", "onionarchitecture.adapter.cli..") .ad...
@PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); } }
Architectures { @PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); } private Architectures(); }
Architectures { @PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
@Test public void onion_architecture_description_with_missing_layers() { OnionArchitecture architecture = onionArchitecture(); assertThat(architecture.getDescription()).isEqualTo("Onion architecture consisting of"); }
@PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); } }
Architectures { @PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); } private Architectures(); }
Architectures { @PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
@Test public void onion_architecture_overridden_description() { OnionArchitecture architecture = onionArchitecture() .domainModels("onionarchitecture.domain.model..") .domainServices("onionarchitecture.domain.service..") .applicationServices("onionarchitecture.application..") .adapter("cli", "onionarchitecture.adapter....
@PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); } }
Architectures { @PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); } private Architectures(); }
Architectures { @PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
@Test public void onion_architecture_because_clause() { ArchRule architecture = onionArchitecture() .domainModels("onionarchitecture.domain.model..") .domainServices("onionarchitecture.domain.service..") .applicationServices("onionarchitecture.application..") .adapter("cli", "onionarchitecture.adapter.cli..") .adapter(...
@PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); } }
Architectures { @PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); } private Architectures(); }
Architectures { @PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
Architectures { @PublicAPI(usage = ACCESS) public static OnionArchitecture onionArchitecture() { return new OnionArchitecture(); } private Architectures(); @PublicAPI(usage = ACCESS) static LayeredArchitecture layeredArchitecture(); @PublicAPI(usage = ACCESS) static OnionArchitecture onionArchitecture(); }
@Test public void loads_a_single_extension() throws IOException { testServicesFile.addService(TestExtension.class); Iterable<ArchUnitExtension> extensions = extensionLoader.getAll(); assertThat(getOnlyElement(extensions)).isInstanceOf(TestExtension.class); }
Iterable<ArchUnitExtension> getAll() { return extensions.get(); }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
@Test public void handleViolations_reports_only_violations_referring_to_the_correct_type() { ConditionEvents events = events( SimpleConditionEvent.satisfied(new CorrectType("do not handle"), "I'm not violated"), SimpleConditionEvent.violated(new WrongType(), "I'm violated, but wrong type"), SimpleConditionEvent.violate...
@PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public void handleViolations(ViolationHandler<?> violationHandler) { ConditionEvent.Handler eventHandler = convertToEventHandler(violationHandler); for (final ConditionEvent event : eventsByViolation.get(Type.VIOLATION)) { event.handleWith(eventHandler); } }
ConditionEvents implements Iterable<ConditionEvent> { @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public void handleViolations(ViolationHandler<?> violationHandler) { ConditionEvent.Handler eventHandler = convertToEventHandler(violationHandler); for (final ConditionEvent event : eventsByViolation.get(Type.VIOLATIO...
ConditionEvents implements Iterable<ConditionEvent> { @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public void handleViolations(ViolationHandler<?> violationHandler) { ConditionEvent.Handler eventHandler = convertToEventHandler(violationHandler); for (final ConditionEvent event : eventsByViolation.get(Type.VIOLATIO...
ConditionEvents implements Iterable<ConditionEvent> { @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public void handleViolations(ViolationHandler<?> violationHandler) { ConditionEvent.Handler eventHandler = convertToEventHandler(violationHandler); for (final ConditionEvent event : eventsByViolation.get(Type.VIOLATIO...
ConditionEvents implements Iterable<ConditionEvent> { @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public void handleViolations(ViolationHandler<?> violationHandler) { ConditionEvent.Handler eventHandler = convertToEventHandler(violationHandler); for (final ConditionEvent event : eventsByViolation.get(Type.VIOLATIO...
@Test public void get_package_identifier_associated_with_class() { String expectedPackageIdentifier = SomeOriginClass.class.getPackage().getName().replaceAll(".*\\.", ".."); JavaClassDiagramAssociation javaClassDiagramAssociation = createAssociation(TestDiagram.in(temporaryFolder) .component("A").withStereoTypes(expect...
Set<String> getPackageIdentifiersFromComponentOf(JavaClass javaClass) { return getPackageIdentifiersFromComponentOf(getComponentOf(javaClass)); }
JavaClassDiagramAssociation { Set<String> getPackageIdentifiersFromComponentOf(JavaClass javaClass) { return getPackageIdentifiersFromComponentOf(getComponentOf(javaClass)); } }
JavaClassDiagramAssociation { Set<String> getPackageIdentifiersFromComponentOf(JavaClass javaClass) { return getPackageIdentifiersFromComponentOf(getComponentOf(javaClass)); } JavaClassDiagramAssociation(PlantUmlDiagram diagram); }
JavaClassDiagramAssociation { Set<String> getPackageIdentifiersFromComponentOf(JavaClass javaClass) { return getPackageIdentifiersFromComponentOf(getComponentOf(javaClass)); } JavaClassDiagramAssociation(PlantUmlDiagram diagram); }
JavaClassDiagramAssociation { Set<String> getPackageIdentifiersFromComponentOf(JavaClass javaClass) { return getPackageIdentifiersFromComponentOf(getComponentOf(javaClass)); } JavaClassDiagramAssociation(PlantUmlDiagram diagram); }
@Test public void get_target_package_identifiers_of_class() { String expectedTarget1 = "..target1"; String expectedTarget2 = "..target2"; JavaClassDiagramAssociation javaClassDiagramAssociation = createAssociation(TestDiagram.in(temporaryFolder) .component("A").withStereoTypes(SomeOriginClass.class.getPackage().getName...
Set<String> getTargetPackageIdentifiers(final JavaClass javaClass) { ImmutableSet.Builder<String> result = ImmutableSet.builder(); for (PlantUmlComponent target : getComponentOf(javaClass).getDependencies()) { result.addAll(getPackageIdentifiersFromComponentOf(target)); } return result.build(); }
JavaClassDiagramAssociation { Set<String> getTargetPackageIdentifiers(final JavaClass javaClass) { ImmutableSet.Builder<String> result = ImmutableSet.builder(); for (PlantUmlComponent target : getComponentOf(javaClass).getDependencies()) { result.addAll(getPackageIdentifiersFromComponentOf(target)); } return result.bui...
JavaClassDiagramAssociation { Set<String> getTargetPackageIdentifiers(final JavaClass javaClass) { ImmutableSet.Builder<String> result = ImmutableSet.builder(); for (PlantUmlComponent target : getComponentOf(javaClass).getDependencies()) { result.addAll(getPackageIdentifiersFromComponentOf(target)); } return result.bui...
JavaClassDiagramAssociation { Set<String> getTargetPackageIdentifiers(final JavaClass javaClass) { ImmutableSet.Builder<String> result = ImmutableSet.builder(); for (PlantUmlComponent target : getComponentOf(javaClass).getDependencies()) { result.addAll(getPackageIdentifiersFromComponentOf(target)); } return result.bui...
JavaClassDiagramAssociation { Set<String> getTargetPackageIdentifiers(final JavaClass javaClass) { ImmutableSet.Builder<String> result = ImmutableSet.builder(); for (PlantUmlComponent target : getComponentOf(javaClass).getDependencies()) { result.addAll(getPackageIdentifiersFromComponentOf(target)); } return result.bui...
@Test public void rejects_class_not_contained_in_any_component() { JavaClassDiagramAssociation javaClassDiagramAssociation = createAssociation(TestDiagram.in(temporaryFolder) .component("SomeComponent").withStereoTypes("..someStereotype.") .write()); JavaClass classNotContained = importClassWithContext(Object.class); t...
Set<String> getTargetPackageIdentifiers(final JavaClass javaClass) { ImmutableSet.Builder<String> result = ImmutableSet.builder(); for (PlantUmlComponent target : getComponentOf(javaClass).getDependencies()) { result.addAll(getPackageIdentifiersFromComponentOf(target)); } return result.build(); }
JavaClassDiagramAssociation { Set<String> getTargetPackageIdentifiers(final JavaClass javaClass) { ImmutableSet.Builder<String> result = ImmutableSet.builder(); for (PlantUmlComponent target : getComponentOf(javaClass).getDependencies()) { result.addAll(getPackageIdentifiersFromComponentOf(target)); } return result.bui...
JavaClassDiagramAssociation { Set<String> getTargetPackageIdentifiers(final JavaClass javaClass) { ImmutableSet.Builder<String> result = ImmutableSet.builder(); for (PlantUmlComponent target : getComponentOf(javaClass).getDependencies()) { result.addAll(getPackageIdentifiersFromComponentOf(target)); } return result.bui...
JavaClassDiagramAssociation { Set<String> getTargetPackageIdentifiers(final JavaClass javaClass) { ImmutableSet.Builder<String> result = ImmutableSet.builder(); for (PlantUmlComponent target : getComponentOf(javaClass).getDependencies()) { result.addAll(getPackageIdentifiersFromComponentOf(target)); } return result.bui...
JavaClassDiagramAssociation { Set<String> getTargetPackageIdentifiers(final JavaClass javaClass) { ImmutableSet.Builder<String> result = ImmutableSet.builder(); for (PlantUmlComponent target : getComponentOf(javaClass).getDependencies()) { result.addAll(getPackageIdentifiersFromComponentOf(target)); } return result.bui...
@Test public void reports_if_class_is_contained_in_any_component() { JavaClassDiagramAssociation javaClassDiagramAssociation = createAssociation(TestDiagram.in(temporaryFolder) .component("Object").withStereoTypes(Object.class.getPackage().getName()) .write()); assertThat(javaClassDiagramAssociation.contains(importClas...
boolean contains(JavaClass javaClass) { return !getAssociatedComponents(javaClass).isEmpty(); }
JavaClassDiagramAssociation { boolean contains(JavaClass javaClass) { return !getAssociatedComponents(javaClass).isEmpty(); } }
JavaClassDiagramAssociation { boolean contains(JavaClass javaClass) { return !getAssociatedComponents(javaClass).isEmpty(); } JavaClassDiagramAssociation(PlantUmlDiagram diagram); }
JavaClassDiagramAssociation { boolean contains(JavaClass javaClass) { return !getAssociatedComponents(javaClass).isEmpty(); } JavaClassDiagramAssociation(PlantUmlDiagram diagram); }
JavaClassDiagramAssociation { boolean contains(JavaClass javaClass) { return !getAssociatedComponents(javaClass).isEmpty(); } JavaClassDiagramAssociation(PlantUmlDiagram diagram); }
@Test public void class_resides_in_multiple_packages() { JavaClassDiagramAssociation javaClassDiagramAssociation = createAssociation(TestDiagram.in(temporaryFolder) .component("A").withStereoTypes("..foopackage..") .component("B").withStereoTypes("..barpackage") .write()); JavaClass classContainedInTwoComponents = impo...
Set<String> getTargetPackageIdentifiers(final JavaClass javaClass) { ImmutableSet.Builder<String> result = ImmutableSet.builder(); for (PlantUmlComponent target : getComponentOf(javaClass).getDependencies()) { result.addAll(getPackageIdentifiersFromComponentOf(target)); } return result.build(); }
JavaClassDiagramAssociation { Set<String> getTargetPackageIdentifiers(final JavaClass javaClass) { ImmutableSet.Builder<String> result = ImmutableSet.builder(); for (PlantUmlComponent target : getComponentOf(javaClass).getDependencies()) { result.addAll(getPackageIdentifiersFromComponentOf(target)); } return result.bui...
JavaClassDiagramAssociation { Set<String> getTargetPackageIdentifiers(final JavaClass javaClass) { ImmutableSet.Builder<String> result = ImmutableSet.builder(); for (PlantUmlComponent target : getComponentOf(javaClass).getDependencies()) { result.addAll(getPackageIdentifiersFromComponentOf(target)); } return result.bui...
JavaClassDiagramAssociation { Set<String> getTargetPackageIdentifiers(final JavaClass javaClass) { ImmutableSet.Builder<String> result = ImmutableSet.builder(); for (PlantUmlComponent target : getComponentOf(javaClass).getDependencies()) { result.addAll(getPackageIdentifiersFromComponentOf(target)); } return result.bui...
JavaClassDiagramAssociation { Set<String> getTargetPackageIdentifiers(final JavaClass javaClass) { ImmutableSet.Builder<String> result = ImmutableSet.builder(); for (PlantUmlComponent target : getComponentOf(javaClass).getDependencies()) { result.addAll(getPackageIdentifiersFromComponentOf(target)); } return result.bui...
@Test public void parses_correct_number_of_components() { PlantUmlDiagram diagram = createDiagram(TestDiagram.in(temporaryFolder) .component("SomeOrigin").withStereoTypes("..origin..") .component("SomeTarget").withStereoTypes("..target..") .write()); assertThat(diagram.getAllComponents()).hasSize(2); }
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void parses_a_simple_component() { PlantUmlDiagram diagram = createDiagram(TestDiagram.in(temporaryFolder) .component("SomeOrigin").withStereoTypes("..origin..") .write()); PlantUmlComponent origin = getComponentWithName("SomeOrigin", diagram); assertThat(getOnlyElement(origin.getStereotypes())).as("Stereo...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test @UseDataProvider("simple_diagrams") public void parses_dependency_of_simple_component_diagram(Function<TestDiagram, TestDiagram> testCase) { TestDiagram initialDiagram = TestDiagram.in(temporaryFolder) .component("SomeOrigin").withStereoTypes("..origin..") .component("SomeTarget").withStereoTypes("..target.."); P...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test @UseDataProvider("dependency_arrow_testcases") public void parses_various_types_of_dependency_arrows(String dependency) { PlantUmlDiagram diagram = createDiagram(TestDiagram.in(temporaryFolder) .component("SomeOrigin").withStereoTypes("..origin..") .component("SomeTarget").withStereoTypes("..target..") .rawLine(d...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void does_not_include_commented_out_lines() { PlantUmlDiagram diagram = createDiagram(TestDiagram.in(temporaryFolder) .component("uncommentedComponent").withAlias("uncommentedAlias").withStereoTypes("..uncommentedPackage..") .rawLine(" ' [commentedComponent] <<..commentedPackage..>> as commentedAlias") .ra...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void caches_loaded_extensions() { testServicesFile.addService(TestExtension.class); Iterable<ArchUnitExtension> first = extensionLoader.getAll(); Iterable<ArchUnitExtension> second = extensionLoader.getAll(); assertThat(first).usingElementComparator(sameInstance()).hasSameElementsAs(second); }
Iterable<ArchUnitExtension> getAll() { return extensions.get(); }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
@Test public void does_not_include_dependency_descriptions() { PlantUmlDiagram diagram = createDiagram(TestDiagram.in(temporaryFolder) .component("component").withStereoTypes("..somePackage..") .component("otherComponent").withStereoTypes("..somePackage2..") .rawLine("[component] --> [otherComponent] : this part should...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void throws_exception_with_components_that_are_not_yet_defined() { File file = TestDiagram.in(temporaryFolder) .dependencyFrom("[NotYetDefined]").to("[AlsoNotYetDefined]") .write(); thrown.expect(IllegalDiagramException.class); thrown.expectMessage("There is no Component with name or alias = 'NotYetDefined...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void throws_exception_with_components_without_stereotypes() { File file = TestDiagram.in(temporaryFolder) .rawLine("[componentWithoutStereotype]") .write(); thrown.expect(IllegalDiagramException.class); thrown.expectMessage("componentWithoutStereotype"); thrown.expectMessage("at least one stereotype specif...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void parses_two_identical_components_no_dependency() { PlantUmlDiagram diagram = createDiagram(TestDiagram.in(temporaryFolder) .component("someName").withAlias("someAlias").withStereoTypes("someStereotype") .component("someName").withAlias("someAlias").withStereoTypes("someStereotype") .write()); assertTha...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void rejects_a_component_with_an_illegal_alias() { File file = TestDiagram.in(temporaryFolder) .component("irrelevant").withAlias("ill[]egal").withStereoTypes("..irrelevant..") .write(); thrown.expect(IllegalDiagramException.class); thrown.expectMessage("Alias 'ill[]egal' should not contain character(s): '...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void parses_a_tricky_alias() { PlantUmlDiagram diagram = createDiagram(TestDiagram.in(temporaryFolder) .component("tricky").withAlias("because it's quoted").withStereoTypes("..tricky..") .component("tricky as hell cause of as keyword").withAlias("other").withStereoTypes("..other..") .write()); PlantUmlComp...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void parses_component_diagram_with_multiple_stereotypes() { PlantUmlDiagram diagram = createDiagram(TestDiagram.in(temporaryFolder) .component("someComponent") .withStereoTypes("..firstPackage..", "..secondPackage..", "..thirdPackage..") .write()); PlantUmlComponent component = getOnlyElement(diagram.getAl...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void parses_component_diagram_with_multiple_stereotypes_and_alias() { PlantUmlDiagram diagram = createDiagram(TestDiagram.in(temporaryFolder) .component("someComponent").withAlias("someAlias") .withStereoTypes("..firstPackage..", "..secondPackage..", "..thirdPackage..") .write()); PlantUmlComponent compone...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void parses_diagram_with_dependencies_that_use_alias() { PlantUmlDiagram diagram = createDiagram(TestDiagram.in(temporaryFolder) .component("A").withAlias("aliasForA").withStereoTypes("..controller..") .component("B").withAlias("aliasForB").withStereoTypes("..service..") .dependencyFrom("aliasForA").to("al...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void parses_dependencies_between_components_without_brackets() { PlantUmlDiagram diagram = createDiagram(TestDiagram.in(temporaryFolder) .component("A").withStereoTypes("..origin..") .component("B").withStereoTypes("..target..") .dependencyFrom("A").to("B") .write()); PlantUmlComponent a = getComponentWith...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void loads_multiple_extensions() throws IOException { testServicesFile.addService(TestExtension.class); testServicesFile.addService(DummyTestExtension.class); testServicesFile.addService(YetAnotherDummyTestExtension.class); Iterable<ArchUnitExtension> extensions = extensionLoader.getAll(); assertThat(exten...
Iterable<ArchUnitExtension> getAll() { return extensions.get(); }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
@Test public void parses_multiple_components_and_dependencies() { File file = TestDiagram.in(temporaryFolder) .component("Component1").withStereoTypes("..origin1..") .component("Component2").withStereoTypes("..target1..") .component("Component3").withStereoTypes("..origin2..") .component("Component4").withStereoTypes("...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void parses_a_diagram_with_non_unique_origins() { File file = TestDiagram.in(temporaryFolder) .component("Component1").withStereoTypes("..origin..") .component("Component2").withStereoTypes("..target1..") .component("Component3").withStereoTypes("..target2..") .dependencyFrom("[Component1]").to("[Component...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void parse_a_diagram_with_non_unique_targets() { File file = TestDiagram.in(temporaryFolder) .component("Component1").withStereoTypes("..origin1..") .component("Component2").withStereoTypes("..origin2..") .component("Component3").withStereoTypes("..target..") .dependencyFrom("[Component1]").to("[Component3...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void parse_a_component_diagram_with_both_alias_and_names_used() { PlantUmlDiagram diagram = createDiagram(TestDiagram.in(temporaryFolder) .component("A").withAlias("foo").withStereoTypes("..service..") .component("B").withStereoTypes("..controller..") .dependencyFrom("[B]").to("foo") .dependencyFrom("foo")...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void parses_a_component_diagram_that_uses_alias_with_and_without_brackets() { File file = TestDiagram.in(temporaryFolder) .component("A").withAlias("foo").withStereoTypes("..origin..") .component("B").withAlias("bar").withStereoTypes("..target..") .dependencyFrom("foo").to("bar") .dependencyFrom("[foo]").t...
private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dependencies = parse...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
PlantUmlParser { private PlantUmlDiagram createDiagram(List<String> rawDiagramLines) { List<String> diagramLines = filterOutComments(rawDiagramLines); Set<PlantUmlComponent> components = parseComponents(diagramLines); PlantUmlComponents plantUmlComponents = new PlantUmlComponents(components); List<ParsedDependency> dep...
@Test public void diagram_with_multiple_dependencies_that_considers_only_certain_packages() { File file = TestDiagram.in(temporaryFolder) .component("SomeOrigin").withStereoTypes("..origin") .component("SomeIntermediary").withStereoTypes("..intermediary") .component("SomeTarget").withStereoTypes("..target") .dependency...
@PublicAPI(usage = ACCESS) public static PlantUmlArchCondition adhereToPlantUmlDiagram(URL url, Configuration configuration) { return create(url, configuration); }
PlantUmlArchCondition extends ArchCondition<JavaClass> { @PublicAPI(usage = ACCESS) public static PlantUmlArchCondition adhereToPlantUmlDiagram(URL url, Configuration configuration) { return create(url, configuration); } }
PlantUmlArchCondition extends ArchCondition<JavaClass> { @PublicAPI(usage = ACCESS) public static PlantUmlArchCondition adhereToPlantUmlDiagram(URL url, Configuration configuration) { return create(url, configuration); } private PlantUmlArchCondition( String description, DescribedPredicate<Depe...
PlantUmlArchCondition extends ArchCondition<JavaClass> { @PublicAPI(usage = ACCESS) public static PlantUmlArchCondition adhereToPlantUmlDiagram(URL url, Configuration configuration) { return create(url, configuration); } private PlantUmlArchCondition( String description, DescribedPredicate<Depe...
PlantUmlArchCondition extends ArchCondition<JavaClass> { @PublicAPI(usage = ACCESS) public static PlantUmlArchCondition adhereToPlantUmlDiagram(URL url, Configuration configuration) { return create(url, configuration); } private PlantUmlArchCondition( String description, DescribedPredicate<Depe...
@Test public void default_violation_store_works() throws IOException { useTemporaryDefaultStorePath(); ArchConfiguration.get().setProperty(ALLOW_STORE_CREATION_PROPERTY_NAME, "true"); String[] frozenViolations = {"first violation", "second violation"}; FreezingArchRule frozen = freeze(rule("some description") .withViol...
@PublicAPI(usage = ACCESS) public static FreezingArchRule freeze(ArchRule rule) { return new FreezingArchRule(rule, ViolationStoreFactory.create(), ViolationLineMatcherFactory.create()); }
FreezingArchRule implements ArchRule { @PublicAPI(usage = ACCESS) public static FreezingArchRule freeze(ArchRule rule) { return new FreezingArchRule(rule, ViolationStoreFactory.create(), ViolationLineMatcherFactory.create()); } }
FreezingArchRule implements ArchRule { @PublicAPI(usage = ACCESS) public static FreezingArchRule freeze(ArchRule rule) { return new FreezingArchRule(rule, ViolationStoreFactory.create(), ViolationLineMatcherFactory.create()); } private FreezingArchRule(ArchRule delegate, ViolationStore store, ViolationLineMatcher matc...
FreezingArchRule implements ArchRule { @PublicAPI(usage = ACCESS) public static FreezingArchRule freeze(ArchRule rule) { return new FreezingArchRule(rule, ViolationStoreFactory.create(), ViolationLineMatcherFactory.create()); } private FreezingArchRule(ArchRule delegate, ViolationStore store, ViolationLineMatcher matc...
FreezingArchRule implements ArchRule { @PublicAPI(usage = ACCESS) public static FreezingArchRule freeze(ArchRule rule) { return new FreezingArchRule(rule, ViolationStoreFactory.create(), ViolationLineMatcherFactory.create()); } private FreezingArchRule(ArchRule delegate, ViolationStore store, ViolationLineMatcher matc...
@Test @DataProvider(splitBy = "\\|", value = { "" + "|" + "|" + true, "" + "abc|" + "abc|" + true, "" + "abc|" + "abcd|" + false, "" + "(A.java:1)|" + "(A.java:2)|" + true, "" + "A.java:1|" + "A.java:2|" + false, "" + "(A.java:1)|" + "(A.java:2|" + false, "" + "A$1 B$2 C$4 (X.java:111)|" + "A$2 B$3 C$5 (X.java:222)|" +...
static ViolationLineMatcher create() { return ArchConfiguration.get().containsProperty(FREEZE_LINE_MATCHER_PROPERTY) ? createInstance(ArchConfiguration.get().getProperty(FREEZE_LINE_MATCHER_PROPERTY)) : DEFAULT_MATCHER; }
ViolationLineMatcherFactory { static ViolationLineMatcher create() { return ArchConfiguration.get().containsProperty(FREEZE_LINE_MATCHER_PROPERTY) ? createInstance(ArchConfiguration.get().getProperty(FREEZE_LINE_MATCHER_PROPERTY)) : DEFAULT_MATCHER; } }
ViolationLineMatcherFactory { static ViolationLineMatcher create() { return ArchConfiguration.get().containsProperty(FREEZE_LINE_MATCHER_PROPERTY) ? createInstance(ArchConfiguration.get().getProperty(FREEZE_LINE_MATCHER_PROPERTY)) : DEFAULT_MATCHER; } }
ViolationLineMatcherFactory { static ViolationLineMatcher create() { return ArchConfiguration.get().containsProperty(FREEZE_LINE_MATCHER_PROPERTY) ? createInstance(ArchConfiguration.get().getProperty(FREEZE_LINE_MATCHER_PROPERTY)) : DEFAULT_MATCHER; } }
ViolationLineMatcherFactory { static ViolationLineMatcher create() { return ArchConfiguration.get().containsProperty(FREEZE_LINE_MATCHER_PROPERTY) ? createInstance(ArchConfiguration.get().getProperty(FREEZE_LINE_MATCHER_PROPERTY)) : DEFAULT_MATCHER; } }
@Test public void getAllFields() { Collection<Field> fields = ReflectionUtils.getAllFields(Child.class, named("field")); assertThat(fields).containsOnly( field(Child.class, "field"), field(UpperMiddle.class, "field"), field(LowerMiddle.class, "field"), field(Parent.class, "field") ); }
static Collection<Field> getAllFields(Class<?> owner, Predicate<? super Field> predicate) { return filter(getAll(owner, new Collector<Field>() { @Override protected Collection<? extends Field> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredFields()); } }), toGuava(predicate)); }
ReflectionUtils { static Collection<Field> getAllFields(Class<?> owner, Predicate<? super Field> predicate) { return filter(getAll(owner, new Collector<Field>() { @Override protected Collection<? extends Field> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredFields()); } }), toGuava(predicate))...
ReflectionUtils { static Collection<Field> getAllFields(Class<?> owner, Predicate<? super Field> predicate) { return filter(getAll(owner, new Collector<Field>() { @Override protected Collection<? extends Field> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredFields()); } }), toGuava(predicate))...
ReflectionUtils { static Collection<Field> getAllFields(Class<?> owner, Predicate<? super Field> predicate) { return filter(getAll(owner, new Collector<Field>() { @Override protected Collection<? extends Field> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredFields()); } }), toGuava(predicate))...
ReflectionUtils { static Collection<Field> getAllFields(Class<?> owner, Predicate<? super Field> predicate) { return filter(getAll(owner, new Collector<Field>() { @Override protected Collection<? extends Field> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredFields()); } }), toGuava(predicate))...
@Test public void getAllMethods() { Collection<Method> methods = ReflectionUtils.getAllMethods(Child.class, named("overrideMe")); assertThat(methods).containsOnly( method(Child.class, "overrideMe"), method(UpperMiddle.class, "overrideMe"), method(LowerMiddle.class, "overrideMe"), method(Parent.class, "overrideMe") ); }
static Collection<Method> getAllMethods(Class<?> owner, Predicate<? super Method> predicate) { return filter(getAll(owner, new Collector<Method>() { @Override protected Collection<? extends Method> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredMethods()); } }), toGuava(predicate)); }
ReflectionUtils { static Collection<Method> getAllMethods(Class<?> owner, Predicate<? super Method> predicate) { return filter(getAll(owner, new Collector<Method>() { @Override protected Collection<? extends Method> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredMethods()); } }), toGuava(predi...
ReflectionUtils { static Collection<Method> getAllMethods(Class<?> owner, Predicate<? super Method> predicate) { return filter(getAll(owner, new Collector<Method>() { @Override protected Collection<? extends Method> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredMethods()); } }), toGuava(predi...
ReflectionUtils { static Collection<Method> getAllMethods(Class<?> owner, Predicate<? super Method> predicate) { return filter(getAll(owner, new Collector<Method>() { @Override protected Collection<? extends Method> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredMethods()); } }), toGuava(predi...
ReflectionUtils { static Collection<Method> getAllMethods(Class<?> owner, Predicate<? super Method> predicate) { return filter(getAll(owner, new Collector<Method>() { @Override protected Collection<? extends Method> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredMethods()); } }), toGuava(predi...
@Test public void rejects_null_extension_identifier() { testServicesFile.addService(TestExtensionWithNullIdentifier.class); thrown.expect(ExtensionLoadingException.class); thrown.expectMessage("identifier"); thrown.expectMessage("null"); thrown.expectMessage(containingWord(TestExtensionWithNullIdentifier.class.getName(...
Iterable<ArchUnitExtension> getAll() { return extensions.get(); }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
@Test public void getAllSupertypes() { assertThat(ReflectionUtils.getAllSuperTypes(Child.class)).containsOnly( Child.class, ChildInterface.class, UpperMiddle.class, LowerMiddle.class, Parent.class, SomeInterface.class, OtherInterface.class, Object.class ); }
static Set<Class<?>> getAllSuperTypes(Class<?> type) { if (type == null) { return Collections.emptySet(); } ImmutableSet.Builder<Class<?>> result = ImmutableSet.<Class<?>>builder() .add(type) .addAll(getAllSuperTypes(type.getSuperclass())); for (Class<?> c : type.getInterfaces()) { result.addAll(getAllSuperTypes(c)); }...
ReflectionUtils { static Set<Class<?>> getAllSuperTypes(Class<?> type) { if (type == null) { return Collections.emptySet(); } ImmutableSet.Builder<Class<?>> result = ImmutableSet.<Class<?>>builder() .add(type) .addAll(getAllSuperTypes(type.getSuperclass())); for (Class<?> c : type.getInterfaces()) { result.addAll(getAl...
ReflectionUtils { static Set<Class<?>> getAllSuperTypes(Class<?> type) { if (type == null) { return Collections.emptySet(); } ImmutableSet.Builder<Class<?>> result = ImmutableSet.<Class<?>>builder() .add(type) .addAll(getAllSuperTypes(type.getSuperclass())); for (Class<?> c : type.getInterfaces()) { result.addAll(getAl...
ReflectionUtils { static Set<Class<?>> getAllSuperTypes(Class<?> type) { if (type == null) { return Collections.emptySet(); } ImmutableSet.Builder<Class<?>> result = ImmutableSet.<Class<?>>builder() .add(type) .addAll(getAllSuperTypes(type.getSuperclass())); for (Class<?> c : type.getInterfaces()) { result.addAll(getAl...
ReflectionUtils { static Set<Class<?>> getAllSuperTypes(Class<?> type) { if (type == null) { return Collections.emptySet(); } ImmutableSet.Builder<Class<?>> result = ImmutableSet.<Class<?>>builder() .add(type) .addAll(getAllSuperTypes(type.getSuperclass())); for (Class<?> c : type.getInterfaces()) { result.addAll(getAl...
@Test public void getAllMethods_of_interface() { assertThat(ReflectionUtils.getAllMethods(SubInterface.class, always(true))) .containsOnly( method(SomeInterface.class, "foo"), method(OtherInterface.class, "bar")); }
static Collection<Method> getAllMethods(Class<?> owner, Predicate<? super Method> predicate) { return filter(getAll(owner, new Collector<Method>() { @Override protected Collection<? extends Method> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredMethods()); } }), toGuava(predicate)); }
ReflectionUtils { static Collection<Method> getAllMethods(Class<?> owner, Predicate<? super Method> predicate) { return filter(getAll(owner, new Collector<Method>() { @Override protected Collection<? extends Method> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredMethods()); } }), toGuava(predi...
ReflectionUtils { static Collection<Method> getAllMethods(Class<?> owner, Predicate<? super Method> predicate) { return filter(getAll(owner, new Collector<Method>() { @Override protected Collection<? extends Method> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredMethods()); } }), toGuava(predi...
ReflectionUtils { static Collection<Method> getAllMethods(Class<?> owner, Predicate<? super Method> predicate) { return filter(getAll(owner, new Collector<Method>() { @Override protected Collection<? extends Method> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredMethods()); } }), toGuava(predi...
ReflectionUtils { static Collection<Method> getAllMethods(Class<?> owner, Predicate<? super Method> predicate) { return filter(getAll(owner, new Collector<Method>() { @Override protected Collection<? extends Method> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredMethods()); } }), toGuava(predi...
@Test public void getAllFields_of_interface() { assertThat(ReflectionUtils.getAllFields(SubInterface.class, always(true))) .containsOnly( field(SomeInterface.class, "SOME_CONSTANT"), field(OtherInterface.class, "OTHER_CONSTANT")); }
static Collection<Field> getAllFields(Class<?> owner, Predicate<? super Field> predicate) { return filter(getAll(owner, new Collector<Field>() { @Override protected Collection<? extends Field> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredFields()); } }), toGuava(predicate)); }
ReflectionUtils { static Collection<Field> getAllFields(Class<?> owner, Predicate<? super Field> predicate) { return filter(getAll(owner, new Collector<Field>() { @Override protected Collection<? extends Field> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredFields()); } }), toGuava(predicate))...
ReflectionUtils { static Collection<Field> getAllFields(Class<?> owner, Predicate<? super Field> predicate) { return filter(getAll(owner, new Collector<Field>() { @Override protected Collection<? extends Field> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredFields()); } }), toGuava(predicate))...
ReflectionUtils { static Collection<Field> getAllFields(Class<?> owner, Predicate<? super Field> predicate) { return filter(getAll(owner, new Collector<Field>() { @Override protected Collection<? extends Field> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredFields()); } }), toGuava(predicate))...
ReflectionUtils { static Collection<Field> getAllFields(Class<?> owner, Predicate<? super Field> predicate) { return filter(getAll(owner, new Collector<Field>() { @Override protected Collection<? extends Field> extractFrom(Class<?> type) { return ImmutableList.copyOf(type.getDeclaredFields()); } }), toGuava(predicate))...
@Test public void loads_classes() { JavaClasses classes = cache.getClassesToAnalyzeFor(TestClass.class, analyzePackages("com.tngtech.archunit.junit")); assertThat(classes).as("Classes were found").isNotEmpty(); }
JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisRequest, testClass...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
@Test public void reuses_loaded_classes_by_test() { cache.getClassesToAnalyzeFor(TestClass.class, analyzePackages("com.tngtech.archunit.junit")); cache.getClassesToAnalyzeFor(TestClass.class, analyzePackages("com.tngtech.archunit.junit")); verifyNumberOfImports(1); }
JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisRequest, testClass...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
@Test public void reuses_loaded_classes_by_locations_if_cacheMode_is_FOREVER() { cache.getClassesToAnalyzeFor(TestClass.class, analyzePackages("com.tngtech.archunit.junit")); cache.getClassesToAnalyzeFor(EquivalentTestClass.class, analyzePackages("com.tngtech.archunit.junit")); verifyNumberOfImports(1); }
JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisRequest, testClass...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
@Test public void doesnt_reuse_loaded_classes_by_locations_if_cacheMode_is_PER_CLASS() { cache.getClassesToAnalyzeFor(TestClass.class, analyzePackages("com.tngtech.archunit.junit").withCacheMode(PER_CLASS)); assertThat(cache.cachedByLocations.asMap()).as("Classes cached by location").isEmpty(); cache.getClassesToAnalyz...
JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisRequest, testClass...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
@Test public void filters_jars_relative_to_class() { JavaClasses classes = cache.getClassesToAnalyzeFor(TestClass.class, analyzePackagesOf(Rule.class)); assertThat(classes).isNotEmpty(); for (JavaClass clazz : classes) { assertThat(clazz.getPackageName()).doesNotContain("tngtech"); } }
JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisRequest, testClass...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
@Test public void gets_all_classes_relative_to_class() { JavaClasses classes = cache.getClassesToAnalyzeFor(TestClass.class, analyzePackagesOf(getClass())); assertThat(classes).isNotEmpty(); assertThat(classes.contain(getClass())).as("root class is contained itself").isTrue(); }
JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisRequest, testClass...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
@Test public void get_all_classes_by_LocationProvider() { JavaClasses classes = cache.getClassesToAnalyzeFor(TestClass.class, new TestAnalysisRequest() .withPackagesRoots(ClassCacheTest.class) .withLocationProviders(TestLocationProviderOfClass_String.class, TestLocationProviderOfClass_Rule.class)); assertThatTypes(clas...
JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisRequest, testClass...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
@Test public void rejects_illegal_characters_in_extension_identifier() { testServicesFile.addService(TestExtensionWithIllegalIdentifier.class); thrown.expect(ExtensionLoadingException.class); thrown.expectMessage("identifier"); thrown.expectMessage("'.'"); thrown.expectMessage(containingWord(TestExtensionWithIllegalIde...
Iterable<ArchUnitExtension> getAll() { return extensions.get(); }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
@Test public void rejects_LocationProviders_without_default_constructor() { thrown.expect(ArchTestExecutionException.class); thrown.expectMessage("public default constructor"); thrown.expectMessage(LocationProvider.class.getSimpleName()); cache.getClassesToAnalyzeFor(WrongLocationProviderWithConstructorParam.class, ana...
JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisRequest, testClass...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
@Test public void filters_urls() { JavaClasses classes = cache.getClassesToAnalyzeFor(TestClass.class, new TestAnalysisRequest().withImportOptions(TestFilterForJUnitJars.class)); assertThat(classes).isNotEmpty(); for (JavaClass clazz : classes) { assertThat(clazz.getPackageName()).doesNotContain("tngtech"); assertThat(...
JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisRequest, testClass...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
@Test public void non_existing_packages_are_ignored() { JavaClasses first = cache.getClassesToAnalyzeFor(TestClass.class, new TestAnalysisRequest() .withPackages("something.that.doesnt.exist") .withPackagesRoots(Rule.class)); JavaClasses second = cache.getClassesToAnalyzeFor(TestClass.class, analyzePackagesOf(Rule.clas...
JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisRequest, testClass...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
@Test @UseDataProvider("test_classes_without_any_imported_classes") public void when_there_are_only_nonexisting_sources_nothing_is_imported(TestAnalysisRequest analysisRequest) { JavaClasses classes = cache.getClassesToAnalyzeFor(TestClass.class, analysisRequest); assertThat(classes).isEmpty(); verify(cacheClassFileImp...
JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisRequest, testClass...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
@Test public void distinguishes_import_option_when_caching() { JavaClasses importingWholeClasspathWithFilter = cache.getClassesToAnalyzeFor(TestClass.class, new TestAnalysisRequest().withImportOptions(TestFilterForJUnitJars.class)); JavaClasses importingWholeClasspathWithEquivalentButDifferentFilter = cache.getClassesT...
JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisRequest, testClass...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
ClassCache { JavaClasses getClassesToAnalyzeFor(Class<?> testClass, ClassAnalysisRequest classAnalysisRequest) { checkNotNull(testClass); checkNotNull(classAnalysisRequest); if (cachedByTest.containsKey(testClass)) { return cachedByTest.get(testClass); } LocationsKey locations = RequestedLocations.by(classAnalysisReque...
@Test public void rejects_non_unique_extension_identifier() { testServicesFile.addService(TestExtension.class); testServicesFile.addService(TestExtensionWithSameIdentifier.class); thrown.expect(ExtensionLoadingException.class); thrown.expectMessage("must be unique"); thrown.expectMessage(TestExtension.UNIQUE_IDENTIFIER...
Iterable<ArchUnitExtension> getAll() { return extensions.get(); }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
@Test public void logs_discovered_extensions() { testServicesFile.addService(TestExtension.class); testServicesFile.addService(DummyTestExtension.class); logTestRule.watch(ArchUnitExtensionLoader.class, Level.INFO); extensionLoader.getAll(); logTestRule.assertLogMessage(Level.INFO, expectedExtensionLoadedMessage(TestEx...
Iterable<ArchUnitExtension> getAll() { return extensions.get(); }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
ArchUnitExtensionLoader { Iterable<ArchUnitExtension> getAll() { return extensions.get(); } }
@Test @UseDataProvider("conditionCombinations") public void join_inits_all_conditions(ConditionCombination combination) { ConditionWithInitAndFinish one = someCondition("one"); ConditionWithInitAndFinish two = someCondition("two"); combination.combine(one, two).init(singleton("init")); assertThat(one.allObjectsToTest)....
public void init(Iterable<T> allObjectsToTest) { }
ArchCondition { public void init(Iterable<T> allObjectsToTest) { } }
ArchCondition { public void init(Iterable<T> allObjectsToTest) { } ArchCondition(String description, Object... args); }
ArchCondition { public void init(Iterable<T> allObjectsToTest) { } ArchCondition(String description, Object... args); void init(Iterable<T> allObjectsToTest); abstract void check(T item, ConditionEvents events); void finish(ConditionEvents events); ArchCondition<T> and(ArchCondition<? super T> condition); ArchCondition...
ArchCondition { public void init(Iterable<T> allObjectsToTest) { } ArchCondition(String description, Object... args); void init(Iterable<T> allObjectsToTest); abstract void check(T item, ConditionEvents events); void finish(ConditionEvents events); ArchCondition<T> and(ArchCondition<? super T> condition); ArchCondition...
@Test @UseDataProvider("conditionCombinations") public void join_finishes_all_conditions(ConditionCombination combination) { ConditionWithInitAndFinish one = someCondition("one"); ConditionWithInitAndFinish two = someCondition("two"); ConditionEvents events = new ConditionEvents(); combination.combine(one, two).finish(...
public void finish(ConditionEvents events) { }
ArchCondition { public void finish(ConditionEvents events) { } }
ArchCondition { public void finish(ConditionEvents events) { } ArchCondition(String description, Object... args); }
ArchCondition { public void finish(ConditionEvents events) { } ArchCondition(String description, Object... args); void init(Iterable<T> allObjectsToTest); abstract void check(T item, ConditionEvents events); void finish(ConditionEvents events); ArchCondition<T> and(ArchCondition<? super T> condition); ArchCondition<T> ...
ArchCondition { public void finish(ConditionEvents events) { } ArchCondition(String description, Object... args); void init(Iterable<T> allObjectsToTest); abstract void check(T item, ConditionEvents events); void finish(ConditionEvents events); ArchCondition<T> and(ArchCondition<? super T> condition); ArchCondition<T> ...
@Test public void properties_are_passed_to_FailureReport() { EvaluationResult result = new EvaluationResult( hasDescription("special description"), events("first bummer", "second bummer"), Priority.HIGH); assertThat(result.getFailureReport().getDetails()).containsExactly("first bummer", "second bummer"); assertThat(res...
@PublicAPI(usage = ACCESS) public FailureReport getFailureReport() { return new FailureReport(rule, priority, events.getFailureMessages()); }
EvaluationResult { @PublicAPI(usage = ACCESS) public FailureReport getFailureReport() { return new FailureReport(rule, priority, events.getFailureMessages()); } }
EvaluationResult { @PublicAPI(usage = ACCESS) public FailureReport getFailureReport() { return new FailureReport(rule, priority, events.getFailureMessages()); } @PublicAPI(usage = ACCESS) EvaluationResult(HasDescription rule, Priority priority); @PublicAPI(usage = ACCESS) EvaluationResult(HasDescription rule, Conditi...
EvaluationResult { @PublicAPI(usage = ACCESS) public FailureReport getFailureReport() { return new FailureReport(rule, priority, events.getFailureMessages()); } @PublicAPI(usage = ACCESS) EvaluationResult(HasDescription rule, Priority priority); @PublicAPI(usage = ACCESS) EvaluationResult(HasDescription rule, Conditi...
EvaluationResult { @PublicAPI(usage = ACCESS) public FailureReport getFailureReport() { return new FailureReport(rule, priority, events.getFailureMessages()); } @PublicAPI(usage = ACCESS) EvaluationResult(HasDescription rule, Priority priority); @PublicAPI(usage = ACCESS) EvaluationResult(HasDescription rule, Conditi...
@Test public void throws_exception_if_object_is_set_more_than_once() { InitialConfiguration<Object> configuration = new InitialConfiguration<>(); configuration.set("old"); thrown.expect(IllegalStateException.class); thrown.expectMessage("set once"); thrown.expectMessage("old"); thrown.expectMessage("changed"); configur...
public synchronized void set(T object) { checkState(this.value == null, String.format( "Configuration may only be set once - current: %s / new: %s", this.value, object)); this.value = object; }
InitialConfiguration { public synchronized void set(T object) { checkState(this.value == null, String.format( "Configuration may only be set once - current: %s / new: %s", this.value, object)); this.value = object; } }
InitialConfiguration { public synchronized void set(T object) { checkState(this.value == null, String.format( "Configuration may only be set once - current: %s / new: %s", this.value, object)); this.value = object; } }
InitialConfiguration { public synchronized void set(T object) { checkState(this.value == null, String.format( "Configuration may only be set once - current: %s / new: %s", this.value, object)); this.value = object; } synchronized void set(T object); synchronized T get(); }
InitialConfiguration { public synchronized void set(T object) { checkState(this.value == null, String.format( "Configuration may only be set once - current: %s / new: %s", this.value, object)); this.value = object; } synchronized void set(T object); synchronized T get(); }
@Test public void handles_erased_generics_as_upper_bound() { ConditionEvents events = events( SimpleConditionEvent.violated(new CorrectType("ignore"), "correct"), SimpleConditionEvent.violated(new WrongType(), "wrong")); Set<String> handledFailureMessages = new HashSet<>(); events.handleViolations(genericBoundByCorrect...
@PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public void handleViolations(ViolationHandler<?> violationHandler) { ConditionEvent.Handler eventHandler = convertToEventHandler(violationHandler); for (final ConditionEvent event : eventsByViolation.get(Type.VIOLATION)) { event.handleWith(eventHandler); } }
ConditionEvents implements Iterable<ConditionEvent> { @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public void handleViolations(ViolationHandler<?> violationHandler) { ConditionEvent.Handler eventHandler = convertToEventHandler(violationHandler); for (final ConditionEvent event : eventsByViolation.get(Type.VIOLATIO...
ConditionEvents implements Iterable<ConditionEvent> { @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public void handleViolations(ViolationHandler<?> violationHandler) { ConditionEvent.Handler eventHandler = convertToEventHandler(violationHandler); for (final ConditionEvent event : eventsByViolation.get(Type.VIOLATIO...
ConditionEvents implements Iterable<ConditionEvent> { @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public void handleViolations(ViolationHandler<?> violationHandler) { ConditionEvent.Handler eventHandler = convertToEventHandler(violationHandler); for (final ConditionEvent event : eventsByViolation.get(Type.VIOLATIO...
ConditionEvents implements Iterable<ConditionEvent> { @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public void handleViolations(ViolationHandler<?> violationHandler) { ConditionEvent.Handler eventHandler = convertToEventHandler(violationHandler); for (final ConditionEvent event : eventsByViolation.get(Type.VIOLATIO...
@Test public void throws_exception_if_no_value_is_present_on_access() { thrown.expect(IllegalStateException.class); thrown.expectMessage("No value was ever set"); new InitialConfiguration<>().get(); }
public synchronized T get() { checkState(value != null, "No value was ever set"); return value; }
InitialConfiguration { public synchronized T get() { checkState(value != null, "No value was ever set"); return value; } }
InitialConfiguration { public synchronized T get() { checkState(value != null, "No value was ever set"); return value; } }
InitialConfiguration { public synchronized T get() { checkState(value != null, "No value was ever set"); return value; } synchronized void set(T object); synchronized T get(); }
InitialConfiguration { public synchronized T get() { checkState(value != null, "No value was ever set"); return value; } synchronized void set(T object); synchronized T get(); }
@Test public void locations_of_URLs() throws Exception { Collection<Location> locations = Locations.of(ImmutableList.of( urlOfClass(getClass()), urlOfClass(Locations.class))); assertThat(urisOf(locations)).containsOnly( urlOfClass(getClass()).toURI(), urlOfClass(Locations.class).toURI() ); }
@PublicAPI(usage = ACCESS) public static Set<Location> of(Iterable<URL> urls) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (URL url : urls) { result.add(Location.of(url)); } return result.build(); }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> of(Iterable<URL> urls) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (URL url : urls) { result.add(Location.of(url)); } return result.build(); } }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> of(Iterable<URL> urls) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (URL url : urls) { result.add(Location.of(url)); } return result.build(); } private Locations(); }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> of(Iterable<URL> urls) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (URL url : urls) { result.add(Location.of(url)); } return result.build(); } private Locations(); @PublicAPI(usage = ACCESS) static Set<Location> of(Iterable<UR...
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> of(Iterable<URL> urls) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (URL url : urls) { result.add(Location.of(url)); } return result.build(); } private Locations(); @PublicAPI(usage = ACCESS) static Set<Location> of(Iterable<UR...
@Test public void locations_of_packages_within_file_URIs() throws Exception { Set<Location> locations = Locations.ofPackage("com.tngtech.archunit.core.importer"); assertThat(urisOf(locations)).contains( uriOfFolderOf(getClass()), uriOfFolderOf(Locations.class) ); }
@PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); } }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); } private Locations(); }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); } private Locations(); @PublicAPI(usage = ACCESS) sta...
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); } private Locations(); @PublicAPI(usage = ACCESS) sta...
@Test public void locations_of_packages_within_JAR_URIs() throws Exception { Set<Location> locations = Locations.ofPackage("org.junit"); assertThat(urisOf(locations)).contains( uriOfFolderOf(Test.class) ); }
@PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); } }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); } private Locations(); }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); } private Locations(); @PublicAPI(usage = ACCESS) sta...
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); } private Locations(); @PublicAPI(usage = ACCESS) sta...
@Test public void locations_of_packages_within_JAR_URIs_that_do_not_contain_package_folder() throws Exception { independentClasspathRule.configureClasspath(); Set<Location> locations = Locations.ofPackage(independentClasspathRule.getIndependentTopLevelPackage()); ClassFileSource source = getOnlyElement(locations).asCla...
@PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); } }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); } private Locations(); }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); } private Locations(); @PublicAPI(usage = ACCESS) sta...
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); } private Locations(); @PublicAPI(usage = ACCESS) sta...
@Test public void locations_of_packages_from_mixed_URIs() { Set<Location> locations = Locations.ofPackage("com.tngtech"); assertThat(urisOf(locations)).contains( resolvedUri(getClass(), "/com/tngtech"), resolvedUri(DataProvider.class, "/com/tngtech") ); }
@PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); } }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); } private Locations(); }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); } private Locations(); @PublicAPI(usage = ACCESS) sta...
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofPackage(String pkg) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (Location location : getLocationsOf(asResourceName(pkg))) { result.add(location); } return result.build(); } private Locations(); @PublicAPI(usage = ACCESS) sta...
@Test public void locations_of_class_from_file_URI() throws Exception { assertThat(urisOf(Locations.ofClass(getClass()))).containsExactly( urlOfClass(getClass()).toURI() ); }
@PublicAPI(usage = ACCESS) public static Set<Location> ofClass(Class<?> clazz) { return getLocationsOf(asResourceName(clazz.getName()) + ".class"); }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofClass(Class<?> clazz) { return getLocationsOf(asResourceName(clazz.getName()) + ".class"); } }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofClass(Class<?> clazz) { return getLocationsOf(asResourceName(clazz.getName()) + ".class"); } private Locations(); }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofClass(Class<?> clazz) { return getLocationsOf(asResourceName(clazz.getName()) + ".class"); } private Locations(); @PublicAPI(usage = ACCESS) static Set<Location> of(Iterable<URL> urls); @PublicAPI(usage = ACCESS) static Set<Location> ofPackage(String...
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofClass(Class<?> clazz) { return getLocationsOf(asResourceName(clazz.getName()) + ".class"); } private Locations(); @PublicAPI(usage = ACCESS) static Set<Location> of(Iterable<URL> urls); @PublicAPI(usage = ACCESS) static Set<Location> ofPackage(String...
@Test public void locations_of_class_from_JAR_URI() throws Exception { assertThat(urisOf(Locations.ofClass(Test.class))).containsExactly( urlOfClass(Test.class).toURI() ); }
@PublicAPI(usage = ACCESS) public static Set<Location> ofClass(Class<?> clazz) { return getLocationsOf(asResourceName(clazz.getName()) + ".class"); }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofClass(Class<?> clazz) { return getLocationsOf(asResourceName(clazz.getName()) + ".class"); } }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofClass(Class<?> clazz) { return getLocationsOf(asResourceName(clazz.getName()) + ".class"); } private Locations(); }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofClass(Class<?> clazz) { return getLocationsOf(asResourceName(clazz.getName()) + ".class"); } private Locations(); @PublicAPI(usage = ACCESS) static Set<Location> of(Iterable<URL> urls); @PublicAPI(usage = ACCESS) static Set<Location> ofPackage(String...
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> ofClass(Class<?> clazz) { return getLocationsOf(asResourceName(clazz.getName()) + ".class"); } private Locations(); @PublicAPI(usage = ACCESS) static Set<Location> of(Iterable<URL> urls); @PublicAPI(usage = ACCESS) static Set<Location> ofPackage(String...
@Test public void locations_in_classpath() throws Exception { assertThat(urisOf(Locations.inClassPath())).contains( getClass().getResource("/").toURI(), resolvedUri(DataProvider.class, "/"), resolvedUri(Test.class, "/") ); }
@PublicAPI(usage = ACCESS) public static Set<Location> inClassPath() { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (URL url : locationResolver.get().resolveClassPath()) { result.add(Location.of(url)); } return result.build(); }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> inClassPath() { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (URL url : locationResolver.get().resolveClassPath()) { result.add(Location.of(url)); } return result.build(); } }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> inClassPath() { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (URL url : locationResolver.get().resolveClassPath()) { result.add(Location.of(url)); } return result.build(); } private Locations(); }
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> inClassPath() { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (URL url : locationResolver.get().resolveClassPath()) { result.add(Location.of(url)); } return result.build(); } private Locations(); @PublicAPI(usage = ACCESS) static ...
Locations { @PublicAPI(usage = ACCESS) public static Set<Location> inClassPath() { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (URL url : locationResolver.get().resolveClassPath()) { result.add(Location.of(url)); } return result.build(); } private Locations(); @PublicAPI(usage = ACCESS) static ...
@Test @UseDataProvider("locations_of_own_class") public void contains(Location location) { assertThat(location.contains("archunit")).as("location contains 'archunit'").isTrue(); assertThat(location.contains("/archunit/")).as("location contains '/archunit/'").isTrue(); assertThat(location.contains(getClass().getSimpleNa...
@PublicAPI(usage = ACCESS) public boolean contains(String part) { return uri.toString().contains(part); }
Location { @PublicAPI(usage = ACCESS) public boolean contains(String part) { return uri.toString().contains(part); } }
Location { @PublicAPI(usage = ACCESS) public boolean contains(String part) { return uri.toString().contains(part); } Location(NormalizedUri uri); }
Location { @PublicAPI(usage = ACCESS) public boolean contains(String part) { return uri.toString().contains(part); } Location(NormalizedUri uri); @PublicAPI(usage = ACCESS) URI asURI(); @PublicAPI(usage = ACCESS) boolean contains(String part); @PublicAPI(usage = ACCESS) boolean matches(Pattern pattern); @PublicAPI(usag...
Location { @PublicAPI(usage = ACCESS) public boolean contains(String part) { return uri.toString().contains(part); } Location(NormalizedUri uri); @PublicAPI(usage = ACCESS) URI asURI(); @PublicAPI(usage = ACCESS) boolean contains(String part); @PublicAPI(usage = ACCESS) boolean matches(Pattern pattern); @PublicAPI(usag...
@Test public void can_handle_with_generic_superclasses() { ConditionEvents events = events( SimpleConditionEvent.violated(new Object(), "ignore"), SimpleConditionEvent.violated("correct", "ignore")); StringHandler handler = new StringHandler(); events.handleViolations(handler); assertThat(handler.getRecorded()).contain...
@PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public void handleViolations(ViolationHandler<?> violationHandler) { ConditionEvent.Handler eventHandler = convertToEventHandler(violationHandler); for (final ConditionEvent event : eventsByViolation.get(Type.VIOLATION)) { event.handleWith(eventHandler); } }
ConditionEvents implements Iterable<ConditionEvent> { @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public void handleViolations(ViolationHandler<?> violationHandler) { ConditionEvent.Handler eventHandler = convertToEventHandler(violationHandler); for (final ConditionEvent event : eventsByViolation.get(Type.VIOLATIO...
ConditionEvents implements Iterable<ConditionEvent> { @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public void handleViolations(ViolationHandler<?> violationHandler) { ConditionEvent.Handler eventHandler = convertToEventHandler(violationHandler); for (final ConditionEvent event : eventsByViolation.get(Type.VIOLATIO...
ConditionEvents implements Iterable<ConditionEvent> { @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public void handleViolations(ViolationHandler<?> violationHandler) { ConditionEvent.Handler eventHandler = convertToEventHandler(violationHandler); for (final ConditionEvent event : eventsByViolation.get(Type.VIOLATIO...
ConditionEvents implements Iterable<ConditionEvent> { @PublicAPI(usage = ACCESS, state = EXPERIMENTAL) public void handleViolations(ViolationHandler<?> violationHandler) { ConditionEvent.Handler eventHandler = convertToEventHandler(violationHandler); for (final ConditionEvent event : eventsByViolation.get(Type.VIOLATIO...
@Test @UseDataProvider("locations_of_own_class") public void matches(Location location) { assertThat(location.matches(Pattern.compile("archunit.*"))).as("location matches 'archunit.*'").isFalse(); assertThat(location.matches(Pattern.compile(".*archunit.*"))).as("location matches '.*archunit.*'").isTrue(); assertThat(lo...
@PublicAPI(usage = ACCESS) public boolean matches(Pattern pattern) { return pattern.matcher(uri.toString()).matches(); }
Location { @PublicAPI(usage = ACCESS) public boolean matches(Pattern pattern) { return pattern.matcher(uri.toString()).matches(); } }
Location { @PublicAPI(usage = ACCESS) public boolean matches(Pattern pattern) { return pattern.matcher(uri.toString()).matches(); } Location(NormalizedUri uri); }
Location { @PublicAPI(usage = ACCESS) public boolean matches(Pattern pattern) { return pattern.matcher(uri.toString()).matches(); } Location(NormalizedUri uri); @PublicAPI(usage = ACCESS) URI asURI(); @PublicAPI(usage = ACCESS) boolean contains(String part); @PublicAPI(usage = ACCESS) boolean matches(Pattern pattern); ...
Location { @PublicAPI(usage = ACCESS) public boolean matches(Pattern pattern) { return pattern.matcher(uri.toString()).matches(); } Location(NormalizedUri uri); @PublicAPI(usage = ACCESS) URI asURI(); @PublicAPI(usage = ACCESS) boolean contains(String part); @PublicAPI(usage = ACCESS) boolean matches(Pattern pattern); ...
@Test public void asUri() throws URISyntaxException { URL url = getClass().getResource("."); assertThat(Location.of(url).asURI()).isEqualTo(url.toURI()); }
@PublicAPI(usage = ACCESS) public URI asURI() { return uri.toURI(); }
Location { @PublicAPI(usage = ACCESS) public URI asURI() { return uri.toURI(); } }
Location { @PublicAPI(usage = ACCESS) public URI asURI() { return uri.toURI(); } Location(NormalizedUri uri); }
Location { @PublicAPI(usage = ACCESS) public URI asURI() { return uri.toURI(); } Location(NormalizedUri uri); @PublicAPI(usage = ACCESS) URI asURI(); @PublicAPI(usage = ACCESS) boolean contains(String part); @PublicAPI(usage = ACCESS) boolean matches(Pattern pattern); @PublicAPI(usage = ACCESS) abstract boolean isJar()...
Location { @PublicAPI(usage = ACCESS) public URI asURI() { return uri.toURI(); } Location(NormalizedUri uri); @PublicAPI(usage = ACCESS) URI asURI(); @PublicAPI(usage = ACCESS) boolean contains(String part); @PublicAPI(usage = ACCESS) boolean matches(Pattern pattern); @PublicAPI(usage = ACCESS) abstract boolean isJar()...