Tests.java
6.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*
* Demoiselle Framework
* Copyright (C) 2010 SERPRO
* ----------------------------------------------------------------------------
* This file is part of Demoiselle Framework.
*
* Demoiselle Framework is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License version 3
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License version 3
* along with this program; if not, see <http://www.gnu.org/licenses/>
* or write to the Free Software Foundation, Inc., 51 Franklin Street,
* Fifth Floor, Boston, MA 02110-1301, USA.
* ----------------------------------------------------------------------------
* Este arquivo é parte do Framework Demoiselle.
*
* O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou
* modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação
* do Software Livre (FSF).
*
* Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA
* GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou
* APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português
* para maiores detalhes.
*
* Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título
* "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses/>
* ou escreva para a Fundação do Software Livre (FSF) Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA.
*/
package test;
import java.io.File;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.FileAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
import org.junit.Ignore;
import br.gov.frameworkdemoiselle.annotation.NextView;
import br.gov.frameworkdemoiselle.annotation.PreviousView;
import br.gov.frameworkdemoiselle.annotation.Redirect;
import br.gov.frameworkdemoiselle.internal.bootstrap.JsfBootstrap;
import br.gov.frameworkdemoiselle.internal.configuration.ExceptionHandlerConfig;
import br.gov.frameworkdemoiselle.internal.configuration.JsfSecurityConfig;
import br.gov.frameworkdemoiselle.internal.context.FacesViewContextImpl;
import br.gov.frameworkdemoiselle.internal.implementation.AbstractExceptionHandler;
import br.gov.frameworkdemoiselle.internal.implementation.ApplicationExceptionHandler;
import br.gov.frameworkdemoiselle.internal.implementation.ApplicationExceptionHandlerFactory;
import br.gov.frameworkdemoiselle.internal.implementation.AuthenticationExceptionHandler;
import br.gov.frameworkdemoiselle.internal.implementation.AuthenticationExceptionHandlerFactory;
import br.gov.frameworkdemoiselle.internal.implementation.AuthorizationExceptionHandler;
import br.gov.frameworkdemoiselle.internal.implementation.AuthorizationExceptionHandlerFactory;
import br.gov.frameworkdemoiselle.internal.implementation.FacesMessageAppender;
import br.gov.frameworkdemoiselle.internal.implementation.FileRendererImpl;
import br.gov.frameworkdemoiselle.internal.implementation.ParameterImpl;
import br.gov.frameworkdemoiselle.internal.implementation.RedirectExceptionHandler;
import br.gov.frameworkdemoiselle.internal.implementation.RedirectExceptionHandlerFactory;
import br.gov.frameworkdemoiselle.internal.implementation.SecurityObserver;
import br.gov.frameworkdemoiselle.internal.procuder.ParameterProducer;
import br.gov.frameworkdemoiselle.template.AbstractEditPageBean;
import br.gov.frameworkdemoiselle.template.AbstractListPageBean;
import br.gov.frameworkdemoiselle.template.AbstractPageBean;
import br.gov.frameworkdemoiselle.template.EditPageBean;
import br.gov.frameworkdemoiselle.template.ListPageBean;
import br.gov.frameworkdemoiselle.template.PageBean;
import br.gov.frameworkdemoiselle.util.Faces;
import br.gov.frameworkdemoiselle.util.FileRenderer;
import br.gov.frameworkdemoiselle.util.Locales;
import br.gov.frameworkdemoiselle.util.PageNotFoundException;
import br.gov.frameworkdemoiselle.util.Parameter;
import br.gov.frameworkdemoiselle.util.Redirector;
@Ignore
public final class Tests {
private Tests() {
}
public static WebArchive createDeployment() {
File[] libs = Maven.resolver().offline().loadPomFromFile("pom.xml", "arquillian-test")
.importCompileAndRuntimeDependencies().resolve().withTransitivity().asFile();
return ShrinkWrap
.create(WebArchive.class)
.addClass(PageNotFoundException.class)
.addClass(Locales.class)
.addClass(Parameter.class)
.addClass(Faces.class)
.addClass(Redirector.class)
.addClass(FileRenderer.class)
.addClass(JsfSecurityConfig.class)
.addClass(ExceptionHandlerConfig.class)
.addClass(FacesViewContextImpl.class)
.addClass(AuthorizationExceptionHandlerFactory.class)
.addClass(ApplicationExceptionHandler.class)
.addClass(FileRendererImpl.class)
.addClass(SecurityObserver.class)
.addClass(FacesMessageAppender.class)
.addClass(RedirectExceptionHandler.class)
.addClass(AuthenticationExceptionHandlerFactory.class)
.addClass(AuthenticationExceptionHandler.class)
.addClass(ApplicationExceptionHandlerFactory.class)
.addClass(ParameterImpl.class)
.addClass(AuthorizationExceptionHandler.class)
.addClass(RedirectExceptionHandlerFactory.class)
.addClass(AbstractExceptionHandler.class)
.addClass(JsfBootstrap.class)
.addClass(ParameterProducer.class)
.addClass(AbstractPageBean.class)
.addClass(ListPageBean.class)
.addClass(AbstractListPageBean.class)
.addClass(AbstractEditPageBean.class)
.addClass(PageBean.class)
.addClass(EditPageBean.class)
.addClass(PreviousView.class)
.addClass(Redirect.class)
.addClass(NextView.class)
.addAsResource(createFileAsset("src/main/resources/demoiselle-jsf-bundle.properties"),
"demoiselle-jsf-bundle.properties")
.addAsWebInfResource(createFileAsset("src/test/resources/test/beans.xml"), "beans.xml")
.addAsManifestResource(createFileAsset("src/main/resources/META-INF/faces-config.xml"),
"faces-config.xml")
.addAsManifestResource(createFileAsset("src/main/resources/META-INF/demoiselle-d.taglib.xml"),
"demoiselle-d.taglib.xml")
.addAsManifestResource(
createFileAsset("src/main/resources/META-INF/tags/br/gov/frameworkdemoiselle/checkLoggedIn.xhtml"),
"checkedLoggedIn.xhtml").addAsLibraries(libs);
}
public static FileAsset createFileAsset(final String pathname) {
return new FileAsset(new File(pathname));
}
}