Skip to content

Commit

Permalink
📝 License plugin configured and license headers added
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jan 4, 2022
1 parent 396c4cd commit d792e8f
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 7 deletions.
16 changes: 16 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2022 The original authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License .
#

FROM gitpod/workspace-full

RUN bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh \
Expand Down
16 changes: 16 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2022 The original authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License .
#

image:
file: .gitpod.Dockerfile

Expand Down
4 changes: 2 additions & 2 deletions etc/eclipse-formatter-config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
Copyright 2021 The original authors
Copyright 2022 The original authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License .
-->
<profiles version="12">
Expand Down
4 changes: 2 additions & 2 deletions jreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2021 The original authors
# Copyright 2022 The original authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,7 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License .
#

project:
Expand Down
17 changes: 17 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2022 The original authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License .
-->
<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">
Expand Down
4 changes: 2 additions & 2 deletions src/main/assembly/assembly.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
Copyright 2021 The original authors
Copyright 2022 The original authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License .
-->
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/org/rrajesh1979/demo/MyCheckSum.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2022 The original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License .
*/

package org.rrajesh1979.demo;

import java.io.File;
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/testdata/TestFile-1.txt

This file was deleted.

52 changes: 52 additions & 0 deletions src/test/java/org/rrajesh1979/demo/MyCheckSumTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright 2022 The original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License .
*/
package org.rrajesh1979.demo;

import java.io.*;
import java.math.BigInteger;
import java.security.NoSuchAlgorithmException;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

class MyCheckSumTest {

@Test
void main() {
}

@Test
void getCheckSum() throws IOException, NoSuchAlgorithmException {
File tempFile = createTempDataFile();

byte[] checkSumBytes = MyCheckSum.getCheckSum(tempFile.getAbsolutePath());
String calculatedCheckSum = new BigInteger(checkSumBytes).toString(16);

tempFile.delete();
String expectedCheckSum = "764efa883dda1e11db47671c4a3bbd9e";
assertEquals(expectedCheckSum, calculatedCheckSum);
}

static File createTempDataFile() throws IOException {
File tempFile = File.createTempFile("checksum", "test");
try (FileOutputStream fileOutputStream = new FileOutputStream(tempFile)) {
fileOutputStream.write("hi\n".getBytes());
fileOutputStream.flush();
}
return tempFile;
}
}

0 comments on commit d792e8f

Please sign in to comment.