@Test public void testArtifactProperties() throws URISyntaxException, IOException { P2ArtifactCoordinates foundArtifact = getArtifact(); Map<String, String> properties = foundArtifact.getProperties(); assertThat(properties).isNotNull(); Map<String, String> expectedProperties = new HashMap<>(); expectedProperties.put("id", ID); expectedProperties.put("version", VERSION); expectedProperties.put("classifier", CLASSIFIER); expectedProperties.put("download.size", "1"); expectedProperties.forEach( (key, value) -> { assertThat(properties.containsKey(key)).as(key + " not found").isTrue(); assertThat(value).isEqualTo(properties.get(key)); }); }
public static P2ArtifactCoordinates getArtifact(String repositoryBaseDir, String bundle) throws IOException { P2Repository p2Repository = null; final P2ArtifactCoordinates artifactToFind = P2ArtifactCoordinates.create(bundle); for (P2Artifact p2Artifact : p2Repository.getArtifacts().getArtifacts()) { P2ArtifactCoordinates foundArtifact = new P2ArtifactCoordinates(p2Artifact.getId(), p2Artifact.getVersion(), p2Artifact.getClassifier()); if (foundArtifact.equals(artifactToFind)) { addProperties(foundArtifact, p2Artifact, repositoryBaseDir); String bundleFilename = P2ArtifactRuleProcessor.getFilename(p2Repository.getMappings(), foundArtifact); foundArtifact.setFilename(bundleFilename); return foundArtifact; } } return null; }
P2ArtifactReader { public static P2ArtifactCoordinates getArtifact(String repositoryBaseDir, String bundle) throws IOException { P2Repository p2Repository = null; final P2ArtifactCoordinates artifactToFind = P2ArtifactCoordinates.create(bundle); for (P2Artifact p2Artifact : p2Repository.getArtifacts().getArtifacts()) { P2ArtifactCoordinates foundArtifact = new P2ArtifactCoordinates(p2Artifact.getId(), p2Artifact.getVersion(), p2Artifact.getClassifier()); if (foundArtifact.equals(artifactToFind)) { addProperties(foundArtifact, p2Artifact, repositoryBaseDir); String bundleFilename = P2ArtifactRuleProcessor.getFilename(p2Repository.getMappings(), foundArtifact); foundArtifact.setFilename(bundleFilename); return foundArtifact; } } return null; } }
P2ArtifactReader { public static P2ArtifactCoordinates getArtifact(String repositoryBaseDir, String bundle) throws IOException { P2Repository p2Repository = null; final P2ArtifactCoordinates artifactToFind = P2ArtifactCoordinates.create(bundle); for (P2Artifact p2Artifact : p2Repository.getArtifacts().getArtifacts()) { P2ArtifactCoordinates foundArtifact = new P2ArtifactCoordinates(p2Artifact.getId(), p2Artifact.getVersion(), p2Artifact.getClassifier()); if (foundArtifact.equals(artifactToFind)) { addProperties(foundArtifact, p2Artifact, repositoryBaseDir); String bundleFilename = P2ArtifactRuleProcessor.getFilename(p2Repository.getMappings(), foundArtifact); foundArtifact.setFilename(bundleFilename); return foundArtifact; } } return null; }  }
P2ArtifactReader { public static P2ArtifactCoordinates getArtifact(String repositoryBaseDir, String bundle) throws IOException { P2Repository p2Repository = null; final P2ArtifactCoordinates artifactToFind = P2ArtifactCoordinates.create(bundle); for (P2Artifact p2Artifact : p2Repository.getArtifacts().getArtifacts()) { P2ArtifactCoordinates foundArtifact = new P2ArtifactCoordinates(p2Artifact.getId(), p2Artifact.getVersion(), p2Artifact.getClassifier()); if (foundArtifact.equals(artifactToFind)) { addProperties(foundArtifact, p2Artifact, repositoryBaseDir); String bundleFilename = P2ArtifactRuleProcessor.getFilename(p2Repository.getMappings(), foundArtifact); foundArtifact.setFilename(bundleFilename); return foundArtifact; } } return null; }  static P2ArtifactCoordinates getArtifact(String repositoryBaseDir,
                                                    String bundle); }
P2ArtifactReader { public static P2ArtifactCoordinates getArtifact(String repositoryBaseDir, String bundle) throws IOException { P2Repository p2Repository = null; final P2ArtifactCoordinates artifactToFind = P2ArtifactCoordinates.create(bundle); for (P2Artifact p2Artifact : p2Repository.getArtifacts().getArtifacts()) { P2ArtifactCoordinates foundArtifact = new P2ArtifactCoordinates(p2Artifact.getId(), p2Artifact.getVersion(), p2Artifact.getClassifier()); if (foundArtifact.equals(artifactToFind)) { addProperties(foundArtifact, p2Artifact, repositoryBaseDir); String bundleFilename = P2ArtifactRuleProcessor.getFilename(p2Repository.getMappings(), foundArtifact); foundArtifact.setFilename(bundleFilename); return foundArtifact; } } return null; }  static P2ArtifactCoordinates getArtifact(String repositoryBaseDir,
                                                    String bundle);  }