Skip to content

Commit a39c258

Browse files
committed
Updated with new release version 1.4.2
1 parent f092877 commit a39c258

27 files changed

+687
-4
lines changed

idaithalam-kafka/api-testing.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
3+
<suite name="End-2-End API automation Suite">
4+
<test name="End-2-End API automation Suite" >
5+
<classes>
6+
<class name="io.virtualan.test.APITestWithExcelAsTestManager">
7+
8+
</class>
9+
</classes>
10+
</test>
11+
</suite>

idaithalam-kafka/pom.xml

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>io.virtualan</groupId>
4+
<artifactId>idaithalam-db-kafka-apitesting</artifactId>
5+
<packaging>jar</packaging>
6+
<name>idaithalam-db-kafka-apitesting</name>
7+
<version>1.0.0-SNAPSHOT</version>
8+
<properties>
9+
<kafka-clients.version>2.8.0</kafka-clients.version>
10+
<cucumber.version>7.0.0</cucumber.version>
11+
<virtualan.version>1.4.2</virtualan.version>
12+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13+
<slf4j.version>1.7.33</slf4j.version>
14+
<idaithalam.version>1.6.1-SNAPSHOT</idaithalam.version>
15+
<testng.ver>7.5</testng.ver>
16+
<java.version>11</java.version>
17+
<maven.compiler.source>${java.version}</maven.compiler.source>
18+
<maven.compiler.target>${java.version}</maven.compiler.target>
19+
</properties>
20+
21+
<build>
22+
<plugins>
23+
<plugin>
24+
<groupId>org.apache.maven.plugins</groupId>
25+
<artifactId>maven-surefire-plugin</artifactId>
26+
<version>2.18.1</version>
27+
<configuration>
28+
<skipTests>false</skipTests>
29+
<suiteXmlFiles>
30+
<suiteXmlFile>api-testing.xml</suiteXmlFile>
31+
</suiteXmlFiles>
32+
</configuration>
33+
</plugin>
34+
<plugin>
35+
<groupId>net.masterthought</groupId>
36+
<artifactId>maven-cucumber-reporting</artifactId>
37+
<version>5.6.0</version>
38+
<executions>
39+
<execution>
40+
<id>report</id>
41+
<phase>install</phase>
42+
<goals>
43+
<goal>generate</goal>
44+
</goals>
45+
<configuration>
46+
<projectName>KAFKA TESTING</projectName>
47+
<outputDirectory>target/html-reports</outputDirectory>
48+
<inputDirectory>${project.build.directory}</inputDirectory>
49+
<jsonFiles>
50+
<param>**/cucumber-*.json</param>
51+
</jsonFiles>
52+
<mergeFeaturesWithRetest>true</mergeFeaturesWithRetest>
53+
<mergeFeaturesById>true</mergeFeaturesById>
54+
<checkBuildResult>false</checkBuildResult>
55+
<skipEmptyJSONFiles>true</skipEmptyJSONFiles>
56+
<skip>false</skip>
57+
</configuration>
58+
</execution>
59+
</executions>
60+
</plugin>
61+
</plugins>
62+
</build>
63+
<dependencies>
64+
<dependency>
65+
<groupId>io.virtualan</groupId>
66+
<artifactId>idaithalam</artifactId>
67+
<version>${idaithalam.version}</version>
68+
</dependency>
69+
<dependency>
70+
<groupId>org.testng</groupId>
71+
<artifactId>testng</artifactId>
72+
<version>${testng.ver}</version>
73+
</dependency>
74+
<dependency>
75+
<groupId>org.slf4j</groupId>
76+
<artifactId>slf4j-api</artifactId>
77+
<version>${slf4j.version}</version>
78+
</dependency>
79+
<dependency>
80+
<groupId>org.slf4j</groupId>
81+
<artifactId>slf4j-simple</artifactId>
82+
<version>${slf4j.version}</version>
83+
</dependency>
84+
<dependency>
85+
<groupId>org.apache.commons</groupId>
86+
<artifactId>commons-lang3</artifactId>
87+
<version>3.12.0</version>
88+
</dependency>
89+
<dependency>
90+
<groupId>org.springframework.boot</groupId>
91+
<artifactId>spring-boot-starter-test</artifactId>
92+
<scope>test</scope>
93+
<version>2.5.10</version>
94+
<exclusions>
95+
<exclusion>
96+
<groupId>com.vaadin.external.google</groupId>
97+
<artifactId>android-json</artifactId>
98+
</exclusion>
99+
<exclusion>
100+
<groupId>ch.qos.logback</groupId>
101+
<artifactId>logback-classic</artifactId>
102+
</exclusion>
103+
<exclusion>
104+
<artifactId>log4j-to-slf4j</artifactId>
105+
<groupId>org.apache.logging.log4j</groupId>
106+
</exclusion>
107+
</exclusions>
108+
</dependency>
109+
<dependency>
110+
<groupId>io.cucumber</groupId>
111+
<artifactId>cucumber-spring</artifactId>
112+
<version>${cucumber.version}</version>
113+
</dependency>
114+
115+
<dependency>
116+
<groupId>org.springframework.boot</groupId>
117+
<artifactId>spring-boot-starter-web</artifactId>
118+
<version>2.5.10</version>
119+
<exclusions>
120+
<exclusion>
121+
<groupId>org.apache.logging.log4j</groupId>
122+
<artifactId>log4j-to-slf4j</artifactId>
123+
</exclusion>
124+
</exclusions>
125+
</dependency>
126+
127+
<dependency>
128+
<groupId>org.springframework.kafka</groupId>
129+
<artifactId>spring-kafka</artifactId>
130+
<version>2.7.4</version>
131+
</dependency>
132+
133+
<dependency>
134+
<groupId>org.springframework.integration</groupId>
135+
<artifactId>spring-integration-kafka</artifactId>
136+
<version>5.5.2</version>
137+
</dependency>
138+
139+
<dependency>
140+
<groupId>org.apache.kafka</groupId>
141+
<artifactId>kafka-clients</artifactId>
142+
<version>2.7.2</version>
143+
</dependency>
144+
145+
<dependency>
146+
<groupId>org.springframework.integration</groupId>
147+
<artifactId>spring-integration-core</artifactId>
148+
<version>5.5.2</version>
149+
</dependency>
150+
151+
152+
<dependency>
153+
<groupId>org.springframework.boot</groupId>
154+
<artifactId>spring-boot-starter-integration</artifactId>
155+
<version>2.5.2</version>
156+
</dependency>
157+
158+
<dependency>
159+
<groupId>com.fasterxml.jackson.core</groupId>
160+
<artifactId>jackson-core</artifactId>
161+
<version>2.13.1</version>
162+
</dependency>
163+
164+
<dependency>
165+
<groupId>javax.validation</groupId>
166+
<artifactId>validation-api</artifactId>
167+
<version>2.0.0.Final</version>
168+
</dependency>
169+
<!-- START Virtual Service API support -->
170+
<dependency>
171+
<groupId>io.virtualan</groupId>
172+
<artifactId>virtualization</artifactId>
173+
<version>${virtualan.version}</version>
174+
<exclusions>
175+
<exclusion>
176+
<artifactId>log4j-to-slf4j</artifactId>
177+
<groupId>org.apache.logging.log4j</groupId>
178+
</exclusion>
179+
</exclusions>
180+
</dependency>
181+
182+
<!-- HyperSQL DB -->
183+
<dependency>
184+
<groupId>org.hsqldb</groupId>
185+
<artifactId>hsqldb</artifactId>
186+
<version>2.6.1</version>
187+
188+
</dependency>
189+
<!-- END Virtual Service API support -->
190+
191+
<!-- Start embedded kafka -->
192+
<dependency>
193+
<groupId>org.springframework.kafka</groupId>
194+
<artifactId>spring-kafka-test</artifactId>
195+
<version>2.7.4</version>
196+
</dependency>
197+
198+
199+
<!-- End -->
200+
</dependencies>
201+
</project>

idaithalam-kafka/readme.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Idaithalam Excel support
2+
3+
## Create the Excel in the following format
4+
5+
|TestCaseName|TestCaseNameDesc|URL|ContentType|RequestFile|RequestProcessingType|ResponseFile|ResponseProcessingType|HTTPAction|ExcludeField|HttpStatusCode|
6+
| -----------|:--------------:|-----:| -----:| -----:| -----:| -----:| -----:| -----:| -----:| -----:|
7+
|PetPost|pet post api test|http://mockbin.org/bin/2c5f64fe-4b65-4453-85a5-5308767e79e8|application/xml|input.xml||output.xml|VirtualanStdType=EDI-271|POST|Date|200|
8+
|PetGet|get API testing|https://live.virtualandemo.com/api/pets/findByTags?tags=grey|application/json|||get_response.json||GET||200|
9+
10+
11+
## Example excel is attached.
12+
[Example excel](https://github.com/virtualansoftware/idaithalam/blob/master/samples/idaithalam-excel-apitesting/src/test/resources/virtualan_collection_pet.xlsx)
13+
14+
## Example Project.
15+
[idaithalam-excel-apitesting](https://github.com/virtualansoftware/idaithalam/tree/master/samples/idaithalam-excel-apitesting)
16+
17+
## Example Genrated reports:
18+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package io.virtualan;
2+
3+
import java.io.IOException;
4+
import java.net.ServerSocket;
5+
import javax.net.ServerSocketFactory;
6+
import org.springframework.beans.factory.annotation.Autowired;
7+
import org.springframework.boot.SpringApplication;
8+
import org.springframework.boot.autoconfigure.SpringBootApplication;
9+
import org.springframework.context.annotation.Bean;
10+
import org.springframework.context.annotation.ComponentScan;
11+
import org.springframework.context.annotation.Configuration;
12+
import org.springframework.kafka.annotation.EnableKafka;
13+
import org.springframework.kafka.test.EmbeddedKafkaBroker;
14+
import org.springframework.kafka.test.context.EmbeddedKafka;
15+
import io.virtualan.message.core.MessagingApplication;
16+
17+
18+
@EnableKafka
19+
@SpringBootApplication
20+
@ComponentScan(basePackages = {"io.virtualan"})
21+
@EmbeddedKafka(partitions = 1, controlledShutdown = false, brokerProperties = {
22+
"listeners=PLAINTEXT://localhost:9092", "port=9092",
23+
"log.dir=target/kafka-logs"})
24+
public class Kafka2SpringBoot {
25+
26+
@Autowired
27+
private Config config;
28+
29+
public static void main(String[] args) {
30+
new SpringApplication(Kafka2SpringBoot.class).run(args);
31+
}
32+
33+
34+
@Autowired
35+
private EmbeddedKafkaBroker broker;
36+
37+
38+
@Configuration
39+
public static class Config {
40+
41+
private int kafkaPort;
42+
43+
private int zkPort;
44+
45+
@Bean
46+
public EmbeddedKafkaBroker broker() throws IOException {
47+
ServerSocket ss = ServerSocketFactory.getDefault().createServerSocket(9092);
48+
this.kafkaPort = ss.getLocalPort();
49+
ss.close();
50+
51+
EmbeddedKafkaBroker embeddedKafkaBroker = new EmbeddedKafkaBroker(1, false) ;
52+
embeddedKafkaBroker.kafkaPorts(this.kafkaPort);
53+
embeddedKafkaBroker.brokerProperty("log.dir", "target/kafka-logs");
54+
return embeddedKafkaBroker;
55+
56+
}
57+
58+
}
59+
60+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
server.port=8800
2+
virtualan.datasource.driver-class-name=org.hsqldb.jdbcDriver
3+
virtualan.datasource.jdbcurl=jdbc:hsqldb:mem:dataSource
4+
virtualan.datasource.username=sa
5+
virtualan.datasource.password=
6+
virtualan.application.name= Kafka
7+
virtualan.data.load=initial-load.json
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"Kafka" : [
3+
{
4+
"broker" : "localhost:9092",
5+
"topics": [
6+
"virtualan.input", "virtualan.output"
7+
],
8+
"consumer" : "consumer-pet.properties",
9+
"producer" : "producer-pet.properties"
10+
}
11+
]
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[
2+
{
3+
"brokerUrl": "localhost:9092",
4+
"input": "{ \"category\": { \"id\": 100, \"name\": \"Fish-POST\" }, \"id\": 100, \"name\": \"GoldFish-POST\", \"photoUrls\": [ \"/fish/\" ], \"status\": \"available\", \"tags\": [ { \"id\": 100, \"name\": \"Fish-POST\" } ] } |",
5+
"output": "{ \"category\": { \"id\": 100, \"name\": \"Fish-POST\" }, \"id\": 100, \"name\": \"GoldFish-POST\", \"photoUrls\": [ \"/fish/\" ], \"status\": \"available\", \"tags\": [ { \"id\": 100, \"name\": \"Fish-POST\" } ] } |",
6+
"requestTopicOrQueueName": "virtualan.input",
7+
"responseTopicOrQueueName": "virtualan.output",
8+
"type": "Response",
9+
"resource": "virtualan.input",
10+
"requestType": "KAFKA"
11+
}
12+
]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package io.virtualan.cucumblan.core;
2+
3+
import io.cucumber.java.Before;
4+
import io.virtualan.Kafka2SpringBoot;
5+
import org.slf4j.Logger;
6+
import org.slf4j.LoggerFactory;
7+
import org.springframework.boot.test.context.SpringBootContextLoader;
8+
import org.springframework.boot.test.context.SpringBootTest;
9+
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
10+
import org.springframework.test.context.ContextConfiguration;
11+
12+
@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT)
13+
@ContextConfiguration(classes = Kafka2SpringBoot.class, loader = SpringBootContextLoader.class)
14+
@io.cucumber.spring.CucumberContextConfiguration
15+
public class CucumberContextConfiguration {
16+
17+
private static final Logger LOG = LoggerFactory.getLogger(CucumberContextConfiguration.class);
18+
19+
@Before
20+
public void setUp() {
21+
LOG.info("-------------- Spring Virtualan Kafka Context Initialized For Executing Cucumber Tests --------------");
22+
}
23+
24+
}

0 commit comments

Comments
 (0)