1 23 package com.sun.enterprise.management.deploy; 24 25 import java.util.Map ; 26 27 import java.io.IOException ; 28 import java.io.File ; 29 import java.io.IOException ; 30 import java.io.Serializable ; 31 32 import com.sun.appserv.management.deploy.DeploymentSource; 33 import com.sun.appserv.management.deploy.DeploymentSourceImpl; 34 35 36 import com.sun.enterprise.management.AMXTestBase; 37 import com.sun.enterprise.management.Capabilities; 38 39 41 public final class DeploymentSourceTest extends junit.framework.TestCase 42 { 43 public 44 DeploymentSourceTest( ) 45 { 46 } 47 48 private DeploymentSourceImpl 49 createDeploymentSource() 50 throws IOException 51 { 52 final File archiveFile = File.createTempFile( "junk", "junk" ); 53 archiveFile.deleteOnExit(); 54 55 final String [] entriesAdded = new String [] { "hello", "there" }; 56 final String [] entriesRemoved = new String [0]; 57 final String [] entriesDeleted = new String [0]; 58 final DeploymentSourceImpl ds = 59 new DeploymentSourceImpl( archiveFile.toString(), 60 true, 61 entriesAdded, entriesRemoved, entriesDeleted, null ); 62 63 return( ds ); 64 } 65 66 public void 67 testCreateDeploymentSource() 68 throws IOException 69 { 70 createDeploymentSource(); 71 } 72 73 74 public void 75 testDeploymentSourceFromMap() 76 throws IOException 77 { 78 final DeploymentSourceImpl ds = createDeploymentSource(); 79 final Map <String ,Serializable > data = ds.asMap(); 80 81 final DeploymentSourceImpl ds2 = new DeploymentSourceImpl( data ); 82 83 assert( ds2.equals( ds ) ); 84 assert( ds.equals( ds2 ) ); 85 } 86 87 88 } 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | Popular Tags |