Commit 582356dc authored by wutu's avatar wutu

fix 缺少主函数的bug

parent 06f70474
...@@ -34,26 +34,6 @@ ...@@ -34,26 +34,6 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>top.ninwoo.BisheTestMain</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
......
...@@ -45,4 +45,21 @@ ...@@ -45,4 +45,21 @@
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${springboot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project> </project>
\ No newline at end of file
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>cnf-client-starter</artifactId> <artifactId>cnf-client-starter</artifactId>
<properties> <properties>
......
...@@ -50,6 +50,12 @@ ...@@ -50,6 +50,12 @@
<groupId>top.ninwoo</groupId> <groupId>top.ninwoo</groupId>
<artifactId>cnf-utils</artifactId> <artifactId>cnf-utils</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
...@@ -65,4 +71,21 @@ ...@@ -65,4 +71,21 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${springboot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project> </project>
\ No newline at end of file
...@@ -92,12 +92,12 @@ ...@@ -92,12 +92,12 @@
</dependencies> </dependencies>
<build> <!-- <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<!--这里写上main方法所在类的路径--> &lt;!&ndash;这里写上main方法所在类的路径&ndash;&gt;
<configuration> <configuration>
<mainClass>top.ninwoo.edgecenter.EdgeCenterApp</mainClass> <mainClass>top.ninwoo.edgecenter.EdgeCenterApp</mainClass>
</configuration> </configuration>
...@@ -110,5 +110,22 @@ ...@@ -110,5 +110,22 @@
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
</build>-->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${springboot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build> </build>
</project> </project>
\ No newline at end of file
...@@ -35,18 +35,20 @@ ...@@ -35,18 +35,20 @@
<artifactId>influxdb-java</artifactId> <artifactId>influxdb-java</artifactId>
<version>2.9</version> <version>2.9</version>
</dependency> </dependency>
<dependency>
<groupId>top.ninwoo</groupId>
<artifactId>cnf-weixingsim</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<version>${springboot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
......
...@@ -10,13 +10,8 @@ import top.ninwoo.bishe.starter.service.ClusterService; ...@@ -10,13 +10,8 @@ import top.ninwoo.bishe.starter.service.ClusterService;
import top.ninwoo.bishe.starter.service.NetworkService; import top.ninwoo.bishe.starter.service.NetworkService;
import top.ninwoo.common.entity.*; import top.ninwoo.common.entity.*;
import top.ninwoo.client.BisheTestMain; import top.ninwoo.client.BisheTestMain;
import top.ninwoo.weixingsim.entity.SimData;
import top.ninwoo.weixingsim.entity.WeiXingData;
import top.ninwoo.weixingsim.service.impl.ToponetImpl;
import top.ninwoo.weixingsim.service.impl.WeixingImpl;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -204,190 +199,6 @@ public class BisheTests { ...@@ -204,190 +199,6 @@ public class BisheTests {
} }
// 测试初始化设置
@Test
public void test2() throws IllegalAccessException, InterruptedException {
//从文本中获取卫星的数据
WeixingImpl wx = new WeixingImpl();
ToponetImpl tp = new ToponetImpl();
SimData sd = new SimData();
File file = new File("C:\\WorkSpace\\test\\topusim_1.txt");
List<WeiXingData> wxData = wx.iniTopo(file);
int[][] toponet = tp.getTopology(wxData,sd);
ArrayList<SeparatedClusterConfig> clusterConfigs = new ArrayList<>();
SeparatedClusterConfig separatedClusterConfig = new SeparatedClusterConfig();
List<ContainerDescription> cds = new ArrayList<>();
// TODO: 这个ID应该是从借口获取的
separatedClusterConfig.setEdgeNodeId("192.168.190.135:8081");
ClusterConfig clusterConfig = new ClusterConfig();
clusterConfig.setId(11111l);
clusterConfig.setOwner("joliu");
//创建容器
for (int k = 0; k < wxData.size(); k++) {
ContainerDescription containerDescription = new ContainerDescription();
containerDescription.setMode("normal");
containerDescription.setReplicas(1);
DockerContainer container = new DockerContainer();
container.setName(wxData.get(k).getName());
container.setCommand("sh");
container.setImage("joliu/networktest");
containerDescription.setDockerContainer(container);
cds.add(containerDescription);
}
clusterConfig.setDockers(cds);
NetworkTopology topo = new NetworkTopology();
topo.setAppNames(tp.getAppNames(wxData));
// 这个参数好像没啥用
topo.setTopologyId(11);
topo.setTopology(toponet);
clusterConfig.setTopology(topo);
separatedClusterConfig.setClusterConfig(clusterConfig);
clusterConfigs.add(separatedClusterConfig);
clusterService.sendClusterConfigToEdgeNode(clusterConfigs);
//下发逻辑拓扑
clusterService.sendLogicTopoToEdgeNode(clusterConfigs);
}
//测试连续传输
@Test
public void test3() throws IllegalAccessException, InterruptedException {
ArrayList<SeparatedClusterConfig> clusterConfigs = new ArrayList<>();
SeparatedClusterConfig separatedClusterConfig = new SeparatedClusterConfig();
List<ContainerDescription> cds = new ArrayList<>();
// TODO: 这个ID应该是从借口获取的
separatedClusterConfig.setEdgeNodeId("192.168.190.135:8081");
ClusterConfig clusterConfig = new ClusterConfig();
clusterConfig.setId(11111l);
clusterConfig.setOwner("joliu");
//从文本中获取卫星的数据
WeixingImpl wx = new WeixingImpl();
ToponetImpl tp = new ToponetImpl();
SimData sd = new SimData();
//tp.delHistory();
File file = new File("C:\\WorkSpace\\test\\topusim_1.txt");
List<WeiXingData> wxData = wx.iniTopo(file);
int[][] toponet = tp.getTopology(wxData,sd);
//创建容器
for (int k = 0; k < wxData.size(); k++) {
ContainerDescription containerDescription = new ContainerDescription();
containerDescription.setMode("normal");
containerDescription.setReplicas(1);
DockerContainer container = new DockerContainer();
container.setName(wxData.get(k).getName());
container.setCommand("sh");
container.setImage("joliu/networktest");
containerDescription.setDockerContainer(container);
cds.add(containerDescription);
}
clusterConfig.setDockers(cds);
NetworkTopology topo = new NetworkTopology();
topo.setAppNames(tp.getAppNames(wxData));
// 这个参数好像没啥用
topo.setTopologyId(11);
topo.setTopology(toponet);
clusterConfig.setTopology(topo);
separatedClusterConfig.setClusterConfig(clusterConfig);
clusterConfigs.add(separatedClusterConfig);
clusterService.sendClusterConfigToEdgeNode(clusterConfigs);
//下发逻辑拓扑
clusterService.sendLogicTopoToEdgeNode(clusterConfigs);
for (int i = 1; ; i++) {
Thread.sleep(2000);
int time = i * sd.getJiange();
List<WeiXingData> changetp = wx.changeTopo(wxData,time);
topo.setTopology(tp.getTopology(changetp,sd));
//下发修改后逻辑拓扑
clusterService.adjustLogicTopoToEdgeNode(clusterConfigs);
}
}
//测试历史功能,需要提前定义好输出文本地址
@Test
public void test4() throws IllegalAccessException, InterruptedException {
ArrayList<SeparatedClusterConfig> clusterConfigs = new ArrayList<>();
SeparatedClusterConfig separatedClusterConfig = new SeparatedClusterConfig();
List<ContainerDescription> cds = new ArrayList<>();
// TODO: 这个ID应该是从借口获取的
separatedClusterConfig.setEdgeNodeId("192.168.190.135:8081");
ClusterConfig clusterConfig = new ClusterConfig();
clusterConfig.setId(11111l);
clusterConfig.setOwner("joliu");
//从文本中获取卫星的数据
WeixingImpl wx = new WeixingImpl();
ToponetImpl tp = new ToponetImpl();
SimData sd = new SimData();
tp.delHistory();
File file = new File("C:\\WorkSpace\\test\\topusim_1.txt");
List<WeiXingData> wxData = wx.iniTopo(file);
int[][] toponet = tp.getTopology(wxData,sd);
//创建容器
for (int k = 0; k < wxData.size(); k++) {
ContainerDescription containerDescription = new ContainerDescription();
containerDescription.setMode("normal");
containerDescription.setReplicas(1);
DockerContainer container = new DockerContainer();
container.setName(wxData.get(k).getName());
container.setCommand("sh");
container.setImage("joliu/networktest");
containerDescription.setDockerContainer(container);
cds.add(containerDescription);
}
clusterConfig.setDockers(cds);
NetworkTopology topo = new NetworkTopology();
topo.setAppNames(tp.getAppNames(wxData));
// 这个参数好像没啥用
topo.setTopologyId(11);
topo.setTopology(toponet);
clusterConfig.setTopology(topo);
separatedClusterConfig.setClusterConfig(clusterConfig);
clusterConfigs.add(separatedClusterConfig);
clusterService.sendClusterConfigToEdgeNode(clusterConfigs);
//下发逻辑拓扑
clusterService.sendLogicTopoToEdgeNode(clusterConfigs);
for (int i = 1; ; i++) {
Thread.sleep(2000);
int time = i * sd.getJiange();
List<WeiXingData> changetp = wx.changeTopo(wxData,time);
topo.setTopology(tp.getTopology(changetp,sd));
tp.history(topo.getAppNames(),topo.getTopology());
//下发修改后逻辑拓扑
clusterService.adjustLogicTopoToEdgeNode(clusterConfigs);
}
}
//测试容器运行程序 //测试容器运行程序
@Test @Test
public void test5() { public void test5() {
......
...@@ -17,14 +17,15 @@ ...@@ -17,14 +17,15 @@
<module>cnf-test</module> <module>cnf-test</module>
<module>cnf-edge-center</module> <module>cnf-edge-center</module>
<module>cnf-client-starter</module> <module>cnf-client-starter</module>
<module>apps/cnf-case-dis</module>
<module>apps/cnf-weixingsim</module> <module>apps/cnf-weixingsim</module>
<module>apps/cnf-case-dis</module>
<module>apps/cnf-app-demo</module> <module>apps/cnf-app-demo</module>
</modules> </modules>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<springboot.version>2.1.2.RELEASE</springboot.version>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
...@@ -43,17 +44,17 @@ ...@@ -43,17 +44,17 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<version>2.1.2.RELEASE</version> <version>${springboot.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId> <artifactId>spring-boot-starter-actuator</artifactId>
<version>2.1.2.RELEASE</version> <version>${springboot.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<version>2.1.2.RELEASE</version> <version>${springboot.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
...@@ -77,11 +78,6 @@ ...@@ -77,11 +78,6 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.2.1.RELEASE</version>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment