Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for Pippo restart #642

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ public void testControllerWithInterceptor() {
when().get("/").then().statusCode(200);
}

/** Tests that server is working after restart */
@Test
public void testControllerWithInterceptor2() {
when().get("/").then().statusCode(200);
}

@Inherited
@InterceptorBinding
@Retention(RUNTIME)
Expand Down
7 changes: 7 additions & 0 deletions pippo-server-parent/pippo-jetty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
<artifactId>metainf-services</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>ro.pippo</groupId>
<artifactId>pippo-test</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright (C) 2014-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ro.pippo.jetty;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import ro.pippo.core.Application;
import ro.pippo.core.HttpConstants;
import ro.pippo.test.PippoExtension;
import ro.pippo.test.PippoTest;

public class PippoCoreTest extends PippoTest {

@RegisterExtension
public static PippoExtension pippoExtension = new PippoExtension(new Application() {{

GET("/", routeContext -> routeContext.status(HttpConstants.StatusCode.OK));

}});

/** Tests if Pippo initialized properly */
@Test
public void testSimple() {
when()
.get("/")
.then()
.statusCode(HttpConstants.StatusCode.OK)
;
}

/** Tests if everything still works after Pippo stop/start cycle */
@Test
public void testSimple2() {
when()
.get("/")
.then()
.statusCode(HttpConstants.StatusCode.OK)
;
}

}
7 changes: 7 additions & 0 deletions pippo-server-parent/pippo-tomcat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
<artifactId>metainf-services</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>ro.pippo</groupId>
<artifactId>pippo-test</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright (C) 2014-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ro.pippo.tomcat;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import ro.pippo.core.Application;
import ro.pippo.core.HttpConstants;
import ro.pippo.test.PippoExtension;
import ro.pippo.test.PippoTest;

public class PippoCoreTest extends PippoTest {

@RegisterExtension
public static PippoExtension pippoExtension = new PippoExtension(new Application() {{

GET("/", routeContext -> routeContext.status(HttpConstants.StatusCode.OK));

}});

/** Tests if Pippo initialized properly */
@Test
public void testSimple() {
when()
.get("/")
.then()
.statusCode(HttpConstants.StatusCode.OK)
;
}

/** Tests if everything still works after Pippo stop/start cycle */
@Test
public void testSimple2() {
when()
.get("/")
.then()
.statusCode(HttpConstants.StatusCode.OK)
;
}

}
7 changes: 7 additions & 0 deletions pippo-server-parent/pippo-undertow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
<artifactId>metainf-services</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>ro.pippo</groupId>
<artifactId>pippo-test</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright (C) 2014-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ro.pippo.undertow;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import ro.pippo.core.Application;
import ro.pippo.core.HttpConstants;
import ro.pippo.test.PippoExtension;
import ro.pippo.test.PippoTest;

public class PippoCoreTest extends PippoTest {

@RegisterExtension
public static PippoExtension pippoExtension = new PippoExtension(new Application() {{

GET("/", routeContext -> routeContext.status(HttpConstants.StatusCode.OK));

}});

/** Tests if Pippo initialized properly */
@Test
public void testSimple() {
when()
.get("/")
.then()
.statusCode(HttpConstants.StatusCode.OK)
;
}

/** Tests if everything still works after Pippo stop/start cycle */
@Test
public void testSimple2() {
when()
.get("/")
.then()
.statusCode(HttpConstants.StatusCode.OK)
;
}

}