users@glassfish.java.net

Re: archive questiion

From: <forums_at_java.net>
Date: Thu, 18 Nov 2010 02:27:24 -0800

@RunWith(Arquillian.class)
@Run(RunModeType.AS_CLIENT)//RunModeType.AS_CLIENT)IN_CONTAINER
public class DocUtilsServiceTest {
    @Deployment
    public static WebArchive getDeployment() {
        String str = "C:" + File.separator + "Dokumente und
Einstellungen" + File.separator + "user + File.separator + "Eigene Dateien" +
File.separator + "NetBeansProjects" + File.separator + "WS-DocUtils" +
File.separator + "build" + File.separator + "web" + File.separator +
"WEB-INF" + File.separator + "resources" + File.separator +
"wkhtmltopdf.exe";
        File file = new File(str);
        WebArchive archive = ShrinkWrap.create(WebArchive.class,
"test.war");
        archive.addClasses(DocUtilsService.class);
        archive.addPackages(true,
DocUtilsHTML2PDFConverterException.class.getPackage(),
HTML2PDFConverterProperties.class.getPackage(),
ProcessStreamReader.class.getPackage());
        archive.addManifestResource(EmptyAsset.INSTANCE,
ArchivePaths.create("beans.xml"));
        archive.addWebResource(file, "resources/"+file.getName());
<--------------------------------------------------------- add the external
app. to archive
        System.out.println(archive.toString(Formatters.VERBOSE));
        return archive;
    }

here I build the archive

 

in my class i dn't invoke it i just test the class that invoks it, this why i
want to set the path so that class know where it is.

 


--
[Message sent by forum member 'yahya_h']
View Post: http://forums.java.net/node/719994