diff options
Diffstat (limited to 'juick-spring-www/src/test')
3 files changed, 0 insertions, 123 deletions
diff --git a/juick-spring-www/src/test/java/com/juick/www/NotFoundPageTest.java b/juick-spring-www/src/test/java/com/juick/www/NotFoundPageTest.java deleted file mode 100644 index c01194f47..000000000 --- a/juick-spring-www/src/test/java/com/juick/www/NotFoundPageTest.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.juick.www; - -import com.juick.configuration.DataConfiguration; -import com.juick.www.configuration.WebSecurityConfig; -import com.juick.www.configuration.WwwServletConfiguration; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.ContextHierarchy; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.web.WebAppConfiguration; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import org.springframework.web.context.WebApplicationContext; - -import javax.inject.Inject; - -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view; - -/** - * Created by aalexeev on 11/24/16. - */ -@RunWith(SpringJUnit4ClassRunner.class) -@WebAppConfiguration -@ContextHierarchy({ - @ContextConfiguration(classes = { - com.juick.www.configuration.WebAppConfiguration.class, - WebSecurityConfig.class, - DataConfiguration.class}), - @ContextConfiguration(classes = {WwwServletConfiguration.class}), -}) -public class NotFoundPageTest { - @Inject - private WebApplicationContext wac; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac) - .apply(SecurityMockMvcConfigurers.springSecurity()).build(); - } - - @Test - public void pageNotFoundTest() throws Exception { - mockMvc.perform(get("/-11")) - .andExpect(status().is4xxClientError()) - .andExpect(view().name("views/error")); - - mockMvc.perform(get("/-1")) - .andExpect(status().is4xxClientError()) - .andExpect(view().name("views/error")); - } -} diff --git a/juick-spring-www/src/test/java/com/juick/www/ThymeleafTestsJunitRunner.java b/juick-spring-www/src/test/java/com/juick/www/ThymeleafTestsJunitRunner.java deleted file mode 100644 index 4fd1f1f50..000000000 --- a/juick-spring-www/src/test/java/com/juick/www/ThymeleafTestsJunitRunner.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.juick.www; - -import nz.net.ultraq.thymeleaf.LayoutDialect; -import org.junit.Assert; -import org.junit.Test; -import org.thymeleaf.dialect.IDialect; -import org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect; -import org.thymeleaf.spring4.dialect.SpringStandardDialect; -import org.thymeleaf.testing.templateengine.context.web.SpringWebProcessingContextBuilder; -import org.thymeleaf.testing.templateengine.engine.TestExecutor; - -import java.util.ArrayList; -import java.util.List; - -/** - * Created by aalexeev on 11/24/16. - */ -public class ThymeleafTestsJunitRunner { - - @Test - public void runThymeleafTest() { - final List<IDialect> dialects = new ArrayList<>(); - dialects.add(new SpringStandardDialect()); - dialects.add(new LayoutDialect()); - dialects.add(new SpringSecurityDialect()); - - final SpringWebProcessingContextBuilder springPCBuilder = new SpringWebProcessingContextBuilder(); - - springPCBuilder.setApplicationContextConfigLocation(null); - - final TestExecutor executor = new TestExecutor(); - executor.setProcessingContextBuilder(springPCBuilder); - executor.setDialects(dialects); - - executor.execute("classpath:tests"); - - Assert.assertTrue(executor.isAllOK()); - executor.reset(); - } -} diff --git a/juick-spring-www/src/test/resources/tests/simple.thtest b/juick-spring-www/src/test/resources/tests/simple.thtest deleted file mode 100644 index 1505a382b..000000000 --- a/juick-spring-www/src/test/resources/tests/simple.thtest +++ /dev/null @@ -1,25 +0,0 @@ -%TEMPLATE_MODE HTML -# ------------ separator comment ----------- -%CONTEXT -onevar = 'Goodbye,' -# ------------------------------------------ -%MESSAGES -one.msg = Crisis -# ------------------------------------------ -%INPUT -<!DOCTYPE html> -<html> - <body> - <span th:text="${onevar}">Hello,</span> - <span th:text="#{one.msg}">World!</span> - </body> -</html> -# ------------------------------------------ -%OUTPUT -<!DOCTYPE html> -<html> - <body> - <span>Goodbye,</span> - <span>Crisis</span> - </body> -</html>
\ No newline at end of file |