Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chtrembl committed Aug 30, 2023
1 parent 6b7e177 commit 53f62b4
Show file tree
Hide file tree
Showing 9 changed files with 993 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Compiled class file
*.class

**/.DS_Store

# Log file
*.log

Expand Down
25 changes: 25 additions & 0 deletions petstore/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,31 @@
"hostName": "127.0.0.1",
"port": 5005,
"preLaunchTask": "func: host start"
},
{
"type": "java",
"name": "Spring Boot-PetstoreappApplication<petstoreapp>",
"request": "launch",
"cwd": "${workspaceFolder}",
"mainClass": "com.chtrembl.petstoreapp.PetstoreappApplication",
"projectName": "petstoreapp",
"args": "",
"envFile": "${workspaceFolder}/.env",
"env": {
"PETSTOREPETSERVICE_URL": "http://20.232.80.1/",
"PETSTORESERVICES_SUBSCRIPTION_KEY": "c188da3994064bccbcf852098d0f4dff",
"PETSTORE_APIM_HOST": "azurepetstoreapimgmnt.azure-api.net"
}
},
{
"type": "java",
"name": "Spring Boot-OpenAPI2SpringBoot<org.openapitools-petstoreapi>",
"request": "launch",
"cwd": "${workspaceFolder}",
"mainClass": "org.openapitools.OpenAPI2SpringBoot",
"projectName": "org.openapitools-petstoreapi",
"args": "",
"envFile": "${workspaceFolder}/.env"
}
]
}
3 changes: 2 additions & 1 deletion petstore/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"front_matter_title": ""
}
},
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:jni+resolve=off"
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:jni+resolve=off",
"java.configuration.updateBuildConfiguration": "interactive"
}
2 changes: 2 additions & 0 deletions petstore/petstoreapp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
node_modules/
**/.DS_Store

*applicationCloudStash.yml

Expand Down
34 changes: 34 additions & 0 deletions petstore/petstoreapp/__tests__/PetStoreFunctions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//sample functions for copilot unit test demo

function sortPetsByNameDescending(pets) {
//if it returns a negative value, the value in a will be ordered before b.
//if it returns 0, the ordering of a and b won’t change.
//if it returns a positive value, the value in b will be ordered before a.
pets.sort((a, b) => {
if (a.name > b.name) {
console.log(`${a.name} is > ${b.name} returning -1`);
return -1;
}
if (a.name < b.name) {
console.log(`${a.name} is < ${b.name} returning 1`);
return 1;
}
return 0;
});
}

function countPetsByCategory(pets, category) {
const counts = {};

pets.forEach(pet => {
const value = pet[category];
counts[value] = counts[value] ? counts[value] + 1 : 1;
});

return counts;
}

module.exports = {
sortPetsByNameDescending,
countPetsByCategory
};
2 changes: 2 additions & 0 deletions petstore/petstoreapp/__tests__/PetStoreFunctions.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const PetStoreFunctions = require('./PetStoreFunctions');
var assert = require('assert')
Loading

0 comments on commit 53f62b4

Please sign in to comment.