我是一个后端开发人员,我只是在玩Angular4.所以我做了这个安装教程:https://www.youtube.com/watch?v = cdlbFEsAGXo.
鉴于此,我如何添加bootstrap到应用程序,所以我可以使用类"container-fluid"或"col-md-6"等类似的东西?
我正在玩弹簧框架的弹簧测试.我的目的是在我的休息控制器中测试以下POST方法:
@RestController
@RequestMapping("/project")
public class ProjectController {
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
public Project createProject(@RequestBody Project project, HttpServletResponse response) {
// TODO: create the object, store it in db...
response.setStatus(HttpServletResponse.SC_CREATED);
// return the created object - simulate by returning the request.
return project;
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的测试用例:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {ProjectController.class })
@WebAppConfiguration
public class ProjectControllerTest {
private MockMvc mockMvc;
@Autowired
private WebApplicationContext wac;
@Before
public void setUp() {
mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
}
@Test
public void testCreationOfANewProjectSucceeds() throws Exception { …Run Code Online (Sandbox Code Playgroud) 如果我有以下代码,哪个工作正常:
ExecutorService service = Executors.newFixedThreadPool(100);
[....]
List<Future<SomeObject>> futures = service.invokeAll(callables);
for (Future f : futures) {
f.get();
}
// shutdown the service after all Callables are finished.
service.shutdown();
boolean serviceIsShutDown = service.awaitTermination(5, TimeUnit.SECONDS);
if (serviceIsShutDown) {
System.out.println("Service terminated normally. All ok.");
} else {
// What if it's not shutDown?
[...]
// this?
//service = null;
}
Run Code Online (Sandbox Code Playgroud)
问题:如果通话怎么办?
boolean serviceIsShutDown = service.awaitTermination(5, TimeUnit.SECONDS);
Run Code Online (Sandbox Code Playgroud)
因超时命中而返回false?
我猜ExecutorService中的Threads将保持WAIT状态.什么是最好的解决方案?将服务设置为null并让GarbageCollector删除它?但相关的线程会发生什么?它是否会被垃圾收集,因为仍然有参考?
代码通常有效,但只是好奇.如果返回false该怎么办?
我打算与Jenkins一起使用CD Pipeline来获取我的应用程序,将docker镜像发布到我的私有docker存储库.我想我知道该怎么做.
我不确定Kubernetes的一部分.我想拍摄该图像并将其部署到我的私人Kubernetes集群(目前是1个Master&1 Slave).
问题:安装了kubectl和docker的Jenkins Slave是否需要成为Kubernetes集群的一部分才能触发部署?如何触发该部署?