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

No sql #26

Open
wants to merge 117 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 103 commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
ad360ab
Started working on MongoDB functionality.
jonreding2010 Aug 11, 2020
ee11665
Continued progress, Config unit tests are only ones that still work.
jonreding2010 Aug 11, 2020
2d2dcef
Working on tests
jonreding2010 Aug 12, 2020
ae19537
more work on unit tests
jonreding2010 Sep 3, 2020
29c0b18
updates
jonreding2010 Sep 18, 2020
6d0fb62
continued working on MongoDB stuff, now to figure out why MongoDbDriv…
jonreding2010 Jan 10, 2021
77e9657
working on tests
jonreding2010 Jan 11, 2021
bb74e6f
driver update
jonreding2010 Jan 14, 2021
482fe4a
Merge branch 'master' into MongoDB
jonreding2010 Jan 22, 2021
2a9e9fc
more work on unit tests
jonreding2010 Jan 23, 2021
d307ede
Changed to actual mongoDB repo
jonreding2010 Jan 28, 2021
389b376
updated pom
jonreding2010 Jan 28, 2021
caf6cce
checkstyle changes
jonreding2010 Jun 4, 2021
60ce692
Merge branch 'master' into MongoDB
jonreding2010 Jun 4, 2021
b881d01
added MongoDB as dependency in framework .pom
jonreding2010 Jun 9, 2021
4099d2c
Merge branch 'master' into MongoDB
jonreding2010 Jun 9, 2021
63eb864
checkstyle updates
jonreding2010 Jun 9, 2021
8663ef4
checkstyle updates
jonreding2010 Jun 9, 2021
b1572c9
updated mongodb driver version
jonreding2010 Jun 11, 2021
b799ba2
Merge branch 'master' into MongoDB
jonreding2010 Oct 18, 2021
a7e7df8
added comments
jonreding2010 Oct 18, 2021
245bb18
add docker stuff for mongo db
jredingcsv Jan 23, 2022
9b0aeed
Merge branch 'main' into MongoDB
jredingcsv Jan 23, 2022
141c4eb
more edits for mongo db
jredingcsv Jan 23, 2022
8a3b8a7
added content for mongo db
jredingcsv Jan 23, 2022
6be5f12
added content for mongo db
jredingcsv Jan 24, 2022
1465dea
Merge branch 'main' into NoSQL
jredingcsv Feb 18, 2022
82aeca5
import updates
jredingcsv Feb 18, 2022
f0b0f5d
Merge branch 'main' into NoSQL
jredingcsv Mar 7, 2022
645d65c
updated nosql comments
jredingcsv Mar 7, 2022
6b511ae
copyright update
jredingcsv Mar 8, 2022
4b3698c
copyright update
jredingcsv Mar 8, 2022
44373fa
updated to set up mongo docker
jredingcsv Mar 10, 2022
5cfd803
Merge branch 'main' into NoSQL
jredingcsv Apr 12, 2022
2677b1c
Merge branch 'Add_Interfaces' into NoSQL
jredingcsv Apr 12, 2022
d31d46d
small edits
jredingcsv Apr 13, 2022
6e53965
small edits
jredingcsv Apr 13, 2022
c565353
small edits
jredingcsv Apr 13, 2022
a647e93
small edits
jredingcsv Apr 13, 2022
1abf5d1
Merge branch 'main' into NoSQL
jredingcsv Apr 14, 2022
a894a01
update docker
jredingcsv Apr 14, 2022
42ccfcc
Merge branch 'main' into NoSQL
jredingcsv Apr 15, 2022
0434431
updated some stuff
jredingcsv Apr 15, 2022
5773221
Merge branch 'main' into NoSQL
jredingcsv Apr 29, 2022
6329afe
Merge branch 'main' into NoSQL
jredingcsv May 5, 2022
da4f6cb
add nosql module to maven.yml
jredingcsv May 5, 2022
5664002
checkstyle updates
jredingcsv May 5, 2022
ac5e37e
Merge branch 'main' into NoSQL
jredingcsv Jun 22, 2022
f8420da
Merge branch 'main' into NoSQL
jredingcsv Sep 14, 2022
fdc877e
more updates
jredingcsv Sep 14, 2022
d93231a
manage port as quotes
jredingcsv Sep 16, 2022
e5eb785
Merge branch 'main' into NoSQL
jredingcsv Oct 24, 2022
2e35069
maqs-java-4 initial sweep at rebranding
Dec 9, 2022
e0983c9
replace org name
jonreding2010 Dec 14, 2022
ad0aa02
checkstyle updates
jonreding2010 Dec 14, 2022
d66250e
organize project level properties
jonreding2010 Dec 14, 2022
9ba3085
checkstyle fixes
jonreding2010 Dec 14, 2022
7bb4072
checkstyle fixes
jonreding2010 Dec 14, 2022
345ade9
checkstyle fixes
jonreding2010 Dec 14, 2022
b607f44
checkstyle fixes
jonreding2010 Dec 14, 2022
cd5b5de
checkstyle fixes
jonreding2010 Dec 14, 2022
b5e8c6d
checkstyle fixes
jonreding2010 Dec 14, 2022
c435042
Merge branch 'main' into org_naming_update
jonreding2010 Dec 14, 2022
527e608
fixed failing utilities tests
jonreding2010 Dec 14, 2022
bcee83a
trying to fix text
jonreding2010 Dec 14, 2022
bce15ea
checkstyle update
jonreding2010 Dec 14, 2022
e964036
updated accessibility module to work better
jonreding2010 Dec 14, 2022
64c78f2
checkstyle update
jonreding2010 Dec 14, 2022
a4617c5
checkstyle update
jonreding2010 Dec 14, 2022
96ffcd6
get more database tests working
jonreding2010 Dec 15, 2022
b17b3ed
trying to solve utilities unit test failure
jonreding2010 Dec 15, 2022
7f41081
rename unit tests
jonreding2010 Dec 15, 2022
1b0d255
update testing web page url
jonreding2010 Dec 22, 2022
5904e2b
update js stuff
jonreding2010 Dec 31, 2022
9895417
updated selenium unit tests to used @BeforeMethod set up
jonreding2010 Dec 31, 2022
abfd7af
updated playwright unit tests to used @BeforeMethod set up
jonreding2010 Dec 31, 2022
db7bd64
updated selenium unit tests to work again
jonreding2010 Dec 31, 2022
b3ba4f3
Revert "updated selenium unit tests to work again"
jonreding2010 Dec 31, 2022
1a041ab
Revert "updated selenium unit tests to used @BeforeMethod set up"
jonreding2010 Dec 31, 2022
ebb3a88
update logging unit test to clean up after test run
jonreding2010 Dec 31, 2022
694683a
try @BeforeMethod for ActionBuilder Unit tests
jonreding2010 Dec 31, 2022
3c3a4df
try @BeforeMethod for BaseSeleniumPageModel Unit tests
jonreding2010 Dec 31, 2022
b6b20a1
delete @BeforeMethod for BaseSeleniumPageModel Unit tests
jonreding2010 Dec 31, 2022
61aaca0
try @BeforeMethod for BaseSeleniumPageModel Unit tests
jonreding2010 Dec 31, 2022
7913453
try @BeforeMethod for EventHandler Unit tests
jonreding2010 Dec 31, 2022
3617520
try @BeforeMethod for EventHandler Unit tests
jonreding2010 Dec 31, 2022
6e319aa
try @BeforeMethod for UIFind Unit tests
jonreding2010 Dec 31, 2022
699284f
delete setting up Automation Page Model for UI Wait Factory
jonreding2010 Dec 31, 2022
ed2e5f6
Revert "delete setting up Automation Page Model for UI Wait Factory"
jonreding2010 Dec 31, 2022
e1e60e2
update some small things for web service
jonreding2010 Jan 3, 2023
46e662f
pom updates
jonreding2010 Jan 3, 2023
be998e5
update jackson version
jonreding2010 Jan 3, 2023
af54d40
update folder name to match java naming case
jonreding2010 Jan 3, 2023
abca19f
Merge branch 'org_naming_update' into NoSQL
jonreding2010 Jan 4, 2023
3d06c4a
changed to MAQS org
jonreding2010 Jan 13, 2023
be402a3
Merge branch 'main' into NoSQL
jonreding2010 Feb 11, 2023
f7f7b0b
Update pom.xml
jonreding2010 Feb 11, 2023
a117f9e
update mongo sql content for openmaqs
jonreding2010 Feb 11, 2023
3a8845e
revert fixes
jonreding2010 Feb 11, 2023
7b25b19
checkstyle fixes
jonreding2010 Feb 11, 2023
bf682c1
checkstyle fixes
jonreding2010 Feb 11, 2023
4ba3b83
checkstyle fixes
jonreding2010 Feb 11, 2023
d6084c8
checkstyle fixes
jonreding2010 Feb 11, 2023
d7e329c
appium test fix
jonreding2010 Feb 11, 2023
9eba0d7
update some files
jonreding2010 Feb 14, 2023
2159484
update some files
jonreding2010 Feb 14, 2023
a500a53
Update docker-compose.yml
jonreding2010 Feb 14, 2023
e38a0d7
Merge branch 'main' into NoSQL
jonreding2010 Mar 18, 2023
dcbf86d
Merge branch 'main' into NoSQL
jonreding2010 Apr 14, 2023
d47d6df
Merge remote-tracking branch 'origin/NoSQL' into NoSQL
jonreding2010 Jul 12, 2023
2c55d47
Merge branch 'main' into NoSQL
jonreding2010 Jul 12, 2023
4c80010
update mongo db version
jonreding2010 Jul 12, 2023
695e8c0
Merge branch 'main' into NoSQL
jonreding2010 Oct 31, 2023
d9530dd
Merge branch 'main' into NoSQL
jonreding2010 Dec 13, 2023
ea4f3b8
Merge branch 'NoSQL' of https://github.com/OpenMAQS/openmaqs-java int…
jonreding2010 Jan 16, 2024
062a6ae
update yaml file to set up mongodb database
jonreding2010 Jan 16, 2024
a529fd2
update yaml file to setup mongodb database
jonreding2010 Jan 16, 2024
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
6 changes: 5 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ database:
- openmaqs-database/*
- openmaqs-database/**/*

nosql:
- openmaqs-nosql/*
- openmaqs-nosql/**/*

devops:
- .dependabot/*
- .github/*
Expand All @@ -36,4 +40,4 @@ accessibility:

playwright:
- openmaqs-playwright/*
- openmaqs-playwright/**/*
- openmaqs-playwright/**/*
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
strategy:
fail-fast: false
matrix:
module-name: [ openmaqs-utilities, openmaqs-base, openmaqs-appium, openmaqs-selenium, openmaqs-webservices, openmaqs-cucumber, openmaqs-accessibility, openmaqs-database, openmaqs-playwright ]
module-name: [ openmaqs-utilities, openmaqs-base, openmaqs-appium, openmaqs-selenium, openmaqs-webservices, openmaqs-cucumber, openmaqs-accessibility, openmaqs-database, openmaqs-nosql, openmaqs-playwright ]
steps:
- name: Check if tests can be run
if: matrix.module-name == 'openmaqs-appium' && github.actor == 'dependabot[bot]'
Expand Down
23 changes: 23 additions & 0 deletions Docker/MAQSMongoDB/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '2'

services:
mongo:
image: mongo
restart: always
ports:
- "27017:27017"
volumes:
- ./seed/seed.js:/docker-entrypoint-initdb.d/seed.js
mongo-express:
image: mongo-express
restart: always
ports:
- 8081:8081
links:
- mongo
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME:
ME_CONFIG_MONGODB_ADMINPASSWORD:

# Run a custom bash script that bootstraps the database after it is started.
command: [ '/bin/bash', '/mnt/host/initialize_and_start_sqlserver.sh' ]
22 changes: 22 additions & 0 deletions Docker/MAQSMongoDB/seed/seed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
db = db.getSiblingDB('MongoDatabaseTest')
db.MongoTestCollection.drop();
db.MongoTestCollection.insertMany([
{
"lid": "test1",
"isChanged": true,
"order": 1
},
{
"lid": "test2",
"isChanged": false,
"order": 2
},
{
"lid": "test3",
"isChanged": false
},
{
"lid": "test4",
"isChanged": false
}
])
15 changes: 15 additions & 0 deletions Docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# The extends functionality is not yet available in
# Docker config files versioned 3 and higher.
# If the version is bumped, this config file will have to change.
# See https://github.com/moby/moby/issues/31101.
version: '2'

services:
mssql:
extends:
file: ./MAQSSQLServer/docker-compose.yml
service: mssql
mongo:
extends:
file: ./MAQSMongoDB/docker-compose.yml
service: mongo
13 changes: 8 additions & 5 deletions docker/MAQSMongoDB/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ version: '2'
services:
mongo:
image: mongo
restart: always
restart: always
ports:
- "27017:27017"
- "27017:27017"
volumes:
- ./seed/seed.js:/docker-entrypoint-initdb.d/seed.js
- ./seed/seed.js:/docker-entrypoint-initdb.d/seed.js
mongo-express:
image: mongo-express
restart: always
Expand All @@ -16,5 +16,8 @@ services:
links:
- mongo
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME:
ME_CONFIG_MONGODB_ADMINPASSWORD:
ME_CONFIG_MONGODB_ADMINUSERNAME:
ME_CONFIG_MONGODB_ADMINPASSWORD:

# Run a custom bash script that bootstraps the database after it is started.
command: [ '/bin/bash', '/mnt/host/initialize_and_start_sqlserver.sh' ]
2 changes: 1 addition & 1 deletion docker/MAQSMongoDB/seed/seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ db.MongoTestCollection.insertMany([
"lid": "test4",
"isChanged": false
}
])
])
7 changes: 2 additions & 5 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,15 @@ version: '2'

services:
mssql:
extends:
extends:
file: ./MAQSSQLServer/docker-compose.yml
service: mssql
mongo:
extends:
file: ./MAQSMongoDB/docker-compose.yml
service: mongo

imap:
extends:
file: ./MAQSEmail/docker-compose.yml
service: imap
webservice:
extends:
service: webservice
file: ./MAQSService/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright 2022 (C) MAQS, All rights Reserved
~ Copyright 2023 (C) OpenMAQS, All rights Reserved
-->

<!DOCTYPE html>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright 2022 (C) MAQS, All rights Reserved
~ Copyright 2023 (C) OpenMAQS, All rights Reserved
-->

<!DOCTYPE html>
Expand Down
2 changes: 1 addition & 1 deletion openmaqs-appium/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</AppiumMaqs>

<AppiumCapsMaqs>
<username>JMAQS</username>
<username>maqs-Framework</username>
<accessKey>NEVER_CHECKIN_A_REAL_KEY</accessKey>
<deviceOrientation>portrait</deviceOrientation>
<browserName>Chrome</browserName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void testGetCapabilitiesAsStrings() {

SoftAssert softAssert = new SoftAssert();
softAssert.assertTrue(capabilitiesAsStrings.containsKey(username));
softAssert.assertEquals(capabilitiesAsStrings.get(username), "JMAQS");
softAssert.assertEquals(capabilitiesAsStrings.get(username), "maqs-Framework<");
softAssert.assertTrue(capabilitiesAsStrings.containsKey(accessKey));
softAssert
.assertNotEquals(capabilitiesAsStrings.get(accessKey), "");
Expand All @@ -94,7 +94,7 @@ public void testGetCapabilitiesAsObjects() {

SoftAssert softAssert = new SoftAssert();
softAssert.assertTrue(capabilitiesAsObjects.containsKey(username));
softAssert.assertEquals(capabilitiesAsObjects.get(username), "JMAQS");
softAssert.assertEquals(capabilitiesAsObjects.get(username), "maqs-Framework<");
softAssert.assertTrue(capabilitiesAsObjects.containsKey(accessKey));
softAssert
.assertNotEquals(capabilitiesAsObjects.get(accessKey), "");
Expand Down
41 changes: 41 additions & 0 deletions openmaqs-nosql/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>

<configuration>
<ModualMaqs>
<!-- Generic wait time in milliseconds - AKA how long do you wait for rechecking something -->
<WaitTime>100</WaitTime>

<!-- Generic time-out in milliseconds -->
<Timeout>10000</Timeout>

<!-- Do you want to create logs for your tests
<Log>YES</Log>
<Log>NO</Log>
<Log>OnFail</Log>-->
<Log>YES</Log>

<!--Logging Levels
<LogLevel>VERBOSE</LogLevel>
<LogLevel>INFORMATION</LogLevel>
<LogLevel>GENERIC</LogLevel>
<LogLevel>SUCCESS</LogLevel>
<LogLevel>WARNING</LogLevel>
<LogLevel>ERROR</LogLevel>-->
<LogLevel>VERBOSE</LogLevel>

<!-- Logging Types
<LogType>CONSOLE</LogType>
<LogType>TXT</LogType>
<LogType>HTML</LogType>-->
<LogType>TXT</LogType>

<!-- Log file path - Defaults to build location if no value is defined -->
<FileLoggerPath>./target/logs</FileLoggerPath>
</ModualMaqs>
<NoSQLMaqs>
<MongoConnectionString>mongodb://localhost:27017</MongoConnectionString>
<MongoDatabase>MongoDatabaseTest</MongoDatabase>
<MongoCollection>MongoTestCollection</MongoCollection>
<MongoTimeout>30</MongoTimeout>
</NoSQLMaqs>
</configuration>
44 changes: 44 additions & 0 deletions openmaqs-nosql/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.github.openmaqs</groupId>
<artifactId>openmaqs-java</artifactId>
<version>${revision}</version>
</parent>

<groupId>io.github.openmaqs.nosql</groupId>
<artifactId>openmaqs-nosql</artifactId>
<name>MAQS NoSQL Testing Module</name>
<version>${revision}</version>

<properties>
<mongoDB.version>4.5.0</mongoDB.version>
</properties>

<dependencies>
<dependency>
<groupId>io.github.openmaqs.base</groupId>
<artifactId>openmaqs-base</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.github.openmaqs.utilities</groupId>
<artifactId>openmaqs-utilities</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
<version>${mongoDB.version}</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/*
* Copyright 2023 (C) OpenMAQS, All rights Reserved
*/

package io.github.openmaqs.nosql;


import com.mongodb.client.MongoCollection;
import io.github.openmaqs.base.BaseExtendableTest;
import java.util.function.Supplier;
import org.bson.Document;
import org.testng.ITestResult;

/**
* The Base Mongo Test class.
*/
public class BaseMongoTest extends BaseExtendableTest<MongoTestObject> {

/**
* Initializes a new instance of the BaseMongoTest class,
* Set up the database client for each test class.
*/
public BaseMongoTest() {
// Currently, not populated with any logic
}

/**
* Gets the mongoDB driver.
* @return the mongoDB driver
*/
public MongoDBDriver getMongoDBDriver() {
return this.getTestObject().getMongoDBDriver();
}

/**
* Sets the MongoDB driver.
* @param driver the MongoDB driver to be set.
*/
public void setMongoDBDriver(MongoDBDriver driver) {
this.getTestObject().overrideMongoDBDriver(driver);
}

/**
* Override the Mongo driver - does not lazy load.
* @param driver New Mongo driver
*/
public void overrideConnectionDriver(MongoDBDriver driver) {
this.getTestObject().overrideMongoDBDriver(driver);
}

/**
* Override the Mongo driver - respects lazy loading.
* @param overrideCollectionConnection The collection function
*/
public void overrideConnectionDriver(Supplier<MongoCollection<Document>> overrideCollectionConnection) {
this.getTestObject().overrideMongoDBDriver(overrideCollectionConnection);
}

/**
* Override the Mongo driver - respects lazy loading.
* @param connectionString Client connection string
* @param databaseString Database connection string
* @param collectionString Mongo collection string
*/
public void overrideConnectionDriver(String connectionString, String databaseString, String collectionString) {
this.getTestObject().overrideMongoDBDriver(connectionString, databaseString, collectionString);
}

/**
* Get the base web service url.
* @return The base web service url
*/
protected String getBaseConnectionString() {
return MongoDBConfig.getConnectionString();
}

/**
* Get the base web service url.
* @return The base web service url
*/
protected String getBaseDatabaseString() {
return MongoDBConfig.getDatabaseString();
}

/**
* Get the base web service url.
* @return The base web service url
*/
protected String getBaseCollectionString() {
return MongoDBConfig.getCollectionString();
}

@Override
protected void createNewTestObject() {
this.setTestObject(new MongoTestObject(this.getBaseConnectionString(), this.getBaseDatabaseString(),
this.getBaseCollectionString(), this.createLogger(), this.getFullyQualifiedTestClassName()));
}

/**
* Steps to take before logging teardown results.
* @param resultType The test result
*/
@Override
protected void beforeLoggingTeardown(ITestResult resultType) {
// Currently, not populated with any logic
}
}
Loading