From 6176bede4325a235a198f4c7c94828eb82d90d9f Mon Sep 17 00:00:00 2001 From: Dave Date: Sat, 4 Jul 2015 15:36:56 +0200 Subject: [PATCH] adding license --- src/nodash/core/NoAdapter.java | 17 ++++++++++ src/nodash/core/NoDefaultAdapter.java | 17 ++++++++++ src/nodash/test/NoCoreTest.java | 17 ++++++++++ src/nodash/test/NoDashBasicTests.java | 17 ++++++++++ src/nodash/test/NoSessionTest.java | 17 ++++++++++ src/nodash/test/NoUserTest.java | 46 +++++++++++++++++++-------- src/nodash/test/NoUtilTest.java | 17 ++++++++++ 7 files changed, 134 insertions(+), 14 deletions(-) diff --git a/src/nodash/core/NoAdapter.java b/src/nodash/core/NoAdapter.java index 86c8ca9..e8720f6 100644 --- a/src/nodash/core/NoAdapter.java +++ b/src/nodash/core/NoAdapter.java @@ -1,3 +1,20 @@ +/* + * Copyright 2014 David Horscroft + * + * 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. + * + * The NoCore class is the interface between which the wrapper application (wrapplication?) accesses + * no- functionality. + */ + package nodash.core; import java.security.PublicKey; diff --git a/src/nodash/core/NoDefaultAdapter.java b/src/nodash/core/NoDefaultAdapter.java index bab4cb7..9106cd0 100644 --- a/src/nodash/core/NoDefaultAdapter.java +++ b/src/nodash/core/NoDefaultAdapter.java @@ -1,3 +1,20 @@ +/* + * Copyright 2014 David Horscroft + * + * 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. + * + * The NoCore class is the interface between which the wrapper application (wrapplication?) accesses + * no- functionality. + */ + package nodash.core; import java.io.File; diff --git a/src/nodash/test/NoCoreTest.java b/src/nodash/test/NoCoreTest.java index 067a8c1..5bcc37c 100644 --- a/src/nodash/test/NoCoreTest.java +++ b/src/nodash/test/NoCoreTest.java @@ -1,3 +1,20 @@ +/* + * Copyright 2014 David Horscroft + * + * 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. + * + * The NoCore class is the interface between which the wrapper application (wrapplication?) accesses + * no- functionality. + */ + package nodash.test; import static org.junit.Assert.*; diff --git a/src/nodash/test/NoDashBasicTests.java b/src/nodash/test/NoDashBasicTests.java index 98a28d1..20b384b 100644 --- a/src/nodash/test/NoDashBasicTests.java +++ b/src/nodash/test/NoDashBasicTests.java @@ -1,3 +1,20 @@ +/* + * Copyright 2014 David Horscroft + * + * 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. + * + * The NoCore class is the interface between which the wrapper application (wrapplication?) accesses + * no- functionality. + */ + package nodash.test; import org.junit.runner.RunWith; diff --git a/src/nodash/test/NoSessionTest.java b/src/nodash/test/NoSessionTest.java index 84fb63a..9602fd2 100644 --- a/src/nodash/test/NoSessionTest.java +++ b/src/nodash/test/NoSessionTest.java @@ -1,3 +1,20 @@ +/* + * Copyright 2014 David Horscroft + * + * 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. + * + * The NoCore class is the interface between which the wrapper application (wrapplication?) accesses + * no- functionality. + */ + package nodash.test; import static org.junit.Assert.*; diff --git a/src/nodash/test/NoUserTest.java b/src/nodash/test/NoUserTest.java index 78d91e3..35bbb85 100644 --- a/src/nodash/test/NoUserTest.java +++ b/src/nodash/test/NoUserTest.java @@ -1,3 +1,20 @@ +/* + * Copyright 2014 David Horscroft + * + * 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. + * + * The NoCore class is the interface between which the wrapper application (wrapplication?) accesses + * no- functionality. + */ + package nodash.test; import static org.junit.Assert.*; @@ -14,11 +31,11 @@ import org.apache.commons.codec.binary.Base64; import org.junit.Test; public class NoUserTest { - + @Test public void testNoUser() { NoUser user = new NoUser(); - + assertNotNull(user.getNoActions()); assertEquals(user.getNoActions().size(), 0); assertNotNull(user.getRsaPublicKey()); @@ -31,12 +48,12 @@ public class NoUserTest { public void testCreateFile() { NoUser user = new NoUser(); byte[] file = user.createFile("password".toCharArray()); - + assertNotNull(file); assertTrue(file.length > 0); - + byte[] secondFile = user.createFile("password".toCharArray()); - + assertFalse(Arrays.equals(file, secondFile)); } @@ -44,45 +61,46 @@ public class NoUserTest { public void testCreateHash() { NoUser user = new NoUser(); byte[] hash = user.createHash(); - + assertNotNull(hash); assertEquals(hash.length, 64); - + byte[] secondHash = user.createHash(); - + assertTrue(Arrays.equals(hash, secondHash)); } - + @Test public void testCreateHashString() { NoUser user = new NoUser(); byte[] hash = user.createHash(); String hashString = user.createHashString(); - + assertEquals(Base64.encodeBase64URLSafeString(hash), hashString); } @Test - public void testCreateUserFromFile() throws IllegalBlockSizeException, BadPaddingException, ClassNotFoundException, IOException { + public void testCreateUserFromFile() throws IllegalBlockSizeException, BadPaddingException, + ClassNotFoundException, IOException { NoUser user = new NoUser(); final byte[] originalFile = user.createFile("password".toCharArray()); byte[] file = Arrays.copyOf(originalFile, originalFile.length); byte[] hash = user.createHash(); String hashString = user.createHashString(); user = null; - + try { user = NoUser.createUserFromFile(file, "wrongpassword".toCharArray()); fail("Should have thrown an error when given wrong password."); } catch (BadPaddingException e) { // Do nothing, correct } - + file = Arrays.copyOf(originalFile, originalFile.length); user = NoUser.createUserFromFile(file, "password".toCharArray()); assertTrue(Arrays.equals(hash, user.createHash())); assertEquals(hashString, user.createHashString()); - + file = Arrays.copyOf(originalFile, originalFile.length); try { NoUser.createUserFromFile(file, null); diff --git a/src/nodash/test/NoUtilTest.java b/src/nodash/test/NoUtilTest.java index f2fb919..382ade4 100644 --- a/src/nodash/test/NoUtilTest.java +++ b/src/nodash/test/NoUtilTest.java @@ -1,3 +1,20 @@ +/* + * Copyright 2014 David Horscroft + * + * 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. + * + * The NoCore class is the interface between which the wrapper application (wrapplication?) accesses + * no- functionality. + */ + package nodash.test; import static org.junit.Assert.*;