forked from eclipse-tycho/tycho
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MavenP2SiteTest.java
58 lines (52 loc) · 2.56 KB
/
MavenP2SiteTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*******************************************************************************
* Copyright (c) 2021Christoph Läubrich and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.tycho.test.p2Repository;
import static java.util.Arrays.asList;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.io.File;
import org.apache.commons.io.FileUtils;
import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.junit.Test;
public class MavenP2SiteTest extends AbstractTychoIntegrationTest {
@Test
public void testProduceConsume() throws Exception {
{//parent
Verifier verifier = getVerifier("p2mavensite", false);
verifier.executeGoals(asList("install"));
verifier.verifyErrorFreeLog();
}
{ // producer
Verifier verifier = getVerifier("p2mavensite/producer", false);
verifier.executeGoals(asList("clean", "install"));
verifier.verifyErrorFreeLog();
assertTrue(new File(verifier.getBasedir(), "target/repository/artifacts.xml").exists());
assertTrue(new File(verifier.getBasedir(), "target/repository/content.xml").exists());
assertTrue(new File(verifier.getBasedir(), "target/p2-site.zip").exists());
}
{ // consumer
Verifier verifier = getVerifier("p2mavensite/consumer", false);
verifier.executeGoals(asList("clean", "verify"));
verifier.verifyErrorFreeLog();
}
}
@Test
public void testDeployIgnore() throws Exception {
Verifier verifier = getVerifier("p2mavensite.reactor", false);
verifier.executeGoals(asList("install"));
verifier.verifyErrorFreeLog();
String artifacts = FileUtils
.readFileToString(new File(verifier.getBasedir(), "site/target/repository/artifacts.xml"), "UTF-8");
assertTrue("artifact to deploy is missing", artifacts.contains("id='org.eclipse.tycho.it.deployme'"));
assertFalse("artifact is deployed but should't", artifacts.contains("id='org.eclipse.tycho.it.ignoreme'"));
assertFalse("artifact is deployed but should't", artifacts.contains("id='org.eclipse.tycho.it.ignoreme-property'"));
}
}