Examples of HDScanner


Examples of org.jboss.system.server.profileservice.hotdeploy.HDScanner

    * NullPointerExceptions in previous releases, so no thrown exception equals
    * a pass.
    */
   public void testSettingScanEnabledToTrueDoesNotCauseNPE()
   {
      HDScanner hdScanner = new HDScanner();

      // Calling the setter *before* create/start have been called just like
      // when set via XML.
      hdScanner.setScanEnabled(true);
   }
View Full Code Here

Examples of org.jboss.system.server.profileservice.hotdeploy.HDScanner

    * method from executing/scheduling scanner in previous releases.
    */
    public void testSettingScanEnabledToFalseDoesNotCauseActiveScan()
    throws Exception
    {
      HDScanner hdScanner = new HDScanner();
      hdScanner.setScanEnabled(false);
      hdScanner.create();
      hdScanner.start();

      // Does starting the HDScanner cause a scan to be scheduled?  It shouldn't when
      // ScanEnabled is false.
      assertFalse("HDScanner had a scheduled scan when ScanEnabled was false",
                  hdScanner.isScanScheduled());
    }
View Full Code Here

Examples of org.jboss.system.server.profileservice.hotdeploy.HDScanner

     * <code>false</code> to <code>true</code> works.
     */
    public void testSettingScanEnabledFromFalseToTrueWorks()
    throws Exception
    {
      HDScanner hdScanner = new HDScanner();
      hdScanner.setScanEnabled(false);
      hdScanner.create();
      hdScanner.start();
      assertFalse("HDScanner had a scheduled scan when ScanEnabled was false",
                  hdScanner.isScanScheduled());
     
      hdScanner.setScanEnabled(true);
      assertTrue("HDScanner did not have a scheduled scan when ScanEnabled was set to true",
                  hdScanner.isScanScheduled());
    }
View Full Code Here

Examples of org.jboss.test.virtual.support.ps.hotdeploy.HDScanner

      for(File f : deployDir.listFiles())
         f.delete();

      URI[] appURIs = {deployDir.toURI()};
      MockProfileServiceRepository repository = new MockProfileServiceRepository(root, appURIs);
      HDScanner scanner = new HDScanner();
      scanner.setProfileService(repository);
      scanner.setScanPeriod(1000);

      VFS vfs = VFS.getVFS(root.toURI());
      File archive = generateArchive(deployDir);
      VirtualFile archiveVF = vfs.getChild("deploy/"+archive.getName());     
      VFSDeployment vfsd = VFSDeploymentFactory.getInstance().createVFSDeployment(archiveVF);
      repository.addDeployment(archiveVF.toURI().toString(), vfsd, DeploymentPhase.APPLICATION);

      getLog().debug("Waiting for 10 scans...");
      scanner.start();
      while(scanner.getScanCount() < 10)
      {
         Thread.sleep(1000);
         // Update the archive last modifed time
         archive.setLastModified(System.currentTimeMillis());
      }
      getLog().info("Trying to remove: "+archive.getAbsolutePath());
      assertTrue(archiveVF.delete());
      assertFalse(archiveVF.exists());
      getLog().info("Deleted deployed archive");
      scanner.stop();
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.