Skip to content

Commit

Permalink
[TH2-5165] corrected after review
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-Smirnov-Exactpro committed Mar 4, 2024
1 parent 2dbd671 commit 7b25d0e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

import com.exactpro.cradle.BookId;
import com.exactpro.cradle.BookInfo;
import com.exactpro.cradle.CradleManager;
import com.exactpro.cradle.CradleStorage;
import com.exactpro.th2.common.schema.factory.CommonFactory;
import com.exactpro.th2.test.annotations.Th2AppFactory;
import com.exactpro.th2.test.annotations.Th2TestFactory;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

Expand All @@ -37,8 +37,8 @@ public class BookCliTest extends AbstractCliTest {

@Test
public void addBookTest(@Th2AppFactory CommonFactory appFactory,
@Th2TestFactory CommonFactory testFactory) throws Exception {
CradleStorage cradleStorage = testFactory.getCradleManager().getStorage();
CradleManager manager) throws Exception {
CradleStorage cradleStorage = manager.getStorage();
int initNumberOfBooks = cradleStorage.listBooks().size();

String bookName = "addBookTest";
Expand All @@ -54,8 +54,8 @@ public void addBookTest(@Th2AppFactory CommonFactory appFactory,

@Test
public void addBookWithoutTimeTest(@Th2AppFactory CommonFactory appFactory,
@Th2TestFactory CommonFactory testFactory) throws Exception {
CradleStorage cradleStorage = testFactory.getCradleManager().getStorage();
CradleManager manager) throws Exception {
CradleStorage cradleStorage = manager.getStorage();
int initNumberOfBooks = cradleStorage.listBooks().size();

Instant i1 = Instant.now();
Expand All @@ -74,8 +74,8 @@ public void addBookWithoutTimeTest(@Th2AppFactory CommonFactory appFactory,

@Test
public void addBookWithParamsTest(@Th2AppFactory CommonFactory appFactory,
@Th2TestFactory CommonFactory testFactory) throws Exception {
CradleStorage cradleStorage = testFactory.getCradleManager().getStorage();
CradleManager manager) throws Exception {
CradleStorage cradleStorage = manager.getStorage();
int initNumberOfBooks = cradleStorage.listBooks().size();

Instant created = Instant.now().minus(20, ChronoUnit.MINUTES);
Expand Down Expand Up @@ -103,8 +103,8 @@ public void addBookWithParamsTest(@Th2AppFactory CommonFactory appFactory,

@Test
public void addExistedBookTest(@Th2AppFactory CommonFactory appFactory,
@Th2TestFactory CommonFactory testFactory) throws Exception {
CradleStorage cradleStorage = testFactory.getCradleManager().getStorage();
CradleManager manager) throws Exception {
CradleStorage cradleStorage = manager.getStorage();
int initNumberOfBooks = cradleStorage.listBooks().size();

String bookName = "addExistedBookTest";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

import com.exactpro.cradle.BookId;
import com.exactpro.cradle.BookInfo;
import com.exactpro.cradle.CradleManager;
import com.exactpro.cradle.CradleStorage;
import com.exactpro.cradle.PageId;
import com.exactpro.cradle.PageInfo;
import com.exactpro.th2.common.schema.factory.CommonFactory;
import com.exactpro.th2.test.annotations.Th2AppFactory;
import com.exactpro.th2.test.annotations.Th2TestFactory;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

Expand All @@ -41,8 +41,8 @@ public class PagesCliTest extends AbstractCliTest {

@Test
public void addPageBeforeTest(@Th2AppFactory CommonFactory appFactory,
@Th2TestFactory CommonFactory testFactory) throws Exception {
CradleStorage cradleStorage = testFactory.getCradleManager().getStorage();
CradleManager manager) throws Exception {
CradleStorage cradleStorage = manager.getStorage();

String bookName = "addPageBeforeTest";
BookId bookId = new BookId(bookName);
Expand All @@ -69,8 +69,8 @@ public void addPageBeforeTest(@Th2AppFactory CommonFactory appFactory,

@Test
public void addPageCurrentTimeTest(@Th2AppFactory CommonFactory appFactory,
@Th2TestFactory CommonFactory testFactory) throws Exception {
CradleStorage cradleStorage = testFactory.getCradleManager().getStorage();
CradleManager manager) throws Exception {
CradleStorage cradleStorage = manager.getStorage();

String bookName = "addPageCurrentTimeTest";
BookId bookId = new BookId(bookName);
Expand All @@ -97,8 +97,8 @@ public void addPageCurrentTimeTest(@Th2AppFactory CommonFactory appFactory,

@Test
public void addPageCorrectTest(@Th2AppFactory CommonFactory appFactory,
@Th2TestFactory CommonFactory testFactory) throws Exception {
CradleStorage cradleStorage = testFactory.getCradleManager().getStorage();
CradleManager manager) throws Exception {
CradleStorage cradleStorage = manager.getStorage();

String bookName = "addPageCorrectTest";
BookId bookId = new BookId(bookName);
Expand Down Expand Up @@ -128,8 +128,8 @@ public void addPageCorrectTest(@Th2AppFactory CommonFactory appFactory,

@Test
public void addPageWithoutNameTest(@Th2AppFactory CommonFactory appFactory,
@Th2TestFactory CommonFactory testFactory) throws Exception {
CradleStorage cradleStorage = testFactory.getCradleManager().getStorage();
CradleManager manager) throws Exception {
CradleStorage cradleStorage = manager.getStorage();

String bookName = "addPageWithoutNameTest";
BookId bookId = new BookId(bookName);
Expand Down Expand Up @@ -158,8 +158,8 @@ public void addPageWithoutNameTest(@Th2AppFactory CommonFactory appFactory,

@Test
public void addPageWithParamsTest(@Th2AppFactory CommonFactory appFactory,
@Th2TestFactory CommonFactory testFactory) throws Exception {
CradleStorage cradleStorage = testFactory.getCradleManager().getStorage();
CradleManager manager) throws Exception {
CradleStorage cradleStorage = manager.getStorage();

String bookName = "addPageWithParamsTest";
BookId bookId = new BookId(bookName);
Expand Down Expand Up @@ -192,8 +192,8 @@ public void addPageWithParamsTest(@Th2AppFactory CommonFactory appFactory,

@Test
public void addExistedPageTest(@Th2AppFactory CommonFactory appFactory,
@Th2TestFactory CommonFactory testFactory) throws Exception {
CradleStorage cradleStorage = testFactory.getCradleManager().getStorage();
CradleManager manager) throws Exception {
CradleStorage cradleStorage = manager.getStorage();

String bookName = "addExistedPageTest";
BookId bookId = new BookId(bookName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

package com.exactpro.th2.cradle.adm.cli;

import com.exactpro.cradle.CradleManager;
import com.exactpro.cradle.CradleStorage;
import com.exactpro.th2.common.schema.factory.CommonFactory;
import com.exactpro.th2.cradle.adm.TestBookPageBuilder;
import com.exactpro.th2.test.annotations.Th2AppFactory;
import com.exactpro.th2.test.annotations.Th2TestFactory;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

Expand All @@ -34,8 +34,8 @@
public class ViewersAllBooksTest extends AbstractCliTest {
@Test
public void printAllBooksTest(@Th2AppFactory CommonFactory appFactory,
@Th2TestFactory CommonFactory testFactory) throws Exception {
CradleStorage cradleStorage = testFactory.getCradleManager().getStorage();
CradleManager manager) throws Exception {
CradleStorage cradleStorage = manager.getStorage();

String book1Name = "Book1";
Instant book1Start = Instant.now();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

import com.exactpro.cradle.BookId;
import com.exactpro.cradle.BookInfo;
import com.exactpro.cradle.CradleManager;
import com.exactpro.cradle.CradleStorage;
import com.exactpro.cradle.PageInfo;
import com.exactpro.cradle.utils.CradleStorageException;
import com.exactpro.th2.common.schema.factory.CommonFactory;
import com.exactpro.th2.cradle.adm.TestBookPageBuilder;
import com.exactpro.th2.test.annotations.Th2AppFactory;
import com.exactpro.th2.test.annotations.Th2TestFactory;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -56,8 +56,8 @@ public void printUnknownBookTest(@Th2AppFactory CommonFactory appFactory) {

@Test
public void printBookTest(@Th2AppFactory CommonFactory appFactory,
@Th2TestFactory CommonFactory testFactory) throws Exception {
CradleStorage cradleStorage = testFactory.getCradleManager().getStorage();
CradleManager manager) throws Exception {
CradleStorage cradleStorage = manager.getStorage();

DBMetadata result = getInitData(cradleStorage, "printBookTest");

Expand Down Expand Up @@ -101,8 +101,8 @@ public void printBookTest(@Th2AppFactory CommonFactory appFactory,

@Test
public void printBookTest2(@Th2AppFactory CommonFactory appFactory,
@Th2TestFactory CommonFactory testFactory) throws Exception {
CradleStorage cradleStorage = testFactory.getCradleManager().getStorage();
CradleManager manager) throws Exception {
CradleStorage cradleStorage = manager.getStorage();

DBMetadata result = getInitData(cradleStorage, "printBookTest2");

Expand Down Expand Up @@ -132,8 +132,8 @@ public void printBookTest2(@Th2AppFactory CommonFactory appFactory,

@Test
public void printBookTestWithRemovedPages(@Th2AppFactory CommonFactory appFactory,
@Th2TestFactory CommonFactory testFactory) throws Exception {
CradleStorage cradleStorage = testFactory.getCradleManager().getStorage();
CradleManager manager) throws Exception {
CradleStorage cradleStorage = manager.getStorage();

DBMetadata result = getInitData(cradleStorage, "printBookTestWithRemovedPages");

Expand Down Expand Up @@ -175,8 +175,8 @@ public void printBookTestWithRemovedPages(@Th2AppFactory CommonFactory appFactor

@Test
public void printBookTestWithoutPages(@Th2AppFactory CommonFactory appFactory,
@Th2TestFactory CommonFactory testFactory) throws Exception {
CradleStorage cradleStorage = testFactory.getCradleManager().getStorage();
CradleManager manager) throws Exception {
CradleStorage cradleStorage = manager.getStorage();

DBMetadata result = getInitData(cradleStorage, "printBookTestWithoutPages");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.exactpro.th2.common.schema.factory.CommonFactory;
import com.exactpro.th2.test.annotations.Th2AppFactory;
import com.exactpro.th2.test.annotations.Th2IntegrationTest;
import com.exactpro.th2.test.annotations.Th2TestFactory;
import com.exactpro.th2.test.spec.CradleSpec;
import org.eclipse.jetty.http.HttpTester;
import org.eclipse.jetty.server.LocalConnector;
Expand Down Expand Up @@ -59,8 +58,8 @@ public static void initStorage(CradleManager manager) {

@BeforeEach
public void init(@Th2AppFactory CommonFactory appFactory,
@Th2TestFactory CommonFactory testFactory) throws Exception {
this.storage = testFactory.getCradleManager().getStorage();
CradleManager manager) throws Exception {
this.storage = manager.getStorage();
this.testHttpServer = new TestHttpServer(new Configuration(), appFactory.getCradleManager().getStorage());
this.testHttpServer.run();
this.connector = testHttpServer.getLocalConnector();
Expand Down

0 comments on commit 7b25d0e

Please sign in to comment.