-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dependabot/maven/junit-junit-4.13.2
- Loading branch information
Showing
43 changed files
with
492 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
api/api-facade/api-tests/src/main/resources/META-INF/dirigible/git/v4/client/local.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright (c) 2021 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-FileCopyrightText: 2021 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
const git = require('git/v4/client'); | ||
const assertTrue = require('utils/v4/assert').assertTrue; | ||
const workspaceManager = require("platform/v4/workspace"); | ||
|
||
const user = 'dirigible'; | ||
const email = '[email protected]'; | ||
const workspaceName = 'test-workspace'; | ||
const projectName = 'test-project'; | ||
const repositoryName = projectName; | ||
|
||
const workspace = workspaceManager.createWorkspace(workspaceName); | ||
project = workspace.createProject(projectName); | ||
let firstFile = project.createFile("firstFile.js"); | ||
firstFile.setText('first file content'); | ||
|
||
git.initRepository(user, email, workspaceName, projectName, repositoryName, 'initial commit'); | ||
|
||
let repos = git.getGitRepositories(workspaceName); | ||
console.log("Repository name " + repos[0].getName()) | ||
assertTrue(repos[0].getName() === repositoryName); | ||
|
||
let secondFile = project.createFile("secondFile.js"); | ||
secondFile.setText('second file content'); | ||
console.log("Getting staged changes..."); | ||
let staged = git.getStagedChanges(workspaceName, repositoryName); | ||
console.log("Staged changes count: " + staged.size()) | ||
assertTrue(staged.size() === 0); | ||
|
||
console.log("Getting unstaged changes..."); | ||
let unstaged = git.getUnstagedChanges(workspaceName, repositoryName); | ||
console.log("Unstaged changes count: " + unstaged.size()) | ||
assertTrue(unstaged.size() === 1); | ||
|
||
git.commit(user, email, workspaceName, repositoryName, "second file added", true); | ||
const his = git.getHistory(repositoryName, workspaceName, projectName); | ||
|
||
console.log("History size: " + his.size()) | ||
assertTrue(his.size() === 2); | ||
|
||
let branches = git.getLocalBranches(workspaceName, repositoryName); | ||
console.log("Local branches size: " + branches.size()); | ||
assertTrue(branches.size() === 1); | ||
|
||
git.createBranch(workspaceName, repositoryName, 'new-branch', 'master'); | ||
branches = git.getLocalBranches(workspaceName, repositoryName); | ||
console.log("New local branches size: " + branches.size()); | ||
assertTrue(branches.size() === 2); | ||
|
||
const status = git.status(workspaceName, repositoryName); | ||
console.log("Status is clean: " + status.isClean()); | ||
assertTrue(status.isClean() === true); | ||
|
||
console.log("Deleting test repo..."); | ||
git.deleteRepository(workspaceName, repositoryName); | ||
console.log("Repositories size at the end: " + git.getGitRepositories(workspaceName).size()); | ||
assertTrue(git.getGitRepositories(workspaceName).size() === 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<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>org.eclipse.dirigible</groupId> | ||
<artifactId>dirigible-api-javascript-parent</artifactId> | ||
<version>7.0.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<name>API - JavaScript - HTTP</name> | ||
<artifactId>dirigible-api-javascript-git</artifactId> | ||
<description>Git Module</description> | ||
<packaging>jar</packaging> | ||
|
||
<properties> | ||
<profile.content.phase>generate-sources</profile.content.phase> | ||
<content.repository.name>api-git</content.repository.name> | ||
<content.project.name>git</content.project.name> | ||
|
||
<license.header.location>../../../licensing-header.txt</license.header.location> | ||
</properties> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.