コード例 #1
0
 @Before
 public void setUp() throws Exception {
   String nexusUrl = Settings.getString(Settings.KEYS.ANALYZER_NEXUS_URL);
   LOGGER.fine(nexusUrl);
   searcher = new NexusSearch(new URL(nexusUrl));
   Assume.assumeTrue(searcher.preflightRequest());
 }
コード例 #2
0
 // This test does generate network traffic and communicates with a host
 // you may not be able to reach. Remove the @Ignore annotation if you want to
 // test it anyway
 @Test
 public void testValidSha1() throws Exception {
   MavenArtifact ma = searcher.searchSha1("9977a8d04e75609cf01badc4eb6a9c7198c4c5ea");
   assertEquals("Incorrect group", "org.apache.maven.plugins", ma.getGroupId());
   assertEquals("Incorrect artifact", "maven-compiler-plugin", ma.getArtifactId());
   assertEquals("Incorrect version", "3.1", ma.getVersion());
   assertNotNull("URL Should not be null", ma.getArtifactUrl());
 }
コード例 #3
0
 // This test does generate network traffic and communicates with a host
 // you may not be able to reach. Remove the @Ignore annotation if you want to
 // test it anyway
 @Test(expected = FileNotFoundException.class)
 public void testMissingSha1() throws Exception {
   searcher.searchSha1("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
 }
コード例 #4
0
 @Test(expected = IllegalArgumentException.class)
 public void testMalformedSha1() throws Exception {
   searcher.searchSha1("invalid");
 }
コード例 #5
0
 @Test(expected = IllegalArgumentException.class)
 public void testNullSha1() throws Exception {
   searcher.searchSha1(null);
 }