Skip to content

Commit

Permalink
fix: adjusting expectation to evaluation in ci; needs review
Browse files Browse the repository at this point in the history
  • Loading branch information
karsten-klein committed Sep 10, 2024
1 parent d8ec294 commit 95fda39
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ public void testContainerStructure() throws Exception {
analysis.selectArtifacts(containsToken(COMPONENT_SOURCE_TYPE, "python-library")).hasSizeOf(2);

// FIXME: why are so many files not covered
// FIXME: also the number of files has decreased from 7020 to 7008
analysis.selectArtifacts(AttributeValue.attributeValue(Artifact.Attribute.COMPONENT, null)).hasSizeOf(7008);
analysis.selectArtifacts(AttributeValue.attributeValue(Artifact.Attribute.COMPONENT, null)).hasSizeOf(7020);

// TODO:
// ruby-3.2.0 must be detected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void testComponentPatterns() throws Exception {
public void testContainerStructure() throws Exception {
final Inventory inventory = AbstractCompositionAnalysisTest.testSetup.getInventory();
Analysis analysis = new Analysis(inventory);
analysis.selectArtifacts(containsToken(COMPONENT_SOURCE_TYPE, "rpm")).hasSizeOf(142);
analysis.selectArtifacts(containsToken(COMPONENT_SOURCE_TYPE, "rpm")).hasSizeOf(143);
analysis.selectComponentPatterns(containsToken(VERSION_ANCHOR, "Packages.db")).hasSizeGreaterThan(1);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* Copyright 2009-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.metaeffekt.core.itest.analysis.libraries;

import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.metaeffekt.core.itest.common.fluent.ArtifactList;
import org.metaeffekt.core.itest.common.setup.AbstractCompositionAnalysisTest;
import org.metaeffekt.core.itest.common.setup.UrlBasedTestSetup;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.metaeffekt.core.inventory.processor.model.Artifact.Attribute.*;
import static org.metaeffekt.core.itest.common.predicates.AttributeValue.attributeValue;


public class NarayanaJta_7_0_0_Final extends AbstractCompositionAnalysisTest {

private final Logger LOG = LoggerFactory.getLogger(this.getClass());

@BeforeClass
public static void prepare() {
testSetup = new UrlBasedTestSetup()
.setSource("https://repo1.maven.org/maven2/org/jboss/narayana/jta/narayana-jta/7.0.0.Final/narayana-jta-7.0.0.Final.jar")
.setSha256Hash("21e24127dee2582053a07e90c446eab5d290e1e141f9b45f0e1f7c6f30a0151b")
.setName(NarayanaJta_7_0_0_Final.class.getName());
}

@Ignore
@Test
public void clear() throws Exception {
Assert.assertTrue(testSetup.clear());

}

@Ignore
@Test
public void analyse() throws Exception {
Assert.assertTrue(testSetup.rebuildInventory());
}

@Test
public void assertContent() throws Exception {
ArtifactList artifactList = getAnalysisAfterInvariantCheck()
.selectArtifacts()
.filter(a -> a.getVersion() != null);

artifactList.logListWithAllAttributes();

artifactList.with(attributeValue(ID, "arjuna-7.0.0.Final.jar"),
attributeValue(VERSION, "7.0.0.Final"),
attributeValue(PROJECTS, "[narayana-jta-7.0.0.Final.jar]/META-INF/maven/org.jboss.narayana.arjunacore/arjuna/pom.xml"),
attributeValue(PATH_IN_ASSET, "[narayana-jta-7.0.0.Final.jar]/META-INF/maven/org.jboss.narayana.arjunacore/arjuna/pom.xml"))
.assertNotEmpty();

artifactList.hasSizeOf(7);
}


}

0 comments on commit 95fda39

Please sign in to comment.