Ejemplo n.º 1
0
 /**
  * If we can run the un-deploy functionality without receiving an error
  *
  * @return null
  */
 public function testUndeploy()
 {
     $mockExtractor = $this->getMock('\\AppserverIo\\Appserver\\Core\\Interfaces\\ExtractorInterface');
     $mockExtractor->expects($this->once())->method('unflagArchive');
     $this->appService->injectExtractor($mockExtractor);
     $appNode = new AppNode(__METHOD__, '/opt/appserver/targetwebapp');
     $this->appService->persist($appNode);
     $this->appService->undeploy($appNode->getUuid());
 }
Ejemplo n.º 2
0
 /**
  * If we can run the un-deploy functionality without receiving an error
  *
  * @return null
  */
 public function testUndeploy()
 {
     $mockHost = $this->getMockBuilder('\\AppserverIo\\Appserver\\Core\\Api\\Node\\HostNodeInterface')->setMethods(get_class_methods('\\AppserverIo\\Appserver\\Core\\Api\\Node\\HostNodeInterface'))->getMock();
     $mockHost->expects($this->once())->method('getDeployBase')->willReturn('webapps');
     $mockContainer = $this->getMockBuilder('\\AppserverIo\\Appserver\\Core\\Api\\Node\\ContainerNodeInterface')->setMethods(get_class_methods('\\AppserverIo\\Appserver\\Core\\Api\\Node\\ContainerNodeInterface'))->getMock();
     $mockContainer->expects($this->once())->method('getHost')->willReturn($mockHost);
     $mockExtractor = $this->getMock('\\AppserverIo\\Appserver\\Core\\Interfaces\\ExtractorInterface');
     $mockExtractor->expects($this->once())->method('unflagArchive');
     $this->appService->injectExtractor($mockExtractor);
     $appNode = new AppNode(__METHOD__, '/opt/appserver/targetwebapp');
     $this->appService->persist($appNode);
     $this->appService->undeploy($mockContainer, $appNode->getUuid());
 }
 /**
  * Test if the load() method returns the correct app node.
  *
  * @return null
  */
 public function testLoad()
 {
     $datasourceNode = new DatasourceNode();
     $this->service->persist($datasourceNode);
     $this->assertSame($datasourceNode, $this->service->load($datasourceNode->getPrimaryKey()));
 }
Ejemplo n.º 4
0
 /**
  * Dummy test as there currently is now functionality behind the actual method
  *
  * @return null
  *
  * @expectedException \AppserverIo\Lang\NotImplementedException
  */
 public function testPersist()
 {
     $this->service->persist($this->service->getSystemConfiguration());
 }