Should support core extensions #114

This commit is contained in:
Guillaume Nodet
2020-11-02 14:04:00 +01:00
parent a95ac9e4dc
commit 39dff61060
13 changed files with 382 additions and 28 deletions

View File

@@ -47,9 +47,8 @@ public class DistroIT {
.collect(Collectors.toList());
final String msg = mavenHome.resolve("mvn/lib/ext") + " contains duplicates available in "
+ mavenHome.resolve("mvn/lib")
+ " or " + mavenHome.resolve("mvn/lib");
Assertions.assertEquals(new ArrayList<String>(), dups, msg);
+ mavenHome.resolve("mvn/lib") + " or " + mavenHome.resolve("mvn/boot");
Assertions.assertEquals(new ArrayList<Avc>(), dups, msg);
}
@Test

View File

@@ -0,0 +1,61 @@
/*
* Copyright 2019 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.jboss.fuse.mvnd.it;
import java.io.IOException;
import java.util.Collections;
import javax.inject.Inject;
import org.assertj.core.api.Assertions;
import org.jboss.fuse.mvnd.client.Client;
import org.jboss.fuse.mvnd.client.ClientLayout;
import org.jboss.fuse.mvnd.common.DaemonInfo;
import org.jboss.fuse.mvnd.common.logging.ClientOutput;
import org.jboss.fuse.mvnd.junit.MvndNativeTest;
import org.jboss.fuse.mvnd.junit.TestRegistry;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import static org.junit.jupiter.api.Assertions.assertEquals;
@MvndNativeTest(projectDir = "src/test/projects/extensions")
public class ExtensionsNativeIT {
@Inject
Client client;
@Inject
ClientLayout layout;
@Inject
TestRegistry registry;
@Test
void version() throws IOException, InterruptedException {
registry.killAll();
Assertions.assertThat(registry.getAll().size()).isEqualTo(0);
final ClientOutput o = Mockito.mock(ClientOutput.class);
client.execute(o, "-v").assertSuccess();
Assertions.assertThat(registry.getAll().size()).isEqualTo(1);
DaemonInfo daemon = registry.getAll().iterator().next();
assertEquals(Collections.singletonList("-Ddaemon.core.extensions=io.takari.aether:takari-local-repository:0.11.3"),
daemon.getOptions());
client.execute(o, "-v").assertSuccess();
Assertions.assertThat(registry.getAll().size()).isEqualTo(1);
}
}

View File

@@ -0,0 +1,23 @@
/*
* Copyright 2019 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.jboss.fuse.mvnd.it;
import org.jboss.fuse.mvnd.junit.MvndTest;
@MvndTest(projectDir = "src/test/projects/extensions")
public class ExtensionsTest extends ExtensionsNativeIT {
}

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2020 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.
-->
<extensions>
<extension>
<groupId>io.takari.aether</groupId>
<artifactId>takari-local-repository</artifactId>
<version>0.11.3</version>
</extension>
</extensions>

View File

@@ -0,0 +1,27 @@
<!--
Copyright 2019 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.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.fuse.mvnd.test.extensions</groupId>
<artifactId>extensions</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
</project>