From aa67d24430d8bdf03b5065886afef55fe5773b06 Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Thu, 27 Feb 2020 22:32:19 +0100 Subject: [PATCH] remove test Files --- src/test/java/spoon/Issue3275.java | 27 ------- .../resources/issue3275/BOMCostPrice.java | 77 ------------------- 2 files changed, 104 deletions(-) delete mode 100644 src/test/java/spoon/Issue3275.java delete mode 100644 src/test/resources/issue3275/BOMCostPrice.java diff --git a/src/test/java/spoon/Issue3275.java b/src/test/java/spoon/Issue3275.java deleted file mode 100644 index f4be1ad7c90..00000000000 --- a/src/test/java/spoon/Issue3275.java +++ /dev/null @@ -1,27 +0,0 @@ -package spoon; - -import org.junit.Test; - -import spoon.processing.AbstractProcessor; -import spoon.reflect.CtModel; -import spoon.reflect.code.CtInvocation; -import spoon.reflect.declaration.CtType; -import spoon.reflect.reference.CtTypeReference; - -/** - * Issue3275 - */ -public class Issue3275 { - // the following code reproduces the behavior from the issue - @Test - public void test() { - CtModel model = new FluentLauncher().inputResource("src/test/resources/issue3275/Foo.java") - .noClasspath(true) - .processor(new AbstractProcessor>() { - public void process(CtTypeReference element) { - System.out.println(element.isGenerics()); - } - }) - .buildModel(); - } -} diff --git a/src/test/resources/issue3275/BOMCostPrice.java b/src/test/resources/issue3275/BOMCostPrice.java deleted file mode 100644 index 25d320b7f63..00000000000 --- a/src/test/resources/issue3275/BOMCostPrice.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.eevolution.costing; - -import java.util.Collection; -import java.util.HashMap; -import java.util.stream.Stream; - -import com.google.common.base.Predicates; - -import de.metas.costing.CostAmount; -import de.metas.costing.CostElementId; -import de.metas.product.ProductId; -import de.metas.util.GuavaCollectors; -import de.metas.util.lang.RepoIdAware; -import lombok.Builder; -import lombok.Getter; -import lombok.NonNull; -import lombok.Singular; -import lombok.ToString; - -@ToString -public class BOMCostPrice { - public static BOMCostPrice empty(@NonNull final ProductId productId) { - return builder().productId(productId).build(); - } - - @Getter - private final ProductId productId; - private final HashMap pricesByElementId; - - @Builder - private BOMCostPrice(@NonNull final ProductId productId, - @NonNull @Singular final Collection costElementPrices) { - this.productId = productId; - pricesByElementId = costElementPrices.stream() - .collect(GuavaCollectors.toHashMapByKey(BOMCostElementPrice::getCostElementId)); - } - - public Stream streamCostElementIds() { - return pricesByElementId.keySet().stream(); - } - - public BOMCostElementPrice getCostElementPriceOrNull(@NonNull final CostElementId costElementId) { - return pricesByElementId.get(costElementId); - } - - public void clearOwnCostPrice(@NonNull final CostElementId costElementId) { - final BOMCostElementPrice elementCostPrice = getCostElementPriceOrNull(costElementId); - if (elementCostPrice != null) { - elementCostPrice.clearOwnCostPrice(); - } - } - - public void setComponentsCostPrice(@NonNull final CostAmount costPrice, - @NonNull final CostElementId costElementId) { - pricesByElementId - .computeIfAbsent(costElementId, k -> BOMCostElementPrice.zero(costElementId, costPrice.getCurrencyId())) - .setComponentsCostPrice(costPrice); - } - - public void clearComponentsCostPrice(@NonNull final CostElementId costElementId) { - final BOMCostElementPrice elementCostPrice = getCostElementPriceOrNull(costElementId); - if (elementCostPrice != null) { - elementCostPrice.clearComponentsCostPrice(); - } - } - - Collection getElementPrices() { - return pricesByElementId.values(); - } - - Stream streamIds(@NonNull final Class idType) { - return getElementPrices().stream() - .map(BOMCostElementPrice::getId) - .filter(Predicates.notNull()) - .map(idType::cast); - } -}