KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > management > deploy > DeploymentSourceTest


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.enterprise.management.deploy;
24
25 import java.util.Map JavaDoc;
26
27 import java.io.IOException JavaDoc;
28 import java.io.File JavaDoc;
29 import java.io.IOException JavaDoc;
30 import java.io.Serializable JavaDoc;
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 /**
40  */

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 JavaDoc
51     {
52         final File JavaDoc archiveFile = File.createTempFile( "junk", "junk" );
53         archiveFile.deleteOnExit();
54         
55         final String JavaDoc[] entriesAdded = new String JavaDoc[] { "hello", "there" };
56         final String JavaDoc[] entriesRemoved = new String JavaDoc[0];
57         final String JavaDoc[] entriesDeleted = new String JavaDoc[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 JavaDoc
69     {
70         createDeploymentSource();
71     }
72     
73     
74         public void
75     testDeploymentSourceFromMap()
76         throws IOException JavaDoc
77     {
78         final DeploymentSourceImpl ds = createDeploymentSource();
79         final Map JavaDoc<String JavaDoc,Serializable JavaDoc> 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