diff --git a/.gitignore b/.gitignore index 60c38ed8f5..1890e8bd0e 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,11 @@ spring-openid/src/main/resources/application.properties spring-security-openid/src/main/resources/application.properties spring-all/*.log + +*.jar + +SpringDataInjectionDemo/.mvn/wrapper/maven-wrapper.properties + +spring-call-getters-using-reflection/.mvn/wrapper/maven-wrapper.properties + +spring-check-if-a-property-is-null/.mvn/wrapper/maven-wrapper.properties diff --git a/algorithms/README.md b/algorithms/README.md index f1e12ee243..dc12b528da 100644 --- a/algorithms/README.md +++ b/algorithms/README.md @@ -6,3 +6,5 @@ - [Validating Input With Finite Automata in Java](http://www.baeldung.com/finite-automata-java) - [Introduction to Jenetics Library](http://www.baeldung.com/jenetics) - [Check If a Number Is Prime in Java](http://www.baeldung.com/java-prime-numbers) +- [Example of Hill Climbing Algorithm](http://www.baeldung.com/java-hill-climbing-algorithm) +- [Monte Carlo Tree Search for Tic-Tac-Toe Game](http://www.baeldung.com/java-monte-carlo-tree-search) diff --git a/algorithms/src/main/java/com/baeldung/algorithms/hillclimbing/HillClimbing.java b/algorithms/src/main/java/com/baeldung/algorithms/hillclimbing/HillClimbing.java index d278418a87..77089636c8 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/hillclimbing/HillClimbing.java +++ b/algorithms/src/main/java/com/baeldung/algorithms/hillclimbing/HillClimbing.java @@ -186,4 +186,4 @@ public class HillClimbing { return stackHeuristics; } -} +} \ No newline at end of file diff --git a/algorithms/src/main/java/com/baeldung/algorithms/hillclimbing/State.java b/algorithms/src/main/java/com/baeldung/algorithms/hillclimbing/State.java index ad22aa27e7..9180b33b5b 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/hillclimbing/State.java +++ b/algorithms/src/main/java/com/baeldung/algorithms/hillclimbing/State.java @@ -40,4 +40,4 @@ public class State { public void setHeuristics(int heuristics) { this.heuristics = heuristics; } -} +} \ No newline at end of file diff --git a/algorithms/src/main/java/com/baeldung/algorithms/minimax/GameOfBones.java b/algorithms/src/main/java/com/baeldung/algorithms/minimax/GameOfBones.java new file mode 100644 index 0000000000..8e14afcf7a --- /dev/null +++ b/algorithms/src/main/java/com/baeldung/algorithms/minimax/GameOfBones.java @@ -0,0 +1,14 @@ +package com.baeldung.algorithms.minimax; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +class GameOfBones { + static List getPossibleStates(int noOfBonesInHeap) { + return IntStream.rangeClosed(1, 3).boxed() + .map(i -> noOfBonesInHeap - i) + .filter(newHeapCount -> newHeapCount >= 0) + .collect(Collectors.toList()); + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/minimax/MiniMax.java b/algorithms/src/main/java/com/baeldung/algorithms/minimax/MiniMax.java new file mode 100644 index 0000000000..fed4ebed48 --- /dev/null +++ b/algorithms/src/main/java/com/baeldung/algorithms/minimax/MiniMax.java @@ -0,0 +1,60 @@ +package com.baeldung.algorithms.minimax; + +import java.util.Comparator; +import java.util.List; +import java.util.NoSuchElementException; + +public class MiniMax { + private Tree tree; + + public Tree getTree() { + return tree; + } + + public void constructTree(int noOfBones) { + tree = new Tree(); + Node root = new Node(noOfBones, true); + tree.setRoot(root); + constructTree(root); + } + + private void constructTree(Node parentNode) { + List listofPossibleHeaps = GameOfBones.getPossibleStates(parentNode.getNoOfBones()); + boolean isChildMaxPlayer = !parentNode.isMaxPlayer(); + listofPossibleHeaps.forEach(n -> { + Node newNode = new Node(n, isChildMaxPlayer); + parentNode.addChild(newNode); + if (newNode.getNoOfBones() > 0) { + constructTree(newNode); + } + }); + } + + public boolean checkWin() { + Node root = tree.getRoot(); + checkWin(root); + return root.getScore() == 1; + } + + private void checkWin(Node node) { + List children = node.getChildren(); + boolean isMaxPlayer = node.isMaxPlayer(); + children.forEach(child -> { + if (child.getNoOfBones() == 0) { + child.setScore(isMaxPlayer ? 1 : -1); + } else { + checkWin(child); + } + }); + Node bestChild = findBestChild(isMaxPlayer, children); + node.setScore(bestChild.getScore()); + } + + private Node findBestChild(boolean isMaxPlayer, List children) { + Comparator byScoreComparator = Comparator.comparing(Node::getScore); + + return children.stream() + .max(isMaxPlayer ? byScoreComparator : byScoreComparator.reversed()) + .orElseThrow(NoSuchElementException::new); + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/minimax/Node.java b/algorithms/src/main/java/com/baeldung/algorithms/minimax/Node.java new file mode 100644 index 0000000000..4ceef0073d --- /dev/null +++ b/algorithms/src/main/java/com/baeldung/algorithms/minimax/Node.java @@ -0,0 +1,42 @@ +package com.baeldung.algorithms.minimax; + +import java.util.ArrayList; +import java.util.List; + +public class Node { + private int noOfBones; + private boolean isMaxPlayer; + private int score; + private List children; + + public Node(int noOfBones, boolean isMaxPlayer) { + this.noOfBones = noOfBones; + this.isMaxPlayer = isMaxPlayer; + children = new ArrayList<>(); + } + + int getNoOfBones() { + return noOfBones; + } + + boolean isMaxPlayer() { + return isMaxPlayer; + } + + int getScore() { + return score; + } + + void setScore(int score) { + this.score = score; + } + + List getChildren() { + return children; + } + + void addChild(Node newNode) { + children.add(newNode); + } + +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/minimax/Tree.java b/algorithms/src/main/java/com/baeldung/algorithms/minimax/Tree.java new file mode 100644 index 0000000000..34c56cdd58 --- /dev/null +++ b/algorithms/src/main/java/com/baeldung/algorithms/minimax/Tree.java @@ -0,0 +1,16 @@ +package com.baeldung.algorithms.minimax; + +public class Tree { + private Node root; + + Tree() { + } + + Node getRoot() { + return root; + } + + void setRoot(Node root) { + this.root = root; + } +} diff --git a/algorithms/src/test/java/algorithms/HillClimbingAlgorithmTest.java b/algorithms/src/test/java/algorithms/HillClimbingAlgorithmTest.java index 6e5055da6e..666adbb180 100644 --- a/algorithms/src/test/java/algorithms/HillClimbingAlgorithmTest.java +++ b/algorithms/src/test/java/algorithms/HillClimbingAlgorithmTest.java @@ -55,4 +55,4 @@ public class HillClimbingAlgorithmTest { State nextState = hillClimbing.findNextState(currentState, goalStack); assertTrue(nextState.getHeuristics() > currentState.getHeuristics()); } -} +} \ No newline at end of file diff --git a/algorithms/src/test/java/algorithms/MCTSTest.java b/algorithms/src/test/java/algorithms/MCTSTest.java new file mode 100644 index 0000000000..f969c26311 --- /dev/null +++ b/algorithms/src/test/java/algorithms/MCTSTest.java @@ -0,0 +1,92 @@ +package algorithms; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.List; + +import org.junit.Before; +import org.junit.Test; + +import com.baeldung.algorithms.mcts.montecarlo.MonteCarloTreeSearch; +import com.baeldung.algorithms.mcts.montecarlo.State; +import com.baeldung.algorithms.mcts.montecarlo.UCT; +import com.baeldung.algorithms.mcts.tictactoe.Board; +import com.baeldung.algorithms.mcts.tictactoe.Position; +import com.baeldung.algorithms.mcts.tree.Tree; + +public class MCTSTest { + Tree gameTree; + MonteCarloTreeSearch mcts; + + @Before + public void initGameTree() { + gameTree = new Tree(); + mcts = new MonteCarloTreeSearch(); + } + + @Test + public void givenStats_whenGetUCTForNode_thenUCTMatchesWithManualData() { + double uctValue = 15.79; + assertEquals(UCT.uctValue(600, 300, 20), uctValue, 0.01); + } + + @Test + public void giveninitBoardState_whenGetAllPossibleStates_thenNonEmptyList() { + State initState = gameTree.getRoot().getState(); + List possibleStates = initState.getAllPossibleStates(); + assertTrue(possibleStates.size() > 0); + } + + @Test + public void givenEmptyBoard_whenPerformMove_thenLessAvailablePossitions() { + Board board = new Board(); + int initAvailablePositions = board.getEmptyPositions().size(); + board.performMove(Board.P1, new Position(1, 1)); + int availablePositions = board.getEmptyPositions().size(); + assertTrue(initAvailablePositions > availablePositions); + } + + @Test + public void givenEmptyBoard_whenSimulateInterAIPlay_thenGameDraw() { + Board board = new Board(); + + int player = Board.P1; + int totalMoves = Board.DEFAULT_BOARD_SIZE * Board.DEFAULT_BOARD_SIZE; + for (int i = 0; i < totalMoves; i++) { + board = mcts.findNextMove(board, player); + if (board.checkStatus() != -1) { + break; + } + player = 3 - player; + } + int winStatus = board.checkStatus(); + assertEquals(winStatus, Board.DRAW); + } + + @Test + public void givenEmptyBoard_whenLevel1VsLevel3_thenLevel3WinsOrDraw() { + Board board = new Board(); + MonteCarloTreeSearch mcts1 = new MonteCarloTreeSearch(); + mcts1.setLevel(1); + MonteCarloTreeSearch mcts3 = new MonteCarloTreeSearch(); + mcts3.setLevel(3); + + int player = Board.P1; + int totalMoves = Board.DEFAULT_BOARD_SIZE * Board.DEFAULT_BOARD_SIZE; + for (int i = 0; i < totalMoves; i++) { + if (player == Board.P1) + board = mcts3.findNextMove(board, player); + else + board = mcts1.findNextMove(board, player); + + if (board.checkStatus() != -1) { + break; + } + player = 3 - player; + } + int winStatus = board.checkStatus(); + assertTrue(winStatus == Board.DRAW || winStatus == Board.P1); + } + +} diff --git a/algorithms/src/test/java/algorithms/minimax/MinimaxTest.java b/algorithms/src/test/java/algorithms/minimax/MinimaxTest.java new file mode 100644 index 0000000000..b29c16386c --- /dev/null +++ b/algorithms/src/test/java/algorithms/minimax/MinimaxTest.java @@ -0,0 +1,36 @@ +package algorithms.minimax; + +import org.junit.Before; +import org.junit.Test; + +import static org.junit.Assert.*; +import com.baeldung.algorithms.minimax.MiniMax; +import com.baeldung.algorithms.minimax.Tree; + +public class MinimaxTest { + private Tree gameTree; + private MiniMax miniMax; + + @Before + public void initMiniMaxUtility() { + miniMax = new MiniMax(); + } + + @Test + public void givenMiniMax_whenConstructTree_thenNotNullTree() { + assertNull(gameTree); + miniMax.constructTree(6); + gameTree = miniMax.getTree(); + assertNotNull(gameTree); + } + + @Test + public void givenMiniMax_whenCheckWin_thenComputeOptimal() { + miniMax.constructTree(6); + boolean result = miniMax.checkWin(); + assertTrue(result); + miniMax.constructTree(8); + result = miniMax.checkWin(); + assertFalse(result); + } +} diff --git a/aws/pom.xml b/aws/pom.xml index 8d60240c87..c66c420fae 100644 --- a/aws/pom.xml +++ b/aws/pom.xml @@ -18,9 +18,41 @@ 1.3.0 1.1.0 2.8.0 + 1.11.154 + 4.12 + 2.8.9 + 3.8.0 + + + com.amazonaws + aws-java-sdk + ${aws-java-sdk.version} + + + + junit + junit + ${junit.version} + test + + + + org.mockito + mockito-core + ${mockito-core.version} + test + + + + org.assertj + assertj-core + ${assertj-core.version} + test + + com.amazonaws aws-lambda-java-core diff --git a/aws/src/main/java/com/baeldung/s3/AWSS3Service.java b/aws/src/main/java/com/baeldung/s3/AWSS3Service.java new file mode 100644 index 0000000000..792e41a188 --- /dev/null +++ b/aws/src/main/java/com/baeldung/s3/AWSS3Service.java @@ -0,0 +1,87 @@ +package com.baeldung.s3; + +import java.io.File; +import java.util.List; + +import com.amazonaws.services.s3.AmazonS3; +import com.amazonaws.services.s3.AmazonS3Client; +import com.amazonaws.services.s3.model.Bucket; +import com.amazonaws.services.s3.model.CopyObjectResult; +import com.amazonaws.services.s3.model.DeleteObjectsRequest; +import com.amazonaws.services.s3.model.DeleteObjectsResult; +import com.amazonaws.services.s3.model.ObjectListing; +import com.amazonaws.services.s3.model.PutObjectResult; +import com.amazonaws.services.s3.model.S3Object; + +public class AWSS3Service { + private final AmazonS3 s3client; + + public AWSS3Service() { + this(new AmazonS3Client() { + }); + } + + public AWSS3Service(AmazonS3 s3client) { + this.s3client = s3client; + } + + //is bucket exist? + public boolean doesBucketExist(String bucketName) { + return s3client.doesBucketExist(bucketName); + } + + //create a bucket + public Bucket createBucket(String bucketName) { + return s3client.createBucket(bucketName); + } + + //list all buckets + public List listBuckets() { + return s3client.listBuckets(); + } + + //delete a bucket + public void deleteBucket(String bucketName) { + s3client.deleteBucket(bucketName); + } + + //uploading object + public PutObjectResult putObject(String bucketName, String key, File file) { + return s3client.putObject(bucketName, key, file); + } + + //listing objects + public ObjectListing listObjects(String bucketName) { + return s3client.listObjects(bucketName); + } + + //get an object + public S3Object getObject(String bucketName, String objectKey) { + return s3client.getObject(bucketName, objectKey); + } + + //copying an object + public CopyObjectResult copyObject( + String sourceBucketName, + String sourceKey, + String destinationBucketName, + String destinationKey + ) { + return s3client.copyObject( + sourceBucketName, + sourceKey, + destinationBucketName, + destinationKey + ); + } + + //deleting an object + public void deleteObject(String bucketName, String objectKey) { + s3client.deleteObject(bucketName, objectKey); + } + + //deleting multiple Objects + public DeleteObjectsResult deleteObjects(DeleteObjectsRequest delObjReq) { + return s3client.deleteObjects(delObjReq); + } +} diff --git a/aws/src/main/java/com/baeldung/s3/S3Application.java b/aws/src/main/java/com/baeldung/s3/S3Application.java new file mode 100644 index 0000000000..fcbd7811b5 --- /dev/null +++ b/aws/src/main/java/com/baeldung/s3/S3Application.java @@ -0,0 +1,108 @@ +package com.baeldung.s3; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; + +import com.amazonaws.auth.AWSCredentials; +import com.amazonaws.auth.AWSStaticCredentialsProvider; +import com.amazonaws.auth.BasicAWSCredentials; +import com.amazonaws.regions.Regions; +import com.amazonaws.services.s3.AmazonS3; +import com.amazonaws.services.s3.AmazonS3ClientBuilder; +import com.amazonaws.services.s3.model.Bucket; +import com.amazonaws.services.s3.model.DeleteObjectsRequest; +import com.amazonaws.services.s3.model.ObjectListing; +import com.amazonaws.services.s3.model.S3Object; +import com.amazonaws.services.s3.model.S3ObjectInputStream; +import com.amazonaws.services.s3.model.S3ObjectSummary; + +public class S3Application { + + private static final AWSCredentials credentials; + private static String bucketName; + + static { + //put your accesskey and secretkey here + credentials = new BasicAWSCredentials( + "", + "" + ); + } + + public static void main(String[] args) throws IOException { + //set-up the client + AmazonS3 s3client = AmazonS3ClientBuilder + .standard() + .withCredentials(new AWSStaticCredentialsProvider(credentials)) + .withRegion(Regions.US_EAST_2) + .build(); + + AWSS3Service awsService = new AWSS3Service(s3client); + + bucketName = "baeldung-bucket"; + + //creating a bucket + if(awsService.doesBucketExist(bucketName)) { + System.out.println("Bucket name is not available." + + " Try again with a different Bucket name."); + return; + } + awsService.createBucket(bucketName); + + //list all the buckets + for(Bucket s : awsService.listBuckets() ) { + System.out.println(s.getName()); + } + + //deleting bucket + awsService.deleteBucket("baeldung-bucket-test2"); + + //uploading object + awsService.putObject( + bucketName, + "Document/hello.txt", + new File("/Users/user/Document/hello.txt") + ); + + //listing objects + ObjectListing objectListing = awsService.listObjects(bucketName); + for(S3ObjectSummary os : objectListing.getObjectSummaries()) { + System.out.println(os.getKey()); + } + + //downloading an object + S3Object s3object = awsService.getObject(bucketName, "Document/hello.txt"); + S3ObjectInputStream inputStream = s3object.getObjectContent(); + FileOutputStream fos = new FileOutputStream(new File("/Users/user/Desktop/hello.txt")); + + int read = 0; + byte[] bytes = new byte[1024]; + while ((read = inputStream.read(bytes)) != -1) { + fos.write(bytes, 0, read); + } + inputStream.close(); + fos.close(); + + //copying an object + awsService.copyObject( + "baeldung-bucket", + "picture/pic.png", + "baeldung-bucket2", + "Document/picture.png" + ); + + //deleting an object + awsService.deleteObject(bucketName, "Document/hello.txt"); + + //deleting multiple objects + String objkeyArr[] = { + "Document/hello2.txt", + "Document/picture.png" + }; + + DeleteObjectsRequest delObjReq = new DeleteObjectsRequest("baeldung-bucket") + .withKeys(objkeyArr); + awsService.deleteObjects(delObjReq); + } +} diff --git a/aws/src/test/java/com/baeldung/s3/AWSS3ServiceIntegrationTest.java b/aws/src/test/java/com/baeldung/s3/AWSS3ServiceIntegrationTest.java new file mode 100644 index 0000000000..d386704513 --- /dev/null +++ b/aws/src/test/java/com/baeldung/s3/AWSS3ServiceIntegrationTest.java @@ -0,0 +1,113 @@ +package com.baeldung.s3; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.io.File; + +import org.junit.Before; +import org.junit.Test; + +import com.amazonaws.services.s3.AmazonS3; +import com.amazonaws.services.s3.model.CopyObjectResult; +import com.amazonaws.services.s3.model.DeleteObjectsRequest; +import com.amazonaws.services.s3.model.DeleteObjectsResult; +import com.amazonaws.services.s3.model.PutObjectResult; + +public class AWSS3ServiceIntegrationTest { + + private static final String BUCKET_NAME = "bucket_name"; + private static final String KEY_NAME = "key_name"; + private static final String BUCKET_NAME2 = "bucket_name2"; + private static final String KEY_NAME2 = "key_name2"; + + private AmazonS3 s3; + private AWSS3Service service; + + @Before + public void setUp() { + s3 = mock(AmazonS3.class); + service = new AWSS3Service(s3); + } + + @Test + public void whenInitializingAWSS3Service_thenNotNull() { + assertThat(new AWSS3Service()).isNotNull(); + } + + @Test + public void whenVerifyingIfS3BucketExist_thenCorrect() { + service.doesBucketExist(BUCKET_NAME); + verify(s3).doesBucketExist(BUCKET_NAME); + } + + @Test + public void whenVerifyingCreationOfS3Bucket_thenCorrect() { + service.createBucket(BUCKET_NAME); + verify(s3).createBucket(BUCKET_NAME); + } + + @Test + public void whenVerifyingListBuckets_thenCorrect() { + service.listBuckets(); + verify(s3).listBuckets(); + } + + @Test + public void whenDeletingBucket_thenCorrect() { + service.deleteBucket(BUCKET_NAME); + verify(s3).deleteBucket(BUCKET_NAME); + } + + @Test + public void whenVerifyingPutObject_thenCorrect() { + File file = mock(File.class); + PutObjectResult result = mock(PutObjectResult.class); + when(s3.putObject(anyString(), anyString(), (File) any())).thenReturn(result); + + assertThat(service.putObject(BUCKET_NAME, KEY_NAME, file)).isEqualTo(result); + verify(s3).putObject(BUCKET_NAME, KEY_NAME, file); + } + + @Test + public void whenVerifyingListObjects_thenCorrect() { + service.listObjects(BUCKET_NAME); + verify(s3).listObjects(BUCKET_NAME); + } + + @Test + public void whenVerifyingGetObject_thenCorrect() { + service.getObject(BUCKET_NAME, KEY_NAME); + verify(s3).getObject(BUCKET_NAME, KEY_NAME); + } + + @Test + public void whenVerifyingCopyObject_thenCorrect() { + CopyObjectResult result = mock(CopyObjectResult.class); + when(s3.copyObject(anyString(), anyString(), anyString(), anyString())).thenReturn(result); + + assertThat(service.copyObject(BUCKET_NAME, KEY_NAME, BUCKET_NAME2, KEY_NAME2)).isEqualTo(result); + verify(s3).copyObject(BUCKET_NAME, KEY_NAME, BUCKET_NAME2, KEY_NAME2); + } + + @Test + public void whenVerifyingDeleteObject_thenCorrect() { + service.deleteObject(BUCKET_NAME, KEY_NAME); + verify(s3).deleteObject(BUCKET_NAME, KEY_NAME); + } + + @Test + public void whenVerifyingDeleteObjects_thenCorrect() { + DeleteObjectsRequest request = mock(DeleteObjectsRequest.class); + DeleteObjectsResult result = mock(DeleteObjectsResult.class); + when(s3.deleteObjects((DeleteObjectsRequest)any())).thenReturn(result); + + assertThat(service.deleteObjects(request)).isEqualTo(result); + verify(s3).deleteObjects(request); + } + +} diff --git a/core-java-9/README.md b/core-java-9/README.md index 3e82ffe14b..22d6903f06 100644 --- a/core-java-9/README.md +++ b/core-java-9/README.md @@ -13,3 +13,6 @@ - [Java 9 Process API Improvements](http://www.baeldung.com/java-9-process-api) - [Introduction to Java 9 StackWalking API](http://www.baeldung.com/java-9-stackwalking-api) - [Introduction to Project Jigsaw](http://www.baeldung.com/project-jigsaw-java-modularity) +- [Java 9 Optional API Additions](http://www.baeldung.com/java-9-optional) +- [Java 9 Reactive Streams](http://www.baeldung.com/java-9-reactive-streams) +- [How to Get All Dates Between Two Dates?](http://www.baeldung.com/java-between-dates) diff --git a/core-java/README.md b/core-java/README.md index 559507e472..dabf6f39be 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -113,6 +113,16 @@ - [Difference Between Wait and Sleep in Java](http://www.baeldung.com/java-wait-and-sleep) - [LongAdder and LongAccumulator in Java](http://www.baeldung.com/java-longadder-and-longaccumulator) - [Using Java MappedByteBuffer](http://www.baeldung.com/java-mapped-byte-buffer) +- [The Dining Philosophers Problem in Java](http://www.baeldung.com/java-dining-philoshophers) +- [The Difference Between map() and flatMap()](http://www.baeldung.com/java-difference-map-and-flatmap) +- [How to Round a Number to N Decimal Places in Java](http://www.baeldung.com/java-round-decimal-number) +- [Changing Annotation Parameters At Runtime](http://www.baeldung.com/java-reflection-change-annotation-params) +- [How to Find all Getters Returning Null](http://www.baeldung.com/java-getters-returning-null) +- [Converting String to Stream of chars](http://www.baeldung.com/java-string-to-stream) +- [Changing the Order in a Sum Operation Can Produce Different Results?](http://www.baeldung.com/java-floating-point-sum-order) +- [How to Get a Name of a Method Being Executed?](http://www.baeldung.com/java-name-of-executing-method) +- [Iterate over a Map in Java](http://www.baeldung.com/java-iterate-map) +- [CyclicBarrier in Java](http://www.baeldung.com/java-cyclic-barrier) - [Dynamic Proxies in Java](http://www.baeldung.com/java-dynamic-proxies) - [How to Copy an Array in Java](http://www.baeldung.com/java-array-copy) - [Introduction to JDBC](http://www.baeldung.com/java-jdbc) diff --git a/core-java/pom.xml b/core-java/pom.xml index 84a56c8bc7..ee0d6b4b4a 100644 --- a/core-java/pom.xml +++ b/core-java/pom.xml @@ -417,4 +417,4 @@ 2.19.1 - \ No newline at end of file + diff --git a/core-java/src/main/java/com/baeldung/deserialization/AppleProduct.java b/core-java/src/main/java/com/baeldung/deserialization/AppleProduct.java new file mode 100644 index 0000000000..d672b9a4f5 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/deserialization/AppleProduct.java @@ -0,0 +1,26 @@ +package com.baeldung.deserialization; + +import java.io.Serializable; + +public class AppleProduct implements Serializable { + + private static final long serialVersionUID = 1234567L; // user-defined (i.e. not default or generated) +// private static final long serialVersionUID = 7654321L; // user-defined (i.e. not default or generated) + + public String headphonePort; + public String thunderboltPort; + public String lighteningPort; + + public String getHeadphonePort() { + return headphonePort; + } + + public String getThunderboltPort() { + return thunderboltPort; + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + +} \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/deserialization/DeserializationUtility.java b/core-java/src/main/java/com/baeldung/deserialization/DeserializationUtility.java new file mode 100644 index 0000000000..3ed2b8be1d --- /dev/null +++ b/core-java/src/main/java/com/baeldung/deserialization/DeserializationUtility.java @@ -0,0 +1,27 @@ +package com.baeldung.deserialization; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.util.Base64; + +public class DeserializationUtility { + + public static void main(String[] args) throws ClassNotFoundException, IOException { + + String serializedObj = "rO0ABXNyACljb20uYmFlbGR1bmcuZGVzZXJpYWxpemF0aW9uLkFwcGxlUHJvZHVjdAAAAAAAEtaHAgADTAANaGVhZHBob25lUG9ydHQAEkxqYXZhL2xhbmcvU3RyaW5nO0wADmxpZ2h0ZW5pbmdQb3J0cQB+AAFMAA90aHVuZGVyYm9sdFBvcnRxAH4AAXhwdAARaGVhZHBob25lUG9ydDIwMjBwdAATdGh1bmRlcmJvbHRQb3J0MjAyMA=="; + System.out.println("Deserializing AppleProduct..."); + AppleProduct deserializedObj = (AppleProduct) deSerializeObjectFromString(serializedObj); + System.out.println("Headphone port of AppleProduct:" + deserializedObj.getHeadphonePort()); + System.out.println("Thunderbolt port of AppleProduct:" + deserializedObj.getThunderboltPort()); + } + + public static Object deSerializeObjectFromString(String s) throws IOException, ClassNotFoundException { + byte[] data = Base64.getDecoder().decode(s); + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data)); + Object o = ois.readObject(); + ois.close(); + return o; + } + +} \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/deserialization/SerializationUtility.java b/core-java/src/main/java/com/baeldung/deserialization/SerializationUtility.java new file mode 100644 index 0000000000..1dbcc40e6b --- /dev/null +++ b/core-java/src/main/java/com/baeldung/deserialization/SerializationUtility.java @@ -0,0 +1,30 @@ +package com.baeldung.deserialization; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.util.Base64; + +public class SerializationUtility { + + public static void main(String[] args) throws ClassNotFoundException, IOException { + + AppleProduct macBook = new AppleProduct(); + macBook.headphonePort = "headphonePort2020"; + macBook.thunderboltPort = "thunderboltPort2020"; + + String serializedObj = serializeObjectToString(macBook); + System.out.println("Serialized AppleProduct object to string:"); + System.out.println(serializedObj); + } + + public static String serializeObjectToString(Serializable o) throws IOException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + oos.writeObject(o); + oos.close(); + return Base64.getEncoder().encodeToString(baos.toByteArray()); + } + +} \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/javanetworking/uriurl/URIDemo.java b/core-java/src/main/java/com/baeldung/javanetworking/uriurl/URIDemo.java new file mode 100644 index 0000000000..121e0f5d72 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/javanetworking/uriurl/URIDemo.java @@ -0,0 +1,91 @@ +package com.baeldung.javanetworking.uriurl; + +import java.io.BufferedReader; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class URIDemo { + private final Logger logger = LoggerFactory.getLogger(URIDemo.class); + + String URISTRING = "https://wordpress.org:443/support/topic/page-jumps-within-wordpress/?replies=3#post-2278484"; + // parsed locator + String URISCHEME = "https"; + String URISCHEMESPECIFIC; + String URIHOST = "wordpress.org"; + String URIAUTHORITY = "wordpress.org:443"; + + String URIPATH = "/support/topic/page-jumps-within-wordpress/"; + int URIPORT = 443; + String URIQUERY = "replies=3"; + String URIFRAGMENT = "post-2278484"; + String URIUSERINFO; + String URICOMPOUND = URISCHEME + "://" + URIHOST + ":" + URIPORT + URIPATH + "?" + URIQUERY + "#" + URIFRAGMENT; + + URI uri; + URL url; + BufferedReader in = null; + String URIContent = ""; + + private String getParsedPieces(URI uri) { + logger.info("*** List of parsed pieces ***"); + URISCHEME = uri.getScheme(); + logger.info("URISCHEME: " + URISCHEME); + URISCHEMESPECIFIC = uri.getSchemeSpecificPart(); + logger.info("URISCHEMESPECIFIC: " + URISCHEMESPECIFIC); + URIHOST = uri.getHost(); + URIAUTHORITY = uri.getAuthority(); + logger.info("URIAUTHORITY: " + URIAUTHORITY); + logger.info("URIHOST: " + URIHOST); + URIPATH = uri.getPath(); + logger.info("URIPATH: " + URIPATH); + URIPORT = uri.getPort(); + logger.info("URIPORT: " + URIPORT); + URIQUERY = uri.getQuery(); + logger.info("URIQUERY: " + URIQUERY); + URIFRAGMENT = uri.getFragment(); + logger.info("URIFRAGMENT: " + URIFRAGMENT); + + try { + url = uri.toURL(); + } catch (MalformedURLException e) { + logger.info("MalformedURLException thrown: " + e.getMessage()); + e.printStackTrace(); + } catch (IllegalArgumentException e) { + logger.info("IllegalArgumentException thrown: " + e.getMessage()); + e.printStackTrace(); + } + return url.toString(); + } + + public String testURIAsNew(String URIString) { + // creating URI object + try { + uri = new URI(URIString); + } catch (URISyntaxException e) { + logger.info("URISyntaxException thrown: " + e.getMessage()); + e.printStackTrace(); + throw new IllegalArgumentException(); + } + return getParsedPieces(uri); + } + + public String testURIAsCreate(String URIString) { + // creating URI object + uri = URI.create(URIString); + return getParsedPieces(uri); + } + + public static void main(String[] args) throws Exception { + URIDemo demo = new URIDemo(); + String contentCreate = demo.testURIAsCreate(demo.URICOMPOUND); + demo.logger.info(contentCreate); + String contentNew = demo.testURIAsNew(demo.URICOMPOUND); + demo.logger.info(contentNew); + } +} diff --git a/core-java/src/main/java/com/baeldung/javanetworking/url/URLDemo.java b/core-java/src/main/java/com/baeldung/javanetworking/uriurl/URLDemo.java similarity index 97% rename from core-java/src/main/java/com/baeldung/javanetworking/url/URLDemo.java rename to core-java/src/main/java/com/baeldung/javanetworking/uriurl/URLDemo.java index f8038a7e86..109a9951d2 100644 --- a/core-java/src/main/java/com/baeldung/javanetworking/url/URLDemo.java +++ b/core-java/src/main/java/com/baeldung/javanetworking/uriurl/URLDemo.java @@ -1,9 +1,10 @@ -package com.baeldung.javanetworking.url; +package com.baeldung.javanetworking.uriurl; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; +import java.net.URI; import java.net.URL; import java.net.URLConnection; diff --git a/core-java/src/main/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorExample.java b/core-java/src/main/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorExample.java index 2c852b5e82..0d02391a73 100644 --- a/core-java/src/main/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorExample.java +++ b/core-java/src/main/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorExample.java @@ -11,4 +11,4 @@ public class NoClassDefFoundErrorExample { test = new ClassWithInitErrors(); return test; } -} +} \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/temporaladjuster/CustomTemporalAdjuster.java b/core-java/src/main/java/com/baeldung/temporaladjuster/CustomTemporalAdjuster.java new file mode 100644 index 0000000000..ab491bee66 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/temporaladjuster/CustomTemporalAdjuster.java @@ -0,0 +1,23 @@ +package com.baeldung.temporaladjuster; + +import java.time.DayOfWeek; +import java.time.temporal.ChronoField; +import java.time.temporal.ChronoUnit; +import java.time.temporal.Temporal; +import java.time.temporal.TemporalAdjuster; + +public class CustomTemporalAdjuster implements TemporalAdjuster { + + @Override + public Temporal adjustInto(Temporal temporal) { + DayOfWeek dayOfWeek = DayOfWeek.of(temporal.get(ChronoField.DAY_OF_WEEK)); + int daysToAdd; + if (dayOfWeek == DayOfWeek.FRIDAY) + daysToAdd = 3; + else if (dayOfWeek == DayOfWeek.SATURDAY) + daysToAdd = 2; + else + daysToAdd = 1; + return temporal.plus(daysToAdd, ChronoUnit.DAYS); + } +} diff --git a/core-java/src/test/java/com/baeldung/arraycopy/ArrayCopyUtilUnitTest.java b/core-java/src/test/java/com/baeldung/arraycopy/ArrayCopyUtilUnitTest.java index 6b6f5dbe2a..d9e580acbb 100644 --- a/core-java/src/test/java/com/baeldung/arraycopy/ArrayCopyUtilUnitTest.java +++ b/core-java/src/test/java/com/baeldung/arraycopy/ArrayCopyUtilUnitTest.java @@ -9,6 +9,8 @@ import org.junit.Test; import java.util.Arrays; +import static org.junit.Assert.assertTrue; + public class ArrayCopyUtilUnitTest { private static Employee[] employees; private static final int MAX = 2; @@ -46,10 +48,10 @@ public class ArrayCopyUtilUnitTest { System.arraycopy(array, 2, copiedArray, 0, 3); - Assert.assertTrue(3 == copiedArray.length); - Assert.assertTrue(copiedArray[0] == array[2]); - Assert.assertTrue(copiedArray[1] == array[3]); - Assert.assertTrue(copiedArray[2] == array[4]); + assertTrue(3 == copiedArray.length); + assertTrue(copiedArray[0] == array[2]); + assertTrue(copiedArray[1] == array[3]); + assertTrue(copiedArray[2] == array[4]); } @Test @@ -58,10 +60,10 @@ public class ArrayCopyUtilUnitTest { int[] copiedArray = Arrays.copyOfRange(array, 1, 4); - Assert.assertTrue(3 == copiedArray.length); - Assert.assertTrue(copiedArray[0] == array[1]); - Assert.assertTrue(copiedArray[1] == array[2]); - Assert.assertTrue(copiedArray[2] == array[3]); + assertTrue(3 == copiedArray.length); + assertTrue(copiedArray[0] == array[1]); + assertTrue(copiedArray[1] == array[2]); + assertTrue(copiedArray[2] == array[3]); } @Test @@ -73,9 +75,9 @@ public class ArrayCopyUtilUnitTest { Assert.assertArrayEquals(copiedArray, array); array[0] = 9; - Assert.assertTrue(copiedArray[0] != array[0]); + assertTrue(copiedArray[0] != array[0]); copiedArray[1] = 12; - Assert.assertTrue(copiedArray[1] != array[1]); + assertTrue(copiedArray[1] != array[1]); } @Test @@ -85,7 +87,7 @@ public class ArrayCopyUtilUnitTest { Assert.assertArrayEquals(copiedArray, employees); employees[0].setName(employees[0].getName()+"_Changed"); //change in employees' element caused change in the copied array - Assert.assertTrue(copiedArray[0].getName().equals(employees[0].getName())); + assertTrue(copiedArray[0].getName().equals(employees[0].getName())); } @Test @@ -96,9 +98,9 @@ public class ArrayCopyUtilUnitTest { Assert.assertArrayEquals(copiedArray, array); array[0] = 9; - Assert.assertTrue(copiedArray[0] != array[0]); + assertTrue(copiedArray[0] != array[0]); copiedArray[1] = 12; - Assert.assertTrue(copiedArray[1] != array[1]); + assertTrue(copiedArray[1] != array[1]); } @Test @@ -108,7 +110,7 @@ public class ArrayCopyUtilUnitTest { Assert.assertArrayEquals(copiedArray, employees);; employees[0].setName(employees[0].getName()+"_Changed"); //change in employees' element changed the copied array - Assert.assertTrue(copiedArray[0].getName().equals(employees[0].getName())); + assertTrue(copiedArray[0].getName().equals(employees[0].getName())); } @Test @@ -138,7 +140,7 @@ public class ArrayCopyUtilUnitTest { Assert.assertArrayEquals(copiedArray, employees); employees[0].setName(employees[0].getName()+"_Changed"); //change in employees' element didn't change in the copied array - Assert.assertTrue(copiedArray[0].getName().equals(employees[0].getName())); + assertTrue(copiedArray[0].getName().equals(employees[0].getName())); } @Test diff --git a/core-java/src/test/java/com/baeldung/classnotfoundexception/ClassNotFoundExceptionTest.java b/core-java/src/test/java/com/baeldung/classnotfoundexception/ClassNotFoundExceptionTest.java index a6104e635b..8714d084ab 100644 --- a/core-java/src/test/java/com/baeldung/classnotfoundexception/ClassNotFoundExceptionTest.java +++ b/core-java/src/test/java/com/baeldung/classnotfoundexception/ClassNotFoundExceptionTest.java @@ -8,4 +8,4 @@ public class ClassNotFoundExceptionTest { public void givenNoDriversInClassPath_whenLoadDrivers_thenClassNotFoundException() throws ClassNotFoundException { Class.forName("oracle.jdbc.driver.OracleDriver"); } -} +} \ No newline at end of file diff --git a/core-java/src/test/java/com/baeldung/completablefuture/CompletableFutureLongRunningUnitTest.java b/core-java/src/test/java/com/baeldung/completablefuture/CompletableFutureLongRunningUnitTest.java index 51b9e5338b..0c3a13d176 100644 --- a/core-java/src/test/java/com/baeldung/completablefuture/CompletableFutureLongRunningUnitTest.java +++ b/core-java/src/test/java/com/baeldung/completablefuture/CompletableFutureLongRunningUnitTest.java @@ -24,7 +24,7 @@ public class CompletableFutureLongRunningUnitTest { assertEquals("Hello", result); } - public Future calculateAsync() throws InterruptedException { + private Future calculateAsync() throws InterruptedException { CompletableFuture completableFuture = new CompletableFuture<>(); Executors.newCachedThreadPool().submit(() -> { @@ -44,7 +44,7 @@ public class CompletableFutureLongRunningUnitTest { assertEquals("Hello", result); } - public Future calculateAsyncWithCancellation() throws InterruptedException { + private Future calculateAsyncWithCancellation() throws InterruptedException { CompletableFuture completableFuture = new CompletableFuture<>(); Executors.newCachedThreadPool().submit(() -> { diff --git a/core-java/src/test/java/com/baeldung/concurrent/accumulator/LongAccumulatorUnitTest.java b/core-java/src/test/java/com/baeldung/concurrent/accumulator/LongAccumulatorUnitTest.java index 11c27ff980..2f1abef64e 100644 --- a/core-java/src/test/java/com/baeldung/concurrent/accumulator/LongAccumulatorUnitTest.java +++ b/core-java/src/test/java/com/baeldung/concurrent/accumulator/LongAccumulatorUnitTest.java @@ -24,8 +24,8 @@ public class LongAccumulatorUnitTest { //when Runnable accumulateAction = () -> IntStream - .rangeClosed(0, numberOfIncrements) - .forEach(accumulator::accumulate); + .rangeClosed(0, numberOfIncrements) + .forEach(accumulator::accumulate); for (int i = 0; i < numberOfThreads; i++) { executorService.execute(accumulateAction); diff --git a/core-java/src/test/java/com/baeldung/concurrent/copyonwrite/CopyOnWriteArrayListUnitTest.java b/core-java/src/test/java/com/baeldung/concurrent/copyonwrite/CopyOnWriteArrayListUnitTest.java index 9111403155..3eb1d21872 100644 --- a/core-java/src/test/java/com/baeldung/concurrent/copyonwrite/CopyOnWriteArrayListUnitTest.java +++ b/core-java/src/test/java/com/baeldung/concurrent/copyonwrite/CopyOnWriteArrayListUnitTest.java @@ -17,7 +17,7 @@ public class CopyOnWriteArrayListUnitTest { public void givenCopyOnWriteList_whenIterateAndAddElementToUnderneathList_thenShouldNotChangeIterator() { //given final CopyOnWriteArrayList numbers = - new CopyOnWriteArrayList<>(new Integer[]{1, 3, 5, 8}); + new CopyOnWriteArrayList<>(new Integer[]{1, 3, 5, 8}); //when Iterator iterator = numbers.iterator(); @@ -42,7 +42,7 @@ public class CopyOnWriteArrayListUnitTest { public void givenCopyOnWriteList_whenIterateOverItAndTryToRemoveElement_thenShouldThrowException() { //given final CopyOnWriteArrayList numbers = - new CopyOnWriteArrayList<>(new Integer[]{1, 3, 5, 8}); + new CopyOnWriteArrayList<>(new Integer[]{1, 3, 5, 8}); //when Iterator iterator = numbers.iterator(); diff --git a/core-java/src/test/java/com/baeldung/concurrent/delayqueue/DelayQueueIntegrationTest.java b/core-java/src/test/java/com/baeldung/concurrent/delayqueue/DelayQueueIntegrationTest.java index 6490c6c094..180f3033ab 100644 --- a/core-java/src/test/java/com/baeldung/concurrent/delayqueue/DelayQueueIntegrationTest.java +++ b/core-java/src/test/java/com/baeldung/concurrent/delayqueue/DelayQueueIntegrationTest.java @@ -4,7 +4,11 @@ import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; -import java.util.concurrent.*; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.DelayQueue; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import static junit.framework.TestCase.assertEquals; @@ -19,7 +23,7 @@ public class DelayQueueIntegrationTest { int delayOfEachProducedMessageMilliseconds = 500; DelayQueueConsumer consumer = new DelayQueueConsumer(queue, numberOfElementsToProduce); DelayQueueProducer producer - = new DelayQueueProducer(queue, numberOfElementsToProduce, delayOfEachProducedMessageMilliseconds); + = new DelayQueueProducer(queue, numberOfElementsToProduce, delayOfEachProducedMessageMilliseconds); //when executor.submit(producer); @@ -41,7 +45,7 @@ public class DelayQueueIntegrationTest { int delayOfEachProducedMessageMilliseconds = 10_000; DelayQueueConsumer consumer = new DelayQueueConsumer(queue, numberOfElementsToProduce); DelayQueueProducer producer - = new DelayQueueProducer(queue, numberOfElementsToProduce, delayOfEachProducedMessageMilliseconds); + = new DelayQueueProducer(queue, numberOfElementsToProduce, delayOfEachProducedMessageMilliseconds); //when executor.submit(producer); @@ -63,7 +67,7 @@ public class DelayQueueIntegrationTest { int delayOfEachProducedMessageMilliseconds = -10_000; DelayQueueConsumer consumer = new DelayQueueConsumer(queue, numberOfElementsToProduce); DelayQueueProducer producer - = new DelayQueueProducer(queue, numberOfElementsToProduce, delayOfEachProducedMessageMilliseconds); + = new DelayQueueProducer(queue, numberOfElementsToProduce, delayOfEachProducedMessageMilliseconds); //when executor.submit(producer); diff --git a/core-java/src/test/java/com/baeldung/concurrent/future/FactorialSquareCalculatorUnitTest.java b/core-java/src/test/java/com/baeldung/concurrent/future/FactorialSquareCalculatorUnitTest.java index a47c44506d..1dff70ffb8 100644 --- a/core-java/src/test/java/com/baeldung/concurrent/future/FactorialSquareCalculatorUnitTest.java +++ b/core-java/src/test/java/com/baeldung/concurrent/future/FactorialSquareCalculatorUnitTest.java @@ -1,10 +1,10 @@ package com.baeldung.concurrent.future; -import static org.junit.Assert.assertEquals; +import org.junit.Test; import java.util.concurrent.ForkJoinPool; -import org.junit.Test; +import static org.junit.Assert.assertEquals; public class FactorialSquareCalculatorUnitTest { diff --git a/core-java/src/test/java/com/baeldung/concurrent/future/SquareCalculatorIntegrationTest.java b/core-java/src/test/java/com/baeldung/concurrent/future/SquareCalculatorIntegrationTest.java index 84d7a55504..5f8b05a974 100644 --- a/core-java/src/test/java/com/baeldung/concurrent/future/SquareCalculatorIntegrationTest.java +++ b/core-java/src/test/java/com/baeldung/concurrent/future/SquareCalculatorIntegrationTest.java @@ -8,7 +8,12 @@ import org.junit.rules.TestName; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.concurrent.*; +import java.util.concurrent.CancellationException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; diff --git a/core-java/src/test/java/com/baeldung/concurrent/locks/SharedObjectWithLockManualTest.java b/core-java/src/test/java/com/baeldung/concurrent/locks/SharedObjectWithLockManualTest.java index 4dccbc3e26..0d4591e624 100644 --- a/core-java/src/test/java/com/baeldung/concurrent/locks/SharedObjectWithLockManualTest.java +++ b/core-java/src/test/java/com/baeldung/concurrent/locks/SharedObjectWithLockManualTest.java @@ -9,65 +9,65 @@ import static junit.framework.TestCase.assertEquals; public class SharedObjectWithLockManualTest { - @Test - public void whenLockAcquired_ThenLockedIsTrue() { - final SharedObjectWithLock object = new SharedObjectWithLock(); + @Test + public void whenLockAcquired_ThenLockedIsTrue() { + final SharedObjectWithLock object = new SharedObjectWithLock(); - final int threadCount = 2; - final ExecutorService service = Executors.newFixedThreadPool(threadCount); + final int threadCount = 2; + final ExecutorService service = Executors.newFixedThreadPool(threadCount); - executeThreads(object, threadCount, service); + executeThreads(object, threadCount, service); - assertEquals(true, object.isLocked()); + assertEquals(true, object.isLocked()); - service.shutdown(); - } + service.shutdown(); + } - @Test - public void whenLocked_ThenQueuedThread() { - final int threadCount = 4; - final ExecutorService service = Executors.newFixedThreadPool(threadCount); - final SharedObjectWithLock object = new SharedObjectWithLock(); + @Test + public void whenLocked_ThenQueuedThread() { + final int threadCount = 4; + final ExecutorService service = Executors.newFixedThreadPool(threadCount); + final SharedObjectWithLock object = new SharedObjectWithLock(); - executeThreads(object, threadCount, service); + executeThreads(object, threadCount, service); - assertEquals(object.hasQueuedThreads(), true); + assertEquals(object.hasQueuedThreads(), true); - service.shutdown(); + service.shutdown(); - } + } - public void whenTryLock_ThenQueuedThread() { - final SharedObjectWithLock object = new SharedObjectWithLock(); + public void whenTryLock_ThenQueuedThread() { + final SharedObjectWithLock object = new SharedObjectWithLock(); - final int threadCount = 2; - final ExecutorService service = Executors.newFixedThreadPool(threadCount); + final int threadCount = 2; + final ExecutorService service = Executors.newFixedThreadPool(threadCount); - executeThreads(object, threadCount, service); + executeThreads(object, threadCount, service); - assertEquals(true, object.isLocked()); + assertEquals(true, object.isLocked()); - service.shutdown(); - } + service.shutdown(); + } - @Test - public void whenGetCount_ThenCorrectCount() throws InterruptedException { - final int threadCount = 4; - final ExecutorService service = Executors.newFixedThreadPool(threadCount); - final SharedObjectWithLock object = new SharedObjectWithLock(); + @Test + public void whenGetCount_ThenCorrectCount() throws InterruptedException { + final int threadCount = 4; + final ExecutorService service = Executors.newFixedThreadPool(threadCount); + final SharedObjectWithLock object = new SharedObjectWithLock(); - executeThreads(object, threadCount, service); - Thread.sleep(1000); - assertEquals(object.getCounter(), 4); + executeThreads(object, threadCount, service); + Thread.sleep(1000); + assertEquals(object.getCounter(), 4); - service.shutdown(); + service.shutdown(); - } + } - private void executeThreads(SharedObjectWithLock object, int threadCount, ExecutorService service) { - for (int i = 0; i < threadCount; i++) { - service.execute(object::perform); - } - } + private void executeThreads(SharedObjectWithLock object, int threadCount, ExecutorService service) { + for (int i = 0; i < threadCount; i++) { + service.execute(object::perform); + } + } } diff --git a/core-java/src/test/java/com/baeldung/concurrent/locks/SynchronizedHashMapWithRWLockManualTest.java b/core-java/src/test/java/com/baeldung/concurrent/locks/SynchronizedHashMapWithRWLockManualTest.java index fd6cf08442..3014ae38b2 100644 --- a/core-java/src/test/java/com/baeldung/concurrent/locks/SynchronizedHashMapWithRWLockManualTest.java +++ b/core-java/src/test/java/com/baeldung/concurrent/locks/SynchronizedHashMapWithRWLockManualTest.java @@ -1,6 +1,5 @@ package com.baeldung.concurrent.locks; -import jdk.nashorn.internal.ir.annotations.Ignore; import org.junit.Test; import java.util.concurrent.ExecutorService; @@ -10,49 +9,49 @@ import static junit.framework.TestCase.assertEquals; public class SynchronizedHashMapWithRWLockManualTest { - @Test - public void whenWriting_ThenNoReading() { - SynchronizedHashMapWithRWLock object = new SynchronizedHashMapWithRWLock(); - final int threadCount = 3; - final ExecutorService service = Executors.newFixedThreadPool(threadCount); + @Test + public void whenWriting_ThenNoReading() { + SynchronizedHashMapWithRWLock object = new SynchronizedHashMapWithRWLock(); + final int threadCount = 3; + final ExecutorService service = Executors.newFixedThreadPool(threadCount); - executeWriterThreads(object, threadCount, service); + executeWriterThreads(object, threadCount, service); - assertEquals(object.isReadLockAvailable(), false); + assertEquals(object.isReadLockAvailable(), false); - service.shutdown(); - } + service.shutdown(); + } - @Test - public void whenReading_ThenMultipleReadingAllowed() { - SynchronizedHashMapWithRWLock object = new SynchronizedHashMapWithRWLock(); - final int threadCount = 5; - final ExecutorService service = Executors.newFixedThreadPool(threadCount); + @Test + public void whenReading_ThenMultipleReadingAllowed() { + SynchronizedHashMapWithRWLock object = new SynchronizedHashMapWithRWLock(); + final int threadCount = 5; + final ExecutorService service = Executors.newFixedThreadPool(threadCount); - executeReaderThreads(object, threadCount, service); + executeReaderThreads(object, threadCount, service); - assertEquals(object.isReadLockAvailable(), true); + assertEquals(object.isReadLockAvailable(), true); - service.shutdown(); - } + service.shutdown(); + } - private void executeWriterThreads(SynchronizedHashMapWithRWLock object, int threadCount, ExecutorService service) { - for (int i = 0; i < threadCount; i++) { - service.execute(() -> { - try { - object.put("key" + threadCount, "value" + threadCount); - } catch (InterruptedException e) { - e.printStackTrace(); - } - }); - } - } + private void executeWriterThreads(SynchronizedHashMapWithRWLock object, int threadCount, ExecutorService service) { + for (int i = 0; i < threadCount; i++) { + service.execute(() -> { + try { + object.put("key" + threadCount, "value" + threadCount); + } catch (InterruptedException e) { + e.printStackTrace(); + } + }); + } + } - private void executeReaderThreads(SynchronizedHashMapWithRWLock object, int threadCount, ExecutorService service) { - for (int i = 0; i < threadCount; i++) - service.execute(() -> { - object.get("key" + threadCount); - }); - } + private void executeReaderThreads(SynchronizedHashMapWithRWLock object, int threadCount, ExecutorService service) { + for (int i = 0; i < threadCount; i++) + service.execute(() -> { + object.get("key" + threadCount); + }); + } } diff --git a/core-java/src/test/java/com/baeldung/concurrent/priorityblockingqueue/PriorityBlockingQueueIntegrationTest.java b/core-java/src/test/java/com/baeldung/concurrent/priorityblockingqueue/PriorityBlockingQueueIntegrationTest.java index 9f7b828a9c..d1814c8fc9 100644 --- a/core-java/src/test/java/com/baeldung/concurrent/priorityblockingqueue/PriorityBlockingQueueIntegrationTest.java +++ b/core-java/src/test/java/com/baeldung/concurrent/priorityblockingqueue/PriorityBlockingQueueIntegrationTest.java @@ -42,7 +42,7 @@ public class PriorityBlockingQueueIntegrationTest { try { Integer poll = queue.take(); LOG.debug("Polled: " + poll); - } catch (InterruptedException e) { + } catch (InterruptedException ignored) { } } }); diff --git a/core-java/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockTest.java b/core-java/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockTest.java index 303daa8d26..1f8e8d681a 100644 --- a/core-java/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockTest.java +++ b/core-java/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockTest.java @@ -1,13 +1,13 @@ package com.baeldung.concurrent.synchronize; -import static org.junit.Assert.assertEquals; +import org.junit.Test; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.stream.IntStream; -import org.junit.Test; +import static org.junit.Assert.assertEquals; public class BaeldungSychronizedBlockTest { @@ -17,7 +17,7 @@ public class BaeldungSychronizedBlockTest { BaeldungSynchronizedBlocks synchronizedBlocks = new BaeldungSynchronizedBlocks(); IntStream.range(0, 1000) - .forEach(count -> service.submit(synchronizedBlocks::performSynchronisedTask)); + .forEach(count -> service.submit(synchronizedBlocks::performSynchronisedTask)); service.awaitTermination(100, TimeUnit.MILLISECONDS); assertEquals(1000, synchronizedBlocks.getCount()); @@ -28,7 +28,7 @@ public class BaeldungSychronizedBlockTest { ExecutorService service = Executors.newCachedThreadPool(); IntStream.range(0, 1000) - .forEach(count -> service.submit(BaeldungSynchronizedBlocks::performStaticSyncTask)); + .forEach(count -> service.submit(BaeldungSynchronizedBlocks::performStaticSyncTask)); service.awaitTermination(100, TimeUnit.MILLISECONDS); assertEquals(1000, BaeldungSynchronizedBlocks.getStaticCount()); diff --git a/core-java/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizeMethodsTest.java b/core-java/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizeMethodsTest.java index e829423362..ba7c1f0a7b 100644 --- a/core-java/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizeMethodsTest.java +++ b/core-java/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizeMethodsTest.java @@ -1,14 +1,14 @@ package com.baeldung.concurrent.synchronize; -import static org.junit.Assert.assertEquals; +import org.junit.Ignore; +import org.junit.Test; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.stream.IntStream; -import org.junit.Ignore; -import org.junit.Test; +import static org.junit.Assert.assertEquals; public class BaeldungSynchronizeMethodsTest { @@ -19,7 +19,7 @@ public class BaeldungSynchronizeMethodsTest { BaeldungSynchronizedMethods method = new BaeldungSynchronizedMethods(); IntStream.range(0, 1000) - .forEach(count -> service.submit(method::calculate)); + .forEach(count -> service.submit(method::calculate)); service.awaitTermination(100, TimeUnit.MILLISECONDS); assertEquals(1000, method.getSum()); @@ -31,7 +31,7 @@ public class BaeldungSynchronizeMethodsTest { BaeldungSynchronizedMethods method = new BaeldungSynchronizedMethods(); IntStream.range(0, 1000) - .forEach(count -> service.submit(method::synchronisedCalculate)); + .forEach(count -> service.submit(method::synchronisedCalculate)); service.awaitTermination(100, TimeUnit.MILLISECONDS); assertEquals(1000, method.getSyncSum()); @@ -42,7 +42,7 @@ public class BaeldungSynchronizeMethodsTest { ExecutorService service = Executors.newCachedThreadPool(); IntStream.range(0, 1000) - .forEach(count -> service.submit(BaeldungSynchronizedMethods::syncStaticCalculate)); + .forEach(count -> service.submit(BaeldungSynchronizedMethods::syncStaticCalculate)); service.awaitTermination(100, TimeUnit.MILLISECONDS); assertEquals(1000, BaeldungSynchronizedMethods.staticSum); diff --git a/core-java/src/test/java/com/baeldung/datetime/UseLocalDateTimeUnitTest.java b/core-java/src/test/java/com/baeldung/datetime/UseLocalDateTimeUnitTest.java index 57e1f33280..a10ec66f20 100644 --- a/core-java/src/test/java/com/baeldung/datetime/UseLocalDateTimeUnitTest.java +++ b/core-java/src/test/java/com/baeldung/datetime/UseLocalDateTimeUnitTest.java @@ -7,13 +7,15 @@ import java.time.Month; import org.junit.Assert; import org.junit.Test; +import static org.junit.Assert.assertEquals; + public class UseLocalDateTimeUnitTest { UseLocalDateTime useLocalDateTime = new UseLocalDateTime(); @Test public void givenString_whenUsingParse_thenLocalDateTime() { - Assert.assertEquals(LocalDate.of(2016, Month.MAY, 10), useLocalDateTime.getLocalDateTimeUsingParseMethod("2016-05-10T06:30").toLocalDate()); - Assert.assertEquals(LocalTime.of(6, 30), useLocalDateTime.getLocalDateTimeUsingParseMethod("2016-05-10T06:30").toLocalTime()); + assertEquals(LocalDate.of(2016, Month.MAY, 10), useLocalDateTime.getLocalDateTimeUsingParseMethod("2016-05-10T06:30").toLocalDate()); + assertEquals(LocalTime.of(6, 30), useLocalDateTime.getLocalDateTimeUsingParseMethod("2016-05-10T06:30").toLocalTime()); } } diff --git a/core-java/src/test/java/com/baeldung/datetime/UseLocalDateUnitTest.java b/core-java/src/test/java/com/baeldung/datetime/UseLocalDateUnitTest.java index 8f1997e9e8..e158c0fd67 100644 --- a/core-java/src/test/java/com/baeldung/datetime/UseLocalDateUnitTest.java +++ b/core-java/src/test/java/com/baeldung/datetime/UseLocalDateUnitTest.java @@ -7,48 +7,50 @@ import java.time.LocalDateTime; import org.junit.Assert; import org.junit.Test; +import static org.junit.Assert.assertEquals; + public class UseLocalDateUnitTest { UseLocalDate useLocalDate = new UseLocalDate(); @Test public void givenValues_whenUsingFactoryOf_thenLocalDate() { - Assert.assertEquals("2016-05-10", useLocalDate.getLocalDateUsingFactoryOfMethod(2016, 5, 10).toString()); + assertEquals("2016-05-10", useLocalDate.getLocalDateUsingFactoryOfMethod(2016, 5, 10).toString()); } @Test public void givenString_whenUsingParse_thenLocalDate() { - Assert.assertEquals("2016-05-10", useLocalDate.getLocalDateUsingParseMethod("2016-05-10").toString()); + assertEquals("2016-05-10", useLocalDate.getLocalDateUsingParseMethod("2016-05-10").toString()); } @Test public void whenUsingClock_thenLocalDate() { - Assert.assertEquals(LocalDate.now(), useLocalDate.getLocalDateFromClock()); + assertEquals(LocalDate.now(), useLocalDate.getLocalDateFromClock()); } @Test public void givenDate_whenUsingPlus_thenNextDay() { - Assert.assertEquals(LocalDate.now().plusDays(1), useLocalDate.getNextDay(LocalDate.now())); + assertEquals(LocalDate.now().plusDays(1), useLocalDate.getNextDay(LocalDate.now())); } @Test public void givenDate_whenUsingMinus_thenPreviousDay() { - Assert.assertEquals(LocalDate.now().minusDays(1), useLocalDate.getPreviousDay(LocalDate.now())); + assertEquals(LocalDate.now().minusDays(1), useLocalDate.getPreviousDay(LocalDate.now())); } @Test public void givenToday_whenUsingGetDayOfWeek_thenDayOfWeek() { - Assert.assertEquals(DayOfWeek.SUNDAY, useLocalDate.getDayOfWeek(LocalDate.parse("2016-05-22"))); + assertEquals(DayOfWeek.SUNDAY, useLocalDate.getDayOfWeek(LocalDate.parse("2016-05-22"))); } @Test public void givenToday_whenUsingWithTemporalAdjuster_thenFirstDayOfMonth() { - Assert.assertEquals(1, useLocalDate.getFirstDayOfMonth().getDayOfMonth()); + assertEquals(1, useLocalDate.getFirstDayOfMonth().getDayOfMonth()); } @Test public void givenLocalDate_whenUsingAtStartOfDay_thenReturnMidnight() { - Assert.assertEquals(LocalDateTime.parse("2016-05-22T00:00:00"), useLocalDate.getStartOfDay(LocalDate.parse("2016-05-22"))); + assertEquals(LocalDateTime.parse("2016-05-22T00:00:00"), useLocalDate.getStartOfDay(LocalDate.parse("2016-05-22"))); } } diff --git a/core-java/src/test/java/com/baeldung/deserialization/DeserializationUnitTest.java b/core-java/src/test/java/com/baeldung/deserialization/DeserializationUnitTest.java new file mode 100644 index 0000000000..887e7e41da --- /dev/null +++ b/core-java/src/test/java/com/baeldung/deserialization/DeserializationUnitTest.java @@ -0,0 +1,67 @@ +package com.baeldung.deserialization; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.io.InvalidClassException; + +import org.junit.Ignore; +import org.junit.Test; + +public class DeserializationUnitTest { + + private static final String serializedObj = "rO0ABXNyACljb20uYmFlbGR1bmcuZGVzZXJpYWxpemF0aW9uLkFwcGxlUHJvZHVjdAAAAAAAEtaHAgADTAANaGVhZHBob25lUG9ydHQAEkxqYXZhL2xhbmcvU3RyaW5nO0wADmxpZ2h0ZW5pbmdQb3J0cQB+AAFMAA90aHVuZGVyYm9sdFBvcnRxAH4AAXhwdAARaGVhZHBob25lUG9ydDIwMjBwdAATdGh1bmRlcmJvbHRQb3J0MjAyMA=="; + + private static long userDefinedSerialVersionUID = 1234567L; + + /** + * Tests the deserialization of the original "AppleProduct" (no exceptions are thrown) + * @throws ClassNotFoundException + * @throws IOException + */ + @Test + public void testDeserializeObj_compatible() throws IOException, ClassNotFoundException { + + assertEquals(userDefinedSerialVersionUID, AppleProduct.getSerialVersionUID()); + + AppleProduct macBook = new AppleProduct(); + macBook.headphonePort = "headphonePort2020"; + macBook.thunderboltPort = "thunderboltPort2020"; + + // serializes the "AppleProduct" object + String serializedProduct = SerializationUtility.serializeObjectToString(macBook); + + // deserializes the "AppleProduct" object + AppleProduct deserializedProduct = (AppleProduct) DeserializationUtility.deSerializeObjectFromString(serializedProduct); + + assertTrue(deserializedProduct.headphonePort.equalsIgnoreCase(macBook.headphonePort)); + assertTrue(deserializedProduct.thunderboltPort.equalsIgnoreCase(macBook.thunderboltPort)); + + } + + /** + * Tests the deserialization of the modified (non-compatible) "AppleProduct". + * The test should result in an InvalidClassException being thrown. + * + * Note: to run this test: + * 1. Modify the value of the serialVersionUID identifier in AppleProduct.java + * 2. Remove the @Ignore annotation + * 3. Run the test individually (do not run the entire set of tests) + * 4. Revert the changes made in 1 & 2 (so that you're able to re-run the tests successfully) + * + * @throws ClassNotFoundException + * @throws IOException + */ + @Ignore + @Test(expected = InvalidClassException.class) + public void testDeserializeObj_incompatible() throws ClassNotFoundException, IOException { + + assertNotEquals(userDefinedSerialVersionUID, AppleProduct.getSerialVersionUID()); + + // attempts to deserialize the "AppleProduct" object + DeserializationUtility.deSerializeObjectFromString(serializedObj); + } + +} diff --git a/core-java/src/test/java/com/baeldung/doublecolon/ComputerUtilsUnitTest.java b/core-java/src/test/java/com/baeldung/doublecolon/ComputerUtilsUnitTest.java index f69e4b03ee..7157dead6e 100644 --- a/core-java/src/test/java/com/baeldung/doublecolon/ComputerUtilsUnitTest.java +++ b/core-java/src/test/java/com/baeldung/doublecolon/ComputerUtilsUnitTest.java @@ -83,7 +83,7 @@ public class ComputerUtilsUnitTest { final TriFunction integerStringIntegerObjectTriFunction = MacbookPro::new; final MacbookPro macbookPro = integerStringIntegerObjectTriFunction.apply(2010, "black", 100); - Double initialValue = new Double(999.99); + Double initialValue = 999.99; final Double actualValue = macbookPro.calculateValue(initialValue); Assert.assertEquals(766.659, actualValue, 0.0); } diff --git a/core-java/src/test/java/com/baeldung/file/FileOperationsManualTest.java b/core-java/src/test/java/com/baeldung/file/FileOperationsManualTest.java index 74886bdb53..ea71d1b5c1 100644 --- a/core-java/src/test/java/com/baeldung/file/FileOperationsManualTest.java +++ b/core-java/src/test/java/com/baeldung/file/FileOperationsManualTest.java @@ -6,7 +6,12 @@ import org.hamcrest.Matchers; import org.junit.Assert; import org.junit.Test; -import java.io.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.net.URISyntaxException; import java.net.URL; import java.net.URLConnection; @@ -14,6 +19,10 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.stream.Stream; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + public class FileOperationsManualTest { @Test @@ -25,7 +34,7 @@ public class FileOperationsManualTest { InputStream inputStream = new FileInputStream(file); String data = readFromInputStream(inputStream); - Assert.assertEquals(expectedData, data.trim()); + assertEquals(expectedData, data.trim()); } @Test @@ -36,7 +45,7 @@ public class FileOperationsManualTest { InputStream inputStream = clazz.getResourceAsStream("/fileTest.txt"); String data = readFromInputStream(inputStream); - Assert.assertEquals(expectedData, data.trim()); + assertEquals(expectedData, data.trim()); } @Test @@ -47,7 +56,7 @@ public class FileOperationsManualTest { InputStream inputStream = clazz.getResourceAsStream("/LICENSE.txt"); String data = readFromInputStream(inputStream); - Assert.assertThat(data.trim(), CoreMatchers.containsString(expectedData)); + assertThat(data.trim(), CoreMatchers.containsString(expectedData)); } @Test @@ -61,7 +70,7 @@ public class FileOperationsManualTest { InputStream inputStream = urlConnection.getInputStream(); String data = readFromInputStream(inputStream); - Assert.assertThat(data.trim(), CoreMatchers.containsString(expectedData)); + assertThat(data.trim(), CoreMatchers.containsString(expectedData)); } @Test @@ -72,7 +81,7 @@ public class FileOperationsManualTest { File file = new File(classLoader.getResource("fileTest.txt").getFile()); String data = FileUtils.readFileToString(file); - Assert.assertEquals(expectedData, data.trim()); + assertEquals(expectedData, data.trim()); } @Test @@ -84,7 +93,7 @@ public class FileOperationsManualTest { byte[] fileBytes = Files.readAllBytes(path); String data = new String(fileBytes); - Assert.assertEquals(expectedData, data.trim()); + assertEquals(expectedData, data.trim()); } @Test @@ -98,7 +107,7 @@ public class FileOperationsManualTest { lines.forEach(line -> data.append(line).append("\n")); lines.close(); - Assert.assertEquals(expectedData, data.toString().trim()); + assertEquals(expectedData, data.toString().trim()); } private String readFromInputStream(InputStream inputStream) throws IOException { diff --git a/core-java/src/test/java/com/baeldung/filesystem/jndi/test/LookupFSJNDIIntegrationTest.java b/core-java/src/test/java/com/baeldung/filesystem/jndi/test/LookupFSJNDIIntegrationTest.java index 1ec703f0f6..330ec3aee3 100644 --- a/core-java/src/test/java/com/baeldung/filesystem/jndi/test/LookupFSJNDIIntegrationTest.java +++ b/core-java/src/test/java/com/baeldung/filesystem/jndi/test/LookupFSJNDIIntegrationTest.java @@ -1,15 +1,13 @@ package com.baeldung.filesystem.jndi.test; -import static org.junit.Assert.assertNotNull; - -import java.io.File; +import com.baeldung.filesystem.jndi.LookupFSJNDI; +import org.junit.Test; import javax.naming.InitialContext; import javax.naming.NamingException; +import java.io.File; -import org.junit.Test; - -import com.baeldung.filesystem.jndi.LookupFSJNDI; +import static org.junit.Assert.assertNotNull; public class LookupFSJNDIIntegrationTest { LookupFSJNDI fsjndi; diff --git a/core-java/src/test/java/com/baeldung/functionalinterface/FunctionalInterfaceUnitTest.java b/core-java/src/test/java/com/baeldung/functionalinterface/FunctionalInterfaceUnitTest.java index 1036df0bb8..811088cc0c 100644 --- a/core-java/src/test/java/com/baeldung/functionalinterface/FunctionalInterfaceUnitTest.java +++ b/core-java/src/test/java/com/baeldung/functionalinterface/FunctionalInterfaceUnitTest.java @@ -25,7 +25,7 @@ public class FunctionalInterfaceUnitTest { @Test public void whenPassingLambdaToComputeIfAbsent_thenTheValueGetsComputedAndPutIntoMap() { Map nameMap = new HashMap<>(); - Integer value = nameMap.computeIfAbsent("John", s -> s.length()); + Integer value = nameMap.computeIfAbsent("John", String::length); assertEquals(new Integer(4), nameMap.get("John")); assertEquals(new Integer(4), value); diff --git a/core-java/src/test/java/com/baeldung/hashing/SHA256HashingUnitTest.java b/core-java/src/test/java/com/baeldung/hashing/SHA256HashingUnitTest.java index 270cc8be9a..3c34bf2c6e 100644 --- a/core-java/src/test/java/com/baeldung/hashing/SHA256HashingUnitTest.java +++ b/core-java/src/test/java/com/baeldung/hashing/SHA256HashingUnitTest.java @@ -2,7 +2,7 @@ package com.baeldung.hashing; import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; public class SHA256HashingUnitTest { diff --git a/core-java/src/test/java/com/baeldung/http/HttpRequestLiveTest.java b/core-java/src/test/java/com/baeldung/http/HttpRequestLiveTest.java index 691615a1b4..acd6536ac4 100644 --- a/core-java/src/test/java/com/baeldung/http/HttpRequestLiveTest.java +++ b/core-java/src/test/java/com/baeldung/http/HttpRequestLiveTest.java @@ -2,7 +2,6 @@ package com.baeldung.http; import org.apache.commons.lang.StringUtils; import org.junit.Test; -import static org.junit.Assert.*; import java.io.BufferedReader; import java.io.DataOutputStream; @@ -17,6 +16,9 @@ import java.util.List; import java.util.Map; import java.util.Optional; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + public class HttpRequestLiveTest { @Test @@ -39,7 +41,7 @@ public class HttpRequestLiveTest { int status = con.getResponseCode(); BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); String inputLine; - StringBuffer content = new StringBuffer(); + StringBuilder content = new StringBuilder(); while ((inputLine = in.readLine()) != null) { content.append(inputLine); } @@ -67,7 +69,7 @@ public class HttpRequestLiveTest { int status = con.getResponseCode(); BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); String inputLine; - StringBuffer content = new StringBuffer(); + StringBuilder content = new StringBuilder(); while ((inputLine = in.readLine()) != null) { content.append(inputLine); } diff --git a/core-java/src/test/java/com/baeldung/javanetworking/uriurl/test/URIDemoTest.java b/core-java/src/test/java/com/baeldung/javanetworking/uriurl/test/URIDemoTest.java new file mode 100644 index 0000000000..c429039e3d --- /dev/null +++ b/core-java/src/test/java/com/baeldung/javanetworking/uriurl/test/URIDemoTest.java @@ -0,0 +1,65 @@ +package com.baeldung.javanetworking.uriurl.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.URLConnection; + +import org.junit.BeforeClass; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.baeldung.javanetworking.uriurl.URLDemo; + +@FixMethodOrder +public class URIDemoTest { + private final Logger log = LoggerFactory.getLogger(URIDemoTest.class); + String URISTRING = "https://wordpress.org:443/support/topic/page-jumps-within-wordpress/?replies=3#post-2278484"; + // parsed locator + static String URISCHEME = "https"; + String URISCHEMESPECIFIC; + static String URIHOST = "wordpress.org"; + static String URIAUTHORITY = "wordpress.org:443"; + + static String URIPATH = "/support/topic/page-jumps-within-wordpress/"; + int URIPORT = 443; + static int URIDEFAULTPORT = 443; + static String URIQUERY = "replies=3"; + static String URIFRAGMENT = "post-2278484"; + static String URICOMPOUND = URISCHEME + "://" + URIHOST + ":" + URIDEFAULTPORT + URIPATH + "?" + URIQUERY + "#" + URIFRAGMENT; + + static URI uri; + URL url; + BufferedReader in = null; + String URIContent = ""; + + @BeforeClass + public static void givenEmplyURL_whenInitializeURL_thenSuccess() throws URISyntaxException { + uri = new URI(URICOMPOUND); + } + + // check parsed URL + @Test + public void givenURI_whenURIIsParsed_thenSuccess() { + assertNotNull("URI is null", uri); + assertEquals("URI string is not equal", uri.toString(), URISTRING); + assertEquals("Scheme is not equal", uri.getScheme(), URISCHEME); + assertEquals("Authority is not equal", uri.getAuthority(), URIAUTHORITY); + assertEquals("Host string is not equal", uri.getHost(), URIHOST); + assertEquals("Path string is not equal", uri.getPath(), URIPATH); + assertEquals("Port number is not equal", uri.getPort(), URIPORT); + assertEquals("Query string is not equal", uri.getQuery(), URIQUERY); + assertEquals("Fragment string is not equal", uri.getFragment(), URIFRAGMENT); + } +} diff --git a/core-java/src/test/java/com/baeldung/javanetworking/url/test/URLDemoTest.java b/core-java/src/test/java/com/baeldung/javanetworking/uriurl/test/URLDemoTest.java similarity index 95% rename from core-java/src/test/java/com/baeldung/javanetworking/url/test/URLDemoTest.java rename to core-java/src/test/java/com/baeldung/javanetworking/uriurl/test/URLDemoTest.java index 293052e842..47cbf539a5 100644 --- a/core-java/src/test/java/com/baeldung/javanetworking/url/test/URLDemoTest.java +++ b/core-java/src/test/java/com/baeldung/javanetworking/uriurl/test/URLDemoTest.java @@ -1,4 +1,4 @@ -package com.baeldung.javanetworking.url.test; +package com.baeldung.javanetworking.uriurl.test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -18,11 +18,11 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.baeldung.javanetworking.url.URLDemo; +import com.baeldung.javanetworking.uriurl.URLDemo; @FixMethodOrder public class URLDemoTest { - private final Logger log = LoggerFactory.getLogger(URLDemo.class); + private final Logger log = LoggerFactory.getLogger(URLDemoTest.class); static String URLSTRING = "https://wordpress.org:443/support/topic/page-jumps-within-wordpress/?replies=3#post-2278484"; // parsed locator static String URLPROTOCOL = "https"; diff --git a/core-java/src/test/java/com/baeldung/list/flattennestedlist/FlattenNestedListUnitTest.java b/core-java/src/test/java/com/baeldung/list/flattennestedlist/FlattenNestedListUnitTest.java index 50abb4bc92..3c8f519082 100644 --- a/core-java/src/test/java/com/baeldung/list/flattennestedlist/FlattenNestedListUnitTest.java +++ b/core-java/src/test/java/com/baeldung/list/flattennestedlist/FlattenNestedListUnitTest.java @@ -14,7 +14,7 @@ import org.hamcrest.collection.IsIterableContainingInOrder; import org.junit.Test; public class FlattenNestedListUnitTest { - List> lol = asList(asList("one:one"), asList("two:one", "two:two", "two:three"), asList("three:one", "three:two", "three:three", "three:four")); + private List> lol = asList(asList("one:one"), asList("two:one", "two:two", "two:three"), asList("three:one", "three:two", "three:three", "three:four")); @Test public void givenNestedList_thenFlattenImperatively() { @@ -36,13 +36,13 @@ public class FlattenNestedListUnitTest { assertThat(ls, IsIterableContainingInOrder.contains("one:one", "two:one", "two:two", "two:three", "three:one", "three:two", "three:three", "three:four")); } - public List flattenListOfListsImperatively(List> list) { + private List flattenListOfListsImperatively(List> list) { List ls = new ArrayList<>(); list.forEach(ls::addAll); return ls; } - public List flattenListOfListsStream(List> list) { + private List flattenListOfListsStream(List> list) { return list.stream().flatMap(Collection::stream).collect(Collectors.toList()); } } diff --git a/core-java/src/test/java/com/baeldung/list/listoflist/ListOfListsUnitTest.java b/core-java/src/test/java/com/baeldung/list/listoflist/ListOfListsUnitTest.java index 75f8b8359f..7a23afa12f 100644 --- a/core-java/src/test/java/com/baeldung/list/listoflist/ListOfListsUnitTest.java +++ b/core-java/src/test/java/com/baeldung/list/listoflist/ListOfListsUnitTest.java @@ -1,18 +1,19 @@ package com.baeldung.list.listoflist; +import org.junit.Before; +import org.junit.Test; + import java.util.ArrayList; import java.util.List; import static org.junit.Assert.assertEquals; -import org.junit.Before; -import org.junit.Test; public class ListOfListsUnitTest { - private List> listOfLists = new ArrayList>(); - private ArrayList penList = new ArrayList<>(); - private ArrayList pencilList = new ArrayList<>(); - private ArrayList rubberList = new ArrayList<>(); + private List> listOfLists = new ArrayList<>(); + private List penList = new ArrayList<>(); + private List pencilList = new ArrayList<>(); + private List rubberList = new ArrayList<>(); @SuppressWarnings("unchecked") @Before @@ -29,11 +30,11 @@ public class ListOfListsUnitTest { @Test public void givenListOfLists_thenCheckNames() { assertEquals("Pen 1", ((Pen) listOfLists.get(0) - .get(0)).getName()); + .get(0)).getName()); assertEquals("Pencil 1", ((Pencil) listOfLists.get(1) - .get(0)).getName()); + .get(0)).getName()); assertEquals("Rubber 1", ((Rubber) listOfLists.get(2) - .get(0)).getName()); + .get(0)).getName()); } @SuppressWarnings("unchecked") @@ -43,10 +44,10 @@ public class ListOfListsUnitTest { ((ArrayList) listOfLists.get(1)).remove(0); listOfLists.remove(1); assertEquals("Rubber 1", ((Rubber) listOfLists.get(1) - .get(0)).getName()); + .get(0)).getName()); listOfLists.remove(0); assertEquals("Rubber 1", ((Rubber) listOfLists.get(0) - .get(0)).getName()); + .get(0)).getName()); } @Test @@ -60,17 +61,17 @@ public class ListOfListsUnitTest { ArrayList rubbers = new ArrayList<>(); rubbers.add(new Rubber("Rubber 1")); rubbers.add(new Rubber("Rubber 2")); - + List> list = new ArrayList>(); list.add(pens); list.add(pencils); list.add(rubbers); - + assertEquals("Pen 1", ((Pen) list.get(0) - .get(0)).getName()); + .get(0)).getName()); assertEquals("Pencil 1", ((Pencil) list.get(1) - .get(0)).getName()); + .get(0)).getName()); assertEquals("Rubber 1", ((Rubber) list.get(2) - .get(0)).getName()); + .get(0)).getName()); } } diff --git a/core-java/src/test/java/com/baeldung/mappedbytebuffer/MappedByteBufferUnitTest.java b/core-java/src/test/java/com/baeldung/mappedbytebuffer/MappedByteBufferUnitTest.java index 22457d196e..3c2d9904d4 100644 --- a/core-java/src/test/java/com/baeldung/mappedbytebuffer/MappedByteBufferUnitTest.java +++ b/core-java/src/test/java/com/baeldung/mappedbytebuffer/MappedByteBufferUnitTest.java @@ -47,7 +47,7 @@ public class MappedByteBufferUnitTest { //when try (FileChannel fileChannel = (FileChannel) Files.newByteChannel(pathToWrite, - EnumSet.of(StandardOpenOption.READ, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING))) { + EnumSet.of(StandardOpenOption.READ, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING))) { MappedByteBuffer mappedByteBuffer = fileChannel.map(FileChannel.MapMode.READ_WRITE, 0, charBuffer.length()); if (mappedByteBuffer != null) { @@ -61,7 +61,7 @@ public class MappedByteBufferUnitTest { } - public Path getFileURIFromResources(String fileName) throws Exception { + private Path getFileURIFromResources(String fileName) throws Exception { ClassLoader classLoader = getClass().getClassLoader(); return Paths.get(classLoader.getResource(fileName).getPath()); } diff --git a/core-java/src/test/java/com/baeldung/maths/BigDecimalImplTest.java b/core-java/src/test/java/com/baeldung/maths/BigDecimalImplTest.java index 973b987224..788fbd7047 100644 --- a/core-java/src/test/java/com/baeldung/maths/BigDecimalImplTest.java +++ b/core-java/src/test/java/com/baeldung/maths/BigDecimalImplTest.java @@ -1,9 +1,10 @@ package com.baeldung.maths; +import org.junit.Assert; +import org.junit.Test; + import java.math.BigDecimal; import java.math.RoundingMode; -import org.junit.Assert; -import org.junit.Test; public class BigDecimalImplTest { diff --git a/core-java/src/test/java/com/baeldung/maths/BigIntegerImplTest.java b/core-java/src/test/java/com/baeldung/maths/BigIntegerImplTest.java index 040c595065..aa8eaa9909 100644 --- a/core-java/src/test/java/com/baeldung/maths/BigIntegerImplTest.java +++ b/core-java/src/test/java/com/baeldung/maths/BigIntegerImplTest.java @@ -1,11 +1,10 @@ package com.baeldung.maths; -import java.math.BigInteger; - import org.junit.Assert; - import org.junit.Test; +import java.math.BigInteger; + public class BigIntegerImplTest { @Test diff --git a/core-java/src/test/java/com/baeldung/maths/RoundTest.java b/core-java/src/test/java/com/baeldung/maths/RoundTest.java index 95db146414..5ce9523e21 100644 --- a/core-java/src/test/java/com/baeldung/maths/RoundTest.java +++ b/core-java/src/test/java/com/baeldung/maths/RoundTest.java @@ -5,6 +5,9 @@ import org.decimal4j.util.DoubleRounder; import org.junit.Assert; import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; + public class RoundTest { private double value = 2.03456d; private int places = 2; diff --git a/core-java/src/test/java/com/baeldung/money/JavaMoneyUnitTest.java b/core-java/src/test/java/com/baeldung/money/JavaMoneyUnitTest.java index 69906543a9..8948d1ebf7 100644 --- a/core-java/src/test/java/com/baeldung/money/JavaMoneyUnitTest.java +++ b/core-java/src/test/java/com/baeldung/money/JavaMoneyUnitTest.java @@ -3,13 +3,13 @@ package com.baeldung.money; import org.javamoney.moneta.FastMoney; import org.javamoney.moneta.Money; import org.javamoney.moneta.format.CurrencyStyle; +import org.junit.Ignore; import org.junit.Test; import javax.money.CurrencyUnit; import javax.money.Monetary; import javax.money.MonetaryAmount; import javax.money.UnknownCurrencyException; -import javax.money.convert.ConversionQueryBuilder; import javax.money.convert.CurrencyConversion; import javax.money.convert.MonetaryConversions; import javax.money.format.AmountFormatQueryBuilder; @@ -19,7 +19,11 @@ import java.util.Arrays; import java.util.List; import java.util.Locale; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; public class JavaMoneyUnitTest { @@ -36,17 +40,16 @@ public class JavaMoneyUnitTest { @Test(expected = UnknownCurrencyException.class) public void givenCurrencyCode_whenNoExist_thanThrowsError() { Monetary.getCurrency("AAA"); - fail(); // if no exception } @Test public void givenAmounts_whenStringified_thanEquals() { CurrencyUnit usd = Monetary.getCurrency("USD"); MonetaryAmount fstAmtUSD = Monetary - .getDefaultAmountFactory() - .setCurrency(usd) - .setNumber(200) - .create(); + .getDefaultAmountFactory() + .setCurrency(usd) + .setNumber(200) + .create(); Money moneyof = Money.of(12, usd); FastMoney fastmoneyof = FastMoney.of(2, usd); @@ -59,10 +62,10 @@ public class JavaMoneyUnitTest { @Test public void givenCurrencies_whenCompared_thanNotequal() { MonetaryAmount oneDolar = Monetary - .getDefaultAmountFactory() - .setCurrency("USD") - .setNumber(1) - .create(); + .getDefaultAmountFactory() + .setCurrency("USD") + .setNumber(1) + .create(); Money oneEuro = Money.of(1, "EUR"); assertFalse(oneEuro.equals(FastMoney.of(1, "EUR"))); @@ -72,10 +75,10 @@ public class JavaMoneyUnitTest { @Test(expected = ArithmeticException.class) public void givenAmount_whenDivided_thanThrowsException() { MonetaryAmount oneDolar = Monetary - .getDefaultAmountFactory() - .setCurrency("USD") - .setNumber(1) - .create(); + .getDefaultAmountFactory() + .setCurrency("USD") + .setNumber(1) + .create(); oneDolar.divide(3); fail(); // if no exception } @@ -85,8 +88,8 @@ public class JavaMoneyUnitTest { List monetaryAmounts = Arrays.asList(Money.of(100, "CHF"), Money.of(10.20, "CHF"), Money.of(1.15, "CHF")); Money sumAmtCHF = (Money) monetaryAmounts - .stream() - .reduce(Money.of(0, "CHF"), MonetaryAmount::add); + .stream() + .reduce(Money.of(0, "CHF"), MonetaryAmount::add); assertEquals("CHF 111.35", sumAmtCHF.toString()); } @@ -97,18 +100,18 @@ public class JavaMoneyUnitTest { Money moneyof = Money.of(12, usd); MonetaryAmount fstAmtUSD = Monetary - .getDefaultAmountFactory() - .setCurrency(usd) - .setNumber(200.50) - .create(); + .getDefaultAmountFactory() + .setCurrency(usd) + .setNumber(200.50) + .create(); MonetaryAmount oneDolar = Monetary - .getDefaultAmountFactory() - .setCurrency("USD") - .setNumber(1) - .create(); + .getDefaultAmountFactory() + .setCurrency("USD") + .setNumber(1) + .create(); Money subtractedAmount = Money - .of(1, "USD") - .subtract(fstAmtUSD); + .of(1, "USD") + .subtract(fstAmtUSD); MonetaryAmount multiplyAmount = oneDolar.multiply(0.25); MonetaryAmount divideAmount = oneDolar.divide(0.25); @@ -124,22 +127,23 @@ public class JavaMoneyUnitTest { @Test public void givenAmount_whenRounded_thanEquals() { MonetaryAmount fstAmtEUR = Monetary - .getDefaultAmountFactory() - .setCurrency("EUR") - .setNumber(1.30473908) - .create(); + .getDefaultAmountFactory() + .setCurrency("EUR") + .setNumber(1.30473908) + .create(); MonetaryAmount roundEUR = fstAmtEUR.with(Monetary.getDefaultRounding()); assertEquals("EUR 1.30473908", fstAmtEUR.toString()); assertEquals("EUR 1.3", roundEUR.toString()); } @Test + @Ignore("Currency providers are not always available") public void givenAmount_whenConversion_thenNotNull() { MonetaryAmount oneDollar = Monetary - .getDefaultAmountFactory() - .setCurrency("USD") - .setNumber(1) - .create(); + .getDefaultAmountFactory() + .setCurrency("USD") + .setNumber(1) + .create(); CurrencyConversion conversionEUR = MonetaryConversions.getConversion("EUR"); @@ -152,10 +156,10 @@ public class JavaMoneyUnitTest { @Test public void givenLocale_whenFormatted_thanEquals() { MonetaryAmount oneDollar = Monetary - .getDefaultAmountFactory() - .setCurrency("USD") - .setNumber(1) - .create(); + .getDefaultAmountFactory() + .setCurrency("USD") + .setNumber(1) + .create(); MonetaryAmountFormat formatUSD = MonetaryFormats.getAmountFormat(Locale.US); String usFormatted = formatUSD.format(oneDollar); @@ -167,16 +171,16 @@ public class JavaMoneyUnitTest { @Test public void givenAmount_whenCustomFormat_thanEquals() { MonetaryAmount oneDollar = Monetary - .getDefaultAmountFactory() - .setCurrency("USD") - .setNumber(1) - .create(); + .getDefaultAmountFactory() + .setCurrency("USD") + .setNumber(1) + .create(); MonetaryAmountFormat customFormat = MonetaryFormats.getAmountFormat(AmountFormatQueryBuilder - .of(Locale.US) - .set(CurrencyStyle.NAME) - .set("pattern", "00000.00 ¤") - .build()); + .of(Locale.US) + .set(CurrencyStyle.NAME) + .set("pattern", "00000.00 ¤") + .build()); String customFormatted = customFormat.format(oneDollar); assertNotNull(customFormat); diff --git a/core-java/src/test/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorTest.java b/core-java/src/test/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorTest.java index bb446dc385..aa11aaa788 100644 --- a/core-java/src/test/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorTest.java +++ b/core-java/src/test/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorTest.java @@ -9,4 +9,4 @@ public class NoClassDefFoundErrorTest { NoClassDefFoundErrorExample sample = new NoClassDefFoundErrorExample(); sample.getClassWithInitErrors(); } -} +} \ No newline at end of file diff --git a/core-java/src/test/java/com/baeldung/regexp/EscapingCharsTest.java b/core-java/src/test/java/com/baeldung/regexp/EscapingCharsTest.java index f8dbde4c4f..47c9cfc621 100644 --- a/core-java/src/test/java/com/baeldung/regexp/EscapingCharsTest.java +++ b/core-java/src/test/java/com/baeldung/regexp/EscapingCharsTest.java @@ -1,71 +1,73 @@ package com.baeldung.regexp; -import static junit.framework.TestCase.assertEquals; -import static org.junit.Assert.assertThat; -import static org.hamcrest.CoreMatchers.*; +import org.junit.Test; + import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.junit.Test; +import static junit.framework.TestCase.assertEquals; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.not; +import static org.junit.Assert.assertThat; public class EscapingCharsTest { @Test public void givenRegexWithDot_whenMatchingStr_thenMatches() { String strInput = "foof"; String strRegex = "foo."; - + assertEquals(true, strInput.matches(strRegex)); } - + @Test public void givenRegexWithDotEsc_whenMatchingStr_thenNotMatching() { String strInput = "foof"; String strRegex = "foo\\."; - + assertEquals(false, strInput.matches(strRegex)); } - + @Test public void givenRegexWithPipeEscaped_whenSplitStr_thenSplits() { String strInput = "foo|bar|hello|world"; String strRegex = "\\Q|\\E"; - + assertEquals(4, strInput.split(strRegex).length); } - + @Test public void givenRegexWithPipeEscQuoteMeth_whenSplitStr_thenSplits() { String strInput = "foo|bar|hello|world"; String strRegex = "|"; - - assertEquals(4,strInput.split(Pattern.quote(strRegex)).length); + + assertEquals(4, strInput.split(Pattern.quote(strRegex)).length); } - + @Test public void givenRegexWithDollar_whenReplacing_thenNotReplace() { String strInput = "I gave $50 to my brother." - + "He bought candy for $35. Now he has $15 left."; + + "He bought candy for $35. Now he has $15 left."; String strRegex = "$"; String strReplacement = "£"; String output = "I gave £50 to my brother." - + "He bought candy for £35. Now he has £15 left."; + + "He bought candy for £35. Now he has £15 left."; Pattern p = Pattern.compile(strRegex); Matcher m = p.matcher(strInput); - + assertThat(output, not(equalTo(m.replaceAll(strReplacement)))); } - + @Test public void givenRegexWithDollarEsc_whenReplacing_thenReplace() { String strInput = "I gave $50 to my brother." - + "He bought candy for $35. Now he has $15 left."; + + "He bought candy for $35. Now he has $15 left."; String strRegex = "\\$"; String strReplacement = "£"; String output = "I gave £50 to my brother." - + "He bought candy for £35. Now he has £15 left."; + + "He bought candy for £35. Now he has £15 left."; Pattern p = Pattern.compile(strRegex); Matcher m = p.matcher(strInput); - - assertEquals(output,m.replaceAll(strReplacement)); + + assertEquals(output, m.replaceAll(strReplacement)); } } diff --git a/core-java/src/test/java/com/baeldung/scripting/NashornUnitTest.java b/core-java/src/test/java/com/baeldung/scripting/NashornUnitTest.java index fe1a7d4bd4..7f165cec86 100644 --- a/core-java/src/test/java/com/baeldung/scripting/NashornUnitTest.java +++ b/core-java/src/test/java/com/baeldung/scripting/NashornUnitTest.java @@ -4,7 +4,11 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import javax.script.*; +import javax.script.Bindings; +import javax.script.Invocable; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; import java.io.InputStreamReader; import java.util.List; import java.util.Map; diff --git a/core-java/src/test/java/com/baeldung/serialization/PersonUnitTest.java b/core-java/src/test/java/com/baeldung/serialization/PersonUnitTest.java index 748898ff3e..dbcdf0ec9d 100644 --- a/core-java/src/test/java/com/baeldung/serialization/PersonUnitTest.java +++ b/core-java/src/test/java/com/baeldung/serialization/PersonUnitTest.java @@ -1,6 +1,6 @@ package com.baeldung.serialization; -import static org.junit.Assert.assertTrue; +import org.junit.Test; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -8,57 +8,57 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -import org.junit.Test; +import static org.junit.Assert.assertTrue; public class PersonUnitTest { - @Test - public void whenSerializingAndDeserializing_ThenObjectIsTheSame() throws IOException, ClassNotFoundException { - Person p = new Person(); - p.setAge(20); - p.setName("Joe"); + @Test + public void whenSerializingAndDeserializing_ThenObjectIsTheSame() throws IOException, ClassNotFoundException { + Person p = new Person(); + p.setAge(20); + p.setName("Joe"); - FileOutputStream fileOutputStream = new FileOutputStream("yofile.txt"); - ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); - objectOutputStream.writeObject(p); - objectOutputStream.flush(); - objectOutputStream.close(); + FileOutputStream fileOutputStream = new FileOutputStream("yofile.txt"); + ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); + objectOutputStream.writeObject(p); + objectOutputStream.flush(); + objectOutputStream.close(); - FileInputStream fileInputStream = new FileInputStream("yofile.txt"); - ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); - Person p2 = (Person) objectInputStream.readObject(); - objectInputStream.close(); + FileInputStream fileInputStream = new FileInputStream("yofile.txt"); + ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); + Person p2 = (Person) objectInputStream.readObject(); + objectInputStream.close(); - assertTrue(p2.getAge() == p.getAge()); - assertTrue(p2.getName().equals(p.getName())); - } + assertTrue(p2.getAge() == p.getAge()); + assertTrue(p2.getName().equals(p.getName())); + } - @Test - public void whenCustomSerializingAndDeserializing_ThenObjectIsTheSame() throws IOException, ClassNotFoundException { - Person p = new Person(); - p.setAge(20); - p.setName("Joe"); + @Test + public void whenCustomSerializingAndDeserializing_ThenObjectIsTheSame() throws IOException, ClassNotFoundException { + Person p = new Person(); + p.setAge(20); + p.setName("Joe"); - Address a = new Address(); - a.setHouseNumber(1); + Address a = new Address(); + a.setHouseNumber(1); - Employee e = new Employee(); - e.setPerson(p); - e.setAddress(a); + Employee e = new Employee(); + e.setPerson(p); + e.setAddress(a); - FileOutputStream fileOutputStream = new FileOutputStream("yofile2.txt"); - ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); - objectOutputStream.writeObject(e); - objectOutputStream.flush(); - objectOutputStream.close(); + FileOutputStream fileOutputStream = new FileOutputStream("yofile2.txt"); + ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); + objectOutputStream.writeObject(e); + objectOutputStream.flush(); + objectOutputStream.close(); - FileInputStream fileInputStream = new FileInputStream("yofile2.txt"); - ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); - Employee e2 = (Employee) objectInputStream.readObject(); - objectInputStream.close(); + FileInputStream fileInputStream = new FileInputStream("yofile2.txt"); + ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); + Employee e2 = (Employee) objectInputStream.readObject(); + objectInputStream.close(); - assertTrue(e2.getPerson().getAge() == e.getPerson().getAge()); - assertTrue(e2.getAddress().getHouseNumber() == (e.getAddress().getHouseNumber())); - } + assertTrue(e2.getPerson().getAge() == e.getPerson().getAge()); + assertTrue(e2.getAddress().getHouseNumber() == (e.getAddress().getHouseNumber())); + } } diff --git a/core-java/src/test/java/com/baeldung/socket/EchoIntegrationTest.java b/core-java/src/test/java/com/baeldung/socket/EchoIntegrationTest.java index 7ac8e0a97a..2bf6d142bb 100644 --- a/core-java/src/test/java/com/baeldung/socket/EchoIntegrationTest.java +++ b/core-java/src/test/java/com/baeldung/socket/EchoIntegrationTest.java @@ -1,14 +1,14 @@ package com.baeldung.socket; -import static org.junit.Assert.assertEquals; - -import java.util.concurrent.Executors; - import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; +import java.util.concurrent.Executors; + +import static org.junit.Assert.assertEquals; + public class EchoIntegrationTest { private static final Integer PORT = 4444; diff --git a/core-java/src/test/java/com/baeldung/stackoverflowerror/CyclicDependancyManualTest.java b/core-java/src/test/java/com/baeldung/stackoverflowerror/CyclicDependancyManualTest.java index 9b86770453..1f1de9149a 100644 --- a/core-java/src/test/java/com/baeldung/stackoverflowerror/CyclicDependancyManualTest.java +++ b/core-java/src/test/java/com/baeldung/stackoverflowerror/CyclicDependancyManualTest.java @@ -1,11 +1,10 @@ package com.baeldung.stackoverflowerror; -import static org.junit.Assert.fail; import org.junit.Test; public class CyclicDependancyManualTest { @Test(expected = StackOverflowError.class) public void whenInstanciatingClassOne_thenThrowsException() { - ClassOne obj = new ClassOne(); + ClassOne obj = new ClassOne(); } } diff --git a/core-java/src/test/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationConditionManualTest.java b/core-java/src/test/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationConditionManualTest.java index 996d0e9017..3530fa1c3e 100644 --- a/core-java/src/test/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationConditionManualTest.java +++ b/core-java/src/test/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationConditionManualTest.java @@ -1,9 +1,9 @@ package com.baeldung.stackoverflowerror; -import static junit.framework.TestCase.assertEquals; -import static org.junit.Assert.fail; import org.junit.Test; +import static junit.framework.TestCase.assertEquals; + public class InfiniteRecursionWithTerminationConditionManualTest { @Test public void givenPositiveIntNoOne_whenCalcFact_thenCorrectlyCalc() { @@ -23,9 +23,9 @@ public class InfiniteRecursionWithTerminationConditionManualTest { @Test(expected = StackOverflowError.class) public void givenNegativeInt_whenCalcFact_thenThrowsException() { - int numToCalcFactorial = -1; - InfiniteRecursionWithTerminationCondition irtc = new InfiniteRecursionWithTerminationCondition(); + int numToCalcFactorial = -1; + InfiniteRecursionWithTerminationCondition irtc = new InfiniteRecursionWithTerminationCondition(); - irtc.calculateFactorial(numToCalcFactorial); + irtc.calculateFactorial(numToCalcFactorial); } } diff --git a/core-java/src/test/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationConditionManualTest.java b/core-java/src/test/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationConditionManualTest.java index a4269aef56..858cec2ffa 100644 --- a/core-java/src/test/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationConditionManualTest.java +++ b/core-java/src/test/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationConditionManualTest.java @@ -1,9 +1,9 @@ package com.baeldung.stackoverflowerror; -import static junit.framework.TestCase.assertEquals; - import org.junit.Test; +import static junit.framework.TestCase.assertEquals; + public class RecursionWithCorrectTerminationConditionManualTest { @Test public void givenNegativeInt_whenCalcFact_thenCorrectlyCalc() { diff --git a/core-java/src/test/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursionManualTest.java b/core-java/src/test/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursionManualTest.java index 65126efff2..1e1c245d4d 100644 --- a/core-java/src/test/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursionManualTest.java +++ b/core-java/src/test/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursionManualTest.java @@ -6,25 +6,25 @@ import org.junit.Test; public class UnintendedInfiniteRecursionManualTest { @Test(expected = StackOverflowError.class) public void givenPositiveIntNoOne_whenCalFact_thenThrowsException() { - int numToCalcFactorial= 1; + int numToCalcFactorial = 1; UnintendedInfiniteRecursion uir = new UnintendedInfiniteRecursion(); - + uir.calculateFactorial(numToCalcFactorial); } - + @Test(expected = StackOverflowError.class) public void givenPositiveIntGtOne_whenCalcFact_thenThrowsException() { - int numToCalcFactorial= 2; + int numToCalcFactorial = 2; UnintendedInfiniteRecursion uir = new UnintendedInfiniteRecursion(); - + uir.calculateFactorial(numToCalcFactorial); } - + @Test(expected = StackOverflowError.class) public void givenNegativeInt_whenCalcFact_thenThrowsException() { - int numToCalcFactorial= -1; + int numToCalcFactorial = -1; UnintendedInfiniteRecursion uir = new UnintendedInfiniteRecursion(); - + uir.calculateFactorial(numToCalcFactorial); } } diff --git a/core-java/src/test/java/com/baeldung/strategy/StrategyDesignPatternUnitTest.java b/core-java/src/test/java/com/baeldung/strategy/StrategyDesignPatternUnitTest.java index 7ca1d000be..2238012e20 100644 --- a/core-java/src/test/java/com/baeldung/strategy/StrategyDesignPatternUnitTest.java +++ b/core-java/src/test/java/com/baeldung/strategy/StrategyDesignPatternUnitTest.java @@ -7,7 +7,9 @@ import java.util.Arrays; import java.util.List; import java.util.function.Function; -import static com.baeldung.strategy.Discounter.*; +import static com.baeldung.strategy.Discounter.christmas; +import static com.baeldung.strategy.Discounter.easter; +import static com.baeldung.strategy.Discounter.newYear; import static org.assertj.core.api.Assertions.assertThat; public class StrategyDesignPatternUnitTest { @@ -26,7 +28,7 @@ public class StrategyDesignPatternUnitTest { public void shouldDivideByTwo_WhenApplyingStaffDiscounterWithAnonyousTypes() { Discounter staffDiscounter = new Discounter() { @Override - public BigDecimal apply( BigDecimal amount) { + public BigDecimal apply(BigDecimal amount) { return amount.multiply(BigDecimal.valueOf(0.5)); } }; diff --git a/core-java/src/test/java/com/baeldung/stream/InfiniteStreamUnitTest.java b/core-java/src/test/java/com/baeldung/stream/InfiniteStreamUnitTest.java index fa482b8dfe..84c8992557 100644 --- a/core-java/src/test/java/com/baeldung/stream/InfiniteStreamUnitTest.java +++ b/core-java/src/test/java/com/baeldung/stream/InfiniteStreamUnitTest.java @@ -5,7 +5,6 @@ import org.junit.Test; import java.util.Arrays; import java.util.List; -import java.util.Random; import java.util.UUID; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -22,8 +21,8 @@ public class InfiniteStreamUnitTest { //when List collect = infiniteStream - .limit(10) - .collect(Collectors.toList()); + .limit(10) + .collect(Collectors.toList()); //then assertEquals(collect, Arrays.asList(0, 2, 4, 6, 8, 10, 12, 14, 16, 18)); @@ -37,9 +36,9 @@ public class InfiniteStreamUnitTest { //when List randomInts = infiniteStreamOfRandomUUID - .skip(10) - .limit(10) - .collect(Collectors.toList()); + .skip(10) + .limit(10) + .collect(Collectors.toList()); //then assertEquals(randomInts.size(), 10); diff --git a/core-java/src/test/java/com/baeldung/stream/StreamAddUnitTest.java b/core-java/src/test/java/com/baeldung/stream/StreamAddUnitTest.java index 8176d6a60c..d0745b8bc9 100644 --- a/core-java/src/test/java/com/baeldung/stream/StreamAddUnitTest.java +++ b/core-java/src/test/java/com/baeldung/stream/StreamAddUnitTest.java @@ -1,10 +1,12 @@ package com.baeldung.stream; +import org.junit.Test; + import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; + import static org.junit.Assert.assertEquals; -import org.junit.Test; public class StreamAddUnitTest { @@ -25,7 +27,7 @@ public class StreamAddUnitTest { Stream newStream = Stream.concat(Stream.of(99), anStream); assertEquals(newStream.findFirst() - .get(), (Integer) 99); + .get(), (Integer) 99); } @Test @@ -38,7 +40,7 @@ public class StreamAddUnitTest { assertEquals(resultList.get(3), (Double) 9.9); } - public Stream insertInStream(Stream stream, T elem, int index) { + private Stream insertInStream(Stream stream, T elem, int index) { List result = stream.collect(Collectors.toList()); result.add(index, elem); return result.stream(); diff --git a/core-java/src/test/java/com/baeldung/stream/StreamApiTest.java b/core-java/src/test/java/com/baeldung/stream/StreamApiTest.java index 68b5fc83a5..f4d0ac6b08 100644 --- a/core-java/src/test/java/com/baeldung/stream/StreamApiTest.java +++ b/core-java/src/test/java/com/baeldung/stream/StreamApiTest.java @@ -20,13 +20,13 @@ public class StreamApiTest { assertEquals("Sean", last); } - + @Test public void givenInfiniteStream_whenGetInfiniteStreamLastElementUsingReduce_thenReturnLastElement() { int last = StreamApi.getInfiniteStreamLastElementUsingReduce(); assertEquals(19, last); } - + @Test public void givenListAndCount_whenGetLastElementUsingSkip_thenReturnLastElement() { List valueList = new ArrayList<>(); diff --git a/core-java/src/test/java/com/baeldung/string/JoinerSplitterUnitTest.java b/core-java/src/test/java/com/baeldung/string/JoinerSplitterUnitTest.java index d58c1026d0..8901bcf9db 100644 --- a/core-java/src/test/java/com/baeldung/string/JoinerSplitterUnitTest.java +++ b/core-java/src/test/java/com/baeldung/string/JoinerSplitterUnitTest.java @@ -1,68 +1,66 @@ package com.baeldung.string; -import static org.junit.Assert.*; +import org.junit.Test; import java.util.ArrayList; import java.util.List; -import org.junit.Test; - -import com.baeldung.string.JoinerSplitter; +import static org.junit.Assert.assertEquals; public class JoinerSplitterUnitTest { - @Test - public void provided_array_convert_to_stream_and_convert_to_string() { + @Test + public void provided_array_convert_to_stream_and_convert_to_string() { - String[] programming_languages = {"java", "python", "nodejs", "ruby"}; + String[] programming_languages = {"java", "python", "nodejs", "ruby"}; - String expectation = "java,python,nodejs,ruby"; - - String result = JoinerSplitter.join(programming_languages); - assertEquals(result, expectation); - } - - @Test - public void givenArray_transformedToStream_convertToPrefixPostfixString() { + String expectation = "java,python,nodejs,ruby"; - String[] programming_languages = {"java", "python", - "nodejs", "ruby"}; - String expectation = "[java,python,nodejs,ruby]"; - - String result = JoinerSplitter.joinWithPrefixPostFix(programming_languages); - assertEquals(result, expectation); - } - - @Test - public void givenString_transformedToStream_convertToList() { + String result = JoinerSplitter.join(programming_languages); + assertEquals(result, expectation); + } - String programming_languages = "java,python,nodejs,ruby"; - - List expectation = new ArrayList(); - expectation.add("java"); - expectation.add("python"); - expectation.add("nodejs"); - expectation.add("ruby"); - - List result = JoinerSplitter.split(programming_languages); - - assertEquals(result, expectation); - } - - @Test - public void givenString_transformedToStream_convertToListOfChar() { + @Test + public void givenArray_transformedToStream_convertToPrefixPostfixString() { + + String[] programming_languages = {"java", "python", + "nodejs", "ruby"}; + String expectation = "[java,python,nodejs,ruby]"; + + String result = JoinerSplitter.joinWithPrefixPostFix(programming_languages); + assertEquals(result, expectation); + } + + @Test + public void givenString_transformedToStream_convertToList() { + + String programming_languages = "java,python,nodejs,ruby"; + + List expectation = new ArrayList(); + expectation.add("java"); + expectation.add("python"); + expectation.add("nodejs"); + expectation.add("ruby"); + + List result = JoinerSplitter.split(programming_languages); + + assertEquals(result, expectation); + } + + @Test + public void givenString_transformedToStream_convertToListOfChar() { + + String programming_languages = "java,python,nodejs,ruby"; + + List expectation = new ArrayList(); + char[] charArray = programming_languages.toCharArray(); + for (char c : charArray) { + expectation.add(c); + } + + List result = JoinerSplitter.splitToListOfChar(programming_languages); + assertEquals(result, expectation); + + } - String programming_languages = "java,python,nodejs,ruby"; - - List expectation = new ArrayList(); - char[] charArray = programming_languages.toCharArray(); - for (char c : charArray) { - expectation.add(c); - } - - List result = JoinerSplitter.splitToListOfChar(programming_languages); - assertEquals(result, expectation); - - } - } diff --git a/core-java/src/test/java/com/baeldung/string/SplitUnitTest.java b/core-java/src/test/java/com/baeldung/string/SplitUnitTest.java index 5d8703db1a..83fd253b97 100644 --- a/core-java/src/test/java/com/baeldung/string/SplitUnitTest.java +++ b/core-java/src/test/java/com/baeldung/string/SplitUnitTest.java @@ -2,7 +2,6 @@ package com.baeldung.string; import com.google.common.base.Splitter; import org.apache.commons.lang.StringUtils; -import org.assertj.core.util.Lists; import org.junit.Test; import java.util.List; diff --git a/core-java/src/test/java/com/baeldung/string/StringHelperUnitTest.java b/core-java/src/test/java/com/baeldung/string/StringHelperUnitTest.java index 427f02ba16..917ed1c937 100644 --- a/core-java/src/test/java/com/baeldung/string/StringHelperUnitTest.java +++ b/core-java/src/test/java/com/baeldung/string/StringHelperUnitTest.java @@ -1,9 +1,10 @@ package com.baeldung.string; +import org.apache.commons.lang3.StringUtils; +import org.junit.Test; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; -import org.apache.commons.lang3.StringUtils; -import org.junit.Test; public class StringHelperUnitTest { @@ -67,7 +68,7 @@ public class StringHelperUnitTest { assertEquals("abc", StringHelper.removeLastCharOptional(WHITE_SPACE_AT_THE_END_STRING)); assertEquals("abc", StringHelper.removeLastCharRegexOptional(WHITE_SPACE_AT_THE_END_STRING)); } - + @Test public void givenStringWithNewLineAtTheEnd_whenSubstring_thenGetStringWithoutNewLine() { assertEquals("abc", StringHelper.removeLastChar(NEW_LINE_AT_THE_END_STRING)); @@ -78,7 +79,7 @@ public class StringHelperUnitTest { assertEquals("abc", StringHelper.removeLastCharOptional(NEW_LINE_AT_THE_END_STRING)); assertNotEquals("abc", StringHelper.removeLastCharRegexOptional(NEW_LINE_AT_THE_END_STRING)); } - + @Test public void givenMultiLineString_whenSubstring_thenGetStringWithoutNewLine() { assertEquals("abc\nde", StringHelper.removeLastChar(MULTIPLE_LINES_STRING)); diff --git a/core-java/src/test/java/com/baeldung/temporaladjusters/CustomTemporalAdjusterTest.java b/core-java/src/test/java/com/baeldung/temporaladjusters/CustomTemporalAdjusterTest.java new file mode 100644 index 0000000000..a7acc9f743 --- /dev/null +++ b/core-java/src/test/java/com/baeldung/temporaladjusters/CustomTemporalAdjusterTest.java @@ -0,0 +1,56 @@ +package com.baeldung.temporaladjusters; + +import java.time.DayOfWeek; +import java.time.LocalDate; +import java.time.Period; +import java.time.temporal.TemporalAdjuster; +import java.time.temporal.TemporalAdjusters; + +import org.junit.Assert; +import org.junit.Test; + +import com.baeldung.temporaladjuster.CustomTemporalAdjuster; + +public class CustomTemporalAdjusterTest { + + @Test + public void whenAdjustAndImplementInterface_thenNextWorkingDay() { + LocalDate localDate = LocalDate.of(2017, 07, 8); + CustomTemporalAdjuster temporalAdjuster = new CustomTemporalAdjuster(); + LocalDate nextWorkingDay = localDate.with(temporalAdjuster); + + Assert.assertEquals("2017-07-10", nextWorkingDay.toString()); + } + + @Test + public void whenAdjust_thenNextWorkingDay() { + LocalDate localDate = LocalDate.of(2017, 07, 8); + TemporalAdjuster temporalAdjuster = NEXT_WORKING_DAY; + LocalDate date = localDate.with(temporalAdjuster); + + Assert.assertEquals("2017-07-10", date.toString()); + } + + @Test + public void whenAdjust_thenFourteenDaysAfterDate() { + LocalDate localDate = LocalDate.of(2017, 07, 8); + TemporalAdjuster temporalAdjuster = (t) -> t.plus(Period.ofDays(14)); + LocalDate result = localDate.with(temporalAdjuster); + + String fourteenDaysAfterDate = "2017-07-22"; + + Assert.assertEquals(fourteenDaysAfterDate, result.toString()); + } + + static TemporalAdjuster NEXT_WORKING_DAY = TemporalAdjusters.ofDateAdjuster(date -> { + DayOfWeek dayOfWeek = date.getDayOfWeek(); + int daysToAdd; + if (dayOfWeek == DayOfWeek.FRIDAY) + daysToAdd = 3; + else if (dayOfWeek == DayOfWeek.SATURDAY) + daysToAdd = 2; + else + daysToAdd = 1; + return date.plusDays(daysToAdd); + }); +} diff --git a/core-java/src/test/java/com/baeldung/temporaladjusters/TemporalAdjustersTest.java b/core-java/src/test/java/com/baeldung/temporaladjusters/TemporalAdjustersTest.java new file mode 100644 index 0000000000..d06da5a782 --- /dev/null +++ b/core-java/src/test/java/com/baeldung/temporaladjusters/TemporalAdjustersTest.java @@ -0,0 +1,22 @@ +package com.baeldung.temporaladjusters; + +import java.time.DayOfWeek; +import java.time.LocalDate; +import java.time.temporal.TemporalAdjusters; + +import org.junit.Assert; +import org.junit.Test; + +public class TemporalAdjustersTest { + + @Test + public void whenAdjust_thenNextSunday() { + LocalDate localDate = LocalDate.of(2017, 07, 8); + LocalDate nextSunday = localDate.with(TemporalAdjusters.next(DayOfWeek.SUNDAY)); + + String expected = "2017-07-09"; + + Assert.assertEquals(expected, nextSunday.toString()); + } + +} diff --git a/core-java/src/test/java/com/baeldung/unsafe/OffHeapArray.java b/core-java/src/test/java/com/baeldung/unsafe/OffHeapArray.java index f5cab88f3d..2f18c38bc7 100644 --- a/core-java/src/test/java/com/baeldung/unsafe/OffHeapArray.java +++ b/core-java/src/test/java/com/baeldung/unsafe/OffHeapArray.java @@ -15,7 +15,7 @@ class OffHeapArray { return (Unsafe) f.get(null); } - public OffHeapArray(long size) throws NoSuchFieldException, IllegalAccessException { + OffHeapArray(long size) throws NoSuchFieldException, IllegalAccessException { this.size = size; address = getUnsafe().allocateMemory(size * BYTE); } @@ -32,7 +32,7 @@ class OffHeapArray { return size; } - public void freeMemory() throws NoSuchFieldException, IllegalAccessException { + void freeMemory() throws NoSuchFieldException, IllegalAccessException { getUnsafe().freeMemory(address); } diff --git a/ejb/README.md b/ejb/README.md index 08392bc80d..3b729318d4 100644 --- a/ejb/README.md +++ b/ejb/README.md @@ -1,3 +1,4 @@ ## Relevant articles: - [Guide to EJB Set-up](http://www.baeldung.com/ejb-intro) +- [Java EE Session Beans](http://www.baeldung.com/ejb-session-beans) diff --git a/guava/README.md b/guava/README.md index 56d282560b..7ab70cb01f 100644 --- a/guava/README.md +++ b/guava/README.md @@ -28,3 +28,4 @@ - [Guide to Guava ClassToInstanceMap](http://www.baeldung.com/guava-class-to-instance-map) - [Guide to Guava MinMaxPriorityQueue and EvictingQueue](http://www.baeldung.com/guava-minmax-priority-queue-and-evicting-queue) - [Guide to Mathematical Utilities in Guava](http://www.baeldung.com/guava-math) +- [Bloom Filter in Java using Guava](http://www.baeldung.com/guava-bloom-filter) diff --git a/guava/src/main/java/org/baeldung/guava/CustomEvent.java b/guava/src/main/java/org/baeldung/guava/CustomEvent.java index 2d5c3382d4..8534d7da1c 100644 --- a/guava/src/main/java/org/baeldung/guava/CustomEvent.java +++ b/guava/src/main/java/org/baeldung/guava/CustomEvent.java @@ -3,11 +3,11 @@ package org.baeldung.guava; public class CustomEvent { private String action; - public CustomEvent(String action) { + CustomEvent(String action) { this.action = action; } - public String getAction() { + String getAction() { return action; } diff --git a/guava/src/main/java/org/baeldung/guava/EventListener.java b/guava/src/main/java/org/baeldung/guava/EventListener.java index 438fcade63..60beebeea5 100644 --- a/guava/src/main/java/org/baeldung/guava/EventListener.java +++ b/guava/src/main/java/org/baeldung/guava/EventListener.java @@ -28,11 +28,11 @@ public class EventListener { eventsHandled++; } - public int getEventsHandled() { + int getEventsHandled() { return eventsHandled; } - public void resetEventsHandled() { + void resetEventsHandled() { eventsHandled = 0; } } diff --git a/guava/src/test/java/org/baeldung/guava/BloomFilterTest.java b/guava/src/test/java/org/baeldung/guava/BloomFilterTest.java new file mode 100644 index 0000000000..d7c25b7c8d --- /dev/null +++ b/guava/src/test/java/org/baeldung/guava/BloomFilterTest.java @@ -0,0 +1,54 @@ +package org.baeldung.guava; + + +import com.google.common.hash.BloomFilter; +import com.google.common.hash.Funnels; +import org.junit.Test; + +import java.util.stream.IntStream; + +import static org.assertj.core.api.Assertions.assertThat; + +public class BloomFilterTest { + + @Test + public void givenBloomFilter_whenAddNStringsToIt_thenShouldNotReturnAnyFalsePositive() { + //when + BloomFilter filter = BloomFilter.create( + Funnels.integerFunnel(), + 500, + 0.01); + + //when + filter.put(1); + filter.put(2); + filter.put(3); + + //then + // the probability that it returns true, but is actually false is 1% + assertThat(filter.mightContain(1)).isTrue(); + assertThat(filter.mightContain(2)).isTrue(); + assertThat(filter.mightContain(3)).isTrue(); + + assertThat(filter.mightContain(100)).isFalse(); + } + + @Test + public void givenBloomFilter_whenAddNStringsToItMoreThanDefinedExpectedInsertions_thenItWillReturnTrueForAlmostAllElements() { + //when + BloomFilter filter = BloomFilter.create( + Funnels.integerFunnel(), + 5, + 0.01); + + //when + IntStream.range(0, 100_000).forEach(filter::put); + + + //then + assertThat(filter.mightContain(1)).isTrue(); + assertThat(filter.mightContain(2)).isTrue(); + assertThat(filter.mightContain(3)).isTrue(); + assertThat(filter.mightContain(1_000_000)).isTrue(); + } +} diff --git a/guava/src/test/java/org/baeldung/guava/RateLimiterLongRunningUnitTest.java b/guava/src/test/java/org/baeldung/guava/RateLimiterLongRunningUnitTest.java new file mode 100644 index 0000000000..914de01a6d --- /dev/null +++ b/guava/src/test/java/org/baeldung/guava/RateLimiterLongRunningUnitTest.java @@ -0,0 +1,82 @@ +package org.baeldung.guava; + + +import com.google.common.util.concurrent.RateLimiter; +import org.junit.Test; + +import java.time.ZonedDateTime; +import java.util.concurrent.TimeUnit; +import java.util.stream.IntStream; + +import static org.assertj.core.api.Assertions.assertThat; + +public class RateLimiterLongRunningUnitTest { + + @Test + public void givenLimitedResource_whenUseRateLimiter_thenShouldLimitPermits() { + //given + RateLimiter rateLimiter = RateLimiter.create(100); + + //when + long startTime = ZonedDateTime.now().getSecond(); + IntStream.range(0, 1000).forEach(i -> { + rateLimiter.acquire(); + doSomeLimitedOperation(); + }); + long elapsedTimeSeconds = ZonedDateTime.now().getSecond() - startTime; + + //then + assertThat(elapsedTimeSeconds >= 10); + } + + @Test + public void givenLimitedResource_whenRequestTwice_thenShouldPermitWithoutBlocking() { + //given + RateLimiter rateLimiter = RateLimiter.create(2); + + //when + long startTime = ZonedDateTime.now().getSecond(); + rateLimiter.acquire(1); + doSomeLimitedOperation(); + rateLimiter.acquire(1); + doSomeLimitedOperation(); + long elapsedTimeSeconds = ZonedDateTime.now().getSecond() - startTime; + + //then + assertThat(elapsedTimeSeconds <= 1); + } + + @Test + public void givenLimitedResource_whenRequestOnce_thenShouldPermitWithoutBlocking() { + //given + RateLimiter rateLimiter = RateLimiter.create(100); + + //when + long startTime = ZonedDateTime.now().getSecond(); + rateLimiter.acquire(100); + doSomeLimitedOperation(); + long elapsedTimeSeconds = ZonedDateTime.now().getSecond() - startTime; + + //then + assertThat(elapsedTimeSeconds <= 1); + } + + @Test + public void givenLimitedResource_whenTryAcquire_shouldNotBlockIndefinitely() { + //given + RateLimiter rateLimiter = RateLimiter.create(1); + + //when + rateLimiter.acquire(); + boolean result = rateLimiter.tryAcquire(2, 10, TimeUnit.MILLISECONDS); + + //then + assertThat(result).isFalse(); + + } + + private void doSomeLimitedOperation() { + //some computing + } + +} diff --git a/guava21/pom.xml b/guava21/pom.xml index d6e556e4a0..930def2a67 100644 --- a/guava21/pom.xml +++ b/guava21/pom.xml @@ -4,8 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.guava - tutorial + guava21 1.0-SNAPSHOT @@ -15,12 +14,17 @@ - com.google.guava guava 21.0 + + + org.jooq + jool + 0.9.12 + diff --git a/guava21/src/test/java/com.baeldung.guava.zip/ZipCollectionTest.java b/guava21/src/test/java/com.baeldung.guava.zip/ZipCollectionTest.java new file mode 100644 index 0000000000..866e09c6a0 --- /dev/null +++ b/guava21/src/test/java/com.baeldung.guava.zip/ZipCollectionTest.java @@ -0,0 +1,85 @@ +package com.baeldung.guava.zip; + +import com.google.common.collect.Streams; +import org.jooq.lambda.Seq; +import org.jooq.lambda.tuple.Tuple2; +import org.junit.Before; +import org.junit.Test; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import static org.junit.Assert.assertEquals; + +public class ZipCollectionTest { + + private List names; + private List ages; + private List expectedOutput; + + @Before + public void setUp() throws Exception { + names = Arrays.asList("John", "Jane", "Jack", "Dennis"); + ages = Arrays.asList(24, 25, 27); + expectedOutput = Arrays.asList("John:24", "Jane:25", "Jack:27"); + } + + @Test + public void zipCollectionUsingGuava21() { + List output = Streams + .zip(names.stream(), ages.stream(), (name, age) -> name + ":" + age) + .collect(Collectors.toList()); + + assertEquals(output, expectedOutput); + } + + @Test + public void zipCollectionUsingIntStream() { + List output = IntStream + .range(0, Math.min(names.size(), ages.size())) + .mapToObj(i -> names.get(i) + ":" + ages.get(i)) + .collect(Collectors.toList()); + + assertEquals(output, expectedOutput); + } + + @Test + public void zipCollectionUsingJool() { + Seq output = Seq + .of("John", "Jane", "Jack") + .zip(Seq.of(24, 25, 27), (x, y) -> x + ":" + y); + + assertEquals(output.toList(), expectedOutput); + } + + @Test + public void zipCollectionUsingJoolTuple() { + Seq> output = Seq + .of("John", "Jane", "Dennis") + .zip(Seq.of(24, 25, 27)); + + Tuple2 element1 = new Tuple2("John", 24); + Tuple2 element2 = new Tuple2("Jane", 25); + Tuple2 element3 = new Tuple2("Dennis", 27); + + List expectedOutput = Arrays.asList(element1, element2, element3); + assertEquals(output.collect(Collectors.toList()), expectedOutput); + } + + @Test + public void zipCollectionUsingJoolWithIndex() { + Seq> output = Seq + .of("John", "Jane", "Dennis") + .zipWithIndex(); + + Tuple2 element1 = new Tuple2<>("John", 0L); + Tuple2 element2 = new Tuple2<>("Jane", 1L); + Tuple2 element3 = new Tuple2<>("Dennis", 2L); + + List expectedOutput = Arrays.asList(element1, element2, element3); + assertEquals(output.collect(Collectors.toList()), expectedOutput); + } + +} \ No newline at end of file diff --git a/guava21/src/test/java/AtomicLongMapIntegrationTest.java b/guava21/src/test/java/com/baeldung/guava/tutorial/AtomicLongMapIntegrationTest.java similarity index 97% rename from guava21/src/test/java/AtomicLongMapIntegrationTest.java rename to guava21/src/test/java/com/baeldung/guava/tutorial/AtomicLongMapIntegrationTest.java index 9024329a56..273683710c 100644 --- a/guava21/src/test/java/AtomicLongMapIntegrationTest.java +++ b/guava21/src/test/java/com/baeldung/guava/tutorial/AtomicLongMapIntegrationTest.java @@ -1,3 +1,5 @@ +package com.baeldung.guava.tutorial; + import com.google.common.util.concurrent.AtomicLongMap; import org.junit.Test; diff --git a/guava21/src/test/java/ComparatorsUnitTest.java b/guava21/src/test/java/com/baeldung/guava/tutorial/ComparatorsUnitTest.java similarity index 98% rename from guava21/src/test/java/ComparatorsUnitTest.java rename to guava21/src/test/java/com/baeldung/guava/tutorial/ComparatorsUnitTest.java index 3d1f2e9e81..0183e6cf3a 100644 --- a/guava21/src/test/java/ComparatorsUnitTest.java +++ b/guava21/src/test/java/com/baeldung/guava/tutorial/ComparatorsUnitTest.java @@ -1,3 +1,5 @@ +package com.baeldung.guava.tutorial; + import com.google.common.collect.Comparators; import org.junit.Assert; import org.junit.Test; diff --git a/guava21/src/test/java/GuavaStreamsUnitTest.java b/guava21/src/test/java/com/baeldung/guava/tutorial/GuavaStreamsUnitTest.java similarity index 50% rename from guava21/src/test/java/GuavaStreamsUnitTest.java rename to guava21/src/test/java/com/baeldung/guava/tutorial/GuavaStreamsUnitTest.java index 96b4a2ffdb..3d3163cba6 100644 --- a/guava21/src/test/java/GuavaStreamsUnitTest.java +++ b/guava21/src/test/java/com/baeldung/guava/tutorial/GuavaStreamsUnitTest.java @@ -1,21 +1,33 @@ +package com.baeldung.guava.tutorial; + import com.google.common.collect.Streams; -import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import java.util.*; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.OptionalDouble; +import java.util.OptionalInt; +import java.util.OptionalLong; +import java.util.stream.Collectors; import java.util.stream.DoubleStream; import java.util.stream.IntStream; import java.util.stream.LongStream; import java.util.stream.Stream; +import static com.baeldung.guava.tutorial.StreamUtility.assertStreamEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + public class GuavaStreamsUnitTest { - List numbers; + private List numbers; @Before public void setUp() { - numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20); + numbers = IntStream.rangeClosed(1, 20).boxed().collect(Collectors.toList()); } @Test @@ -24,17 +36,17 @@ public class GuavaStreamsUnitTest { Stream streamFromCollection = Streams.stream(numbers); //Assert.assertNotNull(streamFromCollection); - StreamUtility.assertStreamEquals(streamFromCollection, numbers.stream()); + assertStreamEquals(streamFromCollection, numbers.stream()); } @Test public void createStreamsWithIterable() { - Iterable numbersIterable = (Iterable) numbers; + Iterable numbersIterable = numbers; Stream streamFromIterable = Streams.stream(numbersIterable); - Assert.assertNotNull(streamFromIterable); - StreamUtility.assertStreamEquals(streamFromIterable, numbers.stream()); + assertNotNull(streamFromIterable); + assertStreamEquals(streamFromIterable, numbers.stream()); } @Test @@ -43,8 +55,8 @@ public class GuavaStreamsUnitTest { Stream streamFromIterator = Streams.stream(numbersIterator); - Assert.assertNotNull(streamFromIterator); - StreamUtility.assertStreamEquals(streamFromIterator, numbers.stream()); + assertNotNull(streamFromIterator); + assertStreamEquals(streamFromIterator, numbers.stream()); } @Test @@ -52,8 +64,8 @@ public class GuavaStreamsUnitTest { Stream streamFromOptional = Streams.stream(Optional.of(1)); - Assert.assertNotNull(streamFromOptional); - Assert.assertEquals(streamFromOptional.count(), 1); + assertNotNull(streamFromOptional); + assertEquals(streamFromOptional.count(), 1); } @Test @@ -61,8 +73,8 @@ public class GuavaStreamsUnitTest { LongStream streamFromOptionalLong = Streams.stream(OptionalLong.of(1)); - Assert.assertNotNull(streamFromOptionalLong); - Assert.assertEquals(streamFromOptionalLong.count(), 1); + assertNotNull(streamFromOptionalLong); + assertEquals(streamFromOptionalLong.count(), 1); } @Test @@ -71,7 +83,7 @@ public class GuavaStreamsUnitTest { IntStream streamFromOptionalInt = Streams.stream(OptionalInt.of(1)); //Assert.assertNotNull(streamFromOptionalInt); - Assert.assertEquals(streamFromOptionalInt.count(), 1); + assertEquals(streamFromOptionalInt.count(), 1); } @Test @@ -80,63 +92,54 @@ public class GuavaStreamsUnitTest { DoubleStream streamFromOptionalDouble = Streams.stream(OptionalDouble.of(1.0)); //Assert.assertNotNull(streamFromOptionalDouble); - Assert.assertEquals(streamFromOptionalDouble.count(), 1); + assertEquals(streamFromOptionalDouble.count(), 1); } @Test public void concatStreamsOfSameType() { - Stream oddNumbers = Arrays - .asList(1, 3, 5, 7, 9, 11, 13, 15, 17, 19) - .stream(); - Stream evenNumbers = Arrays - .asList(2, 4, 6, 8, 10, 12, 14, 16, 18, 20) - .stream(); + List oddNumbers = Arrays + .asList(1, 3, 5, 7, 9, 11, 13, 15, 17, 19); + List evenNumbers = Arrays + .asList(2, 4, 6, 8, 10, 12, 14, 16, 18, 20); - Stream combinedStreams = Streams.concat(oddNumbers, evenNumbers); + Stream combinedStreams = Streams.concat(oddNumbers.stream(), evenNumbers.stream()); //Assert.assertNotNull(combinedStreams); - StreamUtility.assertStreamEquals(combinedStreams, Stream.concat(oddNumbers, evenNumbers)); + assertStreamEquals(combinedStreams, Stream.concat(oddNumbers.stream(), evenNumbers.stream())); } @Test public void concatStreamsOfTypeLongStream() { - LongStream firstTwenty = LongStream.range(1, 20); - LongStream nextTwenty = LongStream.range(21, 40); + LongStream combinedStreams = Streams.concat(LongStream.range(1, 21), LongStream.range(21, 40)); - LongStream combinedStreams = Streams.concat(firstTwenty, nextTwenty); - - Assert.assertNotNull(combinedStreams); - StreamUtility.assertStreamEquals(combinedStreams, LongStream.concat(firstTwenty, nextTwenty)); + assertNotNull(combinedStreams); + assertStreamEquals(combinedStreams, LongStream.range(1, 40)); } @Test public void concatStreamsOfTypeIntStream() { - IntStream firstTwenty = IntStream.range(1, 20); - IntStream nextTwenty = IntStream.range(21, 40); + IntStream combinedStreams = Streams.concat(IntStream.range(1, 20), IntStream.range(21, 40)); - IntStream combinedStreams = Streams.concat(firstTwenty, nextTwenty); - - Assert.assertNotNull(combinedStreams); - StreamUtility.assertStreamEquals(combinedStreams, IntStream.concat(firstTwenty, nextTwenty)); + assertNotNull(combinedStreams); + assertStreamEquals(combinedStreams, IntStream.concat(IntStream.range(1, 20), IntStream.range(21, 40))); } @Test public void findLastOfStream() { Optional lastElement = Streams.findLast(numbers.stream()); - Assert.assertNotNull(lastElement.get()); - Assert.assertEquals(lastElement.get(), numbers.get(20)); + assertEquals(lastElement.get(), numbers.get(19)); } @Test public void mapWithIndexTest() { - Stream stringSream = Stream.of("a", "b", "c"); + Stream stringStream = Stream.of("a", "b", "c"); - Stream mappedStream = Streams.mapWithIndex(stringSream, (str, index) -> str + ":" + index); + Stream mappedStream = Streams.mapWithIndex(stringStream, (str, index) -> str + ":" + index); //Assert.assertNotNull(mappedStream); - Assert.assertEquals(mappedStream + assertEquals(mappedStream .findFirst() .get(), "a:0"); @@ -144,12 +147,12 @@ public class GuavaStreamsUnitTest { @Test public void streamsZipTest() { - Stream stringSream = Stream.of("a", "b", "c"); - Stream intStream = Stream.of(1, 2, 3); + Stream stringSream = Stream.of("a", "b", "c"); + Stream intStream = Stream.of(1, 2, 3); Stream mappedStream = Streams.zip(stringSream, intStream, (str, index) -> str + ":" + index); //Assert.assertNotNull(mappedStream); - Assert.assertEquals(mappedStream + assertEquals(mappedStream .findFirst() .get(), "a:1"); diff --git a/guava21/src/test/java/InternBuilderUnitTest.java b/guava21/src/test/java/com/baeldung/guava/tutorial/InternBuilderUnitTest.java similarity index 91% rename from guava21/src/test/java/InternBuilderUnitTest.java rename to guava21/src/test/java/com/baeldung/guava/tutorial/InternBuilderUnitTest.java index 183e3eeb43..13d8f5f3b7 100644 --- a/guava21/src/test/java/InternBuilderUnitTest.java +++ b/guava21/src/test/java/com/baeldung/guava/tutorial/InternBuilderUnitTest.java @@ -1,3 +1,5 @@ +package com.baeldung.guava.tutorial; + import com.google.common.collect.Interner; import com.google.common.collect.Interners; import org.junit.Assert; diff --git a/guava21/src/test/java/MonitorUnitTest.java b/guava21/src/test/java/com/baeldung/guava/tutorial/MonitorUnitTest.java similarity index 97% rename from guava21/src/test/java/MonitorUnitTest.java rename to guava21/src/test/java/com/baeldung/guava/tutorial/MonitorUnitTest.java index e29d4a1eeb..a3a9a4f838 100644 --- a/guava21/src/test/java/MonitorUnitTest.java +++ b/guava21/src/test/java/com/baeldung/guava/tutorial/MonitorUnitTest.java @@ -1,3 +1,5 @@ +package com.baeldung.guava.tutorial; + import com.google.common.util.concurrent.Monitor; import org.junit.Assert; import org.junit.Test; diff --git a/guava21/src/test/java/MoreCollectorsUnitTest.java b/guava21/src/test/java/com/baeldung/guava/tutorial/MoreCollectorsUnitTest.java similarity index 95% rename from guava21/src/test/java/MoreCollectorsUnitTest.java rename to guava21/src/test/java/com/baeldung/guava/tutorial/MoreCollectorsUnitTest.java index 5950997788..acd03022d2 100644 --- a/guava21/src/test/java/MoreCollectorsUnitTest.java +++ b/guava21/src/test/java/com/baeldung/guava/tutorial/MoreCollectorsUnitTest.java @@ -1,3 +1,5 @@ +package com.baeldung.guava.tutorial; + import com.google.common.collect.MoreCollectors; import org.junit.Assert; import org.junit.Test; diff --git a/guava21/src/test/java/StreamUtility.java b/guava21/src/test/java/com/baeldung/guava/tutorial/StreamUtility.java similarity index 97% rename from guava21/src/test/java/StreamUtility.java rename to guava21/src/test/java/com/baeldung/guava/tutorial/StreamUtility.java index 1eb866fb88..b730fbf558 100644 --- a/guava21/src/test/java/StreamUtility.java +++ b/guava21/src/test/java/com/baeldung/guava/tutorial/StreamUtility.java @@ -1,3 +1,5 @@ +package com.baeldung.guava.tutorial; + import org.junit.Assert; import java.util.Iterator; diff --git a/javax-servlets/pom.xml b/javax-servlets/pom.xml index 1934102c68..7407666309 100644 --- a/javax-servlets/pom.xml +++ b/javax-servlets/pom.xml @@ -39,7 +39,7 @@ 3.1.0 - 4.5.2 + 4.5.3 \ No newline at end of file diff --git a/javax-servlets/src/test/java/com/baeldung/servlets/FormServletLiveTest.java b/javax-servlets/src/test/java/com/baeldung/servlets/FormServletLiveTest.java index dca725ae32..120a555c5b 100644 --- a/javax-servlets/src/test/java/com/baeldung/servlets/FormServletLiveTest.java +++ b/javax-servlets/src/test/java/com/baeldung/servlets/FormServletLiveTest.java @@ -1,24 +1,24 @@ package com.baeldung.servlets; -import static org.junit.Assert.assertEquals; - -import java.util.ArrayList; -import java.util.List; - import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; -import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.message.BasicNameValuePair; import org.junit.Test; +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertEquals; + public class FormServletLiveTest { @Test public void whenPostRequestUsingHttpClient_thenCorrect() throws Exception { - HttpClient client = new DefaultHttpClient(); + HttpClient client = HttpClientBuilder.create().build(); HttpPost method = new HttpPost("http://localhost:8080/calculateServlet"); List nvps = new ArrayList<>(); diff --git a/json-path/pom.xml b/json-path/pom.xml index e81bc1dcf9..8384ba68ed 100644 --- a/json-path/pom.xml +++ b/json-path/pom.xml @@ -23,6 +23,6 @@ - 2.2.0 + 2.4.0 \ No newline at end of file diff --git a/json-path/src/test/java/com/baeldung/jsonpath/introduction/OperationIntegrationTest.java b/json-path/src/test/java/com/baeldung/jsonpath/introduction/OperationIntegrationTest.java index cb5c695cd8..855f524dbe 100644 --- a/json-path/src/test/java/com/baeldung/jsonpath/introduction/OperationIntegrationTest.java +++ b/json-path/src/test/java/com/baeldung/jsonpath/introduction/OperationIntegrationTest.java @@ -1,10 +1,10 @@ package com.baeldung.jsonpath.introduction; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.not; - +import com.jayway.jsonpath.Criteria; +import com.jayway.jsonpath.DocumentContext; +import com.jayway.jsonpath.Filter; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.Predicate; import org.junit.Test; import java.io.InputStream; @@ -12,15 +12,14 @@ import java.util.List; import java.util.Map; import java.util.Scanner; -import com.jayway.jsonpath.Criteria; -import com.jayway.jsonpath.DocumentContext; -import com.jayway.jsonpath.Filter; -import com.jayway.jsonpath.JsonPath; -import com.jayway.jsonpath.Predicate; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.not; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; public class OperationIntegrationTest { - InputStream jsonInputStream = this.getClass().getClassLoader().getResourceAsStream("intro_api.json"); - String jsonDataSourceString = new Scanner(jsonInputStream, "UTF-8").useDelimiter("\\Z").next(); + private InputStream jsonInputStream = this.getClass().getClassLoader().getResourceAsStream("intro_api.json"); + private String jsonDataSourceString = new Scanner(jsonInputStream, "UTF-8").useDelimiter("\\Z").next(); @Test public void givenJsonPathWithoutPredicates_whenReading_thenCorrect() { @@ -46,12 +45,7 @@ public class OperationIntegrationTest { @Test public void givenJsonPathWithCustomizedPredicate_whenReading_thenCorrect() { - Predicate expensivePredicate = new Predicate() { - public boolean apply(PredicateContext context) { - String value = context.item(Map.class).get("price").toString(); - return Float.valueOf(value) > 20.00; - } - }; + Predicate expensivePredicate = context -> Float.valueOf(context.item(Map.class).get("price").toString()) > 20.00; List> expensive = JsonPath.parse(jsonDataSourceString).read("$['book'][?]", expensivePredicate); predicateUsageAssertionHelper(expensive); } diff --git a/json-path/src/test/java/com/baeldung/jsonpath/introduction/ServiceTest.java b/json-path/src/test/java/com/baeldung/jsonpath/introduction/ServiceTest.java index 868acac8d0..d5cfa50e80 100644 --- a/json-path/src/test/java/com/baeldung/jsonpath/introduction/ServiceTest.java +++ b/json-path/src/test/java/com/baeldung/jsonpath/introduction/ServiceTest.java @@ -1,9 +1,9 @@ package com.baeldung.jsonpath.introduction; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertEquals; -import static org.hamcrest.CoreMatchers.containsString; - +import com.jayway.jsonpath.Configuration; +import com.jayway.jsonpath.DocumentContext; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.Option; import org.junit.Test; import java.io.InputStream; @@ -13,14 +13,13 @@ import java.util.List; import java.util.Map; import java.util.Scanner; -import com.jayway.jsonpath.Configuration; -import com.jayway.jsonpath.DocumentContext; -import com.jayway.jsonpath.JsonPath; -import com.jayway.jsonpath.Option; +import static org.hamcrest.CoreMatchers.containsString; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; public class ServiceTest { - InputStream jsonInputStream = this.getClass().getClassLoader().getResourceAsStream("intro_service.json"); - String jsonString = new Scanner(jsonInputStream, "UTF-8").useDelimiter("\\Z").next(); + private InputStream jsonInputStream = this.getClass().getClassLoader().getResourceAsStream("intro_service.json"); + private String jsonString = new Scanner(jsonInputStream, "UTF-8").useDelimiter("\\Z").next(); @Test public void givenId_whenRequestingRecordData_thenSucceed() { diff --git a/junit5/README.md b/junit5/README.md index c1ff0eab63..49cd8e61a4 100644 --- a/junit5/README.md +++ b/junit5/README.md @@ -4,3 +4,4 @@ - [Guide to Dynamic Tests in Junit 5](http://www.baeldung.com/junit5-dynamic-tests) - [A Guide to @RepeatedTest in Junit 5](http://www.baeldung.com/junit-5-repeated-test) - [Guide to Dynamic Tests in Junit 5](http://www.baeldung.com/junit5-dynamic-tests) +- [A Guied to JUnit 5 Extensions](http://www.baeldung.com/junit-5-extensions) diff --git a/junit5/pom.xml b/junit5/pom.xml index 9f06ebe6a5..2316b034e9 100644 --- a/junit5/pom.xml +++ b/junit5/pom.xml @@ -9,7 +9,7 @@ junit5 Intro to JUnit 5 - + com.baeldung parent-modules @@ -19,14 +19,24 @@ UTF-8 1.8 - 5.0.0-M4 - 1.0.0-M4 + 5.0.0-M5 + 1.0.0-M5 + 4.12.0-M5 + 2.8.2 + 1.4.196 3.6.0 2.19.1 + 4.12 + + + src/test/resources + true + + maven-compiler-plugin @@ -47,6 +57,21 @@ + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + + java + + + + + com.baeldung.TestLauncher + + @@ -57,5 +82,35 @@ ${junit.jupiter.version} test + + org.junit.platform + junit-platform-runner + ${junit.platform.version} + test + + + org.junit.vintage + junit-vintage-engine + ${junit.vintage.version} + test + + + org.apache.logging.log4j + log4j-core + ${log4j2.version} + + + com.h2database + h2 + ${h2.version} + + + junit + junit + ${junit4.version} + test + + + \ No newline at end of file diff --git a/junit5/src/test/java/com/baeldung/EmployeesTest.java b/junit5/src/test/java/com/baeldung/EmployeesTest.java new file mode 100644 index 0000000000..1a6da37d72 --- /dev/null +++ b/junit5/src/test/java/com/baeldung/EmployeesTest.java @@ -0,0 +1,48 @@ +package com.baeldung; + +import java.sql.SQLException; + +import org.apache.logging.log4j.Logger; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; + +import com.baeldung.extensions.EmployeeDaoParameterResolver; +import com.baeldung.extensions.EmployeeDatabaseSetupExtension; +import com.baeldung.extensions.EnvironmentExtension; +import com.baeldung.extensions.IgnoreFileNotFoundExceptionExtension; +import com.baeldung.extensions.LoggingExtension; +import com.baeldung.helpers.Employee; +import com.baeldung.helpers.EmployeeJdbcDao; + +import static org.junit.jupiter.api.Assertions.*; + +@ExtendWith({ EnvironmentExtension.class, EmployeeDatabaseSetupExtension.class, EmployeeDaoParameterResolver.class }) +@ExtendWith(LoggingExtension.class) +@ExtendWith(IgnoreFileNotFoundExceptionExtension.class) +public class EmployeesTest { + + private EmployeeJdbcDao employeeDao; + + private Logger logger; + + public EmployeesTest(EmployeeJdbcDao employeeDao) { + this.employeeDao = employeeDao; + } + + @Test + public void whenAddEmployee_thenGetEmployee() throws SQLException { + Employee emp = new Employee(1, "john"); + employeeDao.add(emp); + assertEquals(1, employeeDao.findAll().size()); + } + + @Test + public void whenGetEmployees_thenEmptyList() throws SQLException { + assertEquals(0, employeeDao.findAll().size()); + } + + public void setLogger(Logger logger) { + this.logger = logger; + } + +} diff --git a/junit5/src/test/java/com/baeldung/TestLauncher.java b/junit5/src/test/java/com/baeldung/TestLauncher.java new file mode 100644 index 0000000000..d0354e19a9 --- /dev/null +++ b/junit5/src/test/java/com/baeldung/TestLauncher.java @@ -0,0 +1,37 @@ +package com.baeldung; + +import org.junit.platform.launcher.LauncherDiscoveryRequest; +import org.junit.platform.launcher.TestExecutionListener; +import org.junit.platform.launcher.TestPlan; +import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; +import org.junit.platform.launcher.core.LauncherFactory; +import org.junit.platform.launcher.listeners.SummaryGeneratingListener; + +import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; + +import java.io.PrintWriter; + +import org.junit.platform.launcher.Launcher; + +public class TestLauncher { + public static void main(String[] args) { + + //@formatter:off + LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request() + .selectors(selectClass("com.baeldung.EmployeesTest")) + .configurationParameter("junit.conditions.deactivate", "com.baeldung.extensions.*") + .configurationParameter("junit.extensions.autodetection.enabled", "true") + .build(); + + //@formatter:on + + TestPlan plan = LauncherFactory.create().discover(request); + Launcher launcher = LauncherFactory.create(); + SummaryGeneratingListener summaryGeneratingListener = new SummaryGeneratingListener(); + launcher.execute(request, new TestExecutionListener[] { summaryGeneratingListener }); + launcher.execute(request); + + summaryGeneratingListener.getSummary().printTo(new PrintWriter(System.out)); + + } +} diff --git a/junit5/src/test/java/com/baeldung/extensions/EmployeeDaoParameterResolver.java b/junit5/src/test/java/com/baeldung/extensions/EmployeeDaoParameterResolver.java new file mode 100644 index 0000000000..2626266454 --- /dev/null +++ b/junit5/src/test/java/com/baeldung/extensions/EmployeeDaoParameterResolver.java @@ -0,0 +1,23 @@ +package com.baeldung.extensions; + +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.ParameterContext; +import org.junit.jupiter.api.extension.ParameterResolutionException; +import org.junit.jupiter.api.extension.ParameterResolver; + +import com.baeldung.helpers.EmployeeJdbcDao; +import com.baeldung.helpers.JdbcConnectionUtil; + +public class EmployeeDaoParameterResolver implements ParameterResolver { + + @Override + public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException { + return parameterContext.getParameter().getType().equals(EmployeeJdbcDao.class); + } + + @Override + public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException { + return new EmployeeJdbcDao(JdbcConnectionUtil.getConnection()); + } + +} diff --git a/junit5/src/test/java/com/baeldung/extensions/EmployeeDatabaseSetupExtension.java b/junit5/src/test/java/com/baeldung/extensions/EmployeeDatabaseSetupExtension.java new file mode 100644 index 0000000000..69e420b28a --- /dev/null +++ b/junit5/src/test/java/com/baeldung/extensions/EmployeeDatabaseSetupExtension.java @@ -0,0 +1,46 @@ +package com.baeldung.extensions; + +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Savepoint; + +import org.junit.jupiter.api.extension.AfterAllCallback; +import org.junit.jupiter.api.extension.AfterEachCallback; +import org.junit.jupiter.api.extension.BeforeAllCallback; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; + +import com.baeldung.helpers.EmployeeJdbcDao; +import com.baeldung.helpers.JdbcConnectionUtil; + +public class EmployeeDatabaseSetupExtension implements BeforeAllCallback, AfterAllCallback, BeforeEachCallback, AfterEachCallback { + + private Connection con = JdbcConnectionUtil.getConnection(); + private EmployeeJdbcDao employeeDao = new EmployeeJdbcDao(con); + private Savepoint savepoint; + + @Override + public void afterAll(ExtensionContext context) throws SQLException { + if (con != null) { + con.close(); + } + } + + @Override + public void beforeAll(ExtensionContext context) throws SQLException { + employeeDao.createTable(); + + } + + @Override + public void afterEach(ExtensionContext context) throws SQLException { + con.rollback(savepoint); + } + + @Override + public void beforeEach(ExtensionContext context) throws SQLException { + con.setAutoCommit(false); + savepoint = con.setSavepoint("before"); + } + +} diff --git a/junit5/src/test/java/com/baeldung/extensions/EnvironmentExtension.java b/junit5/src/test/java/com/baeldung/extensions/EnvironmentExtension.java new file mode 100644 index 0000000000..e2c335799b --- /dev/null +++ b/junit5/src/test/java/com/baeldung/extensions/EnvironmentExtension.java @@ -0,0 +1,27 @@ +package com.baeldung.extensions; + +import java.io.IOException; +import java.util.Properties; + +import org.junit.jupiter.api.extension.ConditionEvaluationResult; +import org.junit.jupiter.api.extension.ExecutionCondition; +import org.junit.jupiter.api.extension.ExtensionContext; + +public class EnvironmentExtension implements ExecutionCondition { + + @Override + public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { + Properties props = new Properties(); + + try { + props.load(EnvironmentExtension.class.getResourceAsStream("application.properties")); + String env = props.getProperty("env"); + if ("qa".equalsIgnoreCase(env)) { + return ConditionEvaluationResult.disabled("Test disabled on QA environment"); + } + } catch (IOException e) { + e.printStackTrace(); + } + return ConditionEvaluationResult.enabled("Test enabled on QA environment"); + } +} diff --git a/junit5/src/test/java/com/baeldung/extensions/IgnoreFileNotFoundExceptionExtension.java b/junit5/src/test/java/com/baeldung/extensions/IgnoreFileNotFoundExceptionExtension.java new file mode 100644 index 0000000000..7216c68c1a --- /dev/null +++ b/junit5/src/test/java/com/baeldung/extensions/IgnoreFileNotFoundExceptionExtension.java @@ -0,0 +1,23 @@ +package com.baeldung.extensions; + +import java.io.FileNotFoundException; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.TestExecutionExceptionHandler; + +public class IgnoreFileNotFoundExceptionExtension implements TestExecutionExceptionHandler { + + Logger logger = LogManager.getLogger(IgnoreFileNotFoundExceptionExtension.class); + + @Override + public void handleTestExecutionException(ExtensionContext context, Throwable throwable) throws Throwable { + + if (throwable instanceof FileNotFoundException) { + logger.error("File not found:" + throwable.getMessage()); + return; + } + throw throwable; + } +} diff --git a/junit5/src/test/java/com/baeldung/extensions/LoggingExtension.java b/junit5/src/test/java/com/baeldung/extensions/LoggingExtension.java new file mode 100644 index 0000000000..437c5c24de --- /dev/null +++ b/junit5/src/test/java/com/baeldung/extensions/LoggingExtension.java @@ -0,0 +1,16 @@ +package com.baeldung.extensions; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.TestInstancePostProcessor; + +public class LoggingExtension implements TestInstancePostProcessor { + + @Override + public void postProcessTestInstance(Object testInstance, ExtensionContext context) throws Exception { + Logger logger = LogManager.getLogger(testInstance.getClass()); + testInstance.getClass().getMethod("setLogger", Logger.class).invoke(testInstance, logger); + } + +} diff --git a/junit5/src/test/java/com/baeldung/helpers/EmployeeJdbcDao.java b/junit5/src/test/java/com/baeldung/helpers/EmployeeJdbcDao.java new file mode 100644 index 0000000000..7600f763cd --- /dev/null +++ b/junit5/src/test/java/com/baeldung/helpers/EmployeeJdbcDao.java @@ -0,0 +1,51 @@ +package com.baeldung.helpers; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EmployeeJdbcDao { + + private Connection con; + + public EmployeeJdbcDao(Connection con) { + this.con = con; + } + + public void createTable() throws SQLException { + String createQuery = "CREATE TABLE employees(id long primary key, firstName varchar(50))"; + PreparedStatement pstmt = con.prepareStatement(createQuery); + + pstmt.execute(); + } + + public void add(Employee emp) throws SQLException { + String insertQuery = "INSERT INTO employees(id, firstName) VALUES(?,?)"; + PreparedStatement pstmt = con.prepareStatement(insertQuery); + pstmt.setLong(1, emp.getId()); + pstmt.setString(2, emp.getFirstName()); + + pstmt.executeUpdate(); + + } + + public List findAll() throws SQLException { + List employees = new ArrayList<>(); + String query = "SELECT * FROM employees"; + PreparedStatement pstmt = con.prepareStatement(query); + + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) { + Employee emp = new Employee(rs.getLong("id"), rs.getString("firstName")); + employees.add(emp); + } + + return employees; + } +} \ No newline at end of file diff --git a/junit5/src/test/java/com/baeldung/helpers/JdbcConnectionUtil.java b/junit5/src/test/java/com/baeldung/helpers/JdbcConnectionUtil.java new file mode 100644 index 0000000000..f380f9674c --- /dev/null +++ b/junit5/src/test/java/com/baeldung/helpers/JdbcConnectionUtil.java @@ -0,0 +1,32 @@ +package com.baeldung.helpers; + +import java.io.IOException; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.util.Properties; + +public class JdbcConnectionUtil { + + private static Connection con; + + public static Connection getConnection() { + if (con == null) { + try { + Properties props = new Properties(); + props.load(JdbcConnectionUtil.class.getResourceAsStream("jdbc.properties")); + Class.forName(props.getProperty("jdbc.driver")); + con = DriverManager.getConnection(props.getProperty("jdbc.url"), props.getProperty("jdbc.user"), props.getProperty("jdbc.password")); + return con; + } catch (IOException exc) { + exc.printStackTrace(); + } catch (ClassNotFoundException exc) { + exc.printStackTrace(); + } catch (SQLException exc) { + exc.printStackTrace(); + } + return null; + } + return con; + } +} diff --git a/junit5/src/test/java/com/baeldung/migration/junit4/AnnotationTestExampleTest.java b/junit5/src/test/java/com/baeldung/migration/junit4/AnnotationTestExampleTest.java new file mode 100644 index 0000000000..fd7fd93d66 --- /dev/null +++ b/junit5/src/test/java/com/baeldung/migration/junit4/AnnotationTestExampleTest.java @@ -0,0 +1,23 @@ +package com.baeldung.migration.junit4; + +import org.junit.Ignore; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import com.baeldung.migration.junit4.categories.Annotations; +import com.baeldung.migration.junit4.categories.JUnit4Tests; + +@Category(value = { Annotations.class, JUnit4Tests.class }) +public class AnnotationTestExampleTest { + @Test(expected = Exception.class) + public void shouldRaiseAnException() throws Exception { + throw new Exception("This is my expected exception"); + } + + @Test(timeout = 1) + @Ignore + public void shouldFailBecauseTimeout() throws InterruptedException { + Thread.sleep(10); + } + +} diff --git a/junit5/src/test/java/com/baeldung/migration/junit4/AssertionsExampleTest.java b/junit5/src/test/java/com/baeldung/migration/junit4/AssertionsExampleTest.java new file mode 100644 index 0000000000..ff2a05a8c4 --- /dev/null +++ b/junit5/src/test/java/com/baeldung/migration/junit4/AssertionsExampleTest.java @@ -0,0 +1,28 @@ +package com.baeldung.migration.junit4; + +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; +import java.util.List; + +import org.junit.Ignore; +import org.junit.Test; + +public class AssertionsExampleTest { + @Test + @Ignore + public void shouldFailBecauseTheNumbersAreNotEqualld() { + assertEquals("Numbers are not equal!", 2, 3); + } + + @Test + public void shouldAssertAllTheGroup() { + List list = Arrays.asList(1, 2, 3); + assertEquals("List is not incremental", list.get(0) + .intValue(), 1); + assertEquals("List is not incremental", list.get(1) + .intValue(), 2); + assertEquals("List is not incremental", list.get(2) + .intValue(), 3); + } +} diff --git a/junit5/src/test/java/com/baeldung/migration/junit4/RuleExampleTest.java b/junit5/src/test/java/com/baeldung/migration/junit4/RuleExampleTest.java new file mode 100644 index 0000000000..10af6a9254 --- /dev/null +++ b/junit5/src/test/java/com/baeldung/migration/junit4/RuleExampleTest.java @@ -0,0 +1,18 @@ +package com.baeldung.migration.junit4; + +import org.junit.Rule; +import org.junit.Test; + +import com.baeldung.migration.junit4.rules.TraceUnitTestRule; + +public class RuleExampleTest { + + @Rule + public final TraceUnitTestRule traceRuleTests = new TraceUnitTestRule(); + + @Test + public void whenTracingTests() { + System.out.println("This is my test"); + /*...*/ + } +} diff --git a/junit5/src/test/java/com/baeldung/migration/junit4/categories/Annotations.java b/junit5/src/test/java/com/baeldung/migration/junit4/categories/Annotations.java new file mode 100644 index 0000000000..a2b1b6bdd3 --- /dev/null +++ b/junit5/src/test/java/com/baeldung/migration/junit4/categories/Annotations.java @@ -0,0 +1,5 @@ +package com.baeldung.migration.junit4.categories; + +public interface Annotations { + +} diff --git a/junit5/src/test/java/com/baeldung/migration/junit4/categories/JUnit4Tests.java b/junit5/src/test/java/com/baeldung/migration/junit4/categories/JUnit4Tests.java new file mode 100644 index 0000000000..6af63d58ab --- /dev/null +++ b/junit5/src/test/java/com/baeldung/migration/junit4/categories/JUnit4Tests.java @@ -0,0 +1,5 @@ +package com.baeldung.migration.junit4.categories; + +public interface JUnit4Tests { + +} diff --git a/junit5/src/test/java/com/baeldung/migration/junit4/rules/TraceUnitTestRule.java b/junit5/src/test/java/com/baeldung/migration/junit4/rules/TraceUnitTestRule.java new file mode 100644 index 0000000000..5c993f17fd --- /dev/null +++ b/junit5/src/test/java/com/baeldung/migration/junit4/rules/TraceUnitTestRule.java @@ -0,0 +1,35 @@ +package com.baeldung.migration.junit4.rules; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.MultipleFailureException; +import org.junit.runners.model.Statement; + +public class TraceUnitTestRule implements TestRule { + + @Override + public Statement apply(Statement base, Description description) { + + return new Statement() { + @Override + public void evaluate() throws Throwable { + List errors = new ArrayList(); + + System.out.println("Starting test ... " + description.getMethodName()); + try { + base.evaluate(); + } catch (Throwable e) { + errors.add(e); + } finally { + System.out.println("... test finished. " + description.getMethodName()); + } + + MultipleFailureException.assertEmpty(errors); + } + }; + } + +} diff --git a/junit5/src/test/java/com/baeldung/migration/junit5/AnnotationTestExampleTest.java b/junit5/src/test/java/com/baeldung/migration/junit5/AnnotationTestExampleTest.java new file mode 100644 index 0000000000..07d8ae64e4 --- /dev/null +++ b/junit5/src/test/java/com/baeldung/migration/junit5/AnnotationTestExampleTest.java @@ -0,0 +1,28 @@ +package com.baeldung.migration.junit5; + +import java.time.Duration; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.platform.runner.JUnitPlatform; +import org.junit.runner.RunWith; + +@Tag("annotations") +@Tag("junit5") +@RunWith(JUnitPlatform.class) +public class AnnotationTestExampleTest { + @Test + public void shouldRaiseAnException() throws Exception { + Assertions.assertThrows(Exception.class, () -> { + throw new Exception("This is my expected exception"); + }); + } + + @Test + @Disabled + public void shouldFailBecauseTimeout() throws InterruptedException { + Assertions.assertTimeout(Duration.ofMillis(1), () -> Thread.sleep(10)); + } +} diff --git a/junit5/src/test/java/com/baeldung/migration/junit5/AssertionsExampleTest.java b/junit5/src/test/java/com/baeldung/migration/junit5/AssertionsExampleTest.java new file mode 100644 index 0000000000..642b7371de --- /dev/null +++ b/junit5/src/test/java/com/baeldung/migration/junit5/AssertionsExampleTest.java @@ -0,0 +1,39 @@ +package com.baeldung.migration.junit5; + +import java.util.Arrays; +import java.util.List; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.junit.platform.runner.JUnitPlatform; +import org.junit.runner.RunWith; + +@RunWith(JUnitPlatform.class) +public class AssertionsExampleTest { + @Test + @Disabled + public void shouldFailBecauseTheNumbersAreNotEqual() { + Assertions.assertEquals(2, 3, "Numbers are not equal!"); + } + + @Test + @Disabled + public void shouldFailBecauseItsNotTrue_overloading() { + Assertions.assertTrue(() -> { + return false; + }, () -> "It's not true!"); + } + + @Test + public void shouldAssertAllTheGroup() { + List list = Arrays.asList(1, 2, 3); + + Assertions.assertAll("List is not incremental", () -> Assertions.assertEquals(list.get(0) + .intValue(), 1), + () -> Assertions.assertEquals(list.get(1) + .intValue(), 2), + () -> Assertions.assertEquals(list.get(2) + .intValue(), 3)); + } +} diff --git a/junit5/src/test/java/com/baeldung/migration/junit5/RuleExampleTest.java b/junit5/src/test/java/com/baeldung/migration/junit5/RuleExampleTest.java new file mode 100644 index 0000000000..a05360250b --- /dev/null +++ b/junit5/src/test/java/com/baeldung/migration/junit5/RuleExampleTest.java @@ -0,0 +1,19 @@ +package com.baeldung.migration.junit5; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.platform.runner.JUnitPlatform; +import org.junit.runner.RunWith; + +import com.baeldung.migration.junit5.extensions.TraceUnitExtension; + +@RunWith(JUnitPlatform.class) +@ExtendWith(TraceUnitExtension.class) +public class RuleExampleTest { + + @Test + public void whenTracingTests() { + System.out.println("This is my test"); + /*...*/ + } +} diff --git a/junit5/src/test/java/com/baeldung/migration/junit5/extensions/TraceUnitExtension.java b/junit5/src/test/java/com/baeldung/migration/junit5/extensions/TraceUnitExtension.java new file mode 100644 index 0000000000..db5d3e2573 --- /dev/null +++ b/junit5/src/test/java/com/baeldung/migration/junit5/extensions/TraceUnitExtension.java @@ -0,0 +1,19 @@ +package com.baeldung.migration.junit5.extensions; + +import org.junit.jupiter.api.extension.AfterEachCallback; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; + +public class TraceUnitExtension implements AfterEachCallback, BeforeEachCallback { + + @Override + public void beforeEach(ExtensionContext context) throws Exception { + System.out.println("Starting test ... " + context.getDisplayName()); + } + + @Override + public void afterEach(ExtensionContext context) throws Exception { + System.out.println("... test finished. " + context.getDisplayName()); + } + +} diff --git a/junit5/src/test/java/com/baeldung/suites/AllTests.java b/junit5/src/test/java/com/baeldung/suites/AllTests.java index 24af1e733b..69f28373eb 100644 --- a/junit5/src/test/java/com/baeldung/suites/AllTests.java +++ b/junit5/src/test/java/com/baeldung/suites/AllTests.java @@ -1,7 +1,11 @@ package com.baeldung.suites; -//@RunWith(JUnitPlatform.class) -//@SelectPackages("com.baeldung") +import org.junit.platform.runner.JUnitPlatform; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.runner.RunWith; + +@RunWith(JUnitPlatform.class) +@SelectPackages("com.baeldung") //@SelectClasses({AssertionTest.class, AssumptionTest.class, ExceptionTest.class}) public class AllTests { diff --git a/junit5/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension b/junit5/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension new file mode 100644 index 0000000000..6bd0136b96 --- /dev/null +++ b/junit5/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension @@ -0,0 +1 @@ +com.baeldung.extensions.EmployeeDaoParameterResolver \ No newline at end of file diff --git a/junit5/src/test/resources/com/baeldung/extensions/application.properties b/junit5/src/test/resources/com/baeldung/extensions/application.properties new file mode 100644 index 0000000000..601f964ff3 --- /dev/null +++ b/junit5/src/test/resources/com/baeldung/extensions/application.properties @@ -0,0 +1 @@ +env=dev \ No newline at end of file diff --git a/junit5/src/test/resources/com/baeldung/helpers/jdbc.properties b/junit5/src/test/resources/com/baeldung/helpers/jdbc.properties new file mode 100644 index 0000000000..8783ea2375 --- /dev/null +++ b/junit5/src/test/resources/com/baeldung/helpers/jdbc.properties @@ -0,0 +1,5 @@ +#h2 db +jdbc.driver=org.h2.Driver +jdbc.url=jdbc:h2:mem:myDb;DB_CLOSE_DELAY=-1 +jdbc.user=sa +jdbc.password= \ No newline at end of file diff --git a/kotlin/README.md b/kotlin/README.md index 1408bc1ebd..6b3fb93dcc 100644 --- a/kotlin/README.md +++ b/kotlin/README.md @@ -6,3 +6,4 @@ - [Kotlin Java Interoperability](http://www.baeldung.com/kotlin-java-interoperability) - [Difference Between “==” and “===” in Kotlin](http://www.baeldung.com/kotlin-equality-operators) - [Generics in Kotlin](http://www.baeldung.com/kotlin-generics) +- [Introduction to Kotlin Coroutines](http://www.baeldung.com/kotlin-coroutines) diff --git a/kotlin/src/main/java/com/baeldung/dataclass/Movie.java b/kotlin/src/main/java/com/baeldung/dataclass/Movie.java new file mode 100644 index 0000000000..7eac98fe2a --- /dev/null +++ b/kotlin/src/main/java/com/baeldung/dataclass/Movie.java @@ -0,0 +1,88 @@ +package com.baeldung.dataclass; + +public class Movie { + + private String name; + private String studio; + private float rating; + + public Movie(String name, String studio, float rating) { + this.name = name; + this.studio = studio; + this.rating = rating; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getStudio() { + return studio; + } + + public void setStudio(String studio) { + this.studio = studio; + } + + public float getRating() { + return rating; + } + + public void setRating(float rating) { + this.rating = rating; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + Float.floatToIntBits(rating); + result = prime * result + ((studio == null) ? 0 : studio.hashCode()); + + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + + if (obj == null) + return false; + + if (getClass() != obj.getClass()) + return false; + + Movie other = (Movie) obj; + + if (name == null) { + if (other.name != null) + return false; + + } else if (!name.equals(other.name)) + return false; + + if (Float.floatToIntBits(rating) != Float.floatToIntBits(other.rating)) + return false; + + if (studio == null) { + if (other.studio != null) + return false; + + } else if (!studio.equals(other.studio)) + return false; + + return true; + } + + @Override + public String toString() { + return "Movie [name=" + name + ", studio=" + studio + ", rating=" + rating + "]"; + } +} \ No newline at end of file diff --git a/kotlin/src/main/java/com/baeldung/lazy/ClassWithHeavyInitialization.java b/kotlin/src/main/java/com/baeldung/lazy/ClassWithHeavyInitialization.java new file mode 100644 index 0000000000..273749e17e --- /dev/null +++ b/kotlin/src/main/java/com/baeldung/lazy/ClassWithHeavyInitialization.java @@ -0,0 +1,14 @@ +package com.baeldung.lazy; + +public class ClassWithHeavyInitialization { + private ClassWithHeavyInitialization() { + } + + private static class LazyHolder { + public static final ClassWithHeavyInitialization INSTANCE = new ClassWithHeavyInitialization(); + } + + public static ClassWithHeavyInitialization getInstance() { + return LazyHolder.INSTANCE; + } +} \ No newline at end of file diff --git a/kotlin/src/main/kotlin/com/baeldung/dataclass/Movie.kt b/kotlin/src/main/kotlin/com/baeldung/dataclass/Movie.kt new file mode 100644 index 0000000000..c0c15b2516 --- /dev/null +++ b/kotlin/src/main/kotlin/com/baeldung/dataclass/Movie.kt @@ -0,0 +1,3 @@ +package com.baeldung.dataclass + +data class Movie(val name: String, val studio: String, var rating: Float) \ No newline at end of file diff --git a/kotlin/src/main/kotlin/com/baeldung/dataclass/Sandbox.kt b/kotlin/src/main/kotlin/com/baeldung/dataclass/Sandbox.kt new file mode 100644 index 0000000000..d47909bf29 --- /dev/null +++ b/kotlin/src/main/kotlin/com/baeldung/dataclass/Sandbox.kt @@ -0,0 +1,26 @@ +package com.baeldung.dataclass + +fun main(args: Array) { + + val movie = Movie("Whiplash", "Sony Pictures", 8.5F) + + println(movie.name) //Whiplash + println(movie.studio) //Sony Pictures + println(movie.rating) //8.5 + + movie.rating = 9F + + println(movie.toString()) //Movie(name=Whiplash, studio=Sony Pictures, rating=9.0) + + val betterRating = movie.copy(rating = 9.5F) + println(betterRating.toString()) //Movie(name=Whiplash, studio=Sony Pictures, rating=9.5) + + movie.component1() //name + movie.component2() //studio + movie.component3() //rating + + val(name, studio, rating) = movie + + fun getMovieInfo() = movie + val(namef, studiof, ratingf) = getMovieInfo() +} \ No newline at end of file diff --git a/kotlin/src/test/java/com/baeldung/kotlin/LazyJavaUnitTest.java b/kotlin/src/test/java/com/baeldung/kotlin/LazyJavaUnitTest.java new file mode 100644 index 0000000000..e2fe58d537 --- /dev/null +++ b/kotlin/src/test/java/com/baeldung/kotlin/LazyJavaUnitTest.java @@ -0,0 +1,20 @@ +package com.baeldung.kotlin; + + +import com.baeldung.lazy.ClassWithHeavyInitialization; +import org.junit.Test; + +import static junit.framework.TestCase.assertTrue; + +public class LazyJavaUnitTest { + + @Test + public void giveHeavyClass_whenInitLazy_thenShouldReturnInstanceOnFirstCall() { + //when + ClassWithHeavyInitialization classWithHeavyInitialization = ClassWithHeavyInitialization.getInstance(); + ClassWithHeavyInitialization classWithHeavyInitialization2 = ClassWithHeavyInitialization.getInstance(); + + //then + assertTrue(classWithHeavyInitialization == classWithHeavyInitialization2); + } +} diff --git a/kotlin/src/test/kotlin/com/baeldung/kotlin/CollectionsTest.kt b/kotlin/src/test/kotlin/com/baeldung/kotlin/CollectionsTest.kt new file mode 100644 index 0000000000..59d6adccac --- /dev/null +++ b/kotlin/src/test/kotlin/com/baeldung/kotlin/CollectionsTest.kt @@ -0,0 +1,146 @@ +package com.baeldung.kotlin + +import org.junit.Test +import kotlin.test.assertTrue +import kotlin.test.assertFalse +import kotlin.test.assertEquals + +class CollectionsTest { + + @Test + fun whenUseDifferentCollections_thenSuccess () { + val theList = listOf("one", "two", "three") + assertTrue(theList.contains("two")) + + val theMutableList = mutableListOf("one", "two", "three") + theMutableList.add("four") + assertTrue(theMutableList.contains("four")) + + val theSet = setOf("one", "two", "three") + assertTrue(theSet.contains("three")) + + val theMutableSet = mutableSetOf("one", "two", "three") + theMutableSet.add("four") + assertTrue(theMutableSet.contains("four")) + + val theMap = mapOf(1 to "one", 2 to "two", 3 to "three") + assertEquals(theMap[2],"two") + + val theMutableMap = mutableMapOf(1 to "one", 2 to "two", 3 to "three") + theMutableMap[4] = "four" + assertEquals(theMutableMap[4],"four") + } + + @Test + fun whenSliceCollection_thenSuccess () { + val theList = listOf("one", "two", "three") + val resultList = theList.slice(1..2) + + assertEquals(2, resultList.size) + assertTrue(resultList.contains("two")) + } + + @Test + fun whenJoinTwoCollections_thenSuccess () { + val firstList = listOf("one", "two", "three") + val secondList = listOf("four", "five", "six") + val resultList = firstList + secondList + + assertEquals(6, resultList.size) + assertTrue(resultList.contains("two")) + assertTrue(resultList.contains("five")) + } + + @Test + fun whenFilterNullValues_thenSuccess () { + val theList = listOf("one", null, "two", null, "three") + val resultList = theList.filterNotNull() + + assertEquals(3, resultList.size) + } + + @Test + fun whenFilterNonPositiveValues_thenSuccess () { + val theList = listOf(1, 2, -3, -4, 5, -6) + val resultList = theList.filter{ it > 0} + //val resultList = theList.filter{ x -> x > 0} + + assertEquals(3, resultList.size) + assertTrue(resultList.contains(1)) + assertFalse(resultList.contains(-4)) + } + + @Test + fun whenDropFirstItems_thenRemoved () { + val theList = listOf("one", "two", "three", "four") + val resultList = theList.drop(2) + + assertEquals(2, resultList.size) + assertFalse(resultList.contains("one")) + assertFalse(resultList.contains("two")) + } + + @Test + fun whenDropFirstItemsBasedOnCondition_thenRemoved () { + val theList = listOf("one", "two", "three", "four") + val resultList = theList.dropWhile{ it.length < 4 } + + assertEquals(2, resultList.size) + assertFalse(resultList.contains("one")) + assertFalse(resultList.contains("two")) + } + + @Test + fun whenExcludeItems_thenRemoved () { + val firstList = listOf("one", "two", "three") + val secondList = listOf("one", "three") + val resultList = firstList - secondList + + assertEquals(1, resultList.size) + assertTrue(resultList.contains("two")) + } + + @Test + fun whenSearchForExistingItem_thenFound () { + val theList = listOf("one", "two", "three") + + assertTrue("two" in theList) + } + + @Test + fun whenGroupItems_thenSuccess () { + val theList = listOf(1, 2, 3, 4, 5, 6) + val resultMap = theList.groupBy{ it % 3} + + assertEquals(3, resultMap.size) + print(resultMap[1]) + assertTrue(resultMap[1]!!.contains(1)) + assertTrue(resultMap[2]!!.contains(5)) + } + + @Test + fun whenApplyFunctionToAllItems_thenSuccess () { + val theList = listOf(1, 2, 3, 4, 5, 6) + val resultList = theList.map{ it * it } + print(resultList) + assertEquals(4, resultList[1]) + assertEquals(9, resultList[2]) + } + + @Test + fun whenApplyMultiOutputFunctionToAllItems_thenSuccess () { + val theList = listOf("John", "Tom") + val resultList = theList.flatMap{ it.toLowerCase().toList()} + print(resultList) + assertEquals(7, resultList.size) + assertTrue(resultList.contains('j')) + } + + @Test + fun whenApplyFunctionToAllItemsWithStartingValue_thenSuccess () { + val theList = listOf(1, 2, 3, 4, 5, 6) + val finalResult = theList.fold( 1000, { oldResult, currentItem -> oldResult + (currentItem *currentItem)}) + print(finalResult) + assertEquals(1091, finalResult) + } +} \ No newline at end of file diff --git a/kotlin/src/test/kotlin/com/baeldung/kotlin/LazyUnitTest.kt b/kotlin/src/test/kotlin/com/baeldung/kotlin/LazyUnitTest.kt new file mode 100644 index 0000000000..9e4179f4fe --- /dev/null +++ b/kotlin/src/test/kotlin/com/baeldung/kotlin/LazyUnitTest.kt @@ -0,0 +1,68 @@ +package com.baeldung.kotlin + +import org.junit.Test +import java.util.concurrent.CountDownLatch +import java.util.concurrent.Executors +import java.util.concurrent.TimeUnit +import java.util.concurrent.atomic.AtomicInteger +import kotlin.test.assertEquals + +class LazyUnitTest { + @Test + fun givenLazyValue_whenGetIt_thenShouldInitializeItOnlyOnce() { + //given + val numberOfInitializations: AtomicInteger = AtomicInteger() + val lazyValue: ClassWithHeavyInitialization by lazy { + numberOfInitializations.incrementAndGet() + ClassWithHeavyInitialization() + } + //when + println(lazyValue) + println(lazyValue) + + //then + assertEquals(numberOfInitializations.get(), 1) + } + + @Test + fun givenLazyValue_whenGetItUsingPublication_thenCouldInitializeItMoreThanOnce() { + //given + val numberOfInitializations: AtomicInteger = AtomicInteger() + val lazyValue: ClassWithHeavyInitialization by lazy(LazyThreadSafetyMode.PUBLICATION) { + numberOfInitializations.incrementAndGet() + ClassWithHeavyInitialization() + } + val executorService = Executors.newFixedThreadPool(2) + val countDownLatch = CountDownLatch(1) + //when + executorService.submit { countDownLatch.await(); println(lazyValue) } + executorService.submit { countDownLatch.await(); println(lazyValue) } + countDownLatch.countDown() + + //then + executorService.awaitTermination(1, TimeUnit.SECONDS) + executorService.shutdown() + assertEquals(numberOfInitializations.get(), 2) + } + + class ClassWithHeavyInitialization { + + } + + + lateinit var a: String + @Test + fun givenLateInitProperty_whenAccessItAfterInit_thenPass() { + //when + a = "it" + println(a) + + //then not throw + } + + @Test(expected = UninitializedPropertyAccessException::class) + fun givenLateInitProperty_whenAccessItWithoutInit_thenThrow() { + //when + println(a) + } +} \ No newline at end of file diff --git a/kotlin/src/test/kotlin/com/baeldung/kotlin/ListToMapTest.kt b/kotlin/src/test/kotlin/com/baeldung/kotlin/ListToMapTest.kt new file mode 100644 index 0000000000..e3477931bb --- /dev/null +++ b/kotlin/src/test/kotlin/com/baeldung/kotlin/ListToMapTest.kt @@ -0,0 +1,74 @@ +package com.baeldung.kotlin + +import org.junit.Test +import kotlin.test.assertTrue + +class ListToMapTest { + + val user1 = User("John", 18, listOf("Hiking, Swimming")) + val user2 = User("Sara", 25, listOf("Chess, Board Games")) + val user3 = User("Dave", 34, listOf("Games, Racing sports")) + val user4 = User("John", 30, listOf("Reading, Poker")) + + @Test + fun givenList_whenConvertToMap_thenResult() { + val myList = listOf(user1, user2, user3) + val myMap = myList.map { it.name to it.age }.toMap() + + assertTrue(myMap.get("John") == 18) + } + + @Test + fun givenList_whenAssociatedBy_thenResult() { + val myList = listOf(user1, user2, user3) + val myMap = myList.associateBy({ it.name }, { it.hobbies }) + + assertTrue(myMap.get("John")!!.contains("Hiking, Swimming")) + } + + @Test + fun givenStringList_whenConvertToMap_thenResult() { + val myList = listOf("a", "b", "c") + val myMap = myList.map { it to it }.toMap() + + assertTrue(myMap.get("a") == "a") + } + + @Test + fun givenStringList_whenAssociate_thenResult() { + val myList = listOf("a", "b", "c", "c", "b") + val myMap = myList.associate{ it to it } + + assertTrue(myMap.get("a") == "a") + } + + @Test + fun givenStringList_whenAssociateTo_thenResult() { + val myList = listOf("a", "b", "c", "c", "b") + val myMap = mutableMapOf() + + myList.associateTo(myMap) {it to it} + + assertTrue(myMap.get("a") == "a") + } + + @Test + fun givenStringList_whenAssociateByTo_thenResult() { + val myList = listOf(user1, user2, user3, user4) + val myMap = mutableMapOf() + + myList.associateByTo(myMap, {it.name}, {it.age}) + + assertTrue(myMap.get("Dave") == 34) + } + + @Test + fun givenStringList_whenAssociateByToUser_thenResult() { + val myList = listOf(user1, user2, user3, user4) + val myMap = mutableMapOf() + + myList.associateByTo(myMap) {it.name} + + assertTrue(myMap.get("Dave")!!.age == 34) + } +} \ No newline at end of file diff --git a/libraries/OpenNLP/PartOfSpeechTag.txt b/libraries/OpenNLP/PartOfSpeechTag.txt deleted file mode 100644 index fdd8238ec4..0000000000 --- a/libraries/OpenNLP/PartOfSpeechTag.txt +++ /dev/null @@ -1 +0,0 @@ -Out of the night that covers me \ No newline at end of file diff --git a/libraries/OpenNLP/doc-cat.train b/libraries/OpenNLP/doc-cat.train deleted file mode 100644 index c457221ec6..0000000000 --- a/libraries/OpenNLP/doc-cat.train +++ /dev/null @@ -1,10 +0,0 @@ -GOOD good morning / -GOOD good evening / -GOOD have a good day / -GOOD nice party! / -GOOD fine pants / -BAD nightmare volcano in the sea / -BAD darkest sky / -BAD greed and waste / -BAD army attacks / -BAD bomb explodes / \ No newline at end of file diff --git a/libraries/OpenNLP/en-chunker.bin b/libraries/OpenNLP/en-chunker.bin deleted file mode 100644 index 65d9356888..0000000000 Binary files a/libraries/OpenNLP/en-chunker.bin and /dev/null differ diff --git a/libraries/OpenNLP/en-ner-location.bin b/libraries/OpenNLP/en-ner-location.bin deleted file mode 100644 index f3788bc1f6..0000000000 Binary files a/libraries/OpenNLP/en-ner-location.bin and /dev/null differ diff --git a/libraries/OpenNLP/en-ner-person.bin b/libraries/OpenNLP/en-ner-person.bin deleted file mode 100644 index 2f68318203..0000000000 Binary files a/libraries/OpenNLP/en-ner-person.bin and /dev/null differ diff --git a/libraries/OpenNLP/en-pos-maxent.bin b/libraries/OpenNLP/en-pos-maxent.bin deleted file mode 100644 index c8cae23c5f..0000000000 Binary files a/libraries/OpenNLP/en-pos-maxent.bin and /dev/null differ diff --git a/libraries/OpenNLP/en-sent.bin b/libraries/OpenNLP/en-sent.bin deleted file mode 100644 index e89076be5a..0000000000 Binary files a/libraries/OpenNLP/en-sent.bin and /dev/null differ diff --git a/libraries/OpenNLP/en-token.bin b/libraries/OpenNLP/en-token.bin deleted file mode 100644 index c417277ca7..0000000000 Binary files a/libraries/OpenNLP/en-token.bin and /dev/null differ diff --git a/libraries/README.md b/libraries/README.md index 293e11cf0c..c7e56db3b8 100644 --- a/libraries/README.md +++ b/libraries/README.md @@ -12,12 +12,18 @@ - [Introduction to Apache Commons Math](http://www.baeldung.com/apache-commons-math) - [Intro to JaVer](http://www.baeldung.com/serenity-bdd) - [Introduction to Netty](http://www.baeldung.com/netty) +- [Merging Streams in Java](http://www.baeldung.com/java-merge-streams) +- [Serenity BDD and Screenplay](http://www.baeldung.com/serenity-screenplay) +- [Introduction to Quartz](http://www.baeldung.com/quartz) +- [How to Warm Up the JVM](http://www.baeldung.com/java-jvm-warmup) +- [Apache Commons Collections SetUtils](http://www.baeldung.com/apache-commons-setutils) - [Guide to Java Data Objects](http://www.baeldung.com/jdo) - [Software Transactional Memory in Java Using Multiverse](http://www.baeldung.com/java-multiverse-stm) - [Introduction to HikariCP](http://www.baeldung.com/hikaricp) - [Serenity BDD with Spring and JBehave](http://www.baeldung.com/serenity-spring-jbehave) - [Locality-Sensitive Hashing in Java Using Java-LSH](http://www.baeldung.com/locality-sensitive-hashing) - [Apache Commons Collections OrderedMap](http://www.baeldung.com/apache-commons-ordered-map) +- [A Guide to Apache Commons DbUtils](http://www.baeldung.com/apache-commons-dbutils) The libraries module contains examples related to small libraries that are relatively easy to use and does not require any separate module of its own. diff --git a/libraries/pom.xml b/libraries/pom.xml index ee5fb2f977..9093a2db03 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -59,7 +59,8 @@ ${basedir}/datanucleus.properties ${basedir}/log4j.properties true - false + false + @@ -70,9 +71,78 @@ + + + org.apache.maven.plugins + maven-war-plugin + 3.0.0 + + false + WEB-INF/classes/VAADIN/widgetsets/WEB-INF/** + + + + com.vaadin + vaadin-maven-plugin + ${vaadin.plugin.version} + + + + update-theme + update-widgetset + compile + compile-theme + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.0.0 + + + + src/main/webapp/VAADIN/themes + + **/styles.css + **/styles.scss.cache + + + + + + + org.eclipse.jetty + jetty-maven-plugin + ${jetty.version} + + 2 + true + + + - + + + + vaadin-addons + http://maven.vaadin.com/vaadin-addons + + + + + + com.vaadin + vaadin-bom + ${vaadin.version} + pom + import + + + + @@ -157,6 +227,11 @@ commons-io ${commons.io.version} + + commons-dbutils + commons-dbutils + ${commons.dbutils.version} + org.apache.flink flink-core @@ -256,6 +331,11 @@ datanucleus-xml 5.0.0-release + + net.openhft + chronicle + 3.6.4 + org.springframework spring-web @@ -299,7 +379,7 @@ com.h2database h2 - 1.4.195 + ${h2.version} pl.pragmatists @@ -338,12 +418,6 @@ netty-all ${netty.version} - - - org.apache.opennlp - opennlp-tools - 1.8.0 - junit junit @@ -366,6 +440,91 @@ groovy-all 2.4.10 + + org.awaitility + awaitility + ${awaitility.version} + test + + + org.awaitility + awaitility-proxy + ${awaitility.version} + test + + + org.hamcrest + java-hamcrest + ${org.hamcrest.java-hamcrest.version} + test + + + + com.vaadin + vaadin-server + + + com.vaadin + vaadin-client-compiled + + + com.vaadin + vaadin-themes + + + org.seleniumhq.selenium + selenium-java + test + 3.4.0 + + + org.seleniumhq.selenium + htmlunit-driver + 2.27 + + + org.eclipse.jetty.websocket + websocket-server + ${jetty.version} + + + org.eclipse.jetty.websocket + websocket-client + ${jetty.version} + + + org.eclipse.jetty.websocket + websocket-api + ${jetty.version} + + + org.eclipse.jetty.websocket + websocket-common + ${jetty.version} + + + org.eclipse.jetty + jetty-continuation + ${jetty.version} + + + org.eclipse.jetty + jetty-util + ${jetty.version} + + + org.seleniumhq.selenium + selenium-api + 3.4.0 + test + jar + + + + net.agkn + hll + ${hll.version} + 0.7.0 @@ -382,6 +541,8 @@ 9.4.3.v20170317 4.5.3 2.5 + 1.6 + 1.4.196 9.4.2.v20170220 4.5.3 2.5 @@ -397,6 +558,55 @@ 4.12 0.10 3.5.0 + 3.0.0 + 2.0.0.0 + + 7.7.10 + 8.0.6 + mytheme + + 1.6.0 - + + + + vaadin-prerelease + + false + + + + vaadin-prereleases + http://maven.vaadin.com/vaadin-prereleases + + + vaadin-snapshots + https://oss.sonatype.org/content/repositories/vaadin-snapshots/ + + false + + + true + + + + + + vaadin-prereleases + http://maven.vaadin.com/vaadin-prereleases + + + vaadin-snapshots + https://oss.sonatype.org/content/repositories/vaadin-snapshots/ + + false + + + true + + + + + + diff --git a/libraries/src/main/java/com/baeldung/awaitility/AsyncService.java b/libraries/src/main/java/com/baeldung/awaitility/AsyncService.java new file mode 100644 index 0000000000..adfa3e1fb2 --- /dev/null +++ b/libraries/src/main/java/com/baeldung/awaitility/AsyncService.java @@ -0,0 +1,52 @@ +package com.baeldung.awaitility; + +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; +import java.util.concurrent.atomic.AtomicLong; + +public class AsyncService { + private final int DELAY = 1000; + private final int INIT_DELAY = 2000; + + private final AtomicLong value = new AtomicLong(0); + private final Executor executor = Executors.newFixedThreadPool(4); + private volatile boolean initialized = false; + + void initialize() { + executor.execute(() -> { + sleep(INIT_DELAY); + initialized = true; + }); + } + + boolean isInitialized() { + return initialized; + } + + void addValue(long val) { + throwIfNotInitialized(); + executor.execute(() -> { + sleep(DELAY); + value.addAndGet(val); + }); + } + + public long getValue() { + throwIfNotInitialized(); + return value.longValue(); + } + + private void sleep(int delay) { + try { + Thread.sleep(delay); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + private void throwIfNotInitialized() { + if (!initialized) { + throw new IllegalStateException("Service is not initialized"); + } + } +} diff --git a/libraries/src/main/java/com/baeldung/chronicle/queue/ChronicleQueue.java b/libraries/src/main/java/com/baeldung/chronicle/queue/ChronicleQueue.java new file mode 100644 index 0000000000..b7770e0b78 --- /dev/null +++ b/libraries/src/main/java/com/baeldung/chronicle/queue/ChronicleQueue.java @@ -0,0 +1,23 @@ +package com.baeldung.chronicle.queue; + +import java.io.IOException; + +import net.openhft.chronicle.Chronicle; +import net.openhft.chronicle.ExcerptAppender; + +public class ChronicleQueue { + + public static void writeToQueue( + Chronicle chronicle, String stringValue, int intValue, long longValue, double doubleValue) + throws IOException { + ExcerptAppender appender = chronicle.createAppender(); + appender.startExcerpt(); + appender.writeUTF(stringValue); + appender.writeInt(intValue); + appender.writeLong(longValue); + appender.writeDouble(doubleValue); + appender.finish(); + appender.close(); + } + +} diff --git a/libraries/src/main/java/com/baeldung/commons/dbutils/Email.java b/libraries/src/main/java/com/baeldung/commons/dbutils/Email.java new file mode 100644 index 0000000000..c82798d52d --- /dev/null +++ b/libraries/src/main/java/com/baeldung/commons/dbutils/Email.java @@ -0,0 +1,38 @@ +package com.baeldung.commons.dbutils; + +public class Email { + private Integer id; + private Integer employeeId; + private String address; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getEmployeeId() { + return employeeId; + } + + public void setEmployeeId(Integer employeeId) { + this.employeeId = employeeId; + } + + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + @Override + public String toString() { + return "Email{" + "id=" + id + ", address=" + address + '}'; + } + +} diff --git a/libraries/src/main/java/com/baeldung/commons/dbutils/Employee.java b/libraries/src/main/java/com/baeldung/commons/dbutils/Employee.java new file mode 100644 index 0000000000..e6f34c0201 --- /dev/null +++ b/libraries/src/main/java/com/baeldung/commons/dbutils/Employee.java @@ -0,0 +1,67 @@ +package com.baeldung.commons.dbutils; + +import java.util.Date; +import java.util.List; + +public class Employee { + private Integer id; + private String firstName; + private String lastName; + private Double salary; + private Date hiredDate; + private List emails; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public Double getSalary() { + return salary; + } + + public void setSalary(Double salary) { + this.salary = salary; + } + + public Date getHiredDate() { + return hiredDate; + } + + public void setHiredDate(Date hiredDate) { + this.hiredDate = hiredDate; + } + + public List getEmails() { + return emails; + } + + public void setEmails(List emails) { + this.emails = emails; + } + + @Override + public String toString() { + return "Employee{" + "id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + ", salary=" + salary + ", hiredDate=" + hiredDate + '}'; + } + +} \ No newline at end of file diff --git a/libraries/src/main/java/com/baeldung/commons/dbutils/EmployeeHandler.java b/libraries/src/main/java/com/baeldung/commons/dbutils/EmployeeHandler.java new file mode 100644 index 0000000000..6f68bafe57 --- /dev/null +++ b/libraries/src/main/java/com/baeldung/commons/dbutils/EmployeeHandler.java @@ -0,0 +1,45 @@ +package com.baeldung.commons.dbutils; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.commons.dbutils.BasicRowProcessor; +import org.apache.commons.dbutils.BeanProcessor; + +import org.apache.commons.dbutils.QueryRunner; +import org.apache.commons.dbutils.handlers.BeanListHandler; + +public class EmployeeHandler extends BeanListHandler { + + private Connection connection; + + public EmployeeHandler(Connection con) { + super(Employee.class, new BasicRowProcessor(new BeanProcessor(getColumnsToFieldsMap()))); + this.connection = con; + } + + @Override + public List handle(ResultSet rs) throws SQLException { + List employees = super.handle(rs); + + QueryRunner runner = new QueryRunner(); + BeanListHandler handler = new BeanListHandler<>(Email.class); + String query = "SELECT * FROM email WHERE employeeid = ?"; + for (Employee employee : employees) { + List emails = runner.query(connection, query, handler, employee.getId()); + employee.setEmails(emails); + } + return employees; + } + + public static Map getColumnsToFieldsMap() { + Map columnsToFieldsMap = new HashMap<>(); + columnsToFieldsMap.put("FIRST_NAME", "firstName"); + columnsToFieldsMap.put("LAST_NAME", "lastName"); + columnsToFieldsMap.put("HIRED_DATE", "hiredDate"); + return columnsToFieldsMap; + } +} diff --git a/libraries/src/main/java/com/baeldung/jetty/JettyServer.java b/libraries/src/main/java/com/baeldung/jetty/JettyServer.java index 1033a7266d..364b05473a 100644 --- a/libraries/src/main/java/com/baeldung/jetty/JettyServer.java +++ b/libraries/src/main/java/com/baeldung/jetty/JettyServer.java @@ -6,11 +6,11 @@ import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.servlet.ServletHandler; import org.eclipse.jetty.util.thread.QueuedThreadPool; -public class JettyServer { +class JettyServer { private Server server; - public void start() throws Exception { + void start() throws Exception { int maxThreads = 100; int minThreads = 10; @@ -33,7 +33,7 @@ public class JettyServer { } - public void stop() throws Exception { + void stop() throws Exception { server.stop(); } } diff --git a/libraries/src/main/java/com/baeldung/junitparams/SafeAdditionUtil.java b/libraries/src/main/java/com/baeldung/junitparams/SafeAdditionUtil.java index a2c1573dca..60436865a9 100644 --- a/libraries/src/main/java/com/baeldung/junitparams/SafeAdditionUtil.java +++ b/libraries/src/main/java/com/baeldung/junitparams/SafeAdditionUtil.java @@ -1,8 +1,8 @@ package com.baeldung.junitparams; -public class SafeAdditionUtil { +class SafeAdditionUtil { - public int safeAdd(int a, int b) { + int safeAdd(int a, int b) { long result = ((long) a) + b; if (result > Integer.MAX_VALUE) { return Integer.MAX_VALUE; diff --git a/libraries/src/main/java/com/baeldung/netty/NettyServer.java b/libraries/src/main/java/com/baeldung/netty/NettyServer.java index b9d35859d0..319829b7b6 100644 --- a/libraries/src/main/java/com/baeldung/netty/NettyServer.java +++ b/libraries/src/main/java/com/baeldung/netty/NettyServer.java @@ -13,7 +13,7 @@ public class NettyServer { private int port; - public NettyServer(int port) { + private NettyServer(int port) { this.port = port; } @@ -27,7 +27,7 @@ public class NettyServer { new NettyServer(port).run(); } - public void run() throws Exception { + private void run() throws Exception { EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup(); try { diff --git a/libraries/src/main/java/com/baeldung/netty/RequestData.java b/libraries/src/main/java/com/baeldung/netty/RequestData.java index e7404c1663..402aa1ef91 100644 --- a/libraries/src/main/java/com/baeldung/netty/RequestData.java +++ b/libraries/src/main/java/com/baeldung/netty/RequestData.java @@ -4,27 +4,27 @@ public class RequestData { private int intValue; private String stringValue; - public int getIntValue() { + int getIntValue() { return intValue; } - public void setIntValue(int intValue) { + void setIntValue(int intValue) { this.intValue = intValue; } - public String getStringValue() { + String getStringValue() { return stringValue; } - public void setStringValue(String stringValue) { + void setStringValue(String stringValue) { this.stringValue = stringValue; } @Override public String toString() { return "RequestData{" + - "intValue=" + intValue + - ", stringValue='" + stringValue + '\'' + - '}'; + "intValue=" + intValue + + ", stringValue='" + stringValue + '\'' + + '}'; } } diff --git a/libraries/src/main/java/com/baeldung/netty/ResponseData.java b/libraries/src/main/java/com/baeldung/netty/ResponseData.java index ce388a9a3d..51d1adaafb 100644 --- a/libraries/src/main/java/com/baeldung/netty/ResponseData.java +++ b/libraries/src/main/java/com/baeldung/netty/ResponseData.java @@ -3,11 +3,11 @@ package com.baeldung.netty; public class ResponseData { private int intValue; - public int getIntValue() { + int getIntValue() { return intValue; } - public void setIntValue(int intValue) { + void setIntValue(int intValue) { this.intValue = intValue; } diff --git a/libraries/src/main/java/com/baeldung/netty/ResponseDataDecoder.java b/libraries/src/main/java/com/baeldung/netty/ResponseDataDecoder.java index ee33679dfe..16e2a61bd3 100644 --- a/libraries/src/main/java/com/baeldung/netty/ResponseDataDecoder.java +++ b/libraries/src/main/java/com/baeldung/netty/ResponseDataDecoder.java @@ -1,11 +1,11 @@ package com.baeldung.netty; -import java.util.List; - import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.ReplayingDecoder; +import java.util.List; + public class ResponseDataDecoder extends ReplayingDecoder { @Override diff --git a/libraries/src/main/java/com/baeldung/opennlp/OpenNLP.java b/libraries/src/main/java/com/baeldung/opennlp/OpenNLP.java deleted file mode 100644 index dd44e96a3a..0000000000 --- a/libraries/src/main/java/com/baeldung/opennlp/OpenNLP.java +++ /dev/null @@ -1,188 +0,0 @@ -package com.baeldung.opennlp; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Arrays; -import java.util.logging.Logger; - -import opennlp.tools.chunker.ChunkerME; -import opennlp.tools.chunker.ChunkerModel; -import opennlp.tools.cmdline.postag.POSModelLoader; -import opennlp.tools.doccat.DoccatFactory; -import opennlp.tools.doccat.DoccatModel; -import opennlp.tools.doccat.DocumentCategorizerME; -import opennlp.tools.doccat.DocumentSample; -import opennlp.tools.doccat.DocumentSampleStream; -import opennlp.tools.namefind.NameFinderME; -import opennlp.tools.namefind.TokenNameFinderModel; -import opennlp.tools.postag.POSModel; -import opennlp.tools.postag.POSSample; -import opennlp.tools.postag.POSTaggerME; -import opennlp.tools.sentdetect.SentenceDetectorME; -import opennlp.tools.sentdetect.SentenceModel; -import opennlp.tools.tokenize.Tokenizer; -import opennlp.tools.tokenize.TokenizerME; -import opennlp.tools.tokenize.TokenizerModel; -import opennlp.tools.tokenize.WhitespaceTokenizer; -import opennlp.tools.util.InputStreamFactory; -import opennlp.tools.util.InvalidFormatException; -import opennlp.tools.util.ObjectStream; -import opennlp.tools.util.PlainTextByLineStream; -import opennlp.tools.util.Span; -import opennlp.tools.util.TrainingParameters; - -public class OpenNLP { - - private final static Logger LOGGER = Logger.getLogger(OpenNLP.class.getName()); - private final static String text = buildString(); - private final static String sentence[] = new String[] { "James", "Jordan", "live", "in", "Oklahoma", "city", "." }; - - private DoccatModel docCatModel; - - public static void main(String[] args) { - new OpenNLP(); - } - - public static String buildString(){ - StringBuilder sb = new StringBuilder(); - sb.append("To get to the south:"); - sb.append(" Go to the store."); - sb.append(" Buy a compass."); - sb.append(" Use the compass."); - sb.append(" Then walk to the south."); - return sb.toString(); - } - - public OpenNLP() { - try { - sentenceDetector(); - tokenizer(); - nameFinder(); - locationFinder(); - trainDocumentCategorizer(); - documentCategorizer(); - partOfSpeechTagger(); - chunker(); - } catch (InvalidFormatException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - public void sentenceDetector() throws InvalidFormatException, IOException { - - InputStream is = new FileInputStream("OpenNLP/en-sent.bin"); - SentenceModel model = new SentenceModel(is); - SentenceDetectorME sdetector = new SentenceDetectorME(model); - String sentences[] = sdetector.sentDetect(text); - for (String sentence : sentences) { - LOGGER.info(sentence); - } - is.close(); - } - - public void tokenizer() throws InvalidFormatException, IOException { - InputStream is = new FileInputStream("OpenNLP/en-token.bin"); - TokenizerModel model = new TokenizerModel(is); - Tokenizer tokenizer = new TokenizerME(model); - String tokens[] = tokenizer.tokenize(text); - for (String token : tokens) { - LOGGER.info(token); - } - is.close(); - } - - public static void nameFinder() throws IOException { - InputStream is = new FileInputStream("OpenNLP/en-ner-person.bin"); - TokenNameFinderModel model = new TokenNameFinderModel(is); - is.close(); - NameFinderME nameFinder = new NameFinderME(model); - Span nameSpans[] = nameFinder.find(sentence); - String[] names = Span.spansToStrings(nameSpans, sentence); - Arrays.stream(names).forEach(LOGGER::info); - for (String name : names) { - LOGGER.info(name); - } - } - - public static void locationFinder() throws IOException { - InputStream is = new FileInputStream("OpenNLP/en-ner-location.bin"); - TokenNameFinderModel model = new TokenNameFinderModel(is); - is.close(); - NameFinderME nameFinder = new NameFinderME(model); - Span locationSpans[] = nameFinder.find(sentence); - String[] locations = Span.spansToStrings(locationSpans, sentence); - Arrays.stream(locations).forEach(LOGGER::info); - for (String location : locations) { - LOGGER.info(location); - } - } - - public void trainDocumentCategorizer() { - - try { - InputStreamFactory isf = new InputStreamFactory() { - public InputStream createInputStream() throws IOException { - return new FileInputStream("OpenNLP/doc-cat.train"); - } - }; - ObjectStream lineStream = new PlainTextByLineStream(isf, "UTF-8"); - ObjectStream sampleStream = new DocumentSampleStream(lineStream); - DoccatFactory docCatFactory = new DoccatFactory(); - docCatModel = DocumentCategorizerME.train("en", sampleStream, TrainingParameters.defaultParams(), docCatFactory); - } catch (IOException e) { - e.printStackTrace(); - } - } - - public void documentCategorizer() { - DocumentCategorizerME myCategorizer = new DocumentCategorizerME(docCatModel); - double[] outcomes = myCategorizer.categorize(sentence); - String category = myCategorizer.getBestCategory(outcomes); - - if (category.equalsIgnoreCase("GOOD")) { - LOGGER.info("Document is positive :) "); - } else { - LOGGER.info("Document is negative :( "); - } - } - - public static void partOfSpeechTagger() throws IOException { - try { - POSModel posModel = new POSModelLoader().load(new File("OpenNLP/en-pos-maxent.bin")); - POSTaggerME posTaggerME = new POSTaggerME(posModel); - InputStreamFactory isf = new InputStreamFactory() { - public InputStream createInputStream() throws IOException { - return new FileInputStream("OpenNLP/PartOfSpeechTag.txt"); - } - }; - ObjectStream lineStream = new PlainTextByLineStream(isf, "UTF-8"); - String line; - while ((line = lineStream.read()) != null) { - String whitespaceTokenizerLine[] = WhitespaceTokenizer.INSTANCE.tokenize(line); - String[] tags = posTaggerME.tag(whitespaceTokenizerLine); - POSSample posSample = new POSSample(whitespaceTokenizerLine, tags); - LOGGER.info(posSample.toString()); - } - lineStream.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - public static void chunker() throws IOException { - InputStream is = new FileInputStream("OpenNLP/en-chunker.bin"); - ChunkerModel cModel = new ChunkerModel(is); - ChunkerME chunkerME = new ChunkerME(cModel); - String[] taggedSentence = new String[] {"Out", "of", "the", "night", "that", "covers", "me"}; - String pos[] = new String[] { "IN", "IN", "DT", "NN", "WDT", "VBZ", "PRP"}; - String chunks[] = chunkerME.chunk(taggedSentence, pos); - for (String chunk : chunks) { - LOGGER.info(chunk); - } - } - -} diff --git a/libraries/src/main/java/com/baeldung/quartz/QuartzExample.java b/libraries/src/main/java/com/baeldung/quartz/QuartzExample.java index 20853aa01b..4757d912f8 100644 --- a/libraries/src/main/java/com/baeldung/quartz/QuartzExample.java +++ b/libraries/src/main/java/com/baeldung/quartz/QuartzExample.java @@ -20,44 +20,44 @@ public class QuartzExample { Scheduler sched = schedFact.getScheduler(); JobDetail job = JobBuilder.newJob(SimpleJob.class) - .withIdentity("myJob", "group1") - .usingJobData("jobSays", "Hello World!") - .usingJobData("myFloatValue", 3.141f) - .build(); + .withIdentity("myJob", "group1") + .usingJobData("jobSays", "Hello World!") + .usingJobData("myFloatValue", 3.141f) + .build(); Trigger trigger = TriggerBuilder.newTrigger() - .withIdentity("myTrigger", "group1") - .startNow() - .withSchedule(SimpleScheduleBuilder.simpleSchedule() - .withIntervalInSeconds(40) - .repeatForever()) - .build(); - + .withIdentity("myTrigger", "group1") + .startNow() + .withSchedule(SimpleScheduleBuilder.simpleSchedule() + .withIntervalInSeconds(40) + .repeatForever()) + .build(); + JobDetail jobA = JobBuilder.newJob(JobA.class) - .withIdentity("jobA", "group2") - .build(); - + .withIdentity("jobA", "group2") + .build(); + JobDetail jobB = JobBuilder.newJob(JobB.class) - .withIdentity("jobB", "group2") - .build(); - + .withIdentity("jobB", "group2") + .build(); + Trigger triggerA = TriggerBuilder.newTrigger() - .withIdentity("triggerA", "group2") - .startNow() - .withPriority(15) - .withSchedule(SimpleScheduleBuilder.simpleSchedule() - .withIntervalInSeconds(40) - .repeatForever()) - .build(); - - Trigger triggerB = TriggerBuilder.newTrigger() - .withIdentity("triggerB", "group2") - .startNow() - .withPriority(10) - .withSchedule(SimpleScheduleBuilder.simpleSchedule() - .withIntervalInSeconds(20) - .repeatForever()) - .build(); + .withIdentity("triggerA", "group2") + .startNow() + .withPriority(15) + .withSchedule(SimpleScheduleBuilder.simpleSchedule() + .withIntervalInSeconds(40) + .repeatForever()) + .build(); + + Trigger triggerB = TriggerBuilder.newTrigger() + .withIdentity("triggerB", "group2") + .startNow() + .withPriority(10) + .withSchedule(SimpleScheduleBuilder.simpleSchedule() + .withIntervalInSeconds(20) + .repeatForever()) + .build(); sched.scheduleJob(job, trigger); sched.scheduleJob(jobA, triggerA); diff --git a/libraries/src/main/java/com/baeldung/quartz/SimpleJob.java b/libraries/src/main/java/com/baeldung/quartz/SimpleJob.java index 986c5e96e5..554d3b9358 100644 --- a/libraries/src/main/java/com/baeldung/quartz/SimpleJob.java +++ b/libraries/src/main/java/com/baeldung/quartz/SimpleJob.java @@ -9,13 +9,11 @@ public class SimpleJob implements Job { public void execute(JobExecutionContext context) throws JobExecutionException { JobDataMap dataMap = context.getJobDetail() - .getJobDataMap(); + .getJobDataMap(); String jobSays = dataMap.getString("jobSays"); float myFloatValue = dataMap.getFloat("myFloatValue"); System.out.println("Job says: " + jobSays + ", and val is: " + myFloatValue); - } - } \ No newline at end of file diff --git a/libraries/src/main/java/com/baeldung/stm/Account.java b/libraries/src/main/java/com/baeldung/stm/Account.java index 734d332308..8b17f87120 100644 --- a/libraries/src/main/java/com/baeldung/stm/Account.java +++ b/libraries/src/main/java/com/baeldung/stm/Account.java @@ -10,20 +10,20 @@ public class Account { private final TxnLong lastUpdate; private final TxnInteger balance; - public Account(final int balance) { + Account(final int balance) { this.lastUpdate = StmUtils.newTxnLong(System.currentTimeMillis()); this.balance = StmUtils.newTxnInteger(balance); } - public Integer getBalance() { + Integer getBalance() { return balance.atomicGet(); } - public void adjustBy(final int amount) { + void adjustBy(final int amount) { adjustBy(amount, System.currentTimeMillis()); } - public void adjustBy(final int amount, final long date) { + private void adjustBy(final int amount, final long date) { StmUtils.atomic(() -> { balance.increment(amount); lastUpdate.set(date); @@ -34,7 +34,7 @@ public class Account { }); } - public void transferTo(final Account other, final int amount) { + void transferTo(final Account other, final int amount) { StmUtils.atomic(() -> { final long date = System.currentTimeMillis(); adjustBy(-amount, date); @@ -45,6 +45,6 @@ public class Account { @Override public String toString() { return StmUtils.atomic((TxnCallable) - txn -> "Balance: " + balance.get(txn) + " lastUpdateDate: " + lastUpdate.get(txn)); + txn -> "Balance: " + balance.get(txn) + " lastUpdateDate: " + lastUpdate.get(txn)); } } \ No newline at end of file diff --git a/libraries/src/main/java/com/baeldung/vaadin/VaadinUI.java b/libraries/src/main/java/com/baeldung/vaadin/VaadinUI.java new file mode 100644 index 0000000000..e134b501c8 --- /dev/null +++ b/libraries/src/main/java/com/baeldung/vaadin/VaadinUI.java @@ -0,0 +1,220 @@ +package com.baeldung.vaadin; + +import com.vaadin.annotations.Theme; +import com.vaadin.annotations.VaadinServletConfiguration; +import com.vaadin.server.ExternalResource; +import com.vaadin.server.FontAwesome; +import com.vaadin.server.VaadinRequest; +import com.vaadin.server.VaadinServlet; +import com.vaadin.ui.Button; +import com.vaadin.ui.CheckBox; +import com.vaadin.ui.ComboBox; +import com.vaadin.ui.DateField; +import com.vaadin.ui.FormLayout; +import com.vaadin.ui.Grid; +import com.vaadin.ui.GridLayout; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.InlineDateField; +import com.vaadin.ui.Label; +import com.vaadin.ui.Link; +import com.vaadin.ui.ListSelect; +import com.vaadin.ui.NativeButton; +import com.vaadin.ui.NativeSelect; +import com.vaadin.ui.Panel; +import com.vaadin.ui.PasswordField; +import com.vaadin.ui.RichTextArea; +import com.vaadin.ui.TextArea; +import com.vaadin.ui.TextField; +import com.vaadin.ui.TwinColSelect; +import com.vaadin.ui.UI; +import com.vaadin.ui.VerticalLayout; + +import javax.servlet.annotation.WebServlet; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Theme("mytheme") +public class VaadinUI extends UI { + + @Override + protected void init(VaadinRequest vaadinRequest) { + final VerticalLayout verticalLayout = new VerticalLayout(); + verticalLayout.setSpacing(true); + verticalLayout.setMargin(true); + final GridLayout gridLayout = new GridLayout(3, 2); + gridLayout.setSpacing(true); + gridLayout.setMargin(true); + final HorizontalLayout horizontalLayout = new HorizontalLayout(); + horizontalLayout.setSpacing(true); + horizontalLayout.setMargin(true); + final FormLayout formLayout = new FormLayout(); + formLayout.setSpacing(true); + formLayout.setMargin(true); + final GridLayout buttonLayout = new GridLayout(3, 5); + buttonLayout.setMargin(true); + buttonLayout.setSpacing(true); + + final Label label = new Label(); + label.setId("Label"); + label.setValue("Label Value"); + label.setCaption("Label"); + gridLayout.addComponent(label); + + final Link link = new Link("Baeldung", + new ExternalResource("http://www.baeldung.com/")); + link.setId("Link"); + link.setTargetName("_blank"); + gridLayout.addComponent(link); + + final TextField textField = new TextField(); + textField.setId("TextField"); + textField.setCaption("TextField:"); + textField.setValue("TextField Value"); + textField.setIcon(FontAwesome.USER); + gridLayout.addComponent(textField); + + final TextArea textArea = new TextArea(); + textArea.setCaption("TextArea"); + textArea.setId("TextArea"); + textArea.setValue("TextArea Value"); + gridLayout.addComponent(textArea); + + final DateField dateField = new DateField("DateField", new Date(0)); + dateField.setId("DateField"); + gridLayout.addComponent(dateField); + + final PasswordField passwordField = new PasswordField(); + passwordField.setId("PasswordField"); + passwordField.setCaption("PasswordField:"); + passwordField.setValue("password"); + gridLayout.addComponent(passwordField); + + final RichTextArea richTextArea = new RichTextArea(); + richTextArea.setCaption("Rich Text Area"); + richTextArea.setValue("

RichTextArea

"); + richTextArea.setSizeFull(); + + Panel richTextPanel = new Panel(); + richTextPanel.setContent(richTextArea); + + final InlineDateField inlineDateField = new InlineDateField(); + inlineDateField.setValue(new Date(0)); + inlineDateField.setCaption("Inline Date Field"); + horizontalLayout.addComponent(inlineDateField); + + Button normalButton = new Button("Normal Button"); + normalButton.setId("NormalButton"); + normalButton.addClickListener(e -> { + label.setValue("CLICK"); + }); + buttonLayout.addComponent(normalButton); + + Button tinyButton = new Button("Tiny Button"); + tinyButton.addStyleName("tiny"); + buttonLayout.addComponent(tinyButton); + + Button smallButton = new Button("Small Button"); + smallButton.addStyleName("small"); + buttonLayout.addComponent(smallButton); + + + Button largeButton = new Button("Large Button"); + largeButton.addStyleName("large"); + buttonLayout.addComponent(largeButton); + + + Button hugeButton = new Button("Huge Button"); + hugeButton.addStyleName("huge"); + buttonLayout.addComponent(hugeButton); + + + Button disabledButton = new Button("Disabled Button"); + disabledButton.setDescription("This button cannot be clicked"); + disabledButton.setEnabled(false); + buttonLayout.addComponent(disabledButton); + + + Button dangerButton = new Button("Danger Button"); + dangerButton.addStyleName("danger"); + buttonLayout.addComponent(dangerButton); + + + Button friendlyButton = new Button("Friendly Button"); + friendlyButton.addStyleName("friendly"); + buttonLayout.addComponent(friendlyButton); + + Button primaryButton = new Button("Primary Button"); + primaryButton.addStyleName("primary"); + buttonLayout.addComponent(primaryButton); + + NativeButton nativeButton = new NativeButton("Native Button"); + buttonLayout.addComponent(nativeButton); + + Button iconButton = new Button("Icon Button"); + iconButton.setIcon(FontAwesome.ALIGN_LEFT); + buttonLayout.addComponent(iconButton); + + Button borderlessButton = new Button("BorderLess Button"); + borderlessButton.addStyleName("borderless"); + buttonLayout.addComponent(borderlessButton); + + Button linkButton = new Button("Link Button"); + linkButton.addStyleName("link"); + buttonLayout.addComponent(linkButton); + + Button quietButton = new Button("Quiet Button"); + quietButton.addStyleName("quiet"); + buttonLayout.addComponent(quietButton); + + horizontalLayout.addComponent(buttonLayout); + + final CheckBox checkbox = new CheckBox("CheckBox"); + checkbox.setValue(true); + checkbox.addValueChangeListener(e -> + checkbox.setValue(!checkbox.getValue())); + formLayout.addComponent(checkbox); + + List numbers = new ArrayList(); + numbers.add("One"); + numbers.add("Ten"); + numbers.add("Eleven"); + ComboBox comboBox = new ComboBox("ComboBox"); + comboBox.addItems(numbers); + formLayout.addComponent(comboBox); + + ListSelect listSelect = new ListSelect("ListSelect"); + listSelect.addItems(numbers); + listSelect.setRows(2); + formLayout.addComponent(listSelect); + + NativeSelect nativeSelect = new NativeSelect("NativeSelect"); + nativeSelect.addItems(numbers); + formLayout.addComponent(nativeSelect); + + TwinColSelect twinColSelect = new TwinColSelect("TwinColSelect"); + twinColSelect.addItems(numbers); + + Grid grid = new Grid("Grid"); + grid.setColumns("Column1", "Column2", "Column3"); + grid.addRow("Item1", "Item2", "Item3"); + grid.addRow("Item4", "Item5", "Item6"); + + Panel panel = new Panel("Panel"); + panel.setContent(grid); + panel.setSizeUndefined(); + + verticalLayout.addComponent(gridLayout); + verticalLayout.addComponent(richTextPanel); + verticalLayout.addComponent(horizontalLayout); + verticalLayout.addComponent(formLayout); + verticalLayout.addComponent(twinColSelect); + verticalLayout.addComponent(panel); + setContent(verticalLayout); + } + + @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true) + @VaadinServletConfiguration(ui = VaadinUI.class, productionMode = false) + public static class MyUIServlet extends VaadinServlet { + } +} \ No newline at end of file diff --git a/libraries/src/main/webapp/VAADIN/themes/mytheme/addons.scss b/libraries/src/main/webapp/VAADIN/themes/mytheme/addons.scss new file mode 100644 index 0000000000..a5670b70c7 --- /dev/null +++ b/libraries/src/main/webapp/VAADIN/themes/mytheme/addons.scss @@ -0,0 +1,7 @@ +/* This file is automatically managed and will be overwritten from time to time. */ +/* Do not manually edit this file. */ + +/* Import and include this mixin into your project theme to include the addon themes */ +@mixin addons { +} + diff --git a/libraries/src/main/webapp/VAADIN/themes/mytheme/favicon.ico b/libraries/src/main/webapp/VAADIN/themes/mytheme/favicon.ico new file mode 100644 index 0000000000..ffb34a65c7 Binary files /dev/null and b/libraries/src/main/webapp/VAADIN/themes/mytheme/favicon.ico differ diff --git a/libraries/src/main/webapp/VAADIN/themes/mytheme/mytheme.scss b/libraries/src/main/webapp/VAADIN/themes/mytheme/mytheme.scss new file mode 100644 index 0000000000..2c5fb8b944 --- /dev/null +++ b/libraries/src/main/webapp/VAADIN/themes/mytheme/mytheme.scss @@ -0,0 +1,38 @@ +// If you edit this file you need to compile the theme. See README.md for details. + +// Global variable overrides. Must be declared before importing Valo. + +// Defines the plaintext font size, weight and family. Font size affects general component sizing. +//$v-font-size: 16px; +//$v-font-weight: 300; +//$v-font-family: "Open Sans", sans-serif; + +// Defines the border used by all components. +//$v-border: 1px solid (v-shade 0.7); +//$v-border-radius: 4px; + +// Affects the color of some component elements, e.g Button, Panel title, etc +//$v-background-color: hsl(210, 0%, 98%); +// Affects the color of content areas, e.g Panel and Window content, TextField input etc +//$v-app-background-color: $v-background-color; + +// Affects the visual appearance of all components +//$v-gradient: v-linear 8%; +//$v-bevel-depth: 30%; +//$v-shadow-opacity: 5%; + +// Defines colors for indicating status (focus, success, failure) +//$v-focus-color: valo-focus-color(); // Calculates a suitable color automatically +//$v-friendly-color: #2c9720; +//$v-error-indicator-color: #ed473b; + +// For more information, see: https://vaadin.com/book/-/page/themes.valo.html +// Example variants can be copy/pasted from https://vaadin.com/wiki/-/wiki/Main/Valo+Examples + +@import "../valo/valo.scss"; + +@mixin mytheme { + @include valo; + + // Insert your own theme rules here +} diff --git a/libraries/src/main/webapp/VAADIN/themes/mytheme/styles.css b/libraries/src/main/webapp/VAADIN/themes/mytheme/styles.css new file mode 100644 index 0000000000..75bf26f498 --- /dev/null +++ b/libraries/src/main/webapp/VAADIN/themes/mytheme/styles.css @@ -0,0 +1,12986 @@ +/** + * Checks if a list contains a certain value. + * + * @param {list} $list - the list to check + * @param {value} $var - the value to search for + * @param {bool} $recursive (false) - should any contained lists be checked for the value + * + * @return {bool} true if the value is found from the list, false otherwise + * + * @group lists + */ + +/** + * Cross-browser opacity. + * + * @param {number} $value - opacity value from 0 to 1 + * @param {bool} $important (false) - should the property value be declared with !important + * + * @group util + */ + +@-webkit-keyframes valo-animate-in-fade { + 0% { + opacity: 0; + } + } + +@-moz-keyframes valo-animate-in-fade { + 0% { + opacity: 0; + } + } + +@keyframes valo-animate-in-fade { + 0% { + opacity: 0; + } + } + +@-webkit-keyframes valo-animate-out-fade { + 100% { + opacity: 0; + } + } + +@-moz-keyframes valo-animate-out-fade { + 100% { + opacity: 0; + } + } + +@keyframes valo-animate-out-fade { + 100% { + opacity: 0; + } + } + +@-webkit-keyframes valo-animate-in-slide-down { + 0% { + -webkit-transform: translateY(-100%); + } + } + +@-moz-keyframes valo-animate-in-slide-down { + 0% { + -moz-transform: translateY(-100%); + } + } + +@keyframes valo-animate-in-slide-down { + 0% { + -webkit-transform: translateY(-100%); + -moz-transform: translateY(-100%); + -ms-transform: translateY(-100%); + -o-transform: translateY(-100%); + transform: translateY(-100%); + } + } + +@-webkit-keyframes valo-animate-in-slide-up { + 0% { + -webkit-transform: translateY(100%); + } + } + +@-moz-keyframes valo-animate-in-slide-up { + 0% { + -moz-transform: translateY(100%); + } + } + +@keyframes valo-animate-in-slide-up { + 0% { + -webkit-transform: translateY(100%); + -moz-transform: translateY(100%); + -ms-transform: translateY(100%); + -o-transform: translateY(100%); + transform: translateY(100%); + } + } + +@-webkit-keyframes valo-animate-in-slide-left { + 0% { + -webkit-transform: translateX(100%); + } + } + +@-moz-keyframes valo-animate-in-slide-left { + 0% { + -moz-transform: translateX(100%); + } + } + +@keyframes valo-animate-in-slide-left { + 0% { + -webkit-transform: translateX(100%); + -moz-transform: translateX(100%); + -ms-transform: translateX(100%); + -o-transform: translateX(100%); + transform: translateX(100%); + } + } + +@-webkit-keyframes valo-animate-in-slide-right { + 0% { + -webkit-transform: translateX(-100%); + } + } + +@-moz-keyframes valo-animate-in-slide-right { + 0% { + -moz-transform: translateX(-100%); + } + } + +@keyframes valo-animate-in-slide-right { + 0% { + -webkit-transform: translateX(-100%); + -moz-transform: translateX(-100%); + -ms-transform: translateX(-100%); + -o-transform: translateX(-100%); + transform: translateX(-100%); + } + } + +@-webkit-keyframes valo-animate-out-slide-down { + 100% { + -webkit-transform: translateY(100%); + } + } + +@-moz-keyframes valo-animate-out-slide-down { + 100% { + -moz-transform: translateY(100%); + } + } + +@keyframes valo-animate-out-slide-down { + 100% { + -webkit-transform: translateY(100%); + -moz-transform: translateY(100%); + -ms-transform: translateY(100%); + -o-transform: translateY(100%); + transform: translateY(100%); + } + } + +@-webkit-keyframes valo-animate-out-slide-up { + 100% { + -webkit-transform: translateY(-100%); + } + } + +@-moz-keyframes valo-animate-out-slide-up { + 100% { + -moz-transform: translateY(-100%); + } + } + +@keyframes valo-animate-out-slide-up { + 100% { + -webkit-transform: translateY(-100%); + -moz-transform: translateY(-100%); + -ms-transform: translateY(-100%); + -o-transform: translateY(-100%); + transform: translateY(-100%); + } + } + +@-webkit-keyframes valo-animate-out-slide-left { + 100% { + -webkit-transform: translateX(-100%); + } + } + +@-moz-keyframes valo-animate-out-slide-left { + 100% { + -moz-transform: translateX(-100%); + } + } + +@keyframes valo-animate-out-slide-left { + 100% { + -webkit-transform: translateX(-100%); + -moz-transform: translateX(-100%); + -ms-transform: translateX(-100%); + -o-transform: translateX(-100%); + transform: translateX(-100%); + } + } + +@-webkit-keyframes valo-animate-out-slide-right { + 100% { + -webkit-transform: translateX(100%); + } + } + +@-moz-keyframes valo-animate-out-slide-right { + 100% { + -moz-transform: translateX(100%); + } + } + +@keyframes valo-animate-out-slide-right { + 100% { + -webkit-transform: translateX(100%); + -moz-transform: translateX(100%); + -ms-transform: translateX(100%); + -o-transform: translateX(100%); + transform: translateX(100%); + } + } + +@-webkit-keyframes valo-overlay-animate-in { + 0% { + -webkit-transform: translatey(-4px); + opacity: 0; + } + } + +@-moz-keyframes valo-overlay-animate-in { + 0% { + -moz-transform: translatey(-4px); + opacity: 0; + } + } + +@keyframes valo-overlay-animate-in { + 0% { + -webkit-transform: translatey(-4px); + -moz-transform: translatey(-4px); + -ms-transform: translatey(-4px); + -o-transform: translatey(-4px); + transform: translatey(-4px); + opacity: 0; + } + } + +@-webkit-keyframes valo-animate-out-slide-down-fade { + 100% { + opacity: 0; + -webkit-transform: translatey(30%); + } + } + +@-moz-keyframes valo-animate-out-slide-down-fade { + 100% { + opacity: 0; + -moz-transform: translatey(30%); + } + } + +@keyframes valo-animate-out-slide-down-fade { + 100% { + opacity: 0; + -webkit-transform: translatey(30%); + -moz-transform: translatey(30%); + -ms-transform: translatey(30%); + -o-transform: translatey(30%); + transform: translatey(30%); + } + } + +/** + * Outputs cross-browser Valo-specific linear gradient background-image declarations. + * + * @group style + * + * @param {color} $color ($v-background-color) - The base color for the gradient color stops + * @param {list} $gradient ($v-gradient) - Valo-specific gradient value. See the documentation for $v-gradient. + * @param {color} $fallback (null) - A fallback color for browser which do not support linear gradients (IE8 and IE9 in particular). If null, the base $color is used instead. + * @param {string} $direction (to bottom) - the direction of the linear gradient. The color stops are by default so that a lighter shade is at the start and a darker shade is at the end. + */ + +/** + * Computes a CSS border property value for the given base color. + * + * @group style + * + * @param {list} $border ($v-border) - CSS border value which can contain any of the color keywords + * @param {color} $color ($v-background-color) - the base color to which the color keywords are applied to + * @param {color} $context (null) - context/surrounding color where the border is expected to appear. The color of the final border is the darker of the two parameters passed to this function. + * @param {number} $strength (1) - adjustment for the border contrast + * + * @return {list} The input $border value with any color keyword replaced with the corresponding actual color + */ + +/** + * Ouput selectors and properties to vertically center elements inside their parent. + * + * @param {string} $to-align (()) - The selector to match the elements which you wish to align vertically. The targeted elements should be inline or inline-block elements. + * @param {string} $align (middle) - The vertical-align value, e.g. top, middle, bottom + * @param {string} $pseudo-element (after) - Which pseudo element to use for the vertical align guide + * + * @group util + */ + +@font-face { + font-family: ThemeIcons; + font-weight: normal; + font-style: normal; + src: url(../valo/util/bourbon/css3/../../../../base/fonts/themeicons-webfont.eot); + src: url(../valo/util/bourbon/css3/../../../../base/fonts/themeicons-webfont.eot?#iefix) format("embedded-opentype"), url(../valo/util/bourbon/css3/../../../../base/fonts/themeicons-webfont.woff) format("woff"), url(../valo/util/bourbon/css3/../../../../base/fonts/themeicons-webfont.ttf) format("truetype"), url(../valo/util/bourbon/css3/../../../../base/fonts/themeicons-webfont.svg#ThemeIcons) format("svg"); +} + +.ThemeIcons { + font-family: ThemeIcons; + font-style: normal; + font-weight: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + display: inline-block; + text-align: center; +} + +@font-face { + font-family: FontAwesome; + font-weight: normal; + font-style: normal; + src: url(../valo/util/bourbon/css3/../../../../base/fonts/fontawesome-webfont.eot); + src: url(../valo/util/bourbon/css3/../../../../base/fonts/fontawesome-webfont.eot?#iefix) format("embedded-opentype"), url(../valo/util/bourbon/css3/../../../../base/fonts/fontawesome-webfont.woff) format("woff"), url(../valo/util/bourbon/css3/../../../../base/fonts/fontawesome-webfont.ttf) format("truetype"), url(../valo/util/bourbon/css3/../../../../base/fonts/fontawesome-webfont.svg#FontAwesome) format("svg"); +} + +.FontAwesome { + font-family: FontAwesome; + font-style: normal; + font-weight: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + display: inline-block; + text-align: center; +} + +@font-face { + font-family: "Open Sans"; + src: url(../valo/fonts/open-sans/OpenSans-Light-webfont.eot); + src: url(../valo/fonts/open-sans/OpenSans-Light-webfont.eot?#iefix) format("embedded-opentype"), url(../valo/fonts/open-sans/OpenSans-Light-webfont.woff) format("woff"), url(../valo/fonts/open-sans/OpenSans-Light-webfont.ttf) format("truetype"); + font-weight: 300; + font-style: normal; +} + +@font-face { + font-family: "Open Sans"; + src: url(../valo/fonts/open-sans/OpenSans-Regular-webfont.eot); + src: url(../valo/fonts/open-sans/OpenSans-Regular-webfont.eot?#iefix) format("embedded-opentype"), url(../valo/fonts/open-sans/OpenSans-Regular-webfont.woff) format("woff"), url(../valo/fonts/open-sans/OpenSans-Regular-webfont.ttf) format("truetype"); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: "Open Sans"; + src: url(../valo/fonts/open-sans/OpenSans-Semibold-webfont.eot); + src: url(../valo/fonts/open-sans/OpenSans-Semibold-webfont.eot?#iefix) format("embedded-opentype"), url(../valo/fonts/open-sans/OpenSans-Semibold-webfont.woff) format("woff"), url(../valo/fonts/open-sans/OpenSans-Semibold-webfont.ttf) format("truetype"); + font-weight: 600; + font-style: normal; +} + +@-webkit-keyframes v-rotate-360 { + to { + -webkit-transform: rotate(360deg); + } + } + +@-moz-keyframes v-rotate-360 { + to { + -moz-transform: rotate(360deg); + } + } + +@-o-keyframes v-rotate-360 { + to { + -o-transform: rotate(360deg); + } + } + +@keyframes v-rotate-360 { + to { + transform: rotate(360deg); + } + } + +@-webkit-keyframes v-progress-start { + 0% { + width: 0%; + } + 100% { + width: 50%; + } + } + +@-moz-keyframes v-progress-start { + 0% { + width: 0%; + } + 100% { + width: 50%; + } + } + +@keyframes v-progress-start { + 0% { + width: 0%; + } + 100% { + width: 50%; + } + } + +@-webkit-keyframes v-progress-delay { + 0% { + width: 50%; + } + 100% { + width: 90%; + } + } + +@-moz-keyframes v-progress-delay { + 0% { + width: 50%; + } + 100% { + width: 90%; + } + } + +@keyframes v-progress-delay { + 0% { + width: 50%; + } + 100% { + width: 90%; + } + } + +@-webkit-keyframes v-progress-wait { + 0% { + width: 90%; + height: 4px; + } + 3% { + width: 91%; + height: 7px; + } + 100% { + width: 96%; + height: 7px; + } + } + +@-moz-keyframes v-progress-wait { + 0% { + width: 90%; + height: 4px; + } + 3% { + width: 91%; + height: 7px; + } + 100% { + width: 96%; + height: 7px; + } + } + +@keyframes v-progress-wait { + 0% { + width: 90%; + height: 4px; + } + 3% { + width: 91%; + height: 7px; + } + 100% { + width: 96%; + height: 7px; + } + } + +@-webkit-keyframes v-progress-wait-pulse { + 0% { + opacity: 1; + } + 50% { + opacity: 0.1; + } + 100% { + opacity: 1; + } + } + +@-moz-keyframes v-progress-wait-pulse { + 0% { + opacity: 1; + } + 50% { + opacity: 0.1; + } + 100% { + opacity: 1; + } + } + +@keyframes v-progress-wait-pulse { + 0% { + opacity: 1; + } + 50% { + opacity: 0.1; + } + 100% { + opacity: 1; + } + } + +/** + * Outputs the context menu selectors and styles, which is used by Table and Tree for instance. + * + * @requires {mixin} valo-selection-item-style + * @requires {mixin} valo-selection-item-selected-style + */ + +/** + * The background color for overlay elements. + * + * @type color + * @group overlay + */ + +.v-shadow, .v-shadow-window { + display: none; +} + +.v-ie8 .v-shadow, .v-ie8 .v-shadow-window { + display: block; +} + +.v-ie8 .v-shadow .top, .v-ie8 .v-shadow-window .top { + position: absolute; + top: -6px; + right: 10px; + bottom: 6px; + left: -10px; + background: black; + filter: alpha(opacity=5) progid:DXImageTransform.Microsoft.blur(pixelradius=10, makeShadow=false); +} + +.v-ie8 .v-shadow .top-left, .v-ie8 .v-shadow-window .top-left { + position: absolute; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; + background: black; + filter: alpha(opacity=9) progid:DXImageTransform.Microsoft.blur(pixelradius=0, makeShadow=false); +} + +/** + * The backgound color for tooltips. + * + * @type color + * @group tooltip + */ + +/** + * + * + * @param {string} $primary-stylename (v-absolutelayout) - + * + * @group absolutelayout + */ + +/** + * Outputs the selectors and properties for the Accordion component. + * + * @param {string} $primary-stylename (v-accordion) - the primary style name for the selectors + * @param {bool} $include-additional-styles - should the mixin output all the different style variations of the component + * @group accordion + */ + +/** + * Outputs the selectors and properties for the Button component. + * + * @param {string} $primary-stylename (v-button) - the primary style name for the selectors + * @param {bool} $include-additional-styles - should the mixin output all the different style variations of the component + * + * @group button + */ + +/** + * A list of colors for custom event colors. Can be an empty list of you don't + * need any custom event colors. + * + * @example javascript + * // Java code + * // 'event' is an instance of EditableCalendarEvent + * event.setStyleName("color1"); // 1st color in the list + * event.setStyleName("color2"); // 2nd color in the list + * // etc. + * + * @group calendar + */ + +/** + * Outputs the selectors and properties for the CheckBox component. + * + * @param {string} $primary-stylename (v-checkbox) - the primary style name for the selectors + * @param {bool} $include-additional-styles - should the mixin output all the different style variations of the component + * + * @group checkbox + */ + +/** + * Outputs the global selectors and properties for the ColorPicker component - styles which are + * considered mandatory for the component to work properly. + * + * @param {string} $primary-stylename (v-colorpicker) - the primary style name for the selectors + * + * @group colorpicker + */ + +/** + * Outputs the selectors and properties for the ComboBox component. + * + * @param {string} $primary-stylename (v-filterselect) - the primary style name for the selectors + * @param {bool} $include-additional-styles - should the mixin output all the different style variations of the component + * + * @group combobox + */ + +/** + * The amount of spacing between different widgets in a component group. + * If null, a computed value is used ($v-border size * -1, or 1px if $v-border size is 0) + * + * @group csslayout + */ + +/** + * + * + * @param {string} $primary-stylename (v-customcomponent) - + * + * @group customcomponent + */ + +/** + * + * + * @param {string} $primary-stylename (v-customlayout) - + * + * @group customlayout + */ + +/** + * Outputs the selectors and properties for the DateField component. + * + * @param {string} $primary-stylename (v-datefield) - the primary style name for the selectors + * @param {bool} $include-additional-styles - should the mixin output all the different style variations of the component + * + * @group datefield + */ + +/** + * Outputs the styles and selectors for the DragAndDropWrapper component. + * + * @param {string} $primary-stylename (v-ddwrapper) - the primary style name for the selectors + * + * @group drag-n-drop + */ + +/** + * + * + * @param {string} $primary-stylename (v-form) - + * + * @group form + */ + +/** + * Outputs the selectors and properties for the FormLayout component. + * + * @param {string} $primary-stylename (v-formlayout) - the primary style name for the selectors + * @param {bool} $include-additional-styles - should the mixin output all the different style variations of the component + * + * @group formlayout + */ + +/** + * + * @group table + */ + +@-webkit-keyframes valo-grid-editor-footer-animate-in { + 0% { + margin-top: -37px; + } + } + +@-moz-keyframes valo-grid-editor-footer-animate-in { + 0% { + margin-top: -37px; + } + } + +@keyframes valo-grid-editor-footer-animate-in { + 0% { + margin-top: -37px; + } + } + +@-webkit-keyframes valo-grid-editor-footer-animate-in-alt { + 0% { + margin-bottom: -38px; + } + 100% { + margin-bottom: -1px; + } + } + +@-moz-keyframes valo-grid-editor-footer-animate-in-alt { + 0% { + margin-bottom: -38px; + } + 100% { + margin-bottom: -1px; + } + } + +@keyframes valo-grid-editor-footer-animate-in-alt { + 0% { + margin-bottom: -38px; + } + 100% { + margin-bottom: -1px; + } + } + +/** + * + * + * @param {string} $primary-stylename (v-gridlayout) - + * + * @group gridlayout + */ + +/** + * The font weight for headers. + * + * @group label + */ + +/** + * + * @group link + */ + +/** + * + * + * @param {string} $primary-stylename (v-loginform) - + * + * @group loginform + */ + +/** + * + * + * @param {string} $primary-stylename (v-menubar) - + * @param {bool} $include-additional-styles - + * + * @group menubar + */ + +/** + * + * + * @param {string} $primary-stylename (v-nativebutton) - + * + * @group nativebutton + */ + +/** + * + * + * @param {string} $primary-stylename (v-select) - + * + * @group nativeselect + */ + +/** + * + * @group notification + */ + +/** + * + * + * @param {string} $primary-stylename (v-select-optiongroup) - + * @param {bool} $include-additional-styles - + * + * @group optiongroup + */ + +/** + * + * + * + * @group orderedlayout + */ + +/** + * + * @group panel + */ + +@-webkit-keyframes v-popupview-animate-in { + 0% { + -webkit-transform: scale(0); + } + } + +@-moz-keyframes v-popupview-animate-in { + 0% { + -moz-transform: scale(0); + } + } + +@keyframes v-popupview-animate-in { + 0% { + -webkit-transform: scale(0); + -moz-transform: scale(0); + -ms-transform: scale(0); + -o-transform: scale(0); + transform: scale(0); + } + } + +/** + * + * @group progressbar + */ + +/** + * + * @group richtextarea + */ + +/** + * + * @group slider + */ + +/** + * + * + * @param {string} $primary-stylename (v-splitpanel) - + * @param {bool} $include-additional-styles - + * + * @group splitpanel + */ + +/** + * + * @group table + */ + +/** + * Should the tabsheet content changes be animated. + * + * @group tabsheet + */ + +/** + * The background color for text fields. + * @group textfield + */ + +/** + * Outputs the selectors and properties for the TextArea component. + * + * @param {string} $primary-stylename (v-textarea) - the primary style name for the selectors + * @param {bool} $include-additional-styles - should the mixin output all the different style variations of the component + * + * @group textarea + */ + +/** + * + * @group tree + */ + +/** + * + * + * @param {string} $primary-stylename (v-treetable) - + * + * @group treetable + */ + +/** + * + * + * @param {string} $primary-stylename (v-select-twincol) - + * + * @group twin-column-select + */ + +/** + * + * + * @param {string} $primary-stylename (v-upload) - + * + * @group upload + */ + +/** + * + */ + +/** + * @group window + */ + +@-webkit-keyframes valo-modal-window-indication { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } + } + +@-moz-keyframes valo-modal-window-indication { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } + } + +@keyframes valo-modal-window-indication { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } + } + +@-webkit-keyframes valo-animate-out-scale-down-fade { + 100% { + -webkit-transform: scale(0.8); + opacity: 0; + } + } + +@-moz-keyframes valo-animate-out-scale-down-fade { + 100% { + -moz-transform: scale(0.8); + opacity: 0; + } + } + +@keyframes valo-animate-out-scale-down-fade { + 100% { + -webkit-transform: scale(0.8); + -moz-transform: scale(0.8); + -ms-transform: scale(0.8); + -o-transform: scale(0.8); + transform: scale(0.8); + opacity: 0; + } + } + +/** + * @group valo-menu + */ + +.v-vaadin-version:after { + content: "7.7.10"; +} + +.v-widget { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + display: inline-block; + vertical-align: top; + text-align: left; + white-space: normal; +} + +.v-generated-body { + overflow: hidden; + margin: 0; + padding: 0; + border: 0; +} + +.v-app { + height: 100%; + -webkit-tap-highlight-color: transparent; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.v-app input[type="text"], .v-app .v-slot > .v-caption, .v-app .v-gridlayout-slot > .v-caption, .v-app .v-has-caption > .v-caption, .v-app .v-formlayout-captioncell > .v-caption, .v-app .v-csslayout > .v-caption { + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} + +.v-app input::-ms-clear { + display: none; +} + +.v-ui { + position: relative; +} + +.v-ui.v-ui-embedded { + margin-top: -1px; + border-top: 1px solid transparent; +} + +.v-ui:focus { + outline: none; +} + +.v-overlay-container { + width: 0; + height: 0; +} + +.v-drag-element { + z-index: 60000; + position: absolute !important; + cursor: default; +} + +.v-clip { + overflow: hidden; +} + +.v-scrollable { + overflow: auto; +} + +.v-scrollable > .v-widget { + vertical-align: middle; + overflow: hidden; +} + +.v-ios.v-webkit .v-scrollable { + -webkit-overflow-scrolling: touch; +} + +.v-ios5.v-webkit .v-scrollable { + -webkit-overflow-scrolling: none; +} + +.v-webkit.v-ios .v-browserframe { + -webkit-overflow-scrolling: touch; + overflow: auto; +} + +.v-assistive-device-only { + position: absolute; + top: -2000px; + left: -2000px; + width: 10px; + overflow: hidden; +} + +.v-icon { + cursor: inherit; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.v-icon, .v-errorindicator, .v-required-field-indicator { + display: inline-block; + line-height: inherit; +} + +.v-caption { + display: inline-block; + white-space: nowrap; + line-height: 1.55; +} + +.v-captiontext { + display: inline-block; + line-height: inherit; +} + +div.v-layout.v-horizontal.v-widget { + white-space: nowrap; +} + +.v-layout.v-vertical > .v-expand, .v-layout.v-horizontal > .v-expand { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 100%; + height: 100%; +} + +.v-slot, .v-spacing { + display: inline-block; + white-space: nowrap; + vertical-align: top; +} + +.v-vertical > .v-slot:after { + display: inline-block; + clear: both; + width: 0; + height: 0; + overflow: hidden; +} + +.v-vertical > .v-slot, .v-vertical > .v-expand > .v-slot { + display: block; + clear: both; +} + +.v-horizontal > .v-slot, .v-horizontal > .v-expand > .v-slot { + height: 100%; +} + +.v-horizontal > .v-expand > .v-slot { + position: relative; +} + +.v-vertical > .v-spacing, .v-vertical > .v-expand > .v-spacing { + width: 0 !important; + display: block; + clear: both; +} + +.v-horizontal > .v-spacing, .v-horizontal > .v-expand > .v-spacing { + height: 0 !important; +} + +.v-align-middle:before, .v-align-bottom:before, .v-expand > .v-align-middle:before, .v-expand > .v-align-bottom:before { + content: ""; + display: inline-block; + height: 100%; + vertical-align: middle; + width: 0; +} + +.v-align-middle, .v-align-bottom { + white-space: nowrap; +} + +.v-align-middle > .v-widget, .v-align-bottom > .v-widget { + display: inline-block; +} + +.v-align-middle, .v-align-middle > .v-widget { + vertical-align: middle; +} + +.v-align-bottom, .v-align-bottom > .v-widget { + vertical-align: bottom; +} + +.v-align-center { + text-align: center; +} + +.v-align-center > .v-widget { + margin-left: auto; + margin-right: auto; +} + +.v-align-right { + text-align: right; +} + +.v-align-right > .v-widget { + margin-left: auto; +} + +.v-has-caption, .v-has-caption > .v-caption { + display: inline-block; +} + +.v-caption-on-left, .v-caption-on-right { + white-space: nowrap; +} + +.v-caption-on-top > .v-caption, .v-caption-on-bottom > .v-caption { + display: block; +} + +.v-caption-on-left > .v-caption { + padding-right: 0.5em; +} + +.v-caption-on-left > .v-widget, .v-caption-on-right > .v-widget { + display: inline-block; +} + +.v-has-caption.v-has-width > .v-widget { + width: 100% !important; +} + +.v-has-caption.v-has-height > .v-widget { + height: 100% !important; +} + +.v-gridlayout { + position: relative; +} + +.v-gridlayout-slot { + position: absolute; + line-height: 1.55; +} + +.v-gridlayout-spacing-on { + overflow: hidden; +} + +.v-gridlayout-spacing, .v-gridlayout-spacing-off { + padding-left: 0; + padding-top: 0; +} + +.v-gridlayout-spacing-off { + overflow: hidden; +} + +.v-calendar-month-day-scrollable { + overflow-y: scroll; +} + +.v-calendar-week-wrapper { + position: relative; + overflow: hidden; +} + +.v-calendar-current-time { + position: absolute; + left: 0; + width: 100%; + height: 1px; + background: red; + z-index: 2; +} + +.v-calendar-event-resizetop, .v-calendar-event-resizebottom { + position: absolute; + height: 5%; + min-height: 3px; + width: 100%; + z-index: 1; +} + +.v-calendar-event-resizetop { + cursor: row-resize; + top: 0; +} + +.v-calendar-event-resizebottom { + cursor: row-resize; + bottom: 0; +} + +.v-calendar-header-month td:first-child { + padding-left: 20px; +} + +.v-calendar-month-sizedheight .v-calendar-month-day { + height: 100px; +} + +.v-calendar-month-sizedwidth .v-calendar-month-day { + width: 100px; +} + +.v-calendar-header-month-Hsized .v-calendar-header-day { + width: 101px; +} + +.v-calendar-header-month-Hsized td:first-child { + padding-left: 21px; +} + +.v-calendar-header-day-Hsized { + width: 200px; +} + +.v-calendar-week-numbers-Vsized .v-calendar-week-number { + height: 100px; + line-height: 100px; +} + +.v-calendar-week-wrapper-Vsized { + height: 400px; + overflow-x: hidden !important; +} + +.v-calendar-times-Vsized .v-calendar-time { + height: 38px; +} + +.v-calendar-times-Hsized .v-calendar-time { + width: 42px; +} + +.v-calendar-day-times-Vsized .v-datecellslot, .v-calendar-day-times-Vsized .v-datecellslot-even { + height: 18px; +} + +.v-calendar-day-times-Hsized, .v-calendar-day-times-Hsized .v-datecellslot, .v-calendar-day-times-Hsized .v-datecellslot-even { + width: 200px; +} + +.v-colorpicker-popup.v-window { + min-width: 220px !important; +} + +.v-colorpicker-gradient-container { + overflow: visible !important; +} + +.v-colorpicker-gradient-clicklayer { + opacity: 0; + filter: alpha(opacity=0) ; +} + +.rgb-gradient .v-colorpicker-gradient-background { + background: url(../valo/components/img/colorpicker/gradient2.png); +} + +.hsv-gradient .v-colorpicker-gradient-foreground { + background: url(../valo/components/img/colorpicker/gradient.png); +} + +.v-colorpicker-gradient-higherbox:before { + content: ""; + width: 11px; + height: 11px; + border-radius: 7px; + border: 1px solid #fff; + -webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(0, 0, 0, 0.3); + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(0, 0, 0, 0.3); + position: absolute; + bottom: -6px; + left: -6px; +} + +.v-colorpicker-popup .v-slider.v-slider-red:before { + background-color: red; +} + +.v-colorpicker-popup .v-slider.v-slider-green:before { + background-color: green; +} + +.v-colorpicker-popup .v-slider.v-slider-blue:before { + background-color: blue; +} + +.v-colorpicker-popup .v-slider.hue-slider:before { + background: url(../valo/components/img/colorpicker/slider_hue_bg.png); +} + +.v-colorpicker-popup input.v-textfield-dark { + color: #fff; +} + +.v-colorpicker-popup input.v-textfield-light { + color: #000; +} + +.v-colorpicker-grid { + height: 319px; +} + +.v-colorpicker-popup .colorselect td { + line-height: 15px; +} + +.v-table-header table, .v-table-footer table, .v-table-table { + border-spacing: 0; + border-collapse: separate; + margin: 0; + padding: 0; + border: 0; + line-height: 1.55; +} + +.v-table-resizer, .v-table-sort-indicator { + float: right; +} + +.v-table-caption-container-align-center { + text-align: center; +} + +.v-table-caption-container-align-right { + text-align: right; +} + +.v-table-header td, .v-table-footer td, .v-table-cell-content { + padding: 0; +} + +.v-table-sort-indicator { + width: 0; +} + +.v-tabsheet-hidetabs > .v-tabsheet-tabcontainer, .v-tabsheet-spacertd, .v-disabled .v-tabsheet-scroller, .v-tabsheet .v-disabled .v-tabsheet-caption-close { + display: none; +} + +.v-tabsheet { + overflow: visible !important; + position: relative; +} + +.v-tabsheet-tabcontainer table, .v-tabsheet-tabcontainer tbody, .v-tabsheet-tabcontainer tr { + display: inline-block; + border-spacing: 0; + border-collapse: collapse; + vertical-align: top; +} + +.v-tabsheet-tabcontainer td { + display: inline-block; + padding: 0; +} + +.v-tabsheet-tabs { + white-space: nowrap; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.v-tabsheet-content { + position: relative; +} + +.v-tabsheet-content > div > .v-scrollable > .v-margin-top { + padding-top: 12px; +} + +.v-tabsheet-content > div > .v-scrollable > .v-margin-right { + padding-right: 12px; +} + +.v-tabsheet-content > div > .v-scrollable > .v-margin-bottom { + padding-bottom: 12px; +} + +.v-tabsheet-content > div > .v-scrollable > .v-margin-left { + padding-left: 12px; +} + +.v-splitpanel-vertical, .v-splitpanel-horizontal { + overflow: hidden; + white-space: nowrap; +} + +.v-splitpanel-hsplitter { + z-index: 100; + cursor: e-resize; + cursor: col-resize; +} + +.v-splitpanel-vsplitter { + z-index: 100; + cursor: s-resize; + cursor: row-resize; +} + +.v-splitpanel-hsplitter:after, .v-splitpanel-vsplitter:after { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; +} + +.v-splitpanel-hsplitter div, .v-splitpanel-vsplitter div { + width: inherit; + height: inherit; + overflow: hidden; + position: relative; +} + +.v-splitpanel-hsplitter div:before, .v-splitpanel-vsplitter div:before { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; +} + +.v-disabled [class$="splitter"] div { + cursor: default; +} + +.v-disabled [class$="splitter"] div:before { + display: none; +} + +.v-splitpanel-horizontal > div > .v-splitpanel-second-container { + position: static !important; + display: inline-block; + vertical-align: top; +} + +.v-splitpanel-horizontal > div > .v-splitpanel-first-container { + display: inline-block; + vertical-align: top; +} + +.mytheme.v-app, .mytheme.v-app-loading { + font: 300 16px/1.55 "Open Sans", sans-serif; + color: #464646; + background-color: #fafafa; + cursor: default; +} + +.mytheme .v-app-loading { + width: 100%; + height: 100%; + background: #fafafa; +} + +.mytheme .v-app-loading:before { + content: ""; + position: fixed; + z-index: 100; + top: 45%; + left: 50%; + width: 28px; + height: 28px; + padding: 9px; + margin-top: -24px; + margin-left: -24px; + background: #fff url(../valo/shared/img/spinner.gif) no-repeat 50%; + border-radius: 4px; +} + +.mytheme .v-loading-indicator { + position: fixed !important; + z-index: 99999; + left: 0; + right: auto; + top: 0; + width: 50%; + opacity: 1; + height: 4px; + background-color: #197de1; + pointer-events: none; + -webkit-transition: none; + -moz-transition: none; + transition: none; + -webkit-animation: v-progress-start 1000ms 200ms both; + -moz-animation: v-progress-start 1000ms 200ms both; + animation: v-progress-start 1000ms 200ms both; +} + +.mytheme .v-loading-indicator[style*="none"] { + display: block !important; + width: 100% !important; + opacity: 0; + -webkit-animation: none; + -moz-animation: none; + animation: none; + -webkit-transition: opacity 500ms 300ms, width 300ms; + -moz-transition: opacity 500ms 300ms, width 300ms; + transition: opacity 500ms 300ms, width 300ms; +} + +.mytheme .v-loading-indicator-delay { + width: 90%; + -webkit-animation: v-progress-delay 3.8s forwards; + -moz-animation: v-progress-delay 3.8s forwards; + animation: v-progress-delay 3.8s forwards; +} + +.v-ff .mytheme .v-loading-indicator-delay { + width: 50%; +} + +.mytheme .v-loading-indicator-wait { + width: 96%; + -webkit-animation: v-progress-wait 5s forwards, v-progress-wait-pulse 1s 4s infinite backwards; + -moz-animation: v-progress-wait 5s forwards, v-progress-wait-pulse 1s 4s infinite backwards; + animation: v-progress-wait 5s forwards, v-progress-wait-pulse 1s 4s infinite backwards; +} + +.v-ff .mytheme .v-loading-indicator-wait { + width: 90%; +} + +.v-ie8 .mytheme .v-loading-indicator, .v-ie8 .mytheme .v-loading-indicator-delay, .v-ie8 .mytheme .v-loading-indicator-wait, .v-ie9 .mytheme .v-loading-indicator, .v-ie9 .mytheme .v-loading-indicator-delay, .v-ie9 .mytheme .v-loading-indicator-wait { + width: 28px !important; + height: 28px; + padding: 9px; + background: #fff url(../valo/shared/img/spinner.gif) no-repeat 50%; + border-radius: 4px; + top: 9px; + right: 9px; + left: auto; + filter: alpha(opacity=50); +} + +.v-ie8 .mytheme .v-loading-indicator[style*="none"], .v-ie8 .mytheme .v-loading-indicator-delay[style*="none"], .v-ie8 .mytheme .v-loading-indicator-wait[style*="none"], .v-ie9 .mytheme .v-loading-indicator[style*="none"], .v-ie9 .mytheme .v-loading-indicator-delay[style*="none"], .v-ie9 .mytheme .v-loading-indicator-wait[style*="none"] { + display: none !important; +} + +.v-ie8 .mytheme .v-loading-indicator-wait, .v-ie9 .mytheme .v-loading-indicator-wait { + filter: alpha(opacity=100); +} + +.mytheme .v-scrollable:focus { + outline: none; +} + +.mytheme img.v-icon { + vertical-align: middle; +} + +.mytheme .v-caption { + font-size: 14px; + font-weight: 400; + padding-bottom: 0.3em; + padding-left: 1px; +} + +.mytheme .v-caption-on-left .v-caption, .mytheme .v-caption-on-right .v-caption { + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-icon + .v-captiontext, .mytheme .v-icon + span { + margin-left: 7px; +} + +.mytheme .v-icon + .v-captiontext:empty, .mytheme .v-icon + span:empty { + margin-left: 0; +} + +.mytheme .v-errorindicator { + color: #ed473b; + font-weight: 600; + width: 19px; + text-align: center; +} + +.mytheme .v-errorindicator:before { + content: "!"; +} + +.mytheme .v-required-field-indicator { + color: #ed473b; + padding: 0 0.2em; +} + +.mytheme select { + font: inherit; + font-weight: 400; + line-height: inherit; + padding: 5px; + margin: 0; + border-radius: 4px; + border: 1px solid #c5c5c5; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + color: #464646; +} + +.mytheme select:focus { + outline: none; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme button { + font: inherit; + font-weight: 400; + line-height: 1.55; +} + +.mytheme a { + cursor: pointer; + color: #197de1; + text-decoration: underline; + font-weight: inherit; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; +} + +.mytheme a:hover { + color: #4396ea; +} + +.mytheme a.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-disabled { + cursor: default !important; +} + +.mytheme .v-drag-element { + background: #fafafa; + color: #464646; + -webkit-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); + border-radius: 4px; + overflow: hidden; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-tooltip { + background-color: #323232; + background-color: rgba(50, 50, 50, 0.9); + -webkit-box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2); + color: white; + padding: 5px 9px; + border-radius: 3px; + max-width: 35em; + overflow: hidden !important; + font-size: 14px; +} + +.mytheme .v-tooltip div[style*="width"] { + width: auto !important; +} + +.mytheme .v-tooltip .v-errormessage { + background-color: white; + background-color: #fff; + color: #ed473b; + margin: -5px -9px; + padding: 5px 9px; + max-height: 10em; + overflow: auto; + font-weight: 400; +} + +.mytheme .v-tooltip .v-errormessage h2:only-child { + font: inherit; + line-height: inherit; +} + +.mytheme .v-tooltip .v-tooltip-text { + max-height: 10em; + overflow: auto; + margin-top: 10px; +} + +.mytheme .v-tooltip .v-errormessage[aria-hidden="true"] + .v-tooltip-text { + margin-top: 0; +} + +.mytheme .v-tooltip h1, .mytheme .v-tooltip h2, .mytheme .v-tooltip h3, .mytheme .v-tooltip h4 { + color: inherit; +} + +.mytheme .v-contextmenu { + padding: 4px 4px; + border-radius: 4px; + background-color: white; + color: #474747; + -webkit-box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.1), 0 3px 5px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.09098); + box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.1), 0 3px 5px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.09098); + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; + padding: 4px 4px; +} + +.mytheme .v-contextmenu[class*="animate-in"] { + -webkit-animation: valo-overlay-animate-in 120ms; + -moz-animation: valo-overlay-animate-in 120ms; + animation: valo-overlay-animate-in 120ms; +} + +.mytheme .v-contextmenu[class*="animate-out"] { + -webkit-animation: valo-animate-out-fade 120ms; + -moz-animation: valo-animate-out-fade 120ms; + animation: valo-animate-out-fade 120ms; +} + +.mytheme .v-contextmenu table { + border-spacing: 0; +} + +.mytheme .v-contextmenu .gwt-MenuItem { + cursor: pointer; + line-height: 27px; + padding: 0 20px 0 10px; + border-radius: 3px; + font-weight: 400; + white-space: nowrap; + position: relative; + display: block; +} + +.mytheme .v-contextmenu .gwt-MenuItem:active:before { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + background: #0957a6; + opacity: 0.15; + filter: alpha(opacity=15.0) ; + pointer-events: none; + border-radius: inherit; +} + +.mytheme .v-contextmenu .gwt-MenuItem .v-icon { + max-height: 27px; + margin-right: 5px; + min-width: 1em; +} + +.mytheme .v-contextmenu .gwt-MenuItem-selected { + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + color: #ecf2f8; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05); +} + +.mytheme .v-reconnect-dialog { + color: white; + top: 12px; + right: 12px; + max-width: 100%; + border-radius: 0; + -webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.25); + box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.25); + padding: 12px 15px; + background-color: #444; + background-color: rgba(68, 68, 68, 0.9); + line-height: 22px; + text-align: center; +} + +.mytheme .v-reconnect-dialog .text { + display: inline-block; + padding-left: 10px; +} + +.mytheme .v-reconnect-dialog .spinner { + height: 24px !important; + width: 24px !important; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border: 2px solid rgba(25, 125, 225, 0.2); + border-top-color: #197de1; + border-right-color: #197de1; + border-radius: 100%; + -webkit-animation: v-rotate-360 500ms infinite linear; + -moz-animation: v-rotate-360 500ms infinite linear; + animation: v-rotate-360 500ms infinite linear; + pointer-events: none; + display: none; + vertical-align: middle; +} + +.v-ie8 .mytheme .v-reconnect-dialog .spinner, .v-ie9 .mytheme .v-reconnect-dialog .spinner { + border: none; + border-radius: 4px; + background: #fff url(../valo/shared/img/spinner.gif) no-repeat 50% 50%; + background-size: 80%; +} + +.v-ie8 .mytheme .v-reconnect-dialog .spinner { + min-width: 30px; + min-height: 30px; +} + +.mytheme .v-reconnect-dialog.active .spinner { + display: inline-block; +} + +.mytheme .v-absolutelayout-wrapper { + position: absolute; +} + +.mytheme .v-absolutelayout-margin, .mytheme .v-absolutelayout-canvas { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.mytheme .v-absolutelayout.v-has-height > div, .mytheme .v-absolutelayout.v-has-height .v-absolutelayout-margin { + height: 100%; +} + +.mytheme .v-absolutelayout.v-has-height > div, .mytheme .v-absolutelayout.v-has-width .v-absolutelayout-margin { + width: 100%; +} + +.mytheme .v-margin-top { + padding-top: 37px; +} + +.mytheme .v-margin-right { + padding-right: 37px; +} + +.mytheme .v-margin-bottom { + padding-bottom: 37px; +} + +.mytheme .v-margin-left { + padding-left: 37px; +} + +.mytheme .v-spacing { + width: 12px; + height: 12px; +} + +.mytheme .v-verticallayout-well, .mytheme .v-horizontallayout-well { + background: #f5f5f5; + color: #454545; + -webkit-box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.05), inset 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.05), inset 0 2px 3px rgba(0, 0, 0, 0.05); + border-radius: 4px; + border: 1px solid #c5c5c5; +} + +.mytheme .v-verticallayout-well > div > [class*="-caption"], .mytheme .v-horizontallayout-well > div > [class*="-caption"] { + background: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-verticallayout-well > .v-margin-top, .mytheme .v-horizontallayout-well > .v-margin-top { + padding-top: 12px; +} + +.mytheme .v-verticallayout-well > .v-margin-right, .mytheme .v-horizontallayout-well > .v-margin-right { + padding-right: 12px; +} + +.mytheme .v-verticallayout-well > .v-margin-bottom, .mytheme .v-horizontallayout-well > .v-margin-bottom { + padding-bottom: 12px; +} + +.mytheme .v-verticallayout-well > .v-margin-left, .mytheme .v-horizontallayout-well > .v-margin-left { + padding-left: 12px; +} + +.mytheme .v-verticallayout-card, .mytheme .v-horizontallayout-card { + background: white; + color: #474747; + border-radius: 4px; + border: 1px solid #d5d5d5; + -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); +} + +.mytheme .v-verticallayout-card > .v-margin-top, .mytheme .v-horizontallayout-card > .v-margin-top { + padding-top: 12px; +} + +.mytheme .v-verticallayout-card > .v-margin-right, .mytheme .v-horizontallayout-card > .v-margin-right { + padding-right: 12px; +} + +.mytheme .v-verticallayout-card > .v-margin-bottom, .mytheme .v-horizontallayout-card > .v-margin-bottom { + padding-bottom: 12px; +} + +.mytheme .v-verticallayout-card > .v-margin-left, .mytheme .v-horizontallayout-card > .v-margin-left { + padding-left: 12px; +} + +.mytheme .v-horizontallayout-wrapping { + white-space: normal !important; +} + +.mytheme .v-horizontallayout-wrapping > .v-spacing + .v-slot, .mytheme .v-horizontallayout-wrapping > .v-slot:first-child { + margin-bottom: 12px; +} + +.mytheme .v-horizontallayout-wrapping > .v-slot:first-child:last-child { + margin-bottom: 0; +} + +.mytheme .v-button { + position: relative; + text-align: center; + white-space: nowrap; + outline: none; + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + height: 37px; + padding: 0 16px; + color: #191919; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); +} + +.mytheme .v-button:before { + content: ""; + display: inline-block; + width: 0; + height: 100%; + vertical-align: middle; +} + +.mytheme .v-button > div { + vertical-align: middle; +} + +.v-sa .mytheme .v-button:before { + height: 110%; +} + +.v-ff .mytheme .v-button:before { + height: 107%; +} + +.v-ie .mytheme .v-button:before { + margin-top: 4px; +} + +.mytheme .v-button:after { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: inherit; + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; +} + +.mytheme .v-button:focus:after { + -webkit-transition: none; + -moz-transition: none; + transition: none; +} + +.mytheme .v-button.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-button.v-disabled:after { + display: none; +} + +.mytheme .v-button:after { + border: inherit; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; +} + +.mytheme .v-button:hover:after { + background-color: rgba(186, 186, 186, 0.1); +} + +.mytheme .v-button:focus:after { + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-button:active:after { + background-color: rgba(125, 125, 125, 0.2); +} + +.mytheme .v-button-primary { + height: 37px; + padding: 0 16px; + color: #ecf2f8; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #1362b1; + border-top-color: #156ab3; + border-bottom-color: #1156a8; + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + -webkit-box-shadow: inset 0 1px 0 #4d98e6, inset 0 -1px 0 #166bca, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 #4d98e6, inset 0 -1px 0 #166bca, 0 2px 3px rgba(0, 0, 0, 0.05); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05); + padding: 0 19px; + font-weight: bold; + min-width: 81px; +} + +.mytheme .v-button-primary:after { + border: inherit; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; +} + +.mytheme .v-button-primary:hover:after { + background-color: rgba(90, 163, 237, 0.1); +} + +.mytheme .v-button-primary:focus:after { + border: inherit; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-button-primary:active:after { + background-color: rgba(2, 62, 122, 0.2); +} + +.v-ie8 .mytheme .v-button-primary { + min-width: 43px; +} + +.mytheme .v-button-friendly { + height: 37px; + padding: 0 16px; + color: #eaf4e9; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #227719; + border-top-color: #257d1a; + border-bottom-color: #1e6b15; + background-color: #2c9720; + background-image: -webkit-linear-gradient(top, #2f9f22 2%, #26881b 98%); + background-image: linear-gradient(to bottom,#2f9f22 2%, #26881b 98%); + -webkit-box-shadow: inset 0 1px 0 #46b33a, inset 0 -1px 0 #26811b, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 #46b33a, inset 0 -1px 0 #26811b, 0 2px 3px rgba(0, 0, 0, 0.05); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05); +} + +.mytheme .v-button-friendly:after { + border: inherit; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; +} + +.mytheme .v-button-friendly:hover:after { + background-color: rgba(65, 211, 48, 0.1); +} + +.mytheme .v-button-friendly:focus:after { + border: inherit; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-button-friendly:active:after { + background-color: rgba(14, 86, 6, 0.2); +} + +.mytheme .v-button-danger { + height: 37px; + padding: 0 16px; + color: #f9f0ef; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #bb382e; + border-top-color: #bc3c31; + border-bottom-color: #b13028; + background-color: #ed473b; + background-image: -webkit-linear-gradient(top, #ee4c3f 2%, #e13e33 98%); + background-image: linear-gradient(to bottom,#ee4c3f 2%, #e13e33 98%); + -webkit-box-shadow: inset 0 1px 0 #ef786f, inset 0 -1px 0 #da3c31, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 #ef786f, inset 0 -1px 0 #da3c31, 0 2px 3px rgba(0, 0, 0, 0.05); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05); +} + +.mytheme .v-button-danger:after { + border: inherit; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; +} + +.mytheme .v-button-danger:hover:after { + background-color: rgba(243, 137, 129, 0.1); +} + +.mytheme .v-button-danger:focus:after { + border: inherit; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-button-danger:active:after { + background-color: rgba(146, 12, 2, 0.2); +} + +.mytheme .v-button-borderless { + border: none; + -webkit-box-shadow: none; + box-shadow: none; + background: transparent; + color: inherit; +} + +.mytheme .v-button-borderless:hover:after { + background: transparent; +} + +.mytheme .v-button-borderless:active { + opacity: 0.7; + filter: alpha(opacity=70) ; +} + +.mytheme .v-button-borderless:active:after { + background: transparent; +} + +.mytheme .v-button-borderless-colored { + border: none; + -webkit-box-shadow: none; + box-shadow: none; + background: transparent; + color: #197de1; +} + +.mytheme .v-button-borderless-colored:hover { + color: #4396ea; +} + +.mytheme .v-button-borderless-colored:hover:after { + background: transparent; +} + +.mytheme .v-button-borderless-colored:active { + opacity: 0.7; + filter: alpha(opacity=70) ; +} + +.mytheme .v-button-borderless-colored:active:after { + background: transparent; +} + +.mytheme .v-button-quiet { + visibility: hidden; +} + +.mytheme .v-button-quiet:focus, .mytheme .v-button-quiet:hover { + visibility: visible; +} + +.mytheme .v-button-quiet [class*="wrap"] { + visibility: visible; +} + +.mytheme .v-button-quiet [class*="caption"] { + display: inline-block; +} + +.mytheme .v-button-link { + border: none; + -webkit-box-shadow: none; + box-shadow: none; + background: transparent; + color: inherit; + cursor: pointer; + color: #197de1; + text-decoration: underline; + font-weight: inherit; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; +} + +.mytheme .v-button-link:hover:after { + background: transparent; +} + +.mytheme .v-button-link:active { + opacity: 0.7; + filter: alpha(opacity=70) ; +} + +.mytheme .v-button-link:active:after { + background: transparent; +} + +.mytheme .v-button-link:hover { + color: #4396ea; +} + +.mytheme .v-button-link.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-button-tiny { + height: 28px; + padding: 0 13px; + + + font-size: 12px; + + border-radius: 4px; +} + +.mytheme .v-button-tiny:after { + border: inherit; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; +} + +.mytheme .v-button-small { + height: 31px; + padding: 0 14px; + + + font-size: 14px; + + border-radius: 4px; +} + +.mytheme .v-button-small:after { + border: inherit; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; +} + +.mytheme .v-button-large { + height: 44px; + padding: 0 19px; + + + font-size: 20px; + + border-radius: 4px; +} + +.mytheme .v-button-large:after { + border: inherit; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; +} + +.mytheme .v-button-huge { + height: 59px; + padding: 0 26px; + + + font-size: 26px; + + border-radius: 4px; +} + +.mytheme .v-button-huge:after { + border: inherit; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; +} + +.mytheme .v-button-icon-align-right [class*="wrap"] { + display: inline-block; +} + +.mytheme .v-button-icon-align-right .v-icon { + float: right; + margin-left: 13px; +} + +.mytheme .v-button-icon-align-right .v-icon + span:not(:empty) { + margin-left: 0; +} + +.mytheme .v-button-icon-align-top { + height: auto; + padding-top: 5px; + padding-bottom: 5px; +} + +.mytheme .v-button-icon-align-top [class*="wrap"] { + display: inline-block; +} + +.mytheme .v-button-icon-align-top .v-icon { + display: block; + margin-left: auto; + margin-right: auto; +} + +.mytheme .v-button-icon-align-top .v-icon + span:not(:empty) { + margin-top: 7px; + margin-left: 0; +} + +.mytheme .v-button-icon-only { + width: 37px; + padding: 0; +} + +.mytheme .v-button-icon-only.v-button-tiny { + width: 28px; +} + +.mytheme .v-button-icon-only.v-button-small { + width: 31px; +} + +.mytheme .v-button-icon-only.v-button-large { + width: 44px; +} + +.mytheme .v-button-icon-only.v-button-huge { + width: 59px; +} + +.mytheme .v-button-icon-only .v-button-caption { + display: none; +} + +.mytheme .v-checkbox { + position: relative; + line-height: 19px; + white-space: nowrap; +} + +.mytheme .v-checkbox.v-has-width label { + white-space: normal; +} + +:root .mytheme .v-checkbox { + padding-left: 25px; +} + +:root .mytheme .v-checkbox label { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + display: inline-block; +} + +:root .mytheme .v-checkbox > input { + position: absolute; + clip: rect(0, 0, 0, 0); + left: 0.2em; + top: 0.2em; + z-index: 0; + margin: 0; +} + +:root .mytheme .v-checkbox > input:focus ~ label:before { + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); +} + +:root .mytheme .v-checkbox > input ~ label:before, :root .mytheme .v-checkbox > input ~ label:after { + content: ""; + display: inline-block; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 19px; + height: 19px; + position: absolute; + top: 0; + left: 0; + border-radius: 4px; + font-size: 13px; + text-align: center; +} + +:root .mytheme .v-checkbox > input ~ label:before { + height: 18.5px; + padding: 0 9px; + color: #191919; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); + padding: 0; + height: 19px; +} + +:root .mytheme .v-checkbox > input ~ label:after { + content: "\f00c"; + font-family: ThemeIcons; + color: transparent; + -webkit-transition: color 100ms; + -moz-transition: color 100ms; + transition: color 100ms; +} + +:root .mytheme .v-checkbox > input:active ~ label:after { + background-color: rgba(125, 125, 125, 0.2); +} + +:root .mytheme .v-checkbox > input:checked ~ label:after { + color: #197de1; +} + +.mytheme .v-checkbox > .v-icon, .mytheme .v-checkbox > label .v-icon { + margin: 0 6px 0 3px; + min-width: 1em; + cursor: pointer; +} + +.mytheme .v-checkbox.v-disabled > label, .mytheme .v-checkbox.v-disabled > .v-icon { + cursor: default; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-checkbox.v-disabled > label > .v-icon { + cursor: default; +} + +:root .mytheme .v-checkbox.v-disabled > input:active ~ label:after { + background: transparent; +} + +.mytheme .v-checkbox.v-readonly > label, .mytheme .v-checkbox.v-readonly > .v-icon { + cursor: default; +} + +.mytheme .v-checkbox.v-readonly > label > .v-icon { + cursor: default; +} + +:root .mytheme .v-checkbox.v-readonly > input:active ~ label:after { + background: transparent; +} + +:root .mytheme .v-checkbox.v-readonly > input ~ label:after { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-checkbox-small { + position: relative; + line-height: 16px; + white-space: nowrap; + font-size: 14px; +} + +.mytheme .v-checkbox-small.v-has-width label { + white-space: normal; +} + +:root .mytheme .v-checkbox-small { + padding-left: 21px; +} + +:root .mytheme .v-checkbox-small label { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + display: inline-block; +} + +:root .mytheme .v-checkbox-small > input { + position: absolute; + clip: rect(0, 0, 0, 0); + left: 0.2em; + top: 0.2em; + z-index: 0; + margin: 0; +} + +:root .mytheme .v-checkbox-small > input:focus ~ label:before { + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); +} + +:root .mytheme .v-checkbox-small > input ~ label:before, :root .mytheme .v-checkbox-small > input ~ label:after { + content: ""; + display: inline-block; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 16px; + height: 16px; + position: absolute; + top: 0; + left: 0; + border-radius: 4px; + font-size: 11px; + text-align: center; +} + +:root .mytheme .v-checkbox-small > input ~ label:before { + height: 15.5px; + padding: 0 7px; + color: #191919; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); + padding: 0; + height: 16px; +} + +:root .mytheme .v-checkbox-small > input ~ label:after { + content: "\f00c"; + font-family: ThemeIcons; + color: transparent; + -webkit-transition: color 100ms; + -moz-transition: color 100ms; + transition: color 100ms; +} + +:root .mytheme .v-checkbox-small > input:active ~ label:after { + background-color: rgba(125, 125, 125, 0.2); +} + +:root .mytheme .v-checkbox-small > input:checked ~ label:after { + color: #197de1; +} + +.mytheme .v-checkbox-small > .v-icon, .mytheme .v-checkbox-small > label .v-icon { + margin: 0 5px 0 3px; + min-width: 1em; + cursor: pointer; +} + +.mytheme .v-checkbox-small.v-disabled > label, .mytheme .v-checkbox-small.v-disabled > .v-icon { + cursor: default; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-checkbox-small.v-disabled > label > .v-icon { + cursor: default; +} + +:root .mytheme .v-checkbox-small.v-disabled > input:active ~ label:after { + background: transparent; +} + +.mytheme .v-checkbox-small.v-readonly > label, .mytheme .v-checkbox-small.v-readonly > .v-icon { + cursor: default; +} + +.mytheme .v-checkbox-small.v-readonly > label > .v-icon { + cursor: default; +} + +:root .mytheme .v-checkbox-small.v-readonly > input:active ~ label:after { + background: transparent; +} + +:root .mytheme .v-checkbox-small.v-readonly > input ~ label:after { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-checkbox-large { + position: relative; + line-height: 22px; + white-space: nowrap; + font-size: 20px; +} + +.mytheme .v-checkbox-large.v-has-width label { + white-space: normal; +} + +:root .mytheme .v-checkbox-large { + padding-left: 29px; +} + +:root .mytheme .v-checkbox-large label { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + display: inline-block; +} + +:root .mytheme .v-checkbox-large > input { + position: absolute; + clip: rect(0, 0, 0, 0); + left: 0.2em; + top: 0.2em; + z-index: 0; + margin: 0; +} + +:root .mytheme .v-checkbox-large > input:focus ~ label:before { + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); +} + +:root .mytheme .v-checkbox-large > input ~ label:before, :root .mytheme .v-checkbox-large > input ~ label:after { + content: ""; + display: inline-block; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 22px; + height: 22px; + position: absolute; + top: 0; + left: 0; + border-radius: 4px; + font-size: 15px; + text-align: center; +} + +:root .mytheme .v-checkbox-large > input ~ label:before { + height: 22px; + padding: 0 10px; + color: #191919; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); + padding: 0; + height: 22px; +} + +:root .mytheme .v-checkbox-large > input ~ label:after { + content: "\f00c"; + font-family: ThemeIcons; + color: transparent; + -webkit-transition: color 100ms; + -moz-transition: color 100ms; + transition: color 100ms; +} + +:root .mytheme .v-checkbox-large > input:active ~ label:after { + background-color: rgba(125, 125, 125, 0.2); +} + +:root .mytheme .v-checkbox-large > input:checked ~ label:after { + color: #197de1; +} + +.mytheme .v-checkbox-large > .v-icon, .mytheme .v-checkbox-large > label .v-icon { + margin: 0 7px 0 4px; + min-width: 1em; + cursor: pointer; +} + +.mytheme .v-checkbox-large.v-disabled > label, .mytheme .v-checkbox-large.v-disabled > .v-icon { + cursor: default; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-checkbox-large.v-disabled > label > .v-icon { + cursor: default; +} + +:root .mytheme .v-checkbox-large.v-disabled > input:active ~ label:after { + background: transparent; +} + +.mytheme .v-checkbox-large.v-readonly > label, .mytheme .v-checkbox-large.v-readonly > .v-icon { + cursor: default; +} + +.mytheme .v-checkbox-large.v-readonly > label > .v-icon { + cursor: default; +} + +:root .mytheme .v-checkbox-large.v-readonly > input:active ~ label:after { + background: transparent; +} + +:root .mytheme .v-checkbox-large.v-readonly > input ~ label:after { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-filterselect { + position: relative; + width: 185px; + height: 37px; + border-radius: 4px; + white-space: nowrap; +} + +.mytheme .v-filterselect [class*="input"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 37px; + border-radius: 4px; + padding: 4px 9px; + border: 1px solid #c5c5c5; + background: white; + color: #474747; + -webkit-box-shadow: inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + width: 100% !important; + height: 100%; + padding-right: 38px; + border-radius: inherit; +} + +.v-ie8 .mytheme .v-filterselect [class*="input"], .v-ie9 .mytheme .v-filterselect [class*="input"] { + line-height: 37px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-filterselect [class*="input"].v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-filterselect [class*="input"]:focus { + outline: none; + -webkit-transition: none; + -moz-transition: none; + transition: none; + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-filterselect [class*="input"][class*="prompt"] { + color: #a3a3a3; +} + +.mytheme .v-filterselect .v-icon + [class*="input"] { + padding-left: 37px; +} + +.mytheme .v-filterselect img.v-icon { + max-height: 37px; + margin-left: 9px; +} + +.mytheme .v-filterselect span.v-icon { + color: #474747; + width: 37px; + line-height: 1; + padding-top: 0.12em; +} + +.mytheme .v-filterselect[class*="prompt"] > [class*="input"] { + color: #a3a3a3; +} + +.mytheme .v-filterselect [class$="button"] { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + position: absolute; + width: 37px; + top: 1px; + right: 1px; + bottom: 1px; + border-left: 1px solid #e4e4e4; + color: #a3a3a3; + border-radius: 0 3px 3px 0; +} + +.v-ie8 .mytheme .v-filterselect [class$="button"] { + background-color: white; +} + +.mytheme .v-filterselect [class$="button"]:before { + font-family: ThemeIcons; + content: "\f078"; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; + position: absolute; + width: 37px; + text-align: center; + top: 50%; + line-height: 1; + margin-top: -0.47em; +} + +.mytheme .v-filterselect [class$="button"]:hover:before { + color: #474747; +} + +.mytheme .v-filterselect [class$="button"]:active:after { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: inherit; + background-color: rgba(128, 128, 128, 0.2); +} + +.mytheme .v-filterselect.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-filterselect.v-disabled [class$="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-filterselect.v-disabled [class$="button"]:active:after { + display: none; +} + +.mytheme .v-filterselect.v-readonly [class*="input"] { + background: #fafafa; + color: #464646; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-filterselect.v-readonly [class*="input"]:focus { + box-shadow: none; + border-color: #c5c5c5; +} + +.mytheme .v-filterselect.v-readonly [class$="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-filterselect.v-readonly [class$="button"]:active:after { + display: none; +} + +.mytheme .v-filterselect .v-icon { + position: absolute; + pointer-events: none; +} + +.mytheme .v-filterselect-error .v-filterselect-input { + border-color: #ed473b !important; + background: #fffbfb; + color: #6c2621; +} + +.mytheme .v-filterselect-error .v-filterselect-button { + color: #ed473b; + border-color: #ed473b; +} + +.mytheme .v-filterselect-suggestpopup { + margin-top: 5px !important; +} + +.mytheme .v-filterselect-suggestpopup[class*="animate-in"] { + -webkit-animation: valo-overlay-animate-in 120ms; + -moz-animation: valo-overlay-animate-in 120ms; + animation: valo-overlay-animate-in 120ms; +} + +.mytheme .v-filterselect-suggestpopup [class$="suggestmenu"] { + padding: 4px 4px; + border-radius: 4px; + background-color: white; + color: #474747; + -webkit-box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.1), 0 3px 5px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.09098); + box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.1), 0 3px 5px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.09098); + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; + padding: 4px 4px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + position: relative; + z-index: 1; + display: block; +} + +.mytheme .v-filterselect-suggestpopup table, .mytheme .v-filterselect-suggestpopup tbody, .mytheme .v-filterselect-suggestpopup tr, .mytheme .v-filterselect-suggestpopup td { + display: block; + width: 100%; + overflow-y: hidden; + float: left; + clear: both; +} + +.mytheme .v-filterselect-suggestpopup .gwt-MenuItem { + cursor: pointer; + line-height: 27px; + padding: 0 20px 0 10px; + border-radius: 3px; + font-weight: 400; + white-space: nowrap; + position: relative; + height: 27px; + box-sizing: border-box; + text-overflow: ellipsis; + overflow-x: hidden; +} + +.mytheme .v-filterselect-suggestpopup .gwt-MenuItem:active:before { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + background: #0957a6; + opacity: 0.15; + filter: alpha(opacity=15.0) ; + pointer-events: none; + border-radius: inherit; +} + +.mytheme .v-filterselect-suggestpopup .gwt-MenuItem .v-icon { + max-height: 27px; + margin-right: 5px; + min-width: 1em; +} + +.mytheme .v-filterselect-suggestpopup .gwt-MenuItem-selected { + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + color: #ecf2f8; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05); +} + +.mytheme .v-filterselect-suggestpopup [class$="status"] { + position: absolute; + right: 4px; + background: rgba(212, 212, 212, 0.9); + color: #3b3b3b; + border-radius: 0 0 4px 4px; + height: 23px; + bottom: -23px; + font-size: 12px; + line-height: 23px; + padding: 0 6px; + cursor: default; + pointer-events: none; + -webkit-animation: valo-animate-in-slide-down 200ms 80ms backwards; + -moz-animation: valo-animate-in-slide-down 200ms 80ms backwards; + animation: valo-animate-in-slide-down 200ms 80ms backwards; +} + +.mytheme .v-filterselect-suggestpopup [class$="status"] > * { + color: #3b3b3b; + text-decoration: none; +} + +.mytheme .v-filterselect-suggestpopup div[class*="page"] { + position: absolute; + z-index: 3; + right: 0; + opacity: 0.2; + filter: alpha(opacity=20) ; + cursor: pointer; + -webkit-transition: all 200ms; + -moz-transition: all 200ms; + transition: all 200ms; + width: 25px; + height: 25px; + line-height: 25px; + text-align: center; + font-family: ThemeIcons; + -webkit-transform: scale(0.8); + -moz-transform: scale(0.8); + -ms-transform: scale(0.8); + -o-transform: scale(0.8); + transform: scale(0.8); + color: #464646; +} + +.mytheme .v-filterselect-suggestpopup div[class*="page"]:after { + content: ""; + position: absolute; + display: block; + border-radius: 50%; +} + +.mytheme .v-filterselect-suggestpopup div[class*="page"]:hover { + opacity: 1; + filter: none ; + background: rgba(250, 250, 250, 0.5); +} + +.mytheme .v-filterselect-suggestpopup div[class*="page"]:hover:after { + top: -10px; + bottom: -10px; + left: -20px; + right: -20px; +} + +.mytheme .v-filterselect-suggestpopup div[class*="page"] span { + display: none; +} + +.mytheme .v-filterselect-suggestpopup:hover div[class*="page"] { + -webkit-transform: scale(1); + -moz-transform: scale(1); + -ms-transform: scale(1); + -o-transform: scale(1); + transform: scale(1); +} + +.mytheme .v-filterselect-suggestpopup div[class*="prev"] { + top: 0; + -webkit-transform-origin: 100% 0%; + -moz-transform-origin: 100% 0%; + -ms-transform-origin: 100% 0%; + -o-transform-origin: 100% 0%; + transform-origin: 100% 0%; + border-radius: 0 4px 0 4px; +} + +.mytheme .v-filterselect-suggestpopup div[class*="prev"]:before { + content: "\f0d8"; +} + +.mytheme .v-filterselect-suggestpopup div[class*="next"] { + bottom: 0; + -webkit-transform-origin: 100% 100%; + -moz-transform-origin: 100% 100%; + -ms-transform-origin: 100% 100%; + -o-transform-origin: 100% 100%; + transform-origin: 100% 100%; + border-radius: 4px 0 4px 0; +} + +.mytheme .v-filterselect-suggestpopup div[class*="next"]:before { + content: "\f0d7"; +} + +.mytheme .v-filterselect-suggestpopup div[class*="-off"] { + display: none; +} + +.mytheme .v-filterselect-no-input { + cursor: pointer; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); +} + +.mytheme .v-filterselect-no-input [class*="input"] { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + cursor: inherit; + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + text-shadow: inherit; + text-overflow: ellipsis; + border-radius: inherit; +} + +.mytheme .v-filterselect-no-input [class*="input"]:focus { + outline: none; + -webkit-transition: none; + -moz-transition: none; + transition: none; + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-filterselect-no-input [class$="button"] { + border-left: none !important; +} + +.mytheme .v-filterselect-no-input:hover [class$="button"]:before { + color: inherit; +} + +.mytheme .v-filterselect-borderless .v-filterselect-input { + border: none; + border-radius: 0; + background: transparent; + -webkit-box-shadow: none; + box-shadow: none; + color: inherit; +} + +.mytheme .v-filterselect-borderless .v-filterselect-input:focus { + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-filterselect-borderless .v-filterselect-input[class*="prompt"] { + color: inherit; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-filterselect-borderless .v-filterselect-button { + border: none; + color: inherit; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-filterselect-borderless.v-filterselect-prompt .v-filterselect-input { + color: inherit; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-filterselect-align-right input { + text-align: right; +} + +.mytheme .v-filterselect-align-center input { + text-align: center; +} + +.mytheme .v-filterselect-tiny { + height: 28px; + + font-size: 12px; +} + +.mytheme .v-filterselect-tiny [class*="input"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 28px; + + padding: 3px 5px; + + + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + width: 100% !important; + height: 100%; + padding-right: 29px; + border-radius: inherit; +} + +.v-ie8 .mytheme .v-filterselect-tiny [class*="input"], .v-ie9 .mytheme .v-filterselect-tiny [class*="input"] { + line-height: 28px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-filterselect-tiny .v-icon + [class*="input"] { + padding-left: 28px; +} + +.mytheme .v-filterselect-tiny img.v-icon { + max-height: 28px; + margin-left: 5px; +} + +.mytheme .v-filterselect-tiny span.v-icon { + + width: 28px; + line-height: 1; + padding-top: 0.12em; +} + +.mytheme .v-filterselect-tiny [class$="button"] { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + position: absolute; + width: 28px; + border-radius: 0 4px 4px 0; +} + +.mytheme .v-filterselect-tiny [class$="button"]:before { + font-family: ThemeIcons; + content: "\f078"; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; + position: absolute; + width: 28px; + text-align: center; + top: 50%; + line-height: 1; + margin-top: -0.47em; +} + +.mytheme .v-filterselect-tiny [class$="button"]:active:after { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: inherit; +} + +.mytheme .v-filterselect-tiny.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-filterselect-tiny.v-disabled [class$="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-filterselect-tiny.v-disabled [class$="button"]:active:after { + display: none; +} + +.mytheme .v-filterselect-tiny.v-readonly [class*="input"] { + background: #fafafa; + color: #464646; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-filterselect-tiny.v-readonly [class*="input"]:focus { + box-shadow: none; + border-color: #c5c5c5; +} + +.mytheme .v-filterselect-tiny.v-readonly [class$="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-filterselect-tiny.v-readonly [class$="button"]:active:after { + display: none; +} + +.mytheme .v-filterselect-compact, .mytheme .v-filterselect-small { + height: 31px; + +} + +.mytheme .v-filterselect-compact [class*="input"], .mytheme .v-filterselect-small [class*="input"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 31px; + + padding: 3px 6px; + + + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + width: 100% !important; + height: 100%; + padding-right: 32px; + border-radius: inherit; +} + +.v-ie8 .mytheme .v-filterselect-compact [class*="input"], .v-ie9 .mytheme .v-filterselect-compact [class*="input"], .v-ie8 .mytheme .v-filterselect-small [class*="input"], .v-ie9 .mytheme .v-filterselect-small [class*="input"] { + line-height: 31px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-filterselect-compact .v-icon + [class*="input"], .mytheme .v-filterselect-small .v-icon + [class*="input"] { + padding-left: 31px; +} + +.mytheme .v-filterselect-compact img.v-icon, .mytheme .v-filterselect-small img.v-icon { + max-height: 31px; + margin-left: 6px; +} + +.mytheme .v-filterselect-compact span.v-icon, .mytheme .v-filterselect-small span.v-icon { + + width: 31px; + line-height: 1; + padding-top: 0.12em; +} + +.mytheme .v-filterselect-compact [class$="button"], .mytheme .v-filterselect-small [class$="button"] { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + position: absolute; + width: 31px; + border-radius: 0 4px 4px 0; +} + +.mytheme .v-filterselect-compact [class$="button"]:before, .mytheme .v-filterselect-small [class$="button"]:before { + font-family: ThemeIcons; + content: "\f078"; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; + position: absolute; + width: 31px; + text-align: center; + top: 50%; + line-height: 1; + margin-top: -0.47em; +} + +.mytheme .v-filterselect-compact [class$="button"]:active:after, .mytheme .v-filterselect-small [class$="button"]:active:after { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: inherit; +} + +.mytheme .v-filterselect-compact.v-disabled, .mytheme .v-filterselect-small.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-filterselect-compact.v-disabled [class$="button"], .mytheme .v-filterselect-small.v-disabled [class$="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-filterselect-compact.v-disabled [class$="button"]:active:after, .mytheme .v-filterselect-small.v-disabled [class$="button"]:active:after { + display: none; +} + +.mytheme .v-filterselect-compact.v-readonly [class*="input"], .mytheme .v-filterselect-small.v-readonly [class*="input"] { + background: #fafafa; + color: #464646; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-filterselect-compact.v-readonly [class*="input"]:focus, .mytheme .v-filterselect-small.v-readonly [class*="input"]:focus { + box-shadow: none; + border-color: #c5c5c5; +} + +.mytheme .v-filterselect-compact.v-readonly [class$="button"], .mytheme .v-filterselect-small.v-readonly [class$="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-filterselect-compact.v-readonly [class$="button"]:active:after, .mytheme .v-filterselect-small.v-readonly [class$="button"]:active:after { + display: none; +} + +.mytheme .v-filterselect-small { + font-size: 14px; +} + +.mytheme .v-filterselect-large { + height: 44px; + + font-size: 20px; +} + +.mytheme .v-filterselect-large [class*="input"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 44px; + + padding: 5px 8px; + + + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + width: 100% !important; + height: 100%; + padding-right: 45px; + border-radius: inherit; +} + +.v-ie8 .mytheme .v-filterselect-large [class*="input"], .v-ie9 .mytheme .v-filterselect-large [class*="input"] { + line-height: 44px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-filterselect-large .v-icon + [class*="input"] { + padding-left: 44px; +} + +.mytheme .v-filterselect-large img.v-icon { + max-height: 44px; + margin-left: 8px; +} + +.mytheme .v-filterselect-large span.v-icon { + + width: 44px; + line-height: 1; + padding-top: 0.12em; +} + +.mytheme .v-filterselect-large [class$="button"] { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + position: absolute; + width: 44px; + border-radius: 0 4px 4px 0; +} + +.mytheme .v-filterselect-large [class$="button"]:before { + font-family: ThemeIcons; + content: "\f078"; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; + position: absolute; + width: 44px; + text-align: center; + top: 50%; + line-height: 1; + margin-top: -0.47em; +} + +.mytheme .v-filterselect-large [class$="button"]:active:after { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: inherit; +} + +.mytheme .v-filterselect-large.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-filterselect-large.v-disabled [class$="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-filterselect-large.v-disabled [class$="button"]:active:after { + display: none; +} + +.mytheme .v-filterselect-large.v-readonly [class*="input"] { + background: #fafafa; + color: #464646; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-filterselect-large.v-readonly [class*="input"]:focus { + box-shadow: none; + border-color: #c5c5c5; +} + +.mytheme .v-filterselect-large.v-readonly [class$="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-filterselect-large.v-readonly [class$="button"]:active:after { + display: none; +} + +.mytheme .v-filterselect-huge { + height: 59px; + + font-size: 26px; +} + +.mytheme .v-filterselect-huge [class*="input"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 59px; + + padding: 7px 10px; + + + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + width: 100% !important; + height: 100%; + padding-right: 60px; + border-radius: inherit; +} + +.v-ie8 .mytheme .v-filterselect-huge [class*="input"], .v-ie9 .mytheme .v-filterselect-huge [class*="input"] { + line-height: 59px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-filterselect-huge .v-icon + [class*="input"] { + padding-left: 59px; +} + +.mytheme .v-filterselect-huge img.v-icon { + max-height: 59px; + margin-left: 10px; +} + +.mytheme .v-filterselect-huge span.v-icon { + + width: 59px; + line-height: 1; + padding-top: 0.12em; +} + +.mytheme .v-filterselect-huge [class$="button"] { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + position: absolute; + width: 59px; + border-radius: 0 4px 4px 0; +} + +.mytheme .v-filterselect-huge [class$="button"]:before { + font-family: ThemeIcons; + content: "\f078"; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; + position: absolute; + width: 59px; + text-align: center; + top: 50%; + line-height: 1; + margin-top: -0.47em; +} + +.mytheme .v-filterselect-huge [class$="button"]:active:after { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: inherit; +} + +.mytheme .v-filterselect-huge.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-filterselect-huge.v-disabled [class$="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-filterselect-huge.v-disabled [class$="button"]:active:after { + display: none; +} + +.mytheme .v-filterselect-huge.v-readonly [class*="input"] { + background: #fafafa; + color: #464646; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-filterselect-huge.v-readonly [class*="input"]:focus { + box-shadow: none; + border-color: #c5c5c5; +} + +.mytheme .v-filterselect-huge.v-readonly [class$="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-filterselect-huge.v-readonly [class$="button"]:active:after { + display: none; +} + +.mytheme .v-csslayout-well { + background: #f5f5f5; + color: #454545; + -webkit-box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.05), inset 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.05), inset 0 2px 3px rgba(0, 0, 0, 0.05); + border-radius: 4px; + border: 1px solid #c5c5c5; +} + +.mytheme .v-csslayout-well > div > [class*="-caption"] { + background: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-csslayout-well > .v-margin-top { + padding-top: 12px; +} + +.mytheme .v-csslayout-well > .v-margin-right { + padding-right: 12px; +} + +.mytheme .v-csslayout-well > .v-margin-bottom { + padding-bottom: 12px; +} + +.mytheme .v-csslayout-well > .v-margin-left { + padding-left: 12px; +} + +.mytheme .v-csslayout-card { + background: white; + color: #474747; + border-radius: 4px; + border: 1px solid #d5d5d5; + -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); +} + +.mytheme .v-csslayout-card > .v-margin-top { + padding-top: 12px; +} + +.mytheme .v-csslayout-card > .v-margin-right { + padding-right: 12px; +} + +.mytheme .v-csslayout-card > .v-margin-bottom { + padding-bottom: 12px; +} + +.mytheme .v-csslayout-card > .v-margin-left { + padding-left: 12px; +} + +.mytheme .v-csslayout-v-component-group { + white-space: nowrap; + position: relative; +} + +.mytheme .v-csslayout-v-component-group .v-widget ~ .v-widget:not(:last-child) { + border-radius: 0; +} + +.mytheme .v-csslayout-v-component-group .v-widget:last-child { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.mytheme .v-csslayout-v-component-group .v-widget:first-child, .mytheme .v-csslayout-v-component-group .v-caption:first-child + .v-widget { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +.mytheme .v-csslayout-v-component-group .v-widget ~ .v-widget.first.first { + border-radius: 4px 0 0 4px; +} + +.mytheme .v-csslayout-v-component-group .v-widget ~ .v-widget.last.last { + border-radius: 0 4px 4px 0; +} + +.mytheme .v-csslayout-v-component-group .v-widget { + vertical-align: middle; + margin-left: -1px; +} + +.mytheme .v-csslayout-v-component-group .v-widget:first-child { + margin-left: 0; +} + +.mytheme .v-csslayout-v-component-group .v-widget:focus, .mytheme .v-csslayout-v-component-group .v-widget[class*="focus"], .mytheme .v-csslayout-v-component-group .v-widget [class*="focus"] { + position: relative; + z-index: 5; +} + +.mytheme .v-form fieldset { + border: none; + padding: 0; + margin: 0; + height: 100%; +} + +.mytheme .v-form-content { + height: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.mytheme [class*="spacing"] > tbody > [class*="row"] > td { + padding-top: 12px; +} + +.mytheme [class*="spacing"] > tbody > [class*="firstrow"] > td { + padding-top: 0; +} + +.mytheme [class*="margin-top"] > tbody > [class*="firstrow"] > td { + padding-top: 37px; +} + +.mytheme [class*="margin-bottom"] > tbody > [class*="lastrow"] > td { + padding-bottom: 37px; +} + +.mytheme [class*="margin-left"] > tbody > [class*="row"] > [class*="captioncell"] { + padding-left: 37px; +} + +.mytheme [class*="margin-left"] > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h2, .mytheme [class*="margin-left"] > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h3, .mytheme [class*="margin-left"] > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h4 { + left: 37px; +} + +.mytheme [class*="margin-right"] > tbody > [class*="row"] > [class*="contentcell"] { + padding-right: 37px; +} + +.mytheme [class*="margin-right"] > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h2, .mytheme [class*="margin-right"] > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h3, .mytheme [class*="margin-right"] > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h4 { + right: 37px; +} + +.mytheme .v-formlayout > table { + border-spacing: 0; + position: relative; +} + +.mytheme .v-formlayout.v-has-width > table, .mytheme .v-formlayout.v-has-width .v-formlayout-contentcell { + width: 100%; +} + +.mytheme .v-formlayout-error-indicator { + width: 19px; +} + +.mytheme .v-formlayout-captioncell { + vertical-align: top; + line-height: 36px; +} + +.mytheme .v-formlayout-captioncell .v-caption { + padding-bottom: 0; +} + +.mytheme .v-formlayout-captioncell .v-caption-h2, .mytheme .v-formlayout-captioncell .v-caption-h3, .mytheme .v-formlayout-captioncell .v-caption-h4 { + height: 3em; +} + +.mytheme .v-formlayout-contentcell .v-checkbox, .mytheme .v-formlayout-contentcell .v-radiobutton { + font-weight: 400; +} + +.mytheme .v-formlayout-contentcell > .v-label-h2, .mytheme .v-formlayout-contentcell > .v-label-h3, .mytheme .v-formlayout-contentcell > .v-label-h4 { + position: absolute; + left: 0; + right: 0; + width: auto !important; + margin-top: -0.5em; + padding-bottom: 0.5em; + border-bottom: 1px solid #dfdfdf; +} + +.mytheme .v-formlayout.light > table { + padding: 0; +} + +.mytheme .v-formlayout.light > table > tbody > tr > td { + padding-top: 0; + height: 37px; + border-bottom: 1px solid #eaeaea; +} + +.mytheme .v-formlayout.light > table > tbody > [class*="lastrow"] > td { + border-bottom: none; +} + +.mytheme .v-formlayout.light > table > tbody > tr > [class*="captioncell"] { + color: #7d7d7d; + text-align: right; + padding-left: 13px; + line-height: 37px; +} + +.mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] { + padding-right: 0; +} + +.mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textfield, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textarea, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-filterselect, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-datefield, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-filterselect-input, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-datefield-textfield { + width: 100%; +} + +.mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textfield, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textarea, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-filterselect input, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-datefield input, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-richtextarea { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 37px; + border-radius: 0; + padding: 4px 7px; + + -webkit-box-shadow: none; + box-shadow: none; + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + background: transparent; + border: none; + color: inherit; +} + +.v-ie8 .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textfield, .v-ie9 .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textfield, .v-ie8 .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textarea, .v-ie9 .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textarea, .v-ie8 .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-filterselect input, .v-ie9 .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-filterselect input, .v-ie8 .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-datefield input, .v-ie9 .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-datefield input, .v-ie8 .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-richtextarea, .v-ie9 .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-richtextarea { + line-height: 37px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textfield.v-disabled, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textarea.v-disabled, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-filterselect input.v-disabled, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-datefield input.v-disabled, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-richtextarea.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textfield:focus, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textarea:focus, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-filterselect input:focus, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-datefield input:focus, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-richtextarea:focus { + outline: none; + -webkit-transition: none; + -moz-transition: none; + transition: none; + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), none; + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), none; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textfield:focus, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textarea:focus, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-filterselect input:focus, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-datefield input:focus, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-richtextarea:focus { + box-shadow: none; +} + +.mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textfield-prompt, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textarea-prompt, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-filterselect-prompt input, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-datefield-prompt input { + color: #a3a3a3; +} + +.mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-textarea, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-richtextarea { + height: auto; +} + +.mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h2, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h3, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h4 { + border-bottom: none; + left: 0; + right: 0; +} + +.mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h3, .mytheme .v-formlayout.light > table > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h4 { + margin-top: 0; +} + +.mytheme .v-formlayout.light .v-richtextarea { + margin: 5px 0; +} + +.mytheme .v-formlayout.light .v-filterselect-button, .mytheme .v-formlayout.light .v-datefield-button { + border: none; +} + +.mytheme .v-formlayout.light .v-filterselect-button:active:after, .mytheme .v-formlayout.light .v-datefield-button:active:after { + display: none; +} + +.mytheme .v-formlayout.light .v-datefield-button { + right: 0; + left: auto; +} + +.mytheme .v-formlayout.light .v-checkbox { + margin-left: 7px; +} + +.mytheme .v-grid { + position: relative; +} + +.mytheme .v-grid-scroller { + position: absolute; + z-index: 1; + outline: none; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.mytheme .v-grid-scroller-horizontal { + left: 0; + right: 0; + bottom: 0; + overflow-y: hidden; + -ms-overflow-y: hidden; +} + +.mytheme .v-grid-scroller-vertical { + right: 0; + top: 0; + bottom: 0; + overflow-x: hidden; + -ms-overflow-x: hidden; +} + +.mytheme .v-grid-tablewrapper { + position: absolute; + overflow: hidden; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + z-index: 5; +} + +.mytheme .v-grid-tablewrapper > table { + border-spacing: 0; + table-layout: fixed; + width: inherit; +} + +.mytheme .v-grid-header-deco, .mytheme .v-grid-footer-deco { + position: absolute; + right: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.mytheme .v-grid-horizontal-scrollbar-deco { + position: absolute; + bottom: 0; + left: 0; + right: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.mytheme .v-grid-header, .mytheme .v-grid-body, .mytheme .v-grid-footer { + position: absolute; + left: 0; + width: inherit; + z-index: 10; +} + +.mytheme .v-grid-header, .mytheme .v-grid-header-deco { + top: 0; +} + +.mytheme .v-grid-footer, .mytheme .v-grid-footer-deco { + bottom: 0; +} + +.mytheme .v-grid-body { + -ms-touch-action: none; + touch-action: none; + z-index: 0; + top: 0; +} + +.mytheme .v-grid-body .v-grid-row { + position: absolute; + top: 0; + left: 0; +} + +.mytheme .v-grid-row { + display: block; +} + +.v-ie8 .mytheme .v-grid-row, .v-ie9 .mytheme .v-grid-row { + float: left; + clear: left; + margin-top: 0; +} + +.mytheme .v-grid-row > td, .mytheme .v-grid-row > th { + background-color: white; +} + +.mytheme .v-grid-row { + width: inherit; +} + +.mytheme .v-grid-cell { + display: block; + float: left; + padding: 2px; + white-space: nowrap; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + overflow: hidden; + font-size: 16px; +} + +.mytheme .v-grid-cell.frozen { + position: relative; + z-index: 1; +} + +.mytheme .v-grid-spacer { + position: absolute; + display: block; + background-color: white; +} + +.mytheme .v-grid-spacer > td { + width: 100%; + height: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.v-ie8 .mytheme .v-grid-spacer, .v-ie9 .mytheme .v-grid-spacer { + margin-top: 0; +} + +.mytheme .v-grid { + outline: none; +} + +.mytheme .v-grid-scroller-vertical, .mytheme .v-grid-scroller-horizontal { + border: 1px solid #d4d4d4; +} + +.mytheme .v-grid-scroller-vertical { + border-left: none; +} + +.mytheme .v-grid-scroller-horizontal { + border-top: none; +} + +.mytheme .v-grid-tablewrapper { + border: 1px solid #d4d4d4; +} + +.mytheme .v-grid .header-drag-table { + border-spacing: 0; + position: relative; + table-layout: fixed; + width: inherit; +} + +.mytheme .v-grid .header-drag-table .v-grid-header { + position: absolute; +} + +.mytheme .v-grid .header-drag-table .v-grid-header > .v-grid-cell { + border: 1px solid #d4d4d4; + margin-top: -10px; + opacity: 0.9; + filter: alpha(opacity=90); + z-index: 30000; +} + +.mytheme .v-grid .header-drag-table .v-grid-header > .v-grid-drop-marker { + background-color: #197de1; + position: absolute; + width: 3px; +} + +.mytheme .v-grid-sidebar.v-contextmenu { + -webkit-box-shadow: none; + box-shadow: none; + border-radius: 0; + position: absolute; + top: 0; + right: 0; + background-color: #fafafa; + border: 1px solid #d4d4d4; + padding: 0; + z-index: 5; +} + +.mytheme .v-grid-sidebar.v-contextmenu.v-grid-sidebar-popup { + right: auto; +} + +.mytheme .v-grid-sidebar.v-contextmenu .v-grid-sidebar-button { + background: transparent; + border: none; + color: inherit; + cursor: pointer; + outline: none; + padding: 0 4px; + text-align: right; + line-height: 1; +} + +.mytheme .v-grid-sidebar.v-contextmenu .v-grid-sidebar-button[disabled] { + cursor: default; +} + +.mytheme .v-grid-sidebar.v-contextmenu .v-grid-sidebar-button::-moz-focus-inner { + border: 0; +} + +.mytheme .v-grid-sidebar.v-contextmenu .v-grid-sidebar-button:after { + content: "\f0c9"; + display: block; + font-family: ThemeIcons, sans-serif; + font-size: 14px; +} + +.mytheme .v-grid-sidebar.v-contextmenu.closed { + border-radius: 0; +} + +.mytheme .v-grid-sidebar.v-contextmenu.open .v-grid-sidebar-button { + width: 100%; +} + +.mytheme .v-grid-sidebar.v-contextmenu.open .v-grid-sidebar-button:after { + content: "\f0c9"; + font-size: 14px; + line-height: 1; +} + +.v-ie .mytheme .v-grid-sidebar.v-contextmenu.open .v-grid-sidebar-button { + vertical-align: middle; +} + +.v-ie8 .mytheme .v-grid-sidebar.v-contextmenu.open .v-grid-sidebar-button:after { + vertical-align: middle; + text-align: center; + display: inline; +} + +.mytheme .v-grid-sidebar.v-contextmenu .v-grid-sidebar-content { + padding: 4px 0; + overflow-y: auto; + overflow-x: hidden; +} + +.mytheme .v-grid-sidebar.v-contextmenu .v-grid-sidebar-content .gwt-MenuBar .gwt-MenuItem .column-hiding-toggle { + text-shadow: none; +} + +.mytheme .v-grid-cell { + background-color: white; + padding: 0 18px; + line-height: 37px; + text-overflow: ellipsis; +} + +.mytheme .v-grid-cell > * { + line-height: 1.55; + vertical-align: middle; +} + +.mytheme .v-grid-cell > div { + display: inline-block; +} + +.mytheme .v-grid-cell.frozen { + -webkit-box-shadow: 1px 0 2px rgba(0, 0, 0, 0.1); + box-shadow: 1px 0 2px rgba(0, 0, 0, 0.1); + border-right: 1px solid #d4d4d4; +} + +.mytheme .v-grid-cell.frozen + th, .mytheme .v-grid-cell.frozen + td { + border-left: none; +} + +.mytheme .v-grid-row > td, .mytheme .v-grid-editor-cells > div { + border-left: 1px solid #d4d4d4; + border-bottom: 1px solid #d4d4d4; +} + +.mytheme .v-grid-row > td:first-child, .mytheme .v-grid-editor-cells > div:first-child { + border-left: none; +} + +.mytheme .v-grid-editor-cells.frozen > div { + -webkit-box-shadow: 1px 0 2px rgba(0, 0, 0, 0.1); + box-shadow: 1px 0 2px rgba(0, 0, 0, 0.1); + border-right: 1px solid #d4d4d4; + border-left: none; +} + +.mytheme .v-grid-row-stripe > td { + background-color: #f5f5f5; +} + +.mytheme .v-grid-row-selected > td { + background: #197de1; +} + +.mytheme .v-grid-row-focused > td { + +} + +.mytheme .v-grid-header th { + position: relative; + background-color: #fafafa; + font-size: 14px; + font-weight: inherit; + border-left: 1px solid #d4d4d4; + border-bottom: 1px solid #d4d4d4; + + text-align: left; +} + +.mytheme .v-grid-header th:first-child { + border-left: none; +} + +.mytheme .v-grid-header .sort-asc, .mytheme .v-grid-header .sort-desc { + padding-right: 35px; +} + +.mytheme .v-grid-header .sort-asc:after, .mytheme .v-grid-header .sort-desc:after { + font-family: ThemeIcons, sans-serif; + content: "\f0de" " " attr(sort-order); + position: absolute; + right: 18px; + font-size: 12px; +} + +.mytheme .v-grid-header .sort-desc:after { + content: "\f0dd" " " attr(sort-order); +} + +.mytheme .v-grid-column-resize-handle { + position: absolute; + width: 36px; + right: -18px; + top: 0px; + bottom: 0px; + cursor: col-resize; + z-index: 10; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.mytheme .v-grid-column-resize-simple-indicator { + position: absolute; + width: 3px; + top: 0px; + left: 18px; + z-index: 9001; + background: #fff; + box-shadow: 0px 0px 5px #000; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.mytheme .v-grid-footer td { + background-color: #fafafa; + font-size: 14px; + font-weight: inherit; + border-left: 1px solid #d4d4d4; + border-top: 1px solid #d4d4d4; + border-bottom: none; + +} + +.mytheme .v-grid-footer td:first-child { + border-left: none; +} + +.mytheme .v-grid-header .v-grid-cell, .mytheme .v-grid-footer .v-grid-cell { + overflow: visible; +} + +.mytheme .v-grid-column-header-content, .mytheme .v-grid-column-footer-content { + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + line-height: 37px; + vertical-align: baseline; +} + +.mytheme .v-grid-header-deco { + border-top: 1px solid #d4d4d4; + border-right: 1px solid #d4d4d4; + background-color: #fafafa; +} + +.mytheme .v-grid-footer-deco { + border-bottom: 1px solid #d4d4d4; + border-right: 1px solid #d4d4d4; + background-color: #fafafa; +} + +.mytheme .v-grid-horizontal-scrollbar-deco { + background-color: #fafafa; + border: 1px solid #d4d4d4; + border-top: none; +} + +.mytheme .v-grid-cell-focused { + position: relative; +} + +.mytheme .v-grid-cell-focused:before { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border: 2px solid #197de1; + display: none; + pointer-events: none; +} + +.ie8 .mytheme .v-grid-cell-focused:before, .ie9 .mytheme .v-grid-cell-focused:before, .ie10 .mytheme .v-grid-cell-focused:before { + content: url(data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==); +} + +.mytheme .v-grid:focus .v-grid-cell-focused:before { + display: block; +} + +.mytheme .v-grid.v-disabled:focus .v-grid-cell-focused:before { + display: none; +} + +.mytheme .v-grid-editor { + position: absolute; + z-index: 20; + overflow: hidden; + left: 0; + right: 0; + border: 1px solid #d4d4d4; + box-sizing: border-box; + -moz-box-sizing: border-box; + margin-top: -1px; + -webkit-box-shadow: 0 0 9px rgba(0, 0, 0, 0.2); + box-shadow: 0 0 9px rgba(0, 0, 0, 0.2); +} + +.mytheme .v-grid-editor.unbuffered .v-grid-editor-footer { + width: 100%; +} + +.mytheme .v-grid-editor-cells { + position: relative; + white-space: nowrap; +} + +.mytheme .v-grid-editor-cells.frozen { + z-index: 2; +} + +.mytheme .v-grid-editor-cells > div { + display: inline-block; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + vertical-align: middle; + background: white; +} + +.mytheme .v-grid-editor-cells > div:first-child { + border-left: none; +} + +.mytheme .v-grid-editor-cells > div > * { + vertical-align: middle; + display: inline-block; +} + +.mytheme .v-grid-editor-cells > div .v-filterselect { + padding-left: 0; +} + +.mytheme .v-grid-editor-cells > div input[type="text"], .mytheme .v-grid-editor-cells > div input[type="text"].v-filterselect-input, .mytheme .v-grid-editor-cells > div input[type="password"] { + padding-left: 18px; +} + +.mytheme .v-grid-editor-cells > div input[type="text"]:not(.v-filterselect-input), .mytheme .v-grid-editor-cells > div input[type="password"] { + padding-right: 9px; +} + +.mytheme .v-grid-editor-cells > div input[type="checkbox"] { + margin-left: 18px; +} + +.mytheme .v-grid-editor-cells > div .v-textfield, .mytheme .v-grid-editor-cells > div .v-datefield, .mytheme .v-grid-editor-cells > div .v-filterselect { + min-width: 100%; + max-width: 100%; + min-height: 100%; + max-height: 100%; +} + +.v-ie8 .mytheme .v-grid-editor-cells > div .v-datefield-button { + margin-left: -37px; +} + +.v-ie8 .mytheme .v-grid-editor-cells > div .v-filterselect-button { + margin-left: -25px; +} + +.mytheme .v-grid-editor-cells > div .v-select, .mytheme .v-grid-editor-cells > div .v-select-select { + min-width: 100%; + max-width: 100%; +} + +.mytheme .v-grid-editor-cells > div.not-editable.v-grid-cell { + float: none; +} + +.mytheme .v-grid-editor-cells .error::before { + position: absolute; + display: block; + height: 0; + width: 0; + content: ""; + border-top: 5px solid red; + border-right: 5px solid transparent; +} + +.mytheme .v-grid-editor-cells .error, .mytheme .v-grid-editor-cells .error > input { + background-color: #fee; +} + +.mytheme .v-grid-editor-footer { + display: table; + height: 37px; + border-top: 1px solid #d4d4d4; + margin-top: -1px; + background: white; + padding: 0 5px; +} + +.mytheme .v-grid-editor-footer + .v-grid-editor-cells > div { + border-bottom: none; + border-top: 1px solid #d4d4d4; +} + +.mytheme .v-grid-editor-footer:first-child { + border-top: none; + margin-top: 0; + border-bottom: 1px solid #d4d4d4; + margin-bottom: -1px; +} + +.mytheme .v-grid-editor-message, .mytheme .v-grid-editor-buttons { + display: table-cell; + white-space: nowrap; + vertical-align: middle; +} + +.mytheme .v-grid-editor-message { + width: 100%; + position: relative; +} + +.mytheme .v-grid-editor-message > div { + position: absolute; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + line-height: 37px; + top: 0; +} + +.mytheme .v-grid-editor-save { + margin-right: 4px; +} + +.mytheme .v-grid-spacer { + padding-left: 1px; +} + +.mytheme .v-grid-spacer > td { + display: block; + padding: 0; + background-color: white; + border-top: 1px solid #eeeeee; + border-bottom: 1px solid #d4d4d4; +} + +.mytheme .v-grid-spacer.stripe > td { + background-color: #f5f5f5; + border-top: 1px solid #e5e5e5; + border-bottom: 1px solid #d4d4d4; +} + +.mytheme .v-grid-spacer-deco-container { + border-top: 1px solid transparent; + position: relative; + top: 0; + z-index: 5; +} + +.mytheme .v-grid-spacer-deco { + top: 0; + left: 0; + width: 2px; + background-color: #197de1; + position: absolute; + height: 100%; + pointer-events: none; +} + +.ie8 .mytheme .v-grid-spacer-deco:before, .ie9 .mytheme .v-grid-spacer-deco:before, .ie10 .mytheme .v-grid-spacer-deco:before { + content: url(data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==); +} + +.mytheme .v-grid-cell > .v-progressbar { + width: 100%; +} + +.mytheme .v-grid { + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + background-color: #fafafa; +} + +.mytheme .v-grid.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-grid-header .v-grid-cell { + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); +} + +.mytheme .v-grid-header .v-grid-cell.dragged { + opacity: 0.5; + filter: alpha(opacity=50) ; + -webkit-transition: opacity 0.3s ease-in-out; + -moz-transition: opacity 0.3s ease-in-out; + transition: opacity 0.3s ease-in-out; +} + +.mytheme .v-grid-header .v-grid-cell.dragged-column-header { + margin-top: -19px; +} + +.mytheme .v-grid-footer .v-grid-cell { + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); +} + +.mytheme .v-grid-header-deco { + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); +} + +.mytheme .v-grid-footer-deco, .mytheme .v-grid-horizontal-scrollbar-deco { + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); +} + +.mytheme .v-grid-row-selected > .v-grid-cell { + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + color: #c8dbed; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05); + border-color: #1d69b4; +} + +.mytheme .v-grid-row-selected > .v-grid-cell-focused:before { + border-color: #71b0ef; +} + +.mytheme .v-grid-editor { + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + border-color: #197de1; +} + +.mytheme .v-grid-editor-footer { + font-size: 14px; + padding: 0 6px; + background: #fafafa; + -webkit-animation: valo-grid-editor-footer-animate-in 200ms 120ms backwards; + -moz-animation: valo-grid-editor-footer-animate-in 200ms 120ms backwards; + animation: valo-grid-editor-footer-animate-in 200ms 120ms backwards; +} + +.mytheme .v-grid-editor-footer:first-child { + -webkit-animation: valo-grid-editor-footer-animate-in-alt 200ms 120ms backwards; + -moz-animation: valo-grid-editor-footer-animate-in-alt 200ms 120ms backwards; + animation: valo-grid-editor-footer-animate-in-alt 200ms 120ms backwards; +} + +.mytheme .v-grid-editor-cells { + z-index: 1; +} + +.mytheme .v-grid-editor-cells > div:before { + content: ""; + display: inline-block; + height: 100%; + vertical-align: middle; +} + +.mytheme .v-grid-editor-cells > div.not-editable.v-grid-cell { + float: none; +} + +.mytheme .v-grid-editor-cells > div .error::before { + border-top: 9px solid #ed473b; + border-right: 9px solid transparent; +} + +.mytheme .v-grid-editor-cells > div .error, .mytheme .v-grid-editor-cells > div .error > input { + background-color: #fffbfb; +} + +.mytheme .v-grid-editor-cells > div .v-textfield, .mytheme .v-grid-editor-cells > div .v-textfield-focus, .mytheme .v-grid-editor-cells > div .v-datefield, .mytheme .v-grid-editor-cells > div .v-datefield .v-textfield-focus, .mytheme .v-grid-editor-cells > div .v-filterselect-input, .mytheme .v-grid-editor-cells > div .v-filterselect-input:focus { + border: none; + border-radius: 0; + background: transparent; + -webkit-box-shadow: inset 0 1px 0 #f2f2f2; + box-shadow: inset 0 1px 0 #f2f2f2; +} + +.mytheme .v-grid-editor-cells > div input[type="text"].v-datefield-textfield { + padding-left: 44.4px; +} + +.v-ie8 .mytheme .v-grid-editor-cells > div .v-datefield-button { + margin-left: 0px; +} + +.v-ie8 .mytheme .v-grid-editor-cells > div .v-filterselect-button { + margin-left: 0px; +} + +.mytheme .v-grid-editor-cells > div .v-textfield-focus, .mytheme .v-grid-editor-cells > div .v-datefield .v-textfield-focus, .mytheme .v-grid-editor-cells > div .v-filterselect-input:focus { + position: relative; +} + +.mytheme .v-grid-editor-cells > div .v-select { + padding-left: 9px; + padding-right: 9px; +} + +.mytheme .v-grid-editor-cells > div .v-checkbox { + margin: 0 9px 0 18px; +} + +.mytheme .v-grid-editor-cells > div .v-checkbox > input[type="checkbox"] { + margin-left: 0; +} + +.mytheme .v-grid-editor-cells > div .v-checkbox > label { + white-space: nowrap; +} + +.mytheme .v-grid-editor-message > div:before { + display: inline-block; + color: #ed473b; + font-weight: 600; + width: 19px; + text-align: center; + content: "!"; +} + +.mytheme .v-grid-editor-save, .mytheme .v-grid-editor-cancel { + cursor: pointer; + color: #197de1; + text-decoration: underline; + font-weight: inherit; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; + font-weight: 400; + text-decoration: none; + border: none; + background: transparent; + padding: 6px 6px; + margin: 0; + outline: none; +} + +.mytheme .v-grid-editor-save:hover, .mytheme .v-grid-editor-cancel:hover { + color: #4396ea; +} + +.mytheme .v-grid-editor-save.v-disabled, .mytheme .v-grid-editor-cancel.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-grid-spacer { + margin-top: -1px; +} + +.mytheme .v-grid-sidebar.v-contextmenu.open .v-grid-sidebar-content { + margin: 0 0 2px; + padding: 4px 4px 2px; + overflow-y: auto; + overflow-x: hidden; +} + +.mytheme .v-grid-sidebar.v-contextmenu.closed { + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); +} + +.mytheme .v-grid-scroller::-webkit-scrollbar { + border: none; +} + +.mytheme .v-grid-scroller::-webkit-scrollbar-thumb { + border-radius: 10px; + border: 4px solid transparent; + background: rgba(0, 0, 0, 0.3); + -webkit-background-clip: content-box; + background-clip: content-box; +} + +.mytheme .v-grid-scroller-vertical::-webkit-scrollbar-thumb { + min-height: 30px; +} + +.mytheme .v-grid-scroller-horizontal::-webkit-scrollbar-thumb { + min-width: 30px; +} + +.mytheme .v-textfield { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 37px; + border-radius: 4px; + padding: 4px 9px; + border: 1px solid #c5c5c5; + background: white; + color: #474747; + -webkit-box-shadow: inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + width: 185px; +} + +.v-ie8 .mytheme .v-textfield, .v-ie9 .mytheme .v-textfield { + line-height: 37px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-textfield.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-textfield:focus { + outline: none; + -webkit-transition: none; + -moz-transition: none; + transition: none; + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-textfield[class*="prompt"] { + color: #a3a3a3; +} + +.mytheme .v-textfield-readonly { + background: #fafafa; + color: #464646; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-textfield-readonly:focus { + box-shadow: none; + border-color: #c5c5c5; +} + +.mytheme .v-textfield-error { + border-color: #ed473b !important; + background: #fffbfb; + color: #6c2621; +} + +.mytheme .v-textfield-borderless { + border: none; + border-radius: 0; + background: transparent; + -webkit-box-shadow: none; + box-shadow: none; + color: inherit; +} + +.mytheme .v-textfield-borderless:focus { + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-textfield-borderless[class*="prompt"] { + color: inherit; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-textfield-tiny { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 28px; + border-radius: 4px; + padding: 3px 7px; + + + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + font-size: 12px; +} + +.v-ie8 .mytheme .v-textfield-tiny, .v-ie9 .mytheme .v-textfield-tiny { + line-height: 28px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-textfield-compact, .mytheme .v-textfield-small { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 31px; + border-radius: 4px; + padding: 3px 8px; + + + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; +} + +.v-ie8 .mytheme .v-textfield-compact, .v-ie9 .mytheme .v-textfield-compact, .v-ie8 .mytheme .v-textfield-small, .v-ie9 .mytheme .v-textfield-small { + line-height: 31px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-textfield-small { + font-size: 14px; +} + +.mytheme .v-textfield-large { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 44px; + border-radius: 4px; + padding: 5px 10px; + + + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + font-size: 20px; +} + +.v-ie8 .mytheme .v-textfield-large, .v-ie9 .mytheme .v-textfield-large { + line-height: 44px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-textfield-huge { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 59px; + border-radius: 4px; + padding: 7px 12px; + + + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + font-size: 26px; +} + +.v-ie8 .mytheme .v-textfield-huge, .v-ie9 .mytheme .v-textfield-huge { + line-height: 59px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-slot-inline-icon { + position: relative; +} + +.mytheme .v-caption-inline-icon { + padding: 0; +} + +.mytheme .v-caption-inline-icon .v-captiontext { + font-size: 14px; + font-weight: 400; + padding-bottom: 0.3em; + padding-left: 1px; + margin: 0; +} + +.mytheme .v-caption-inline-icon .v-icon { + position: absolute; + z-index: 10; +} + +.mytheme .v-caption-inline-icon span.v-icon { + left: 1px; + bottom: 1px; + width: 37px; + line-height: 35px; + text-align: center; + font-size: 16px; +} + +.mytheme .v-caption-inline-icon img.v-icon { + left: 11px; + bottom: 11px; +} + +.mytheme .v-textfield-inline-icon { + padding-left: 37px; +} + +.mytheme .v-slot-inline-icon.v-slot-tiny { + position: relative; +} + +.mytheme .v-caption-inline-icon.v-caption-tiny { + padding: 0; +} + +.mytheme .v-caption-inline-icon.v-caption-tiny .v-captiontext { + font-size: 14px; + font-weight: 400; + padding-bottom: 0.3em; + padding-left: 1px; + margin: 0; +} + +.mytheme .v-caption-inline-icon.v-caption-tiny .v-icon { + position: absolute; + z-index: 10; +} + +.mytheme .v-caption-inline-icon.v-caption-tiny span.v-icon { + left: 1px; + bottom: 1px; + width: 28px; + line-height: 26px; + text-align: center; + font-size: 12px; +} + +.mytheme .v-caption-inline-icon.v-caption-tiny img.v-icon { + left: 6px; + bottom: 6px; +} + +.mytheme .v-textfield-inline-icon.v-textfield-tiny { + padding-left: 28px; +} + +.mytheme .v-slot-inline-icon.v-slot-compact { + position: relative; +} + +.mytheme .v-caption-inline-icon.v-caption-compact { + padding: 0; +} + +.mytheme .v-caption-inline-icon.v-caption-compact .v-captiontext { + font-size: 14px; + font-weight: 400; + padding-bottom: 0.3em; + padding-left: 1px; + margin: 0; +} + +.mytheme .v-caption-inline-icon.v-caption-compact .v-icon { + position: absolute; + z-index: 10; +} + +.mytheme .v-caption-inline-icon.v-caption-compact span.v-icon { + left: 1px; + bottom: 1px; + width: 31px; + line-height: 29px; + text-align: center; + font-size: 16px; +} + +.mytheme .v-caption-inline-icon.v-caption-compact img.v-icon { + left: 8px; + bottom: 8px; +} + +.mytheme .v-textfield-inline-icon.v-textfield-compact { + padding-left: 31px; +} + +.mytheme .v-slot-inline-icon.v-slot-small { + position: relative; +} + +.mytheme .v-caption-inline-icon.v-caption-small { + padding: 0; +} + +.mytheme .v-caption-inline-icon.v-caption-small .v-captiontext { + font-size: 14px; + font-weight: 400; + padding-bottom: 0.3em; + padding-left: 1px; + margin: 0; +} + +.mytheme .v-caption-inline-icon.v-caption-small .v-icon { + position: absolute; + z-index: 10; +} + +.mytheme .v-caption-inline-icon.v-caption-small span.v-icon { + left: 1px; + bottom: 1px; + width: 31px; + line-height: 29px; + text-align: center; + font-size: 14px; +} + +.mytheme .v-caption-inline-icon.v-caption-small img.v-icon { + left: 8px; + bottom: 8px; +} + +.mytheme .v-textfield-inline-icon.v-textfield-small { + padding-left: 31px; +} + +.mytheme .v-slot-inline-icon.v-slot-large { + position: relative; +} + +.mytheme .v-caption-inline-icon.v-caption-large { + padding: 0; +} + +.mytheme .v-caption-inline-icon.v-caption-large .v-captiontext { + font-size: 14px; + font-weight: 400; + padding-bottom: 0.3em; + padding-left: 1px; + margin: 0; +} + +.mytheme .v-caption-inline-icon.v-caption-large .v-icon { + position: absolute; + z-index: 10; +} + +.mytheme .v-caption-inline-icon.v-caption-large span.v-icon { + left: 1px; + bottom: 1px; + width: 44px; + line-height: 42px; + text-align: center; + font-size: 20px; +} + +.mytheme .v-caption-inline-icon.v-caption-large img.v-icon { + left: 14px; + bottom: 14px; +} + +.mytheme .v-textfield-inline-icon.v-textfield-large { + padding-left: 44px; +} + +.mytheme .v-slot-inline-icon.v-slot-huge { + position: relative; +} + +.mytheme .v-caption-inline-icon.v-caption-huge { + padding: 0; +} + +.mytheme .v-caption-inline-icon.v-caption-huge .v-captiontext { + font-size: 14px; + font-weight: 400; + padding-bottom: 0.3em; + padding-left: 1px; + margin: 0; +} + +.mytheme .v-caption-inline-icon.v-caption-huge .v-icon { + position: absolute; + z-index: 10; +} + +.mytheme .v-caption-inline-icon.v-caption-huge span.v-icon { + left: 1px; + bottom: 1px; + width: 59px; + line-height: 57px; + text-align: center; + font-size: 26px; +} + +.mytheme .v-caption-inline-icon.v-caption-huge img.v-icon { + left: 22px; + bottom: 22px; +} + +.mytheme .v-textfield-inline-icon.v-textfield-huge { + padding-left: 59px; +} + +.mytheme .v-textfield-align-right { + text-align: right; +} + +.mytheme .v-textfield-align-center { + text-align: center; +} + +.mytheme .v-textarea { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 37px; + border-radius: 4px; + padding: 6px; + border: 1px solid #c5c5c5; + background: white; + color: #474747; + -webkit-box-shadow: inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + height: auto; + resize: none; + white-space: pre-wrap; + width: 185px; +} + +.v-ie8 .mytheme .v-textarea, .v-ie9 .mytheme .v-textarea { + line-height: 37px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-textarea.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-textarea:focus { + outline: none; + -webkit-transition: none; + -moz-transition: none; + transition: none; + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-textarea[class*="prompt"] { + color: #a3a3a3; +} + +.v-ie8 .mytheme .v-textarea, .v-ie9 .mytheme .v-textarea { + line-height: inherit; + padding-top: 4px; + padding-bottom: 4px; +} + +.mytheme .v-textarea-readonly { + background: #fafafa; + color: #464646; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-textarea-readonly:focus { + box-shadow: none; + border-color: #c5c5c5; +} + +.mytheme .v-textarea-error { + border-color: #ed473b !important; + background: #fffbfb; + color: #6c2621; +} + +.mytheme .v-textarea-borderless { + border: none; + border-radius: 0; + background: transparent; + -webkit-box-shadow: none; + box-shadow: none; + color: inherit; +} + +.mytheme .v-textarea-borderless:focus { + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-textarea-borderless[class*="prompt"] { + color: inherit; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-textarea-tiny { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 28px; + border-radius: 4px; + padding: 6px; + + + + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + height: auto; + resize: none; + white-space: pre-wrap; + font-size: 12px; +} + +.v-ie8 .mytheme .v-textarea-tiny, .v-ie9 .mytheme .v-textarea-tiny { + line-height: 28px; + padding-top: 0; + padding-bottom: 0; +} + +.v-ie8 .mytheme .v-textarea-tiny, .v-ie9 .mytheme .v-textarea-tiny { + line-height: inherit; + padding-top: 3px; + padding-bottom: 3px; +} + +.mytheme .v-textarea-small { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 31px; + border-radius: 4px; + padding: 6px; + + + + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + height: auto; + resize: none; + white-space: pre-wrap; + font-size: 14px; +} + +.v-ie8 .mytheme .v-textarea-small, .v-ie9 .mytheme .v-textarea-small { + line-height: 31px; + padding-top: 0; + padding-bottom: 0; +} + +.v-ie8 .mytheme .v-textarea-small, .v-ie9 .mytheme .v-textarea-small { + line-height: inherit; + padding-top: 3px; + padding-bottom: 3px; +} + +.mytheme .v-textarea-large { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 44px; + border-radius: 4px; + padding: 6px; + + + + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + height: auto; + resize: none; + white-space: pre-wrap; + font-size: 20px; +} + +.v-ie8 .mytheme .v-textarea-large, .v-ie9 .mytheme .v-textarea-large { + line-height: 44px; + padding-top: 0; + padding-bottom: 0; +} + +.v-ie8 .mytheme .v-textarea-large, .v-ie9 .mytheme .v-textarea-large { + line-height: inherit; + padding-top: 5px; + padding-bottom: 5px; +} + +.mytheme .v-textarea-huge { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 59px; + border-radius: 4px; + padding: 6px; + + + + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + height: auto; + resize: none; + white-space: pre-wrap; + font-size: 26px; +} + +.v-ie8 .mytheme .v-textarea-huge, .v-ie9 .mytheme .v-textarea-huge { + line-height: 59px; + padding-top: 0; + padding-bottom: 0; +} + +.v-ie8 .mytheme .v-textarea-huge, .v-ie9 .mytheme .v-textarea-huge { + line-height: inherit; + padding-top: 7px; + padding-bottom: 7px; +} + +.mytheme .v-textarea-align-right { + text-align: right; +} + +.mytheme .v-textarea-align-center { + text-align: center; +} + +.mytheme .v-datefield { + position: relative; + width: 185px; + height: 37px; + border-radius: 4px; +} + +.mytheme .v-datefield [class*="textfield"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 37px; + border-radius: 4px; + padding: 4px 9px; + border: 1px solid #c5c5c5; + background: white; + color: #474747; + -webkit-box-shadow: inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + padding-left: 44.4px; + width: 100%; + height: 100%; + border-radius: inherit; +} + +.v-ie8 .mytheme .v-datefield [class*="textfield"], .v-ie9 .mytheme .v-datefield [class*="textfield"] { + line-height: 37px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-datefield [class*="textfield"].v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-datefield [class*="textfield"]:focus { + outline: none; + -webkit-transition: none; + -moz-transition: none; + transition: none; + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-datefield [class*="textfield"][class*="prompt"] { + color: #a3a3a3; +} + +.mytheme .v-datefield[class*="prompt"] > [class*="textfield"] { + color: #a3a3a3; +} + +.mytheme .v-datefield [class*="button"] { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + -webkit-appearance: none; + background: transparent; + padding: 0; + position: absolute; + z-index: 10; + width: 37px; + line-height: 35px; + text-align: center; + font: inherit; + outline: none; + margin: 0; + top: 1px; + bottom: 1px; + left: 1px; + border: none; + border-right: 1px solid #e4e4e4; + color: #a3a3a3; + border-radius: 3px 0 0 3px; +} + +.mytheme .v-datefield [class*="button"]:hover { + color: #474747; +} + +.mytheme .v-datefield [class*="button"]:before { + font-family: ThemeIcons; + content: "\f073"; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; +} + +.mytheme .v-datefield [class*="button"]:active:after { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + background-color: rgba(128, 128, 128, 0.2); + border-radius: inherit; +} + +.mytheme .v-datefield.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-datefield.v-disabled [class*="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-datefield.v-disabled [class*="button"]:active:after { + display: none; +} + +.mytheme .v-datefield.v-readonly [class*="textfield"] { + background: #fafafa; + color: #464646; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-datefield.v-readonly [class*="textfield"]:focus { + box-shadow: none; + border-color: #c5c5c5; +} + +.mytheme .v-datefield.v-readonly [class*="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-datefield.v-readonly [class*="button"]:active:after { + display: none; +} + +.mytheme .v-datefield-error .v-datefield-textfield { + border-color: #ed473b !important; + background: #fffbfb; + color: #6c2621; +} + +.mytheme .v-datefield-error .v-datefield-button { + color: #ed473b; + border-color: #ed473b; +} + +.mytheme .v-datefield-full { + width: 240px; +} + +.mytheme .v-datefield-day { + width: 185px; +} + +.mytheme .v-datefield-month { + width: 120px; +} + +.mytheme .v-datefield-year { + width: 104px; +} + +.mytheme .v-datefield-popup { + padding: 4px 4px; + border-radius: 4px; + background-color: white; + color: #474747; + -webkit-box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.1), 0 3px 5px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.09098); + box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.1), 0 3px 5px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.09098); + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; + margin-top: 5px !important; + margin-bottom: 5px !important; + margin-right: 5px !important; + cursor: default; + width: auto; +} + +.mytheme .v-datefield-popup[class*="animate-in"] { + -webkit-animation: valo-overlay-animate-in 120ms; + -moz-animation: valo-overlay-animate-in 120ms; + animation: valo-overlay-animate-in 120ms; +} + +.mytheme .v-datefield-popup[class*="animate-out"] { + -webkit-animation: valo-animate-out-fade 120ms; + -moz-animation: valo-animate-out-fade 120ms; + animation: valo-animate-out-fade 120ms; +} + +.mytheme .v-datefield-popup table { + border-collapse: collapse; + border-spacing: 0; + margin: 0 auto; +} + +.mytheme .v-datefield-popup td { + padding: 2px; +} + +.mytheme .v-datefield-popup .v-datefield-calendarpanel { + font-size: 16px; + text-align: center; +} + +.mytheme .v-datefield-popup .v-datefield-calendarpanel:focus { + outline: none; +} + +.mytheme .v-datefield-popup .v-datefield-calendarpanel-day { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 30px; + height: 26px; + border: 1px solid transparent; + line-height: 26px; + text-align: center; + font-size: 14px; + background: #fafafa; + border-radius: 2px; + -webkit-transition: color 200ms; + -moz-transition: color 200ms; + transition: color 200ms; + display: inline-block; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + cursor: pointer; +} + +.mytheme .v-datefield-popup .v-datefield-calendarpanel-day:hover { + color: #197de1; +} + +.mytheme .v-datefield-popup .v-datefield-calendarpanel-day-offmonth { + color: #a0a0a0; + background: transparent; +} + +.mytheme .v-datefield-popup .v-datefield-calendarpanel-day-today { + color: #191919; + font-weight: 600; + border-color: #afafaf; +} + +.mytheme .v-datefield-popup .v-datefield-calendarpanel-day.v-datefield-calendarpanel-day-selected, .mytheme .v-datefield-popup .v-datefield-calendarpanel-day.v-datefield-calendarpanel-day-selected:hover { + color: #c8dbed; + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + border: none; + font-weight: 600; +} + +.mytheme .v-datefield-popup .v-datefield-calendarpanel-day.v-datefield-calendarpanel-day-focused { + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + position: relative; +} + +.v-ie8 .mytheme .v-datefield-popup .v-datefield-calendarpanel-day.v-datefield-calendarpanel-day-focused { + border-color: #197de1; +} + +.mytheme .v-datefield-popup .v-datefield-calendarpanel-day.v-datefield-calendarpanel-day-outside-range, .mytheme .v-datefield-popup .v-datefield-calendarpanel-day.v-datefield-calendarpanel-day-outside-range:hover { + color: #a0a0a0; + cursor: not-allowed; +} + +.mytheme .v-datefield-popup .v-datefield-calendarpanel-weekdays { + height: 26px; + color: rgba(133, 133, 133, 0.85); +} + +.mytheme .v-datefield-popup .v-datefield-calendarpanel-weekdays strong { + font: inherit; + font-size: 14px; +} + +.mytheme .v-datefield-popup .v-datefield-calendarpanel-header { + white-space: nowrap; +} + +.mytheme .v-datefield-popup td[class*="year"] button, .mytheme .v-datefield-popup td[class*="month"] button { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + border: none; + background: transparent; + padding: 0; + margin: 0; + cursor: pointer; + color: transparent; + font-size: 0; + width: 19px; + height: 25px; + outline: none; + position: relative; + vertical-align: middle; +} + +.mytheme .v-datefield-popup td[class*="year"] button:before, .mytheme .v-datefield-popup td[class*="month"] button:before { + color: #a0a0a0; + font-size: 21px; + line-height: 24px; + -webkit-transition: color 200ms; + -moz-transition: color 200ms; + transition: color 200ms; +} + +.mytheme .v-datefield-popup td[class*="year"] button:hover:before, .mytheme .v-datefield-popup td[class*="month"] button:hover:before { + color: #197de1; +} + +.mytheme .v-datefield-popup td[class*="year"] button.outside-range, .mytheme .v-datefield-popup td[class*="month"] button.outside-range { + cursor: default; + opacity: 0.3; + filter: alpha(opacity=30.0) ; +} + +.mytheme .v-datefield-popup td[class*="year"] button.outside-range:hover:before, .mytheme .v-datefield-popup td[class*="month"] button.outside-range:hover:before { + color: #a0a0a0; +} + +.mytheme .v-datefield-popup .v-button-prevyear:before { + font-family: ThemeIcons; + content: "\f100"; +} + +.mytheme .v-datefield-popup .v-button-prevmonth:before { + font-family: ThemeIcons; + content: "\f104"; +} + +.mytheme .v-datefield-popup .v-button-nextyear:before { + font-family: ThemeIcons; + content: "\f101"; +} + +.mytheme .v-datefield-popup .v-button-nextmonth:before { + font-family: ThemeIcons; + content: "\f105"; +} + +.mytheme .v-datefield-popup td.v-datefield-calendarpanel-month { + width: 148px; + color: #197de1; +} + +.mytheme .v-datefield-popup .v-datefield-calendarpanel-year td.v-datefield-calendarpanel-month { + width: 74px; +} + +.mytheme .v-datefield-popup .v-datefield-calendarpanel-weeknumber, .mytheme .v-datefield-popup .v-datefield-calendarpanel-weekdays.v-datefield-calendarpanel-weeknumbers td:first-child { + width: 30px; + color: rgba(133, 133, 133, 0.85); + font-size: 14px; + display: inline-block; + text-align: left; +} + +.mytheme .v-datefield-popup .v-datefield-calendarpanel-weeknumber { + position: relative; +} + +.mytheme .v-datefield-popup .v-datefield-calendarpanel-weeknumbers .v-first:before { + content: ""; + position: absolute; + top: 38px; + bottom: 0; + left: 0; + width: 34px; + border-top: 1px solid #eaeaea; + border-right: 1px solid #eaeaea; + border-top-right-radius: 4px; + border-bottom-left-radius: 4px; + background: #fafafa; +} + +.mytheme .v-datefield-popup td.v-datefield-calendarpanel-time { + width: 100%; + font-size: 14px; +} + +.mytheme .v-datefield-popup td.v-datefield-calendarpanel-time .v-label { + display: inline; + margin: 0 0.1em; + font-weight: 400; +} + +.mytheme .v-datefield-calendarpanel { + font-size: 16px; + text-align: center; +} + +.mytheme .v-datefield-calendarpanel:focus { + outline: none; +} + +.mytheme .v-datefield-calendarpanel-day { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 30px; + height: 26px; + border: 1px solid transparent; + line-height: 26px; + text-align: center; + font-size: 14px; + background: #fafafa; + border-radius: 2px; + -webkit-transition: color 200ms; + -moz-transition: color 200ms; + transition: color 200ms; + display: inline-block; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + cursor: pointer; +} + +.mytheme .v-datefield-calendarpanel-day:hover { + color: #197de1; +} + +.mytheme .v-datefield-calendarpanel-day-offmonth { + color: #a0a0a0; + background: transparent; +} + +.mytheme .v-datefield-calendarpanel-day-today { + color: #191919; + font-weight: 600; + border-color: #afafaf; +} + +.mytheme .v-datefield-calendarpanel-day.v-datefield-calendarpanel-day-selected, .mytheme .v-datefield-calendarpanel-day.v-datefield-calendarpanel-day-selected:hover { + color: #c8dbed; + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + border: none; + font-weight: 600; +} + +.mytheme .v-datefield-calendarpanel-day.v-datefield-calendarpanel-day-focused { + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + position: relative; +} + +.v-ie8 .mytheme .v-datefield-calendarpanel-day.v-datefield-calendarpanel-day-focused { + border-color: #197de1; +} + +.mytheme .v-datefield-calendarpanel-day.v-datefield-calendarpanel-day-outside-range, .mytheme .v-datefield-calendarpanel-day.v-datefield-calendarpanel-day-outside-range:hover { + color: #a0a0a0; + cursor: not-allowed; +} + +.mytheme .v-datefield-calendarpanel-weekdays { + height: 26px; + color: rgba(133, 133, 133, 0.85); +} + +.mytheme .v-datefield-calendarpanel-weekdays strong { + font: inherit; + font-size: 14px; +} + +.mytheme .v-datefield-calendarpanel-header { + white-space: nowrap; +} + +.mytheme td[class*="year"] button, .mytheme td[class*="month"] button { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + border: none; + background: transparent; + padding: 0; + margin: 0; + cursor: pointer; + color: transparent; + font-size: 0; + width: 19px; + height: 25px; + outline: none; + position: relative; + vertical-align: middle; +} + +.mytheme td[class*="year"] button:before, .mytheme td[class*="month"] button:before { + color: #a0a0a0; + font-size: 21px; + line-height: 24px; + -webkit-transition: color 200ms; + -moz-transition: color 200ms; + transition: color 200ms; +} + +.mytheme td[class*="year"] button:hover:before, .mytheme td[class*="month"] button:hover:before { + color: #197de1; +} + +.mytheme td[class*="year"] button.outside-range, .mytheme td[class*="month"] button.outside-range { + cursor: default; + opacity: 0.3; + filter: alpha(opacity=30.0) ; +} + +.mytheme td[class*="year"] button.outside-range:hover:before, .mytheme td[class*="month"] button.outside-range:hover:before { + color: #a0a0a0; +} + +.mytheme .v-button-prevyear:before { + font-family: ThemeIcons; + content: "\f100"; +} + +.mytheme .v-button-prevmonth:before { + font-family: ThemeIcons; + content: "\f104"; +} + +.mytheme .v-button-nextyear:before { + font-family: ThemeIcons; + content: "\f101"; +} + +.mytheme .v-button-nextmonth:before { + font-family: ThemeIcons; + content: "\f105"; +} + +.mytheme td.v-datefield-calendarpanel-month { + width: 148px; + color: #197de1; +} + +.mytheme .v-datefield-calendarpanel-year td.v-datefield-calendarpanel-month { + width: 74px; +} + +.mytheme .v-datefield-calendarpanel-weeknumber, .mytheme .v-datefield-calendarpanel-weekdays.v-datefield-calendarpanel-weeknumbers td:first-child { + width: 30px; + color: rgba(133, 133, 133, 0.85); + font-size: 14px; + display: inline-block; + text-align: left; +} + +.mytheme .v-datefield-calendarpanel-weeknumber { + position: relative; +} + +.mytheme .v-datefield-calendarpanel-weeknumbers .v-first:before { + content: ""; + position: absolute; + top: 38px; + bottom: 0; + left: 0; + width: 34px; + border-top: 1px solid #eaeaea; + border-right: 1px solid #eaeaea; + border-top-right-radius: 4px; + border-bottom-left-radius: 4px; + background: #fafafa; +} + +.mytheme td.v-datefield-calendarpanel-time { + width: 100%; + font-size: 14px; +} + +.mytheme td.v-datefield-calendarpanel-time .v-label { + display: inline; + margin: 0 0.1em; + font-weight: 400; +} + +.mytheme .v-datefield-borderless .v-datefield-textfield { + border: none; + border-radius: 0; + background: transparent; + -webkit-box-shadow: none; + box-shadow: none; + color: inherit; +} + +.mytheme .v-datefield-borderless .v-datefield-textfield:focus { + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-datefield-borderless .v-datefield-textfield[class*="prompt"] { + color: inherit; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-datefield-borderless .v-datefield-button { + border: none; + color: inherit; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-datefield-align-right input { + text-align: right; +} + +.mytheme .v-datefield-align-center input { + text-align: center; +} + +.mytheme .v-datefield-tiny { + height: 28px; + border-radius: 4px; + font-size: 12px; +} + +.mytheme .v-datefield-tiny [class*="textfield"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 28px; + border-radius: 4px; + padding: 3px 7px; + + + + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + padding-left: 33.6px; + width: 100%; + height: 100%; + border-radius: inherit; +} + +.v-ie8 .mytheme .v-datefield-tiny [class*="textfield"], .v-ie9 .mytheme .v-datefield-tiny [class*="textfield"] { + line-height: 28px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-datefield-tiny [class*="button"] { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + -webkit-appearance: none; + background: transparent; + padding: 0; + position: absolute; + z-index: 10; + width: 28px; + line-height: 28px; + text-align: center; + font: inherit; + outline: none; + margin: 0; + border-radius: 4px 0 0 4px; +} + +.mytheme .v-datefield-tiny [class*="button"]:before { + font-family: ThemeIcons; + content: "\f073"; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; +} + +.mytheme .v-datefield-tiny [class*="button"]:active:after { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: inherit; +} + +.mytheme .v-datefield-tiny.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-datefield-tiny.v-disabled [class*="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-datefield-tiny.v-disabled [class*="button"]:active:after { + display: none; +} + +.mytheme .v-datefield-tiny.v-readonly [class*="textfield"] { + background: #fafafa; + color: #464646; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-datefield-tiny.v-readonly [class*="textfield"]:focus { + box-shadow: none; + border-color: #c5c5c5; +} + +.mytheme .v-datefield-tiny.v-readonly [class*="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-datefield-tiny.v-readonly [class*="button"]:active:after { + display: none; +} + +.mytheme .v-datefield-compact, .mytheme .v-datefield-small { + height: 31px; + border-radius: 4px; +} + +.mytheme .v-datefield-compact [class*="textfield"], .mytheme .v-datefield-small [class*="textfield"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 31px; + border-radius: 4px; + padding: 3px 8px; + + + + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + padding-left: 37.2px; + width: 100%; + height: 100%; + border-radius: inherit; +} + +.v-ie8 .mytheme .v-datefield-compact [class*="textfield"], .v-ie9 .mytheme .v-datefield-compact [class*="textfield"], .v-ie8 .mytheme .v-datefield-small [class*="textfield"], .v-ie9 .mytheme .v-datefield-small [class*="textfield"] { + line-height: 31px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-datefield-compact [class*="button"], .mytheme .v-datefield-small [class*="button"] { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + -webkit-appearance: none; + background: transparent; + padding: 0; + position: absolute; + z-index: 10; + width: 31px; + line-height: 31px; + text-align: center; + font: inherit; + outline: none; + margin: 0; + border-radius: 4px 0 0 4px; +} + +.mytheme .v-datefield-compact [class*="button"]:before, .mytheme .v-datefield-small [class*="button"]:before { + font-family: ThemeIcons; + content: "\f073"; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; +} + +.mytheme .v-datefield-compact [class*="button"]:active:after, .mytheme .v-datefield-small [class*="button"]:active:after { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: inherit; +} + +.mytheme .v-datefield-compact.v-disabled, .mytheme .v-datefield-small.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-datefield-compact.v-disabled [class*="button"], .mytheme .v-datefield-small.v-disabled [class*="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-datefield-compact.v-disabled [class*="button"]:active:after, .mytheme .v-datefield-small.v-disabled [class*="button"]:active:after { + display: none; +} + +.mytheme .v-datefield-compact.v-readonly [class*="textfield"], .mytheme .v-datefield-small.v-readonly [class*="textfield"] { + background: #fafafa; + color: #464646; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-datefield-compact.v-readonly [class*="textfield"]:focus, .mytheme .v-datefield-small.v-readonly [class*="textfield"]:focus { + box-shadow: none; + border-color: #c5c5c5; +} + +.mytheme .v-datefield-compact.v-readonly [class*="button"], .mytheme .v-datefield-small.v-readonly [class*="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-datefield-compact.v-readonly [class*="button"]:active:after, .mytheme .v-datefield-small.v-readonly [class*="button"]:active:after { + display: none; +} + +.mytheme .v-datefield-small { + font-size: 14px; +} + +.mytheme .v-datefield-large { + height: 44px; + border-radius: 4px; + font-size: 20px; +} + +.mytheme .v-datefield-large [class*="textfield"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 44px; + border-radius: 4px; + padding: 5px 10px; + + + + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + padding-left: 52.8px; + width: 100%; + height: 100%; + border-radius: inherit; +} + +.v-ie8 .mytheme .v-datefield-large [class*="textfield"], .v-ie9 .mytheme .v-datefield-large [class*="textfield"] { + line-height: 44px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-datefield-large [class*="button"] { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + -webkit-appearance: none; + background: transparent; + padding: 0; + position: absolute; + z-index: 10; + width: 44px; + line-height: 44px; + text-align: center; + font: inherit; + outline: none; + margin: 0; + border-radius: 4px 0 0 4px; +} + +.mytheme .v-datefield-large [class*="button"]:before { + font-family: ThemeIcons; + content: "\f073"; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; +} + +.mytheme .v-datefield-large [class*="button"]:active:after { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: inherit; +} + +.mytheme .v-datefield-large.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-datefield-large.v-disabled [class*="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-datefield-large.v-disabled [class*="button"]:active:after { + display: none; +} + +.mytheme .v-datefield-large.v-readonly [class*="textfield"] { + background: #fafafa; + color: #464646; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-datefield-large.v-readonly [class*="textfield"]:focus { + box-shadow: none; + border-color: #c5c5c5; +} + +.mytheme .v-datefield-large.v-readonly [class*="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-datefield-large.v-readonly [class*="button"]:active:after { + display: none; +} + +.mytheme .v-datefield-huge { + height: 59px; + border-radius: 4px; + font-size: 26px; +} + +.mytheme .v-datefield-huge [class*="textfield"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 59px; + border-radius: 4px; + padding: 7px 12px; + + + + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + padding-left: 70.8px; + width: 100%; + height: 100%; + border-radius: inherit; +} + +.v-ie8 .mytheme .v-datefield-huge [class*="textfield"], .v-ie9 .mytheme .v-datefield-huge [class*="textfield"] { + line-height: 59px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-datefield-huge [class*="button"] { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + -webkit-appearance: none; + background: transparent; + padding: 0; + position: absolute; + z-index: 10; + width: 59px; + line-height: 59px; + text-align: center; + font: inherit; + outline: none; + margin: 0; + border-radius: 4px 0 0 4px; +} + +.mytheme .v-datefield-huge [class*="button"]:before { + font-family: ThemeIcons; + content: "\f073"; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; +} + +.mytheme .v-datefield-huge [class*="button"]:active:after { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: inherit; +} + +.mytheme .v-datefield-huge.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-datefield-huge.v-disabled [class*="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-datefield-huge.v-disabled [class*="button"]:active:after { + display: none; +} + +.mytheme .v-datefield-huge.v-readonly [class*="textfield"] { + background: #fafafa; + color: #464646; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-datefield-huge.v-readonly [class*="textfield"]:focus { + box-shadow: none; + border-color: #c5c5c5; +} + +.mytheme .v-datefield-huge.v-readonly [class*="button"] { + cursor: default; + pointer-events: none; +} + +.mytheme .v-datefield-huge.v-readonly [class*="button"]:active:after { + display: none; +} + +.mytheme .v-inline-datefield-calendarpanel { + font-size: 16px; + text-align: center; +} + +.mytheme .v-inline-datefield-calendarpanel:focus { + outline: none; +} + +.mytheme .v-inline-datefield-calendarpanel-day { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 30px; + height: 26px; + border: 1px solid transparent; + line-height: 26px; + text-align: center; + font-size: 14px; + background: #fafafa; + border-radius: 2px; + -webkit-transition: color 200ms; + -moz-transition: color 200ms; + transition: color 200ms; + display: inline-block; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + cursor: pointer; +} + +.mytheme .v-inline-datefield-calendarpanel-day:hover { + color: #197de1; +} + +.mytheme .v-inline-datefield-calendarpanel-day-offmonth { + color: #a0a0a0; + background: transparent; +} + +.mytheme .v-inline-datefield-calendarpanel-day-today { + color: #191919; + font-weight: 600; + border-color: #afafaf; +} + +.mytheme .v-inline-datefield-calendarpanel-day.v-inline-datefield-calendarpanel-day-selected, .mytheme .v-inline-datefield-calendarpanel-day.v-inline-datefield-calendarpanel-day-selected:hover { + color: #c8dbed; + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + border: none; + font-weight: 600; +} + +.mytheme .v-inline-datefield-calendarpanel-day.v-inline-datefield-calendarpanel-day-focused { + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + position: relative; +} + +.v-ie8 .mytheme .v-inline-datefield-calendarpanel-day.v-inline-datefield-calendarpanel-day-focused { + border-color: #197de1; +} + +.mytheme .v-inline-datefield-calendarpanel-day.v-inline-datefield-calendarpanel-day-outside-range, .mytheme .v-inline-datefield-calendarpanel-day.v-inline-datefield-calendarpanel-day-outside-range:hover { + color: #a0a0a0; + cursor: not-allowed; +} + +.mytheme .v-inline-datefield-calendarpanel-weekdays { + height: 26px; + color: rgba(133, 133, 133, 0.85); +} + +.mytheme .v-inline-datefield-calendarpanel-weekdays strong { + font: inherit; + font-size: 14px; +} + +.mytheme .v-inline-datefield-calendarpanel-header { + white-space: nowrap; +} + +.mytheme td[class*="year"] button, .mytheme td[class*="month"] button { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + border: none; + background: transparent; + padding: 0; + margin: 0; + cursor: pointer; + color: transparent; + font-size: 0; + width: 19px; + height: 25px; + outline: none; + position: relative; + vertical-align: middle; +} + +.mytheme td[class*="year"] button:before, .mytheme td[class*="month"] button:before { + color: #a0a0a0; + font-size: 21px; + line-height: 24px; + -webkit-transition: color 200ms; + -moz-transition: color 200ms; + transition: color 200ms; +} + +.mytheme td[class*="year"] button:hover:before, .mytheme td[class*="month"] button:hover:before { + color: #197de1; +} + +.mytheme td[class*="year"] button.outside-range, .mytheme td[class*="month"] button.outside-range { + cursor: default; + opacity: 0.3; + filter: alpha(opacity=30.0) ; +} + +.mytheme td[class*="year"] button.outside-range:hover:before, .mytheme td[class*="month"] button.outside-range:hover:before { + color: #a0a0a0; +} + +.mytheme .v-button-prevyear:before { + font-family: ThemeIcons; + content: "\f100"; +} + +.mytheme .v-button-prevmonth:before { + font-family: ThemeIcons; + content: "\f104"; +} + +.mytheme .v-button-nextyear:before { + font-family: ThemeIcons; + content: "\f101"; +} + +.mytheme .v-button-nextmonth:before { + font-family: ThemeIcons; + content: "\f105"; +} + +.mytheme td.v-inline-datefield-calendarpanel-month { + width: 148px; + color: #197de1; +} + +.mytheme .v-inline-datefield-calendarpanel-year td.v-inline-datefield-calendarpanel-month { + width: 74px; +} + +.mytheme .v-inline-datefield-calendarpanel-weeknumber, .mytheme .v-inline-datefield-calendarpanel-weekdays.v-inline-datefield-calendarpanel-weeknumbers td:first-child { + width: 30px; + color: rgba(133, 133, 133, 0.85); + font-size: 14px; + display: inline-block; + text-align: left; +} + +.mytheme .v-inline-datefield-calendarpanel-weeknumber { + position: relative; +} + +.mytheme .v-inline-datefield-calendarpanel-weeknumbers .v-first:before { + content: ""; + position: absolute; + top: 38px; + bottom: 0; + left: 0; + width: 34px; + border-top: 1px solid #eaeaea; + border-right: 1px solid #eaeaea; + border-top-right-radius: 4px; + border-bottom-left-radius: 4px; + background: #fafafa; +} + +.mytheme td.v-inline-datefield-calendarpanel-time { + width: 100%; + font-size: 14px; +} + +.mytheme td.v-inline-datefield-calendarpanel-time .v-label { + display: inline; + margin: 0 0.1em; + font-weight: 400; +} + +.mytheme .v-inline-datefield-calendarpanel { + position: relative; + background: white; + padding: 6px; +} + +.mytheme .v-gridlayout-margin-top { + padding-top: 37px; +} + +.mytheme .v-gridlayout-margin-bottom { + padding-bottom: 37px; +} + +.mytheme .v-gridlayout-margin-left { + padding-left: 37px; +} + +.mytheme .v-gridlayout-margin-right { + padding-right: 37px; +} + +.mytheme .v-gridlayout-spacing-on { + padding-left: 12px; + padding-top: 12px; +} + +.mytheme .v-menubar { + position: relative; + text-align: center; + white-space: nowrap; + outline: none; + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + height: 37px; + padding: 0 16px; + color: #191919; + font-weight: 400; + + cursor: default; + border-radius: 4px; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); + padding: 0; + text-align: left; + line-height: 35px; +} + +.mytheme .v-menubar:after { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: inherit; + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; +} + +.mytheme .v-menubar:focus:after { + -webkit-transition: none; + -moz-transition: none; + transition: none; +} + +.mytheme .v-menubar.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-menubar.v-disabled:after { + display: none; +} + +.mytheme .v-menubar:after { + border: inherit; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; +} + +.mytheme .v-menubar:focus:after { + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-menubar > .v-menubar-menuitem { + padding: 0 14px; +} + +.mytheme .v-menubar > .v-menubar-menuitem[class*="-icon-only"] { + width: 37px; +} + +.mytheme .v-menubar:active:after { + background: transparent; +} + +.mytheme .v-menubar > .v-menubar-menuitem { + position: relative; + z-index: 1; + display: inline-block; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + height: 37px; + padding: 0 15px; + color: inherit; + font-weight: 400; + + cursor: pointer; + border-radius: 0; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7; + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7; + background: transparent; + -webkit-box-shadow: none; + box-shadow: none; + border-width: 0 1px 0 0; + border-color: inherit; + height: 100%; + line-height: inherit; + vertical-align: top; + text-align: center; +} + +.mytheme .v-menubar > .v-menubar-menuitem:first-child { + border-left-width: 0; + border-radius: 3px 0 0 3px; +} + +.mytheme .v-menubar > .v-menubar-menuitem:last-child { + border-radius: 0 3px 3px 0; + border-right-width: 0; +} + +.mytheme .v-menubar > .v-menubar-menuitem:first-child:last-child { + border-radius: 3px; +} + +.mytheme .v-menubar > .v-menubar-menuitem:before { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: inherit; +} + +.mytheme .v-menubar > .v-menubar-menuitem:hover { + zoom: 1; +} + +.mytheme .v-menubar > .v-menubar-menuitem:hover:before { + background-color: rgba(186, 186, 186, 0.1); + border: none; +} + +.mytheme .v-menubar > .v-menubar-menuitem:active:before { + background-color: rgba(125, 125, 125, 0.2); +} + +.mytheme .v-menubar > .v-menubar-menuitem .v-icon { + margin: 0 4px 0 -4px; + cursor: inherit; +} + +.mytheme .v-menubar > .v-menubar-menuitem[class*="-icon-only"] { + width: 37px; + padding: 0; +} + +.mytheme .v-menubar > .v-menubar-menuitem[class*="-icon-only"] .v-icon { + margin: 0; +} + +.mytheme .v-menubar > .v-menubar-menuitem-checked { + -webkit-box-shadow: none; + box-shadow: none; + background-color: #ededed; + background-image: -webkit-linear-gradient(bottom, #ededed 2%, #e9e9e9 98%); + background-image: linear-gradient(to top,#ededed 2%, #e9e9e9 98%); + color: #181818; +} + +.mytheme .v-disabled > .v-menubar-menuitem, .mytheme .v-menubar > .v-menubar-menuitem-disabled { + cursor: default; +} + +.mytheme .v-disabled > .v-menubar-menuitem:before, .mytheme .v-menubar > .v-menubar-menuitem-disabled:before { + display: none; +} + +.mytheme .v-menubar-menuitem-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-menubar > .v-menubar-menuitem-selected { + color: #ecf2f8; + + + + border-radius: 0; + border: 1px solid #1362b1; + border-top-color: #156ab3; + border-bottom-color: #1156a8; + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + -webkit-box-shadow: inset 0 1px 0 #4d98e6, inset 0 -1px 0 #166bca; + box-shadow: inset 0 1px 0 #4d98e6, inset 0 -1px 0 #166bca; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05); + border-top-width: 0; + border-left-width: 0; + border-bottom-width: 0; + z-index: 2; +} + +.mytheme .v-menubar > .v-menubar-menuitem-selected:hover:before { + background: none; +} + +.mytheme .v-menubar .v-menubar-submenu-indicator { + display: none; +} + +.mytheme .v-menubar .v-menubar-submenu-indicator + .v-menubar-menuitem-caption:after { + font-family: ThemeIcons; + content: "\f078"; + font-size: 0.7em; + vertical-align: 0.15em; + margin: 0 -0.2em 0 0.5em; + opacity: 0.5; +} + +.mytheme .v-menubar .v-menubar-submenu-indicator + .v-menubar-menuitem-caption:empty:after { + margin-left: -0.2em; +} + +.mytheme .v-menubar-popup { + padding: 4px 4px; + border-radius: 4px; + background-color: white; + color: #474747; + -webkit-box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.1), 0 3px 5px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.09098); + box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.1), 0 3px 5px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.09098); + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; + padding: 4px 4px; + margin: 5px 0 0 1px !important; +} + +.mytheme .v-menubar-popup[class*="animate-in"] { + -webkit-animation: valo-overlay-animate-in 120ms; + -moz-animation: valo-overlay-animate-in 120ms; + animation: valo-overlay-animate-in 120ms; +} + +.mytheme .v-menubar-popup[class*="animate-out"] { + -webkit-animation: valo-animate-out-fade 120ms; + -moz-animation: valo-animate-out-fade 120ms; + animation: valo-animate-out-fade 120ms; +} + +.mytheme .v-menubar-popup .v-menubar-submenu { + outline: none; +} + +.mytheme .v-menubar-popup .v-menubar-menuitem { + display: block; + cursor: pointer; + line-height: 27px; + padding: 0 20px 0 10px; + border-radius: 3px; + font-weight: 400; + white-space: nowrap; + position: relative; + padding-left: 32px; + padding-right: 37px; + position: relative; +} + +.mytheme .v-menubar-popup .v-menubar-menuitem:active:before { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + background: #0957a6; + opacity: 0.15; + filter: alpha(opacity=15.0) ; + pointer-events: none; + border-radius: inherit; +} + +.mytheme .v-menubar-popup .v-menubar-menuitem .v-icon { + max-height: 27px; + margin-right: 5px; + min-width: 1em; +} + +.mytheme .v-menubar-popup .v-menubar-submenu-indicator { + display: none; +} + +.mytheme .v-menubar-popup .v-menubar-submenu-indicator + .v-menubar-menuitem-caption:after { + position: absolute; + right: 10px; + font-family: ThemeIcons; + content: "\f054"; + line-height: 29px; +} + +.mytheme .v-menubar-popup .v-menubar-menuitem-selected { + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + color: #ecf2f8; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05); +} + +.mytheme .v-menubar-popup .v-menubar-separator { + display: block; + margin: 4px 0; + height: 0; + overflow: hidden; + border-bottom: 1px solid #e4e4e4; +} + +.mytheme .v-menubar-popup [class*="checked"] .v-menubar-menuitem-caption:before { + content: "\f00c"; + font-family: ThemeIcons; + position: absolute; + left: 10px; +} + +.mytheme .v-menubar-popup [class*="unchecked"] .v-menubar-menuitem-caption:before { + content: ""; +} + +.mytheme .v-menubar-popup [class*="disabled"] { + cursor: default; +} + +.mytheme .v-menubar-small { + height: 31px; + padding: 0 14px; + + font-weight: 400; + + cursor: default; + border-radius: 4px; + padding: 0; + text-align: left; + line-height: 29px; + font-size: 14px; +} + +.mytheme .v-menubar-small:after { + border: inherit; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; +} + +.mytheme .v-menubar-small > .v-menubar-menuitem { + padding: 0 12px; +} + +.mytheme .v-menubar-small > .v-menubar-menuitem[class*="-icon-only"] { + width: 31px; +} + +.mytheme .v-menubar-borderless { + border: none; + border-radius: 0; + padding: 1px; + -webkit-box-shadow: none; + box-shadow: none; + text-shadow: none; + background: transparent; + color: inherit; +} + +.mytheme .v-menubar-borderless:focus:after { + display: none; +} + +.mytheme .v-menubar-borderless .v-menubar-menuitem { + -webkit-box-shadow: none; + box-shadow: none; + border: none; + margin-right: 1px; + border-radius: 4px; + color: #197de1; + padding: 0 12px; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; +} + +.mytheme .v-menubar-borderless .v-menubar-menuitem:first-child, .mytheme .v-menubar-borderless .v-menubar-menuitem:last-child, .mytheme .v-menubar-borderless .v-menubar-menuitem:first-child:last-child { + border-radius: 4px; +} + +.mytheme .v-menubar-borderless .v-menubar-menuitem:before { + content: none; +} + +.mytheme .v-menubar-borderless .v-menubar-menuitem:hover { + color: #4396ea; +} + +.mytheme .v-menubar-borderless .v-menubar-menuitem:active { + color: inherit; +} + +.mytheme .v-menubar-borderless .v-menubar-menuitem-checked, .mytheme .v-menubar-borderless .v-menubar-menuitem-checked:first-child { + border: 1px solid #c5c5c5; + color: #197de1; +} + +.mytheme .v-menubar-borderless .v-menubar-menuitem-checked .v-menubar-menuitem-caption, .mytheme .v-menubar-borderless .v-menubar-menuitem-checked:first-child .v-menubar-menuitem-caption { + position: relative; + top: -1px; +} + +.mytheme .v-menubar-borderless .v-menubar-menuitem-selected { + color: #ecf2f8; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05); +} + +.mytheme .v-menubar-borderless .v-menubar-menuitem-selected:hover { + color: #ecf2f8; +} + +.mytheme .v-menubar-borderless .v-menubar-menuitem-disabled, .mytheme .v-menubar-borderless .v-menubar-menuitem-disabled:hover { + color: inherit; +} + +.mytheme .v-radiobutton { + position: relative; + line-height: 19px; + white-space: nowrap; +} + +.mytheme .v-radiobutton.v-has-width label { + white-space: normal; +} + +:root .mytheme .v-radiobutton { + padding-left: 25px; +} + +:root .mytheme .v-radiobutton label { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + display: inline-block; +} + +:root .mytheme .v-radiobutton > input { + position: absolute; + clip: rect(0, 0, 0, 0); + left: 0.2em; + top: 0.2em; + z-index: 0; + margin: 0; +} + +:root .mytheme .v-radiobutton > input:focus ~ label:before { + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); +} + +:root .mytheme .v-radiobutton > input ~ label:before, :root .mytheme .v-radiobutton > input ~ label:after { + content: ""; + display: inline-block; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 19px; + height: 19px; + position: absolute; + top: 0; + left: 0; + border-radius: 4px; + font-size: 13px; + text-align: center; +} + +:root .mytheme .v-radiobutton > input ~ label:before { + height: 18.5px; + padding: 0 9px; + color: #191919; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); + padding: 0; + height: 19px; +} + +:root .mytheme .v-radiobutton > input ~ label:after { + content: "\f00c"; + font-family: ThemeIcons; + color: transparent; + -webkit-transition: color 100ms; + -moz-transition: color 100ms; + transition: color 100ms; +} + +:root .mytheme .v-radiobutton > input:active ~ label:after { + background-color: rgba(125, 125, 125, 0.2); +} + +:root .mytheme .v-radiobutton > input:checked ~ label:after { + color: #197de1; +} + +.mytheme .v-radiobutton > .v-icon, .mytheme .v-radiobutton > label .v-icon { + margin: 0 6px 0 3px; + min-width: 1em; + cursor: pointer; +} + +.mytheme .v-radiobutton.v-disabled > label, .mytheme .v-radiobutton.v-disabled > .v-icon { + cursor: default; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-radiobutton.v-disabled > label > .v-icon { + cursor: default; +} + +:root .mytheme .v-radiobutton.v-disabled > input:active ~ label:after { + background: transparent; +} + +.mytheme .v-radiobutton.v-readonly > label, .mytheme .v-radiobutton.v-readonly > .v-icon { + cursor: default; +} + +.mytheme .v-radiobutton.v-readonly > label > .v-icon { + cursor: default; +} + +:root .mytheme .v-radiobutton.v-readonly > input:active ~ label:after { + background: transparent; +} + +:root .mytheme .v-radiobutton.v-readonly > input ~ label:after { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +:root .mytheme .v-radiobutton > input:checked ~ label:after { + width: 7px; + height: 7px; + top: 6px; + left: 6px; + background: #197de1; +} + +:root .mytheme .v-radiobutton > input ~ label:before, :root .mytheme .v-radiobutton > input ~ label:after { + border-radius: 50%; + content: ""; +} + +.mytheme .v-select-optiongroup .v-radiobutton, .mytheme .v-select-optiongroup .v-checkbox { + display: block; + margin: 9px 16px 0 0; +} + +.mytheme .v-select-optiongroup .v-radiobutton:first-child, .mytheme .v-select-optiongroup .v-checkbox:first-child { + margin-top: 6px; +} + +.mytheme .v-select-optiongroup .v-radiobutton:last-child, .mytheme .v-select-optiongroup .v-checkbox:last-child { + margin-bottom: 6px; +} + +.mytheme .v-select-optiongroup.v-has-width label { + white-space: normal; +} + +.mytheme .v-select-optiongroup-small { + font-size: 14px; +} + +.mytheme .v-select-optiongroup-small .v-checkbox { + position: relative; + line-height: 16px; + white-space: nowrap; +} + +.mytheme .v-select-optiongroup-small .v-checkbox.v-has-width label { + white-space: normal; +} + +:root .mytheme .v-select-optiongroup-small .v-checkbox { + padding-left: 21px; +} + +:root .mytheme .v-select-optiongroup-small .v-checkbox label { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + display: inline-block; +} + +:root .mytheme .v-select-optiongroup-small .v-checkbox > input { + position: absolute; + clip: rect(0, 0, 0, 0); + left: 0.2em; + top: 0.2em; + z-index: 0; + margin: 0; +} + +:root .mytheme .v-select-optiongroup-small .v-checkbox > input:focus ~ label:before { + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); +} + +:root .mytheme .v-select-optiongroup-small .v-checkbox > input ~ label:before, :root .mytheme .v-select-optiongroup-small .v-checkbox > input ~ label:after { + content: ""; + display: inline-block; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 16px; + height: 16px; + position: absolute; + top: 0; + left: 0; + border-radius: 4px; + font-size: 11px; + text-align: center; +} + +:root .mytheme .v-select-optiongroup-small .v-checkbox > input ~ label:before { + height: 15.5px; + padding: 0 7px; + color: #191919; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); + padding: 0; + height: 16px; +} + +:root .mytheme .v-select-optiongroup-small .v-checkbox > input ~ label:after { + content: "\f00c"; + font-family: ThemeIcons; + color: transparent; + -webkit-transition: color 100ms; + -moz-transition: color 100ms; + transition: color 100ms; +} + +:root .mytheme .v-select-optiongroup-small .v-checkbox > input:active ~ label:after { + background-color: rgba(125, 125, 125, 0.2); +} + +:root .mytheme .v-select-optiongroup-small .v-checkbox > input:checked ~ label:after { + color: #197de1; +} + +.mytheme .v-select-optiongroup-small .v-checkbox > .v-icon, .mytheme .v-select-optiongroup-small .v-checkbox > label .v-icon { + margin: 0 5px 0 3px; + min-width: 1em; + cursor: pointer; +} + +.mytheme .v-select-optiongroup-small .v-checkbox.v-disabled > label, .mytheme .v-select-optiongroup-small .v-checkbox.v-disabled > .v-icon { + cursor: default; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-select-optiongroup-small .v-checkbox.v-disabled > label > .v-icon { + cursor: default; +} + +:root .mytheme .v-select-optiongroup-small .v-checkbox.v-disabled > input:active ~ label:after { + background: transparent; +} + +.mytheme .v-select-optiongroup-small .v-checkbox.v-readonly > label, .mytheme .v-select-optiongroup-small .v-checkbox.v-readonly > .v-icon { + cursor: default; +} + +.mytheme .v-select-optiongroup-small .v-checkbox.v-readonly > label > .v-icon { + cursor: default; +} + +:root .mytheme .v-select-optiongroup-small .v-checkbox.v-readonly > input:active ~ label:after { + background: transparent; +} + +:root .mytheme .v-select-optiongroup-small .v-checkbox.v-readonly > input ~ label:after { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-select-optiongroup-small .v-radiobutton { + position: relative; + line-height: 16px; + white-space: nowrap; +} + +.mytheme .v-select-optiongroup-small .v-radiobutton.v-has-width label { + white-space: normal; +} + +:root .mytheme .v-select-optiongroup-small .v-radiobutton { + padding-left: 21px; +} + +:root .mytheme .v-select-optiongroup-small .v-radiobutton label { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + display: inline-block; +} + +:root .mytheme .v-select-optiongroup-small .v-radiobutton > input { + position: absolute; + clip: rect(0, 0, 0, 0); + left: 0.2em; + top: 0.2em; + z-index: 0; + margin: 0; +} + +:root .mytheme .v-select-optiongroup-small .v-radiobutton > input:focus ~ label:before { + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); +} + +:root .mytheme .v-select-optiongroup-small .v-radiobutton > input ~ label:before, :root .mytheme .v-select-optiongroup-small .v-radiobutton > input ~ label:after { + content: ""; + display: inline-block; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 16px; + height: 16px; + position: absolute; + top: 0; + left: 0; + border-radius: 4px; + font-size: 11px; + text-align: center; +} + +:root .mytheme .v-select-optiongroup-small .v-radiobutton > input ~ label:before { + height: 15.5px; + padding: 0 7px; + color: #191919; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); + padding: 0; + height: 16px; +} + +:root .mytheme .v-select-optiongroup-small .v-radiobutton > input ~ label:after { + content: "\f00c"; + font-family: ThemeIcons; + color: transparent; + -webkit-transition: color 100ms; + -moz-transition: color 100ms; + transition: color 100ms; +} + +:root .mytheme .v-select-optiongroup-small .v-radiobutton > input:active ~ label:after { + background-color: rgba(125, 125, 125, 0.2); +} + +:root .mytheme .v-select-optiongroup-small .v-radiobutton > input:checked ~ label:after { + color: #197de1; +} + +.mytheme .v-select-optiongroup-small .v-radiobutton > .v-icon, .mytheme .v-select-optiongroup-small .v-radiobutton > label .v-icon { + margin: 0 5px 0 3px; + min-width: 1em; + cursor: pointer; +} + +.mytheme .v-select-optiongroup-small .v-radiobutton.v-disabled > label, .mytheme .v-select-optiongroup-small .v-radiobutton.v-disabled > .v-icon { + cursor: default; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-select-optiongroup-small .v-radiobutton.v-disabled > label > .v-icon { + cursor: default; +} + +:root .mytheme .v-select-optiongroup-small .v-radiobutton.v-disabled > input:active ~ label:after { + background: transparent; +} + +.mytheme .v-select-optiongroup-small .v-radiobutton.v-readonly > label, .mytheme .v-select-optiongroup-small .v-radiobutton.v-readonly > .v-icon { + cursor: default; +} + +.mytheme .v-select-optiongroup-small .v-radiobutton.v-readonly > label > .v-icon { + cursor: default; +} + +:root .mytheme .v-select-optiongroup-small .v-radiobutton.v-readonly > input:active ~ label:after { + background: transparent; +} + +:root .mytheme .v-select-optiongroup-small .v-radiobutton.v-readonly > input ~ label:after { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +:root .mytheme .v-select-optiongroup-small .v-radiobutton > input:checked ~ label:after { + width: 6px; + height: 6px; + top: 5px; + left: 5px; + background: #197de1; +} + +:root .mytheme .v-select-optiongroup-small .v-radiobutton > input ~ label:before, :root .mytheme .v-select-optiongroup-small .v-radiobutton > input ~ label:after { + border-radius: 50%; + content: ""; +} + +.mytheme .v-select-optiongroup-small .v-radiobutton, .mytheme .v-select-optiongroup-small .v-checkbox { + display: block; + margin: 8px 16px 0 0; +} + +.mytheme .v-select-optiongroup-small .v-radiobutton:first-child, .mytheme .v-select-optiongroup-small .v-checkbox:first-child { + margin-top: 5px; +} + +.mytheme .v-select-optiongroup-small .v-radiobutton:last-child, .mytheme .v-select-optiongroup-small .v-checkbox:last-child { + margin-bottom: 5px; +} + +.mytheme .v-select-optiongroup-small.v-has-width label { + white-space: normal; +} + +.mytheme .v-select-optiongroup-large { + font-size: 20px; +} + +.mytheme .v-select-optiongroup-large .v-checkbox { + position: relative; + line-height: 22px; + white-space: nowrap; +} + +.mytheme .v-select-optiongroup-large .v-checkbox.v-has-width label { + white-space: normal; +} + +:root .mytheme .v-select-optiongroup-large .v-checkbox { + padding-left: 29px; +} + +:root .mytheme .v-select-optiongroup-large .v-checkbox label { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + display: inline-block; +} + +:root .mytheme .v-select-optiongroup-large .v-checkbox > input { + position: absolute; + clip: rect(0, 0, 0, 0); + left: 0.2em; + top: 0.2em; + z-index: 0; + margin: 0; +} + +:root .mytheme .v-select-optiongroup-large .v-checkbox > input:focus ~ label:before { + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); +} + +:root .mytheme .v-select-optiongroup-large .v-checkbox > input ~ label:before, :root .mytheme .v-select-optiongroup-large .v-checkbox > input ~ label:after { + content: ""; + display: inline-block; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 22px; + height: 22px; + position: absolute; + top: 0; + left: 0; + border-radius: 4px; + font-size: 15px; + text-align: center; +} + +:root .mytheme .v-select-optiongroup-large .v-checkbox > input ~ label:before { + height: 22px; + padding: 0 10px; + color: #191919; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); + padding: 0; + height: 22px; +} + +:root .mytheme .v-select-optiongroup-large .v-checkbox > input ~ label:after { + content: "\f00c"; + font-family: ThemeIcons; + color: transparent; + -webkit-transition: color 100ms; + -moz-transition: color 100ms; + transition: color 100ms; +} + +:root .mytheme .v-select-optiongroup-large .v-checkbox > input:active ~ label:after { + background-color: rgba(125, 125, 125, 0.2); +} + +:root .mytheme .v-select-optiongroup-large .v-checkbox > input:checked ~ label:after { + color: #197de1; +} + +.mytheme .v-select-optiongroup-large .v-checkbox > .v-icon, .mytheme .v-select-optiongroup-large .v-checkbox > label .v-icon { + margin: 0 7px 0 4px; + min-width: 1em; + cursor: pointer; +} + +.mytheme .v-select-optiongroup-large .v-checkbox.v-disabled > label, .mytheme .v-select-optiongroup-large .v-checkbox.v-disabled > .v-icon { + cursor: default; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-select-optiongroup-large .v-checkbox.v-disabled > label > .v-icon { + cursor: default; +} + +:root .mytheme .v-select-optiongroup-large .v-checkbox.v-disabled > input:active ~ label:after { + background: transparent; +} + +.mytheme .v-select-optiongroup-large .v-checkbox.v-readonly > label, .mytheme .v-select-optiongroup-large .v-checkbox.v-readonly > .v-icon { + cursor: default; +} + +.mytheme .v-select-optiongroup-large .v-checkbox.v-readonly > label > .v-icon { + cursor: default; +} + +:root .mytheme .v-select-optiongroup-large .v-checkbox.v-readonly > input:active ~ label:after { + background: transparent; +} + +:root .mytheme .v-select-optiongroup-large .v-checkbox.v-readonly > input ~ label:after { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-select-optiongroup-large .v-radiobutton { + position: relative; + line-height: 22px; + white-space: nowrap; +} + +.mytheme .v-select-optiongroup-large .v-radiobutton.v-has-width label { + white-space: normal; +} + +:root .mytheme .v-select-optiongroup-large .v-radiobutton { + padding-left: 29px; +} + +:root .mytheme .v-select-optiongroup-large .v-radiobutton label { + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + cursor: pointer; + display: inline-block; +} + +:root .mytheme .v-select-optiongroup-large .v-radiobutton > input { + position: absolute; + clip: rect(0, 0, 0, 0); + left: 0.2em; + top: 0.2em; + z-index: 0; + margin: 0; +} + +:root .mytheme .v-select-optiongroup-large .v-radiobutton > input:focus ~ label:before { + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5), inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); +} + +:root .mytheme .v-select-optiongroup-large .v-radiobutton > input ~ label:before, :root .mytheme .v-select-optiongroup-large .v-radiobutton > input ~ label:after { + content: ""; + display: inline-block; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 22px; + height: 22px; + position: absolute; + top: 0; + left: 0; + border-radius: 4px; + font-size: 15px; + text-align: center; +} + +:root .mytheme .v-select-optiongroup-large .v-radiobutton > input ~ label:before { + height: 22px; + padding: 0 10px; + color: #191919; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); + padding: 0; + height: 22px; +} + +:root .mytheme .v-select-optiongroup-large .v-radiobutton > input ~ label:after { + content: "\f00c"; + font-family: ThemeIcons; + color: transparent; + -webkit-transition: color 100ms; + -moz-transition: color 100ms; + transition: color 100ms; +} + +:root .mytheme .v-select-optiongroup-large .v-radiobutton > input:active ~ label:after { + background-color: rgba(125, 125, 125, 0.2); +} + +:root .mytheme .v-select-optiongroup-large .v-radiobutton > input:checked ~ label:after { + color: #197de1; +} + +.mytheme .v-select-optiongroup-large .v-radiobutton > .v-icon, .mytheme .v-select-optiongroup-large .v-radiobutton > label .v-icon { + margin: 0 7px 0 4px; + min-width: 1em; + cursor: pointer; +} + +.mytheme .v-select-optiongroup-large .v-radiobutton.v-disabled > label, .mytheme .v-select-optiongroup-large .v-radiobutton.v-disabled > .v-icon { + cursor: default; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-select-optiongroup-large .v-radiobutton.v-disabled > label > .v-icon { + cursor: default; +} + +:root .mytheme .v-select-optiongroup-large .v-radiobutton.v-disabled > input:active ~ label:after { + background: transparent; +} + +.mytheme .v-select-optiongroup-large .v-radiobutton.v-readonly > label, .mytheme .v-select-optiongroup-large .v-radiobutton.v-readonly > .v-icon { + cursor: default; +} + +.mytheme .v-select-optiongroup-large .v-radiobutton.v-readonly > label > .v-icon { + cursor: default; +} + +:root .mytheme .v-select-optiongroup-large .v-radiobutton.v-readonly > input:active ~ label:after { + background: transparent; +} + +:root .mytheme .v-select-optiongroup-large .v-radiobutton.v-readonly > input ~ label:after { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +:root .mytheme .v-select-optiongroup-large .v-radiobutton > input:checked ~ label:after { + width: 8px; + height: 8px; + top: 7px; + left: 7px; + background: #197de1; +} + +:root .mytheme .v-select-optiongroup-large .v-radiobutton > input ~ label:before, :root .mytheme .v-select-optiongroup-large .v-radiobutton > input ~ label:after { + border-radius: 50%; + content: ""; +} + +.mytheme .v-select-optiongroup-large .v-radiobutton, .mytheme .v-select-optiongroup-large .v-checkbox { + display: block; + margin: 11px 16px 0 0; +} + +.mytheme .v-select-optiongroup-large .v-radiobutton:first-child, .mytheme .v-select-optiongroup-large .v-checkbox:first-child { + margin-top: 7px; +} + +.mytheme .v-select-optiongroup-large .v-radiobutton:last-child, .mytheme .v-select-optiongroup-large .v-checkbox:last-child { + margin-bottom: 7px; +} + +.mytheme .v-select-optiongroup-large.v-has-width label { + white-space: normal; +} + +.mytheme .v-select-optiongroup-horizontal { + white-space: nowrap; +} + +.mytheme .v-select-optiongroup-horizontal .v-radiobutton, .mytheme .v-select-optiongroup-horizontal .v-checkbox { + display: inline-block; +} + +.mytheme .v-select-optiongroup-horizontal.v-has-width { + white-space: normal; +} + +.mytheme .v-select-optiongroup-horizontal.v-has-width label { + white-space: nowrap; +} + +.mytheme .v-link { + cursor: pointer; + color: #197de1; + text-decoration: underline; + font-weight: inherit; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; +} + +.mytheme .v-link:hover { + color: #4396ea; +} + +.mytheme .v-link.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-link a { + cursor: inherit; + color: inherit; + text-decoration: inherit; + -webkit-transition: inherit; + -moz-transition: inherit; + transition: inherit; +} + +.mytheme .v-link .v-icon { + cursor: inherit; +} + +.mytheme .v-link-small { + font-size: 14px; +} + +.mytheme .v-link-large { + font-size: 20px; +} + +.mytheme .v-window { + padding: 4px 4px; + border-radius: 4px; + background-color: white; + color: #474747; + -webkit-box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.1), 0 3px 5px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.09098); + box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.1), 0 3px 5px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.09098); + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1), 0 16px 80px -6px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.09098); + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1), 0 16px 80px -6px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.09098); + padding: 0; + min-width: 148px !important; + min-height: 37px !important; + white-space: nowrap; + overflow: hidden !important; + -webkit-transition: width 200ms, height 200ms, top 200ms, left 200ms; + -moz-transition: width 200ms, height 200ms, top 200ms, left 200ms; + transition: width 200ms, height 200ms, top 200ms, left 200ms; +} + +.mytheme .v-window[class*="animate-in"] { + -webkit-animation: valo-animate-in-fade 140ms; + -moz-animation: valo-animate-in-fade 140ms; + animation: valo-animate-in-fade 140ms; +} + +.mytheme .v-window[class*="animate-out"] { + -webkit-animation: valo-animate-out-scale-down-fade 100ms; + -moz-animation: valo-animate-out-scale-down-fade 100ms; + animation: valo-animate-out-scale-down-fade 100ms; +} + +.mytheme .v-window.v-window-animate-in { + -webkit-transition: none; + -moz-transition: none; + transition: none; +} + +.mytheme .v-window-modalitycurtain { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + background-color: #222; + background-image: -webkit-radial-gradient(50% 50%, circle, #222, #0e0e0e); + background-image: radial-gradient( circle at 50% 50%, #222, #0e0e0e); + opacity: 0.72; + filter: alpha(opacity=72) ; + -webkit-animation: valo-animate-in-fade 400ms 100ms backwards; + -moz-animation: valo-animate-in-fade 400ms 100ms backwards; + animation: valo-animate-in-fade 400ms 100ms backwards; +} + +.v-op12 .mytheme .v-window-modalitycurtain { + -webkit-animation: none; + -moz-animation: none; + animation: none; +} + +.mytheme .v-window-draggingCurtain { + position: fixed !important; +} + +.mytheme .v-window-resizingCurtain + .v-window, .mytheme .v-window-draggingCurtain + .v-window { + -webkit-transition: none; + -moz-transition: none; + transition: none; +} + +.mytheme .v-window-outerheader { + cursor: move; + position: absolute; + z-index: 2; + top: 0; + left: 0; + right: 0; + -webkit-transform: translatez(0); + -moz-transform: translatez(0); + -ms-transform: translatez(0); + -o-transform: translatez(0); + transform: translatez(0); +} + +.mytheme .v-window-outerheader:after { + content: ""; + position: absolute; + bottom: -1px; + right: 0; + left: 0; + height: 0; + border-top: 1px solid #dfdfdf; + border-color: rgba(197, 197, 197, 0.5); +} + +.mytheme .v-window-header { + line-height: 36px; + padding-left: 12px; + margin-right: 74px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + color: #7e7e7e; +} + +.mytheme .v-window-restorebox-disabled ~ .v-window-closebox ~ .v-window-header, .mytheme .v-window-maximizebox-disabled ~ .v-window-closebox ~ .v-window-header { + margin-right: 37px; +} + +.mytheme .v-window-restorebox-disabled ~ .v-window-closebox-disabled ~ .v-window-header, .mytheme .v-window-maximizebox-disabled ~ .v-window-closebox-disabled ~ .v-window-header { + margin-right: 12px; +} + +.mytheme .v-window-closebox, .mytheme .v-window-maximizebox, .mytheme .v-window-restorebox { + position: absolute; + z-index: 3; + top: 0; + right: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 33px; + height: 36px; + background-color: white; + line-height: 34px; + text-align: center; + cursor: pointer; + font-size: 21px; + color: #999999; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; +} + +.mytheme .v-window-closebox:focus, .mytheme .v-window-maximizebox:focus, .mytheme .v-window-restorebox:focus { + outline: none; +} + +.mytheme .v-window-closebox:hover, .mytheme .v-window-maximizebox:hover, .mytheme .v-window-restorebox:hover { + opacity: 1; + filter: none ; + color: #197de1; +} + +.mytheme .v-window-closebox:active, .mytheme .v-window-maximizebox:active, .mytheme .v-window-restorebox:active { + color: inherit; +} + +.mytheme .v-window-closebox { + padding-right: 4px; + border-radius: 0 4px 0 4px; +} + +.mytheme .v-window-closebox:before { + content: "\00d7"; +} + +.mytheme .v-window-maximizebox, .mytheme .v-window-restorebox { + right: 33px; + padding-left: 4px; + border-radius: 0 0 0 4px; +} + +.mytheme .v-window-maximizebox + .v-window-closebox, .mytheme .v-window-restorebox + .v-window-closebox { + border-bottom-left-radius: 0; +} + +.mytheme .v-window-closebox-disabled, .mytheme .v-window-resizebox-disabled, .mytheme .v-window-restorebox-disabled, .mytheme .v-window-maximizebox-disabled { + display: none; +} + +.mytheme .v-window-closebox-disabled + .v-window-closebox, .mytheme .v-window-resizebox-disabled + .v-window-closebox, .mytheme .v-window-restorebox-disabled + .v-window-closebox, .mytheme .v-window-maximizebox-disabled + .v-window-closebox { + width: 37px; + padding-right: 0; + border-bottom-left-radius: 4px; +} + +.mytheme .v-window-maximizebox:before { + content: "+"; +} + +.mytheme .v-window-restorebox:before { + content: "\2013"; +} + +.mytheme .v-window > .popupContent, .mytheme .v-window-wrap, .mytheme .v-window-contents, .mytheme .v-window-contents > .v-scrollable { + height: 100%; +} + +.mytheme .v-window-contents { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border-radius: 4px; + margin-top: 0 !important; +} + +.mytheme .v-window-contents > .v-scrollable { + position: relative; +} + +.mytheme .v-window-contents > .v-scrollable > .v-margin-top { + padding-top: 12px; +} + +.mytheme .v-window-contents > .v-scrollable > .v-margin-right { + padding-right: 12px; +} + +.mytheme .v-window-contents > .v-scrollable > .v-margin-bottom { + padding-bottom: 12px; +} + +.mytheme .v-window-contents > .v-scrollable > .v-margin-left { + padding-left: 12px; +} + +.mytheme .v-window-contents > .v-scrollable > .v-formlayout [class*="margin-top"] > tbody > [class*="firstrow"] > td { + padding-top: 12px; +} + +.mytheme .v-window-contents > .v-scrollable > .v-formlayout [class*="margin-bottom"] > tbody > [class*="lastrow"] > td { + padding-bottom: 12px; +} + +.mytheme .v-window-contents > .v-scrollable > .v-formlayout [class*="margin-left"] > tbody > [class*="row"] > [class*="captioncell"] { + padding-left: 12px; +} + +.mytheme .v-window-contents > .v-scrollable > .v-formlayout [class*="margin-left"] > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h2, .mytheme .v-window-contents > .v-scrollable > .v-formlayout [class*="margin-left"] > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h3, .mytheme .v-window-contents > .v-scrollable > .v-formlayout [class*="margin-left"] > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h4 { + left: 12px; +} + +.mytheme .v-window-contents > .v-scrollable > .v-formlayout [class*="margin-right"] > tbody > [class*="row"] > [class*="contentcell"] { + padding-right: 12px; +} + +.mytheme .v-window-contents > .v-scrollable > .v-formlayout [class*="margin-right"] > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h2, .mytheme .v-window-contents > .v-scrollable > .v-formlayout [class*="margin-right"] > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h3, .mytheme .v-window-contents > .v-scrollable > .v-formlayout [class*="margin-right"] > tbody > [class*="row"] > [class*="contentcell"] > .v-label-h4 { + right: 12px; +} + +.mytheme .v-window-contents > .v-scrollable:focus { + outline: none; +} + +.mytheme .v-window-contents > .v-scrollable:before { + content: ""; + position: absolute; + z-index: 2; + top: 0; + height: 0; + border-top: 1px solid white; + left: 0; + right: 0; +} + +.mytheme .v-window-contents > .v-scrollable .v-panel-captionwrap:after { + border-color: #dfdfdf; +} + +.mytheme .v-window-contents > .v-scrollable .v-panel-content:before { + border-color: white; +} + +.mytheme .v-window-footer { + height: 0; +} + +.mytheme .v-window-resizebox { + position: absolute; + z-index: 1000; + right: 0; + bottom: 0; + width: 19px; + height: 19px; + cursor: nwse-resize; +} + +.v-ie8 .mytheme .v-window-resizebox { + background: #000; + filter: alpha(opacity=0.1); +} + +.v-ie8 .mytheme .v-window-resizebox, .v-ie9 .mytheme .v-window-resizebox { + cursor: se-resize; +} + +.mytheme .v-window-modalitycurtain:active ~ .v-window { + -webkit-animation: none; + -moz-animation: none; + animation: none; +} + +.mytheme .v-window-top-toolbar > .v-widget, .mytheme .v-window-bottom-toolbar > .v-widget { + vertical-align: top; +} + +.mytheme .v-window-top-toolbar .v-label, .mytheme .v-window-bottom-toolbar .v-label { + line-height: 36px; +} + +.mytheme .v-window-top-toolbar .v-spacing, .mytheme .v-window-bottom-toolbar .v-spacing { + width: 6px; +} + +.mytheme .v-window-top-toolbar.v-layout { + padding: 7px 12px; + position: relative; + z-index: 2; + border-top: 1px solid #dfdfdf; + border-bottom: 1px solid #dfdfdf; + background-color: #fafafa; +} + +.mytheme .v-window-top-toolbar.v-menubar { + margin: 12px 12px 6px; +} + +.mytheme .v-window-top-toolbar.v-menubar-borderless { + padding-left: 6px; + padding-right: 6px; + margin: 5px 0; +} + +.mytheme .v-window-bottom-toolbar.v-layout { + padding: 7px 12px; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #f0f0f0 0, #fafafa 4px); + background-image: linear-gradient(to bottom,#f0f0f0 0, #fafafa 4px); + border-top: 1px solid #dfdfdf; + border-radius: 0 0 4px 4px; +} + +.mytheme .v-margin-left.v-margin-right.v-margin-top .v-window-top-toolbar.v-layout { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + margin: -12px -12px 0; +} + +.mytheme .v-margin-left.v-margin-right.v-margin-top .v-window-top-toolbar.v-menubar { + margin: 0; +} + +.mytheme .v-margin-left.v-margin-right.v-margin-top .v-window-top-toolbar.v-menubar-borderless { + margin: -6px -6px 0; + padding: 0; +} + +.mytheme .v-margin-left.v-margin-right.v-margin-bottom .v-window-bottom-toolbar.v-layout { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + margin: 0 -12px -12px; +} + +.mytheme .v-tree { + position: relative; + white-space: nowrap; +} + +.mytheme .v-tree:focus { + outline: none; +} + +.mytheme .v-tree-node:before { + content: ""; + position: absolute; + display: inline-block; + z-index: 3; + width: 1.9em; + height: 28px; + cursor: pointer; + background: red; + opacity: 0; +} + +.v-ie8 .mytheme .v-tree-node:before { + position: static; + margin-left: -1.9em; + vertical-align: top; + content: "\f0da"; + font-family: ThemeIcons; + text-align: center; + background: transparent; +} + +.v-ie8 .mytheme .v-tree-node { + padding-left: 1.9em; +} + +.mytheme .v-tree-node-caption { + height: 28px; + line-height: 27px; + overflow: hidden; + white-space: nowrap; + vertical-align: top; +} + +.mytheme .v-tree-node-caption > div { + display: inline-block; + width: 100%; + position: relative; + z-index: 2; +} + +.mytheme .v-tree-node-caption > div:before { + content: "\f0da"; + font-family: ThemeIcons; + display: inline-block; + width: 0.5em; + text-align: center; + margin: 0 0.6em 0 0.8em; + -webkit-transition: all 100ms; + -moz-transition: all 100ms; + transition: all 100ms; +} + +.v-ie8 .mytheme .v-tree-node-caption > div:before { + display: none; +} + +.mytheme .v-tree-node-caption span { + padding-right: 28px; + cursor: pointer; + display: inline-block; + width: 100%; +} + +.v-ie .mytheme .v-tree-node-caption span { + width: auto; +} + +.mytheme .v-tree-node-caption .v-icon { + padding-right: 0; + width: auto; + min-width: 1em; +} + +.mytheme .v-tree-node-caption:after { + content: ""; + display: block; + vertical-align: top; + position: absolute; + z-index: 1; + left: 0; + margin-top: -28px; + width: 100%; + height: 28px; + border-radius: 4px; + opacity: 0; + -webkit-transition: opacity 120ms; + -moz-transition: opacity 120ms; + transition: opacity 120ms; +} + +.v-ie8 .mytheme .v-tree-node-caption:after { + content: none; +} + +.v-ie8 .mytheme .v-tree-node-caption { + display: inline-block; +} + +.mytheme .v-tree-node-expanded > .v-tree-node-caption > div:before { + -webkit-transform: rotate(90deg); + -moz-transform: rotate(90deg); + -ms-transform: rotate(90deg); + -o-transform: rotate(90deg); + transform: rotate(90deg); + content: "\f0da"; + font-family: ThemeIcons; +} + +.v-ie8 .mytheme .v-tree-node-expanded:before { + content: "\f0d7"; + font-family: ThemeIcons; +} + +.mytheme .v-tree-node-leaf:before, .mytheme .v-tree-node-leaf > .v-tree-node-caption > div:before { + visibility: hidden; +} + +.mytheme .v-tree-node-focused:after { + opacity: 1; + border: 1px solid #197de1; +} + +.v-ie8 .mytheme .v-tree-node-focused { + outline: 1px dotted #197de1; +} + +.mytheme .v-tree-node-selected { + color: #ecf2f8; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05); +} + +.mytheme .v-tree-node-selected:after { + opacity: 1; + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + border: none; +} + +.v-ie8 .mytheme .v-tree-node-selected { + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); +} + +.mytheme .v-tree-node-children { + padding-left: 19px; +} + +.v-ie8 .mytheme .v-tree-node-children { + padding-left: 0; +} + +.mytheme .v-tree-node-drag-top:before, .mytheme .v-tree-node-drag-bottom:after, .mytheme .v-tree-node-drag-bottom.v-tree-node-dragfolder.v-tree-node-expanded > .v-tree-node-children:before { + content: "\2022"; + display: block; + position: absolute; + height: 2px; + width: 100%; + background: #197de1; + font-size: 32px; + line-height: 2px; + color: #197de1; + text-indent: -4px; + text-shadow: 0 0 1px #fafafa, 0 0 1px #fafafa; + opacity: 1; + visibility: visible; +} + +.mytheme .v-tree-node-drag-bottom.v-tree-node-dragfolder.v-tree-node-expanded:after { + content: none; +} + +.mytheme .v-tree-node-caption-drag-center { + -webkit-box-shadow: 0 0 0 2px #197de1; + box-shadow: 0 0 0 2px #197de1; + position: relative; + border-radius: 4px; +} + +.v-ie8 .mytheme .v-tree-node-caption-drag-center { + outline: 2px solid #197de1; +} + +.v-ff .mytheme .v-tree-node-drag-top:before, .v-ff .mytheme .v-tree-node-drag-bottom:after { + line-height: 1px; +} + +.v-ie8 .mytheme .v-tree-node-drag-top:before, .v-ie8 .mytheme .v-tree-node-drag-bottom:after { + line-height: 0; +} + +.mytheme .v-table { + position: relative; + background: #fafafa; + color: #464646; + overflow: hidden; +} + +.mytheme .v-table-header table, .mytheme .v-table-footer table, .mytheme .v-table-table { + -webkit-box-shadow: 0 0 0 1px #d4d4d4; + box-shadow: 0 0 0 1px #d4d4d4; +} + +.v-ie8 .mytheme .v-table-header table, .v-ie8 .mytheme .v-table-footer table, .v-ie8 .mytheme .v-table-table { + outline: 1px solid #d4d4d4; +} + +.mytheme .v-table-header-wrap, .mytheme .v-table-footer-wrap, .mytheme .v-table-header-drag { + border: 1px solid #d4d4d4; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + white-space: nowrap; + font-size: 14px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); +} + +.mytheme .v-table-header-wrap { + position: relative; + border-bottom: none; +} + +.mytheme .v-table-footer-wrap { + border-top: none; +} + +.mytheme .v-table-footer td { + border-left: 1px solid #d4d4d4; +} + +.mytheme .v-table-footer-container, .mytheme .v-table-caption-container { + overflow: hidden; + line-height: 1; + min-height: 37px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.v-ie8 .mytheme .v-table-footer-container, .v-ie8 .mytheme .v-table-caption-container { + min-height: 14px; +} + +.mytheme .v-table-footer-container { + padding: 11px 12px 12px; + float: right; +} + +.mytheme [class^="v-table-header-cell"] { + position: relative; +} + +.mytheme .v-table-caption-container, .mytheme .v-table-header-drag { + padding: 12px 12px 11px; + border-left: 1px solid #d4d4d4; +} + +.mytheme .v-table-caption-container-align-right { + padding-right: 4px; +} + +.mytheme .v-table-resizer { + height: 37px; + width: 8px; + cursor: e-resize; + cursor: col-resize; + position: relative; + right: -4px; + z-index: 1; + margin-left: -8px; +} + +.mytheme .v-table-cell-content { + border-left: 1px solid #d4d4d4; + overflow: hidden; + height: 37px; + vertical-align: middle; +} + +.mytheme .v-table-cell-content:first-child { + border-left: none; + padding-left: 1px; +} + +.mytheme .v-table-header td:first-child .v-table-caption-container, .mytheme .v-table-footer td:first-child { + border-left-color: transparent; +} + +.mytheme .v-table-cell-wrapper { + line-height: 1; + padding: 0 12px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + margin-right: 0 !important; +} + +.mytheme .v-table-cell-wrapper > .v-widget { + margin: 3px -6px; +} + +.mytheme .v-table-cell-wrapper > .v-widget.v-label, .mytheme .v-table-cell-wrapper > .v-widget.v-checkbox, .mytheme .v-table-cell-wrapper > .v-widget.v-select-optiongroup { + margin: 0; +} + +.mytheme .v-table-cell-wrapper > .v-widget.v-progressbar { + margin-left: 0; + margin-right: 0; +} + +.mytheme .v-table-body { + border: 1px solid #d4d4d4; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} + +.mytheme .v-table-table { + background-color: white; + white-space: nowrap; +} + +.mytheme .v-table-table td { + border-top: 1px solid #d4d4d4; +} + +.mytheme .v-table-table tr:first-child > td { + border-top: none; +} + +.mytheme .v-table-row { + background-color: white; + cursor: pointer; +} + +.mytheme .v-table-row-odd { + background-color: #f5f5f5; + cursor: pointer; +} + +.mytheme .v-table-body-noselection .v-table-row, .mytheme .v-table-body-noselection .v-table-row-odd { + cursor: default; +} + +.mytheme .v-table [class*="-row"].v-selected { + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + background-origin: border-box; + color: #ecf2f8; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05); +} + +.mytheme .v-table [class*="-row"].v-selected + .v-selected { + background: #166ed5; +} + +.mytheme .v-table [class*="-row"].v-selected + .v-selected td { + border-top-color: #166ed5; +} + +.mytheme .v-table [class*="-row"].v-selected .v-table-cell-content { + border-color: transparent; + border-left-color: #1d69b4; +} + +.mytheme .v-table [class*="-row"].v-selected .v-table-cell-content:first-child { + border-left-color: transparent; +} + +.mytheme .v-table-header-cell-asc .v-table-sort-indicator, .mytheme .v-table-header-cell-desc .v-table-sort-indicator { + background: transparent; + width: 19px; + height: 37px; + line-height: 37px; + margin-left: -19px; +} + +.mytheme .v-table-header-cell-asc .v-table-sort-indicator:before, .mytheme .v-table-header-cell-desc .v-table-sort-indicator:before { + font-style: normal; + font-weight: normal; + display: inline-block; +} + +.mytheme .v-table-header-cell-asc .v-table-sort-indicator:before { + content: "\f0de"; + font-family: ThemeIcons; +} + +.mytheme .v-table-header-cell-desc .v-table-sort-indicator:before { + content: "\f0dd"; + font-family: ThemeIcons; +} + +.mytheme [class*="rowheader"] span.v-icon { + min-width: 1em; +} + +.mytheme .v-table-focus { + outline: 1px solid #197de1; + outline-offset: -1px; +} + +.mytheme .v-drag-element.v-table-focus, .mytheme .v-drag-element .v-table-focus { + outline: none; +} + +.mytheme .v-table-header-drag { + position: absolute; + opacity: 0.9; + filter: alpha(opacity=90) ; + margin-top: -19px; + z-index: 30000; + line-height: 1; +} + +.mytheme .v-table-focus-slot-right { + border-right: 3px solid #197de1; + right: -2px; + margin-left: -11px !important; +} + +.mytheme .v-table-focus-slot-left { + float: left; + border-left: 3px solid #197de1; + left: -1px; + right: auto; + margin-left: 0 !important; + margin-right: -11px; +} + +.mytheme .v-table-column-selector { + height: 37px; + padding: 0 16px; + color: #191919; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7; + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); + position: absolute; + z-index: 2; + top: 0; + right: 0; + width: 19px; + height: 19px; + line-height: 19px; + padding: 0; + border-top-width: 0; + border-right-width: 0; + border-radius: 0 0 0 4px; + cursor: pointer; + text-align: center; + opacity: 0; + filter: alpha(opacity=0) ; + -webkit-transition: opacity 200ms 2s; + -moz-transition: opacity 200ms 2s; + transition: opacity 200ms 2s; +} + +.mytheme .v-table-column-selector:after { + border: inherit; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; +} + +.mytheme .v-table-column-selector:hover:after { + background-color: rgba(186, 186, 186, 0.1); +} + +.mytheme .v-table-column-selector:focus:after { + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-table-column-selector:active:after { + background-color: rgba(125, 125, 125, 0.2); +} + +.mytheme .v-table-column-selector:after { + content: ""; + position: absolute; + border: none; + top: 0; + right: 0; + bottom: 0; + left: 0; +} + +.mytheme .v-table-column-selector:active:after { + background-color: rgba(125, 125, 125, 0.2); +} + +.mytheme .v-table-column-selector:before { + font-family: ThemeIcons; + content: "\f013"; +} + +.mytheme .v-table-header-wrap:hover .v-table-column-selector { + opacity: 1; + filter: none ; + -webkit-transition-delay: 200ms; + -moz-transition-delay: 200ms; + transition-delay: 200ms; +} + +.mytheme .v-on:before, .mytheme .v-off:before { + content: "\f00c"; + font-family: ThemeIcons; + font-size: 0.9em; + margin-right: 6px; +} + +.mytheme .v-on div, .mytheme .v-off div { + display: inline; +} + +.mytheme .v-on.v-disabled, .mytheme .v-off.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-off:before { + visibility: hidden; +} + +.mytheme tbody.v-drag-element { + display: block; + overflow: visible; + -webkit-box-shadow: none; + box-shadow: none; + background: transparent; + opacity: 1; + filter: none ; +} + +.mytheme tbody.v-drag-element tr { + display: block; + + + -webkit-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); + border-radius: 4px; + overflow: hidden; + opacity: 0.5; + filter: alpha(opacity=50) ; + background: white; +} + +.mytheme .v-table-body { + position: relative; + z-index: 1; +} + +.mytheme .v-table-scrollposition { + position: absolute; + top: 50%; + width: 100%; + height: 37px; + line-height: 37px; + margin: -19px 0 0 !important; + text-align: center; +} + +.mytheme .v-table-drag { + overflow: visible; +} + +.mytheme .v-table-drag .v-table-body { + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + border-color: #197de1; +} + +.v-ie8 .mytheme .v-table-drag .v-table-body { + border-color: #197de1; +} + +.mytheme .v-table-drag .v-table-body .v-table-focus { + outline: none; +} + +.mytheme .v-table-row-drag-middle .v-table-cell-content { + background-color: #d1e5f9; + color: #214060; +} + +.mytheme .v-table-row-drag-bottom td.v-table-cell-content { + border-bottom: 2px solid #197de1; + height: 35px; +} + +.mytheme .v-table-row-drag-bottom .v-table-cell-wrapper { + margin-bottom: -2px; +} + +.mytheme .v-table-row-drag-top td.v-table-cell-content { + border-top: 2px solid #197de1; + height: 36px; +} + +.mytheme .v-table-row-drag-top .v-table-cell-wrapper { + margin-top: -1px; +} + +.mytheme .v-table-no-stripes .v-table-row, .mytheme .v-table-no-stripes .v-table-row-odd { + background: transparent; +} + +.mytheme .v-table-no-vertical-lines .v-table-cell-content { + border-left: none; + padding-left: 1px; +} + +.mytheme .v-table-no-vertical-lines.v-treetable .v-table-cell-content { + padding-left: 13px; +} + +.mytheme .v-table-no-horizontal-lines .v-table-cell-content { + border-top: none; + border-bottom: none; +} + +.mytheme .v-table-no-horizontal-lines .v-table-row-drag-top .v-table-cell-content, .mytheme .v-table-no-horizontal-lines .v-table-row-drag-bottom .v-table-cell-content { + height: 36px; +} + +.mytheme .v-table-no-header .v-table-header-wrap { + display: none; +} + +.mytheme .v-table-borderless .v-table-header-wrap, .mytheme .v-table-borderless .v-table-footer-wrap, .mytheme .v-table-borderless .v-table-header-drag, .mytheme .v-table-borderless .v-table-body { + border: none; +} + +.mytheme .v-table-borderless .v-table-header-wrap { + border-bottom: 1px solid #d9d9d9; +} + +.mytheme .v-table-borderless .v-table-footer-wrap { + border-top: 1px solid #d9d9d9; +} + +.mytheme .v-table-compact .v-table-header-wrap, .mytheme .v-table-compact .v-table-footer-wrap, .mytheme .v-table-compact .v-table-header-drag, .mytheme .v-table-small .v-table-header-wrap, .mytheme .v-table-small .v-table-footer-wrap, .mytheme .v-table-small .v-table-header-drag { + font-size: 14px; +} + +.mytheme .v-table-compact .v-table-footer-container, .mytheme .v-table-small .v-table-footer-container { + padding: 8px 7px 9px; +} + +.mytheme .v-table-compact .v-table-caption-container, .mytheme .v-table-compact .v-table-header-drag, .mytheme .v-table-small .v-table-caption-container, .mytheme .v-table-small .v-table-header-drag { + padding-top: 9px; + padding-bottom: 8px; + padding-left: 6px; + padding-right: 6px; +} + +.mytheme .v-table-compact .v-table-caption-container-align-right, .mytheme .v-table-small .v-table-caption-container-align-right { + padding-right: 0; +} + +.mytheme .v-table-compact .v-table-resizer, .mytheme .v-table-small .v-table-resizer { + height: 31px; +} + +.mytheme .v-table-compact .v-table-cell-content, .mytheme .v-table-small .v-table-cell-content { + height: 31px; +} + +.mytheme .v-table-compact .v-table-cell-wrapper, .mytheme .v-table-small .v-table-cell-wrapper { + padding-left: 6px; + padding-right: 6px; +} + +.mytheme .v-table-compact .v-table-cell-wrapper > .v-widget, .mytheme .v-table-small .v-table-cell-wrapper > .v-widget { + margin: 2px -3px; +} + +.mytheme .v-table-compact .v-table-cell-wrapper > .v-widget.v-label, .mytheme .v-table-compact .v-table-cell-wrapper > .v-widget.v-checkbox, .mytheme .v-table-compact .v-table-cell-wrapper > .v-widget.v-select-optiongroup, .mytheme .v-table-small .v-table-cell-wrapper > .v-widget.v-label, .mytheme .v-table-small .v-table-cell-wrapper > .v-widget.v-checkbox, .mytheme .v-table-small .v-table-cell-wrapper > .v-widget.v-select-optiongroup { + margin: 0; +} + +.mytheme .v-table-compact .v-table-cell-wrapper > .v-widget.v-progressbar, .mytheme .v-table-small .v-table-cell-wrapper > .v-widget.v-progressbar { + margin-left: 0; + margin-right: 0; +} + +.mytheme .v-table-compact .v-table-header-cell-asc .v-table-sort-indicator, .mytheme .v-table-compact .v-table-header-cell-desc .v-table-sort-indicator, .mytheme .v-table-small .v-table-header-cell-asc .v-table-sort-indicator, .mytheme .v-table-small .v-table-header-cell-desc .v-table-sort-indicator { + height: 31px; + line-height: 31px; +} + +.mytheme .v-table-compact .v-table-header-drag, .mytheme .v-table-small .v-table-header-drag { + margin-top: -16px; +} + +.mytheme .v-table-compact.v-treetable .v-table-cell-wrapper, .mytheme .v-table-small.v-treetable .v-table-cell-wrapper { + padding-left: 0; + padding-right: 0; + min-height: 16px; +} + +.mytheme .v-table-compact.v-treetable .v-table-cell-content, .mytheme .v-table-small.v-treetable .v-table-cell-content { + padding-left: 6px; + padding-right: 6px; +} + +.mytheme .v-table-compact.v-treetable .v-table-cell-content:first-child, .mytheme .v-table-small.v-treetable .v-table-cell-content:first-child { + padding-left: 7px; +} + +.mytheme .v-table-compact.v-treetable .v-table-footer-container, .mytheme .v-table-small.v-treetable .v-table-footer-container { + padding-left: 6px; + padding-right: 6px; +} + +.mytheme .v-table-compact .v-table-row-drag-top .v-table-cell-content, .mytheme .v-table-compact .v-table-row-drag-bottom .v-table-cell-content, .mytheme .v-table-small .v-table-row-drag-top .v-table-cell-content, .mytheme .v-table-small .v-table-row-drag-bottom .v-table-cell-content { + height: 30px; +} + +.mytheme .v-table-small { + font-size: 14px; +} + +.mytheme .v-table-small.v-treetable .v-table-cell-wrapper { + min-height: 14px; +} + +.mytheme .v-treetable [class*="caption-container"], .mytheme .v-treetable [class*="footer-container"], .mytheme .v-treetable [class*="cell-wrapper"] { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + padding-left: 0; + padding-right: 0; +} + +.mytheme .v-treetable [class*="caption-container"], .mytheme .v-treetable [class*="footer-container"] { + min-height: 14px; +} + +.mytheme .v-treetable [class*="cell-wrapper"] { + min-height: 16px; +} + +.mytheme .v-treetable [class*="caption-container"] { + padding-left: 12px; +} + +.mytheme .v-treetable [class*="caption-container-align-right"] { + padding-left: 20px; +} + +.mytheme .v-treetable [class*="footer-container"] { + padding-right: 12px; +} + +.mytheme .v-treetable [class*="cell-content"] { + padding-left: 12px; + padding-right: 12px; +} + +.mytheme .v-treetable [class*="cell-content"]:first-child { + padding-left: 13px; +} + +.mytheme .v-treetable-treespacer { + display: inline-block; + position: absolute; + width: 19px !important; + margin-left: -25px; + text-align: center; + cursor: pointer; +} + +.mytheme .v-treetable-node-closed:before { + content: "\f0da"; + font-family: ThemeIcons; +} + +.mytheme .v-treetable-node-open:before { + content: "\f0d7"; + font-family: ThemeIcons; +} + +.mytheme .v-splitpanel-horizontal > div > .v-splitpanel-hsplitter { + width: 1px; +} + +.mytheme .v-splitpanel-horizontal > div > .v-splitpanel-hsplitter:after { + left: -6px; + right: -6px; +} + +.mytheme .v-splitpanel-horizontal > div > .v-splitpanel-hsplitter div:before { + height: 37px; + padding: 0 16px; + color: #191919; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, none; + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, none; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); + height: auto; + padding: 0; + border-radius: 0; + background-color: #fafafa; + background-image: -webkit-linear-gradient(left, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to right,#fafafa 2%, #efefef 98%); +} + +.mytheme .v-splitpanel-horizontal > div > .v-splitpanel-hsplitter div:before:after { + border: inherit; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; +} + +.mytheme .v-splitpanel-horizontal > div > .v-splitpanel-hsplitter div:before:hover:after { + background-color: rgba(186, 186, 186, 0.1); +} + +.mytheme .v-splitpanel-horizontal > div > .v-splitpanel-hsplitter div:before:focus:after { + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-splitpanel-horizontal > div > .v-splitpanel-hsplitter div:before:active:after { + background-color: rgba(125, 125, 125, 0.2); +} + +.mytheme .v-splitpanel-horizontal > div > .v-splitpanel-second-container { + margin-left: 1px; +} + +.mytheme .v-splitpanel-vertical > div > .v-splitpanel-vsplitter { + height: 1px; +} + +.mytheme .v-splitpanel-vertical > div > .v-splitpanel-vsplitter:after { + top: -6px; + bottom: -6px; +} + +.mytheme .v-splitpanel-vertical > div > .v-splitpanel-vsplitter div:before { + height: 37px; + padding: 0 16px; + color: #191919; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, none; + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, none; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); + height: auto; + padding: 0; + border-radius: 0; +} + +.mytheme .v-splitpanel-vertical > div > .v-splitpanel-vsplitter div:before:after { + border: inherit; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; +} + +.mytheme .v-splitpanel-vertical > div > .v-splitpanel-vsplitter div:before:hover:after { + background-color: rgba(186, 186, 186, 0.1); +} + +.mytheme .v-splitpanel-vertical > div > .v-splitpanel-vsplitter div:before:focus:after { + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-splitpanel-vertical > div > .v-splitpanel-vsplitter div:before:active:after { + background-color: rgba(125, 125, 125, 0.2); +} + +.mytheme .v-splitpanel-horizontal.large > div > .v-splitpanel-hsplitter { + width: 12px; +} + +.mytheme .v-splitpanel-horizontal.large > div > .v-splitpanel-hsplitter:after { + left: 0px; + right: 0px; +} + +.mytheme .v-splitpanel-horizontal.large > div > .v-splitpanel-hsplitter div:before { + height: 37px; + padding: 0 16px; + color: #191919; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, none; + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, none; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); + height: auto; + padding: 0; + border-radius: 0; + background-color: #fafafa; + background-image: -webkit-linear-gradient(left, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to right,#fafafa 2%, #efefef 98%); +} + +.mytheme .v-splitpanel-horizontal.large > div > .v-splitpanel-hsplitter div:before:after { + border: inherit; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; +} + +.mytheme .v-splitpanel-horizontal.large > div > .v-splitpanel-hsplitter div:before:hover:after { + background-color: rgba(186, 186, 186, 0.1); +} + +.mytheme .v-splitpanel-horizontal.large > div > .v-splitpanel-hsplitter div:before:focus:after { + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-splitpanel-horizontal.large > div > .v-splitpanel-hsplitter div:before:active:after { + background-color: rgba(125, 125, 125, 0.2); +} + +.mytheme .v-splitpanel-horizontal.large > div > .v-splitpanel-hsplitter div:after { + content: ""; + border: 1px solid #dadada; + border-top-color: #bababa; + border-left-color: #bababa; + position: absolute; + top: 50%; + left: 50%; + width: 0; + height: 37px; + margin-left: -1px; + margin-top: -19px; +} + +.mytheme .v-splitpanel-horizontal.large > div > .v-splitpanel-second-container { + margin-left: 12px; +} + +.mytheme .v-splitpanel-vertical.large > div > .v-splitpanel-vsplitter { + height: 12px; +} + +.mytheme .v-splitpanel-vertical.large > div > .v-splitpanel-vsplitter:after { + top: 0px; + bottom: 0px; +} + +.mytheme .v-splitpanel-vertical.large > div > .v-splitpanel-vsplitter div:before { + height: 37px; + padding: 0 16px; + color: #191919; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, none; + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, none; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); + height: auto; + padding: 0; + border-radius: 0; +} + +.mytheme .v-splitpanel-vertical.large > div > .v-splitpanel-vsplitter div:before:after { + border: inherit; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; +} + +.mytheme .v-splitpanel-vertical.large > div > .v-splitpanel-vsplitter div:before:hover:after { + background-color: rgba(186, 186, 186, 0.1); +} + +.mytheme .v-splitpanel-vertical.large > div > .v-splitpanel-vsplitter div:before:focus:after { + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-splitpanel-vertical.large > div > .v-splitpanel-vsplitter div:before:active:after { + background-color: rgba(125, 125, 125, 0.2); +} + +.mytheme .v-splitpanel-vertical.large > div > .v-splitpanel-vsplitter div:after { + content: ""; + border: 1px solid #dadada; + border-top-color: #bababa; + border-left-color: #bababa; + position: absolute; + top: 50%; + left: 50%; + width: 37px; + height: 0; + margin-left: -19px; + margin-top: -1px; +} + +.mytheme .v-progressbar-wrapper { + border-radius: 4px; + height: 9px; + background-color: #d4d4d4; + background-image: -webkit-linear-gradient(bottom, #d7d7d7 2%, #c7c7c7 98%); + background-image: linear-gradient(to top,#d7d7d7 2%, #c7c7c7 98%); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + min-width: 74px; +} + +.mytheme .v-progressbar-indicator { + border-radius: 4px; + height: inherit; + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + + + border: 1px solid #1362b1; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + max-width: 100%; + min-width: 8px; + -webkit-transition: width 160ms; + -moz-transition: width 160ms; + transition: width 160ms; +} + +.mytheme .v-progressbar-point .v-progressbar-indicator { + background: transparent; + -webkit-box-shadow: none; + box-shadow: none; + border: none; + text-align: right; + overflow: hidden; +} + +.mytheme .v-progressbar-point .v-progressbar-indicator:before { + content: ""; + display: inline-block; + border-radius: 4px; + height: inherit; + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + + + border: 1px solid #1362b1; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + max-width: 100%; + width: 9px; + vertical-align: top; +} + +.mytheme .v-progressbar-indeterminate { + height: 24px !important; + width: 24px !important; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border: 2px solid rgba(25, 125, 225, 0.2); + border-top-color: #197de1; + border-right-color: #197de1; + border-radius: 100%; + -webkit-animation: v-rotate-360 500ms infinite linear; + -moz-animation: v-rotate-360 500ms infinite linear; + animation: v-rotate-360 500ms infinite linear; + pointer-events: none; +} + +.v-ie8 .mytheme .v-progressbar-indeterminate, .v-ie9 .mytheme .v-progressbar-indeterminate { + border: none; + border-radius: 4px; + background: #fff url(../valo/shared/img/spinner.gif) no-repeat 50% 50%; + background-size: 80%; +} + +.v-ie8 .mytheme .v-progressbar-indeterminate { + min-width: 30px; + min-height: 30px; +} + +.mytheme .v-progressbar-indeterminate .v-progressbar-wrapper { + display: none; +} + +.mytheme .v-slider { + position: relative; +} + +.mytheme .v-slider:focus { + outline: none; +} + +.mytheme .v-slider:focus .v-slider-handle:after { + opacity: 1; +} + +.v-ie8 .mytheme .v-slider:focus .v-slider-handle:after { + visibility: visible; +} + +.mytheme .v-slider.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-slider-base { + border-radius: 4px; + height: 9px; + background-color: #d4d4d4; + background-image: -webkit-linear-gradient(bottom, #d7d7d7 2%, #c7c7c7 98%); + background-image: linear-gradient(to top,#d7d7d7 2%, #c7c7c7 98%); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + min-width: 74px; + height: 6px; + margin: 16px 11px; + white-space: nowrap; + overflow: hidden; + +} + +.mytheme .v-slider-base:before { + content: ""; + position: absolute; + top: 16px; + bottom: 16px; + left: 11px; + width: 8px; + border-radius: 4px; + border-left: 1px solid #1362b1; +} + +.mytheme .v-slider-base:after { + border-radius: 4px; + height: inherit; + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + + + border: 1px solid #1362b1; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + max-width: 100%; + content: ""; + display: inline-block; + margin-left: -100%; + width: 100%; + vertical-align: top; +} + +.v-ie8 .mytheme .v-slider-base:after { + position: relative; + left: -11px; +} + +.mytheme .v-has-width > .v-slider-base { + min-width: 0; +} + +.mytheme .v-slider-handle { + margin-top: -16px; + width: 0.1px; + display: inline-block; + vertical-align: top; +} + +.mytheme .v-slider-handle:before { + height: 37px; + padding: 0 16px; + color: #191919; + font-weight: 400; + + + border-radius: 4px; + border: 1px solid #c5c5c5; + border-top-color: #c5c5c5; + border-bottom-color: #bcbcbc; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7, 0 2px 3px rgba(0, 0, 0, 0.05); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); +} + +.mytheme .v-slider-handle:before:after { + border: inherit; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; +} + +.mytheme .v-slider-handle:before:hover:after { + background-color: rgba(186, 186, 186, 0.1); +} + +.mytheme .v-slider-handle:before:focus:after { + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-slider-handle:before:active:after { + background-color: rgba(125, 125, 125, 0.2); +} + +.mytheme .v-slider-handle:after { + border: 1px solid #c5c5c5; + border-color: #197de1; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + opacity: 0; + -webkit-transition: opacity 200ms; + -moz-transition: opacity 200ms; + transition: opacity 200ms; +} + +.v-ie8 .mytheme .v-slider-handle:after { + visibility: hidden; +} + +.mytheme .v-slider-handle:before, .mytheme .v-slider-handle:after { + content: ""; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; + width: 22px; + height: 22px; + border-radius: 11px; + position: absolute; + z-index: 1; + margin-top: 8px; + margin-left: -11px; +} + +.mytheme .v-slider-feedback { + background-color: #323232; + background-color: rgba(50, 50, 50, 0.9); + -webkit-box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2); + color: white; + padding: 5px 9px; + border-radius: 3px; + max-width: 35em; + overflow: hidden !important; + font-size: 14px; +} + +.mytheme .v-slider-vertical { + padding: 11px 0; + height: 96px; +} + +.mytheme .v-slider-vertical .v-slider-base { + background-color: #d4d4d4; + background-image: -webkit-linear-gradient(right, #d7d7d7 2%, #c7c7c7 98%); + background-image: linear-gradient(to left,#d7d7d7 2%, #c7c7c7 98%); + width: 6px; + height: 100% !important; + min-width: 0; + margin: 0 16px; +} + +.mytheme .v-slider-vertical .v-slider-base:before { + top: auto; + bottom: 11px; + left: 16px; + right: 16px; + width: auto; + height: 8px; + border-left: none; + border-bottom: 1px solid #1362b1; +} + +.mytheme .v-slider-vertical .v-slider-base:after { + height: 101%; + margin-left: 0; + background-color: #197de1; + background-image: -webkit-linear-gradient(left, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to right,#1b87e3 2%, #166ed5 98%); +} + +.v-ie8 .mytheme .v-slider-vertical .v-slider-base:after { + top: 11px; + left: 0; + height: 130%; +} + +.mytheme .v-slider-vertical .v-slider-handle { + width: 0; + height: 0.1px; + width: 37px; + display: block; +} + +.mytheme .v-slider-vertical .v-slider-handle:before, .mytheme .v-slider-vertical .v-slider-handle:after { + width: 22px; + height: 22px; + margin-top: -11px; + margin-left: -8px; +} + +.mytheme .v-slider-no-indicator .v-slider-base:before, .mytheme .v-slider-no-indicator .v-slider-base:after { + display: none; +} + +.mytheme .v-tabsheet:not(.v-has-width) { + width: auto !important; +} + +.mytheme .v-tabsheet-spacertd { + display: none !important; +} + +.mytheme .v-tabsheet-tabcontainer { + position: relative; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.mytheme .v-tabsheet-tabcontainer:before { + content: ""; + position: absolute; + height: 0; + border-top: 1px solid #dfdfdf; + bottom: 0; + left: 0; + right: 0; +} + +.mytheme .v-tabsheet-tabcontainer .v-tabsheet-tabs { + position: relative; +} + +.mytheme .v-tabsheet-tabitemcell { + vertical-align: bottom; +} + +.mytheme .v-tabsheet-tabitemcell .v-tabsheet-tabitem { + line-height: 0; + overflow: hidden; +} + +.mytheme .v-tabsheet-tabitemcell .v-caption { + margin-left: 19px; + padding: 0 4px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + cursor: pointer; + text-align: center; + line-height: 37px; + font-size: 15px; + font-weight: 300; + color: #696969; + width: auto !important; + overflow: hidden; + text-overflow: ellipsis; + border-bottom: 2px solid transparent; + position: relative; + -webkit-transition: border-bottom 200ms, color 200ms; + -moz-transition: border-bottom 200ms, color 200ms; + transition: border-bottom 200ms, color 200ms; +} + +.mytheme .v-tabsheet-tabitemcell .v-caption .v-captiontext { + display: inline; +} + +.mytheme .v-tabsheet-tabitemcell .v-caption .v-icon + .v-captiontext { + margin-left: 9px; +} + +.mytheme .v-tabsheet-tabitemcell .v-caption:hover { + color: #197de1; +} + +.mytheme .v-tabsheet-tabitemcell .v-caption.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; + cursor: default; + color: inherit !important; +} + +.mytheme .v-tabsheet-tabitemcell:first-child .v-caption, .mytheme .v-tabsheet-tabitemcell[aria-hidden="true"] + td .v-caption { + margin-left: 0; +} + +.mytheme .v-tabsheet-tabitemcell:focus { + outline: none; +} + +.mytheme .v-tabsheet-tabitemcell:focus .v-caption { + color: #197de1; +} + +.mytheme .v-tabsheet-tabitemcell .v-tabsheet-tabitem-selected .v-caption.v-caption { + border-bottom-color: #197de1; + color: #197de1; +} + +.mytheme .v-tabsheet-tabitemcell .v-caption-closable { + padding-right: 22px; +} + +.mytheme .v-tabsheet-tabitemcell.icons-on-top .v-caption-closable { + padding-right: 4px; +} + +.mytheme .v-tabsheet-tabitemcell .v-tabsheet-caption-close { + position: absolute; + right: 0; + top: 50%; + margin: -8px 0 0; + font-size: 18px; + line-height: 18px; + width: 18px; + text-align: center; + border-radius: 2px; + color: #969696; +} + +.mytheme .v-tabsheet-tabitemcell .v-tabsheet-caption-close:hover { + background: rgba(0, 0, 0, 0.03); + color: #197de1; +} + +.mytheme .v-tabsheet-tabitemcell .v-tabsheet-caption-close:active { + background: #197de1; + color: #c8dbed; +} + +.mytheme .v-tabsheet-scroller { + position: absolute; + top: 0; + right: 0; + bottom: 0; + padding-left: 19px; + background-color: transparent; + background-image: -webkit-linear-gradient(right, #fafafa 70%, rgba(250, 250, 250, 0) 100%); + background-image: linear-gradient(to left,#fafafa 70%, rgba(250, 250, 250, 0) 100%); + pointer-events: none; +} + +.mytheme .v-tabsheet-scroller:after { + content: ""; + height: 1px; + position: absolute; + bottom: 0; + left: 0; + right: 0; + display: block; + background-color: transparent; + background-image: -webkit-linear-gradient(right, #dfdfdf 70%, rgba(223, 223, 223, 0) 100%); + background-image: linear-gradient(to left,#dfdfdf 70%, rgba(223, 223, 223, 0) 100%); +} + +.v-ie8 .mytheme .v-tabsheet-scroller, .v-ie9 .mytheme .v-tabsheet-scroller { + background-color: #fafafa; +} + +.v-ie8 .mytheme .v-tabsheet-scroller:after, .v-ie9 .mytheme .v-tabsheet-scroller:after { + background-color: #dfdfdf; +} + +.mytheme .v-tabsheet-scroller button { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + border: none; + background: transparent; + font: inherit; + color: inherit; + height: 100%; + margin: 0; + padding: 0 9px; + outline: none; + cursor: pointer; + pointer-events: auto; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-tabsheet-scroller button:hover { + opacity: 1; + filter: none ; + color: #197de1; +} + +.mytheme .v-tabsheet-scroller button:active { + opacity: 0.7; + filter: alpha(opacity=70) ; + color: #197de1; +} + +.mytheme .v-tabsheet-scroller button::-moz-focus-inner { + padding: 0; + border: 0; +} + +.mytheme .v-tabsheet-scroller [class*="Next"] { + padding-left: 5px; +} + +.mytheme .v-tabsheet-scroller [class*="Next"]:before { + font-family: ThemeIcons; + content: "\f054"; +} + +.mytheme .v-tabsheet-scroller [class*="Prev"] { + padding-right: 5px; +} + +.mytheme .v-tabsheet-scroller [class*="Prev"]:before { + font-family: ThemeIcons; + content: "\f053"; +} + +.mytheme .v-tabsheet-scroller [class*="disabled"] { + cursor: default; + color: inherit !important; + opacity: 0.1 !important; + filter: alpha(opacity=10) !important; +} + +.mytheme .v-tabsheet-tabsheetpanel > .v-scrollable > .v-widget { + -webkit-animation: valo-animate-in-fade 300ms backwards; + -moz-animation: valo-animate-in-fade 300ms backwards; + animation: valo-animate-in-fade 300ms backwards; +} + +.mytheme .v-tabsheet-deco { + height: 20px !important; + width: 20px !important; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border: 2px solid rgba(25, 125, 225, 0.2); + border-top-color: #197de1; + border-right-color: #197de1; + border-radius: 100%; + -webkit-animation: v-rotate-360 500ms infinite linear; + -moz-animation: v-rotate-360 500ms infinite linear; + animation: v-rotate-360 500ms infinite linear; + pointer-events: none; + display: none; + position: absolute; + z-index: 1; + bottom: 50%; + margin-bottom: -29px; + left: 50%; + margin-left: -10px; +} + +.v-ie8 .mytheme .v-tabsheet-deco, .v-ie9 .mytheme .v-tabsheet-deco { + border: none; + border-radius: 4px; + background: #fff url(../valo/shared/img/spinner.gif) no-repeat 50% 50%; + background-size: 80%; +} + +.v-ie8 .mytheme .v-tabsheet-deco { + min-width: 30px; + min-height: 30px; +} + +.mytheme .v-tabsheet-loading .v-tabsheet-deco { + display: block; +} + +.mytheme .v-tabsheet-equal-width-tabs > .v-tabsheet-tabcontainer table, .mytheme .v-tabsheet-equal-width-tabs > .v-tabsheet-tabcontainer tbody, .mytheme .v-tabsheet-equal-width-tabs > .v-tabsheet-tabcontainer tr { + width: 100%; +} + +.mytheme .v-tabsheet-equal-width-tabs > .v-tabsheet-tabcontainer tr { + display: table; + table-layout: fixed; +} + +.mytheme .v-tabsheet-equal-width-tabs > .v-tabsheet-tabcontainer td { + display: table-cell; +} + +.mytheme .v-tabsheet-equal-width-tabs > .v-tabsheet-tabcontainer .v-caption { + margin: 0; + display: block; +} + +.mytheme .v-tabsheet-framed > .v-tabsheet-tabcontainer .v-caption { + margin-left: 4px; + padding: 0 12px; + background-color: #fafafa; + border: 1px solid transparent; + line-height: 36px; + border-radius: 4px 4px 0 0; + font-weight: 400; + -webkit-transition: background-color 160ms; + -moz-transition: background-color 160ms; + transition: background-color 160ms; +} + +.mytheme .v-tabsheet-framed > .v-tabsheet-tabcontainer .v-caption:hover { + background-color: #f2f2f2; + border-bottom-color: #dfdfdf; +} + +.mytheme .v-tabsheet-framed > .v-tabsheet-tabcontainer .v-caption.v-disabled:hover { + background-color: #fafafa; +} + +.mytheme .v-tabsheet-framed > .v-tabsheet-tabcontainer .v-caption-closable { + padding-right: 30px; +} + +.mytheme .v-tabsheet-framed > .v-tabsheet-tabcontainer .v-tabsheet-caption-close { + top: 4px; + right: 4px; + margin-top: 0; +} + +.mytheme .v-tabsheet-framed > .v-tabsheet-tabcontainer td:first-child .v-caption, .mytheme .v-tabsheet-framed > .v-tabsheet-tabcontainer [aria-hidden="true"] + td .v-caption { + margin-left: 0; +} + +.mytheme .v-tabsheet-framed > .v-tabsheet-tabcontainer .v-tabsheet-tabitem .v-caption { + border-color: #dfdfdf; +} + +.mytheme .v-tabsheet-framed > .v-tabsheet-tabcontainer .v-tabsheet-tabitem-selected .v-caption { + background: white; + border-color: #dfdfdf; + border-bottom: none; + padding-bottom: 1px; +} + +.mytheme .v-tabsheet-framed > .v-tabsheet-content { + border: 1px solid #dfdfdf; + border-top: none; +} + +.mytheme .v-tabsheet-framed > .v-tabsheet-content > div { + background: white; +} + +.mytheme .v-tabsheet-framed.padded-tabbar > .v-tabsheet-tabcontainer { + border: 1px solid #dfdfdf; + border-bottom: none; + background: #fafafa; + padding-top: 6px; +} + +.mytheme .v-tabsheet-framed.icons-on-top > .v-tabsheet-tabcontainer .v-tabsheet-tabitem-selected .v-caption { + padding-bottom: 7px; +} + +.mytheme .v-tabsheet-centered-tabs > .v-tabsheet-tabcontainer { + text-align: center; +} + +.mytheme .v-tabsheet-right-aligned-tabs > .v-tabsheet-tabcontainer { + text-align: right; +} + +.mytheme .v-tabsheet-padded-tabbar > .v-tabsheet-tabcontainer .v-tabsheet-tabs { + padding: 0 9px; +} + +.mytheme .v-tabsheet-icons-on-top > .v-tabsheet-tabcontainer .v-caption { + padding-top: 6px; + padding-bottom: 6px; + line-height: 1.2; +} + +.mytheme .v-tabsheet-icons-on-top > .v-tabsheet-tabcontainer .v-icon { + display: block; +} + +.mytheme .v-tabsheet-icons-on-top > .v-tabsheet-tabcontainer .v-icon + .v-captiontext.v-captiontext { + margin-left: 0; +} + +.mytheme .v-tabsheet-icons-on-top > .v-tabsheet-tabcontainer .v-caption-closable { + padding-right: 12px; +} + +.mytheme .v-tabsheet-icons-on-top > .v-tabsheet-tabcontainer .v-tabsheet-caption-close { + top: 4px; + margin-top: 0; +} + +.mytheme .v-tabsheet-compact-tabbar > .v-tabsheet-tabcontainer-compact-tabbar .v-caption { + line-height: 1.8; +} + +.mytheme .v-tabsheet-only-selected-closable > .v-tabsheet-tabcontainer .v-tabsheet-caption-close { + visibility: hidden; +} + +.mytheme .v-tabsheet-only-selected-closable > .v-tabsheet-tabcontainer .v-tabsheet-tabitem-selected .v-tabsheet-caption-close { + visibility: visible; +} + +.mytheme .v-colorpicker-popup.v-window { + min-width: 220px !important; +} + +.mytheme .v-colorpicker-popup .v-tabsheet-tabs { + padding: 0 9px; +} + +.mytheme .v-colorpicker-popup [class$="sliders"] { + padding: 12px; +} + +.mytheme .v-colorpicker-popup [class$="sliders"] .v-widget { + width: 100% !important; + vertical-align: middle; +} + +.mytheme .v-colorpicker-popup [class$="sliders"] .v-has-caption { + white-space: nowrap; + padding-left: 48px; +} + +.mytheme .v-colorpicker-popup [class$="sliders"] .v-caption { + display: inline-block; + margin-left: -48px; + width: 48px; +} + +.mytheme .v-colorpicker-popup [class$="sliders"] .v-slot-hue-slider + .v-slot .v-has-caption { + padding-left: 80px; +} + +.mytheme .v-colorpicker-popup [class$="sliders"] .v-slot-hue-slider + .v-slot .v-caption { + margin-left: -80px; + width: 80px; +} + +.mytheme .v-colorpicker-popup .v-slider-red .v-slider-base:after { + background: red; + border: none; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-colorpicker-popup .v-slider-green .v-slider-base:after { + background: green; + border: none; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-colorpicker-popup .v-slider-blue .v-slider-base:after { + background: blue; + border: none; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-colorpicker-popup .v-margin-bottom { + padding-bottom: 0; +} + +.mytheme .v-colorpicker-popup .resize-button { + width: 100% !important; + height: auto !important; + text-align: center; + outline: none; +} + +.mytheme .v-colorpicker-popup .resize-button:before { + font-family: ThemeIcons; + content: "\f141"; +} + +.mytheme .v-colorpicker-popup .resize-button-caption { + display: none; +} + +.mytheme .v-colorpicker-popup .v-horizontallayout { + height: auto !important; + padding: 9px 0; + background-color: #fafafa; + border-top: 1px solid #ededed; +} + +.mytheme .v-colorpicker-popup .v-horizontallayout .v-expand { + overflow: visible; +} + +.mytheme .v-colorpicker-popup .v-horizontallayout .v-button { + width: 80% !important; +} + +.mytheme .v-colorpicker-preview { + width: 100% !important; + height: auto !important; + padding: 9px; +} + +.mytheme .v-colorpicker-preview-textfield { + height: auto !important; + text-align: center; + border: none; +} + +.mytheme .v-colorpicker { + width: auto; +} + +.mytheme .v-colorpicker-button-color { + position: absolute; + top: 6px; + right: 6px; + bottom: 6px; + left: 6px; + border-radius: 3px; + border: 1px solid rgba(0, 0, 0, 0.5); + max-width: 23px; +} + +.mytheme .v-colorpicker-button-color + .v-button-caption:not(:empty) { + margin-left: 19px; +} + +.v-ie8 .mytheme .v-colorpicker-button-color { + position: relative; + top: auto; + right: auto; + bottom: auto; + left: auto; + width: 16px; + height: 16px; + display: inline-block; + vertical-align: middle; + margin: 0 -8px; +} + +.v-ie8 .mytheme .v-colorpicker-button-color + .v-button-caption { + margin-left: 19px; +} + +.mytheme .v-panel { + background: white; + color: #474747; + border-radius: 4px; + border: 1px solid #d5d5d5; + -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + overflow: visible !important; +} + +.mytheme .v-panel-caption { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0 12px; + line-height: 36px; + border-bottom: 1px solid #d5d5d5; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #f6f6f6 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #f6f6f6 98%); + color: #464646; + font-weight: 400; + font-size: 14px; + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #eeeeee; + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #eeeeee; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); + border-radius: 3px 3px 0 0; +} + +.mytheme .v-panel-content { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 100%; + height: 100%; +} + +.mytheme .v-panel-content > .v-margin-top { + padding-top: 12px; +} + +.mytheme .v-panel-content > .v-margin-right { + padding-right: 12px; +} + +.mytheme .v-panel-content > .v-margin-bottom { + padding-bottom: 12px; +} + +.mytheme .v-panel-content > .v-margin-left { + padding-left: 12px; +} + +.mytheme .v-panel-borderless { + background: transparent; + color: inherit; + border: none; + border-radius: 0; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-panel-borderless > div > [class*="-caption"] { + background: transparent; + -webkit-box-shadow: none; + box-shadow: none; + color: inherit; + padding: 0; + margin: 0 12px; + border-bottom: none; +} + +.mytheme .v-panel-well { + background: #f5f5f5; + color: #454545; + -webkit-box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.05), inset 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.05), inset 0 2px 3px rgba(0, 0, 0, 0.05); + border-radius: 4px; + border: 1px solid #c5c5c5; +} + +.mytheme .v-panel-well > div > [class*="-caption"] { + background: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-panel-scroll-divider > [class*="-captionwrap"] { + position: relative; + z-index: 2; +} + +.mytheme .v-panel-scroll-divider > [class*="-captionwrap"]:after { + content: ""; + position: absolute; + bottom: -1px; + right: 0; + left: 0; + height: 0; + border-top: 1px solid #dfdfdf; + border-color: rgba(197, 197, 197, 0.5); +} + +.mytheme .v-panel-scroll-divider > [class*="-content"]:before { + content: ""; + position: absolute; + z-index: 2; + top: 0; + height: 0; + border-top: 1px solid #fafafa; + left: 0; + right: 0; +} + +.mytheme .v-panel-caption.v-horizontallayout { + height: auto !important; + line-height: 0; +} + +.mytheme .v-panel-caption.v-horizontallayout .v-slot { + vertical-align: middle; +} + +.mytheme .v-panel-caption.v-horizontallayout .v-label { + line-height: 37px; +} + +.mytheme .v-accordion { + background: white; + color: #474747; + border-radius: 4px; + border: 1px solid #d5d5d5; + -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #f4f4f4 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #f4f4f4 98%); + overflow: hidden; +} + +.mytheme .v-accordion-item { + position: relative; +} + +.mytheme .v-accordion-item:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} + +.mytheme .v-accordion-item:last-child { + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; +} + +.mytheme .v-accordion-item:last-child [class*="item-content"] { + border-radius: inherit; +} + +.mytheme .v-accordion-item[class*="item-open"]:last-child > div > .v-caption { + border-radius: 0; +} + +.mytheme .v-accordion-item:not([class*="item-open"]):last-child > div > .v-caption { + border-bottom: none; + margin-bottom: 0; +} + +.mytheme .v-accordion-item[class*="item-open"] + [class*="item"] { + border-top: 1px solid #d9d9d9; +} + +.mytheme .v-accordion-item-caption { + border-radius: inherit; +} + +.mytheme .v-accordion-item-caption > .v-caption { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0 12px; + line-height: 36px; + border-bottom: 1px solid #d5d5d5; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #f6f6f6 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #f6f6f6 98%); + color: #464646; + font-weight: 400; + font-size: 14px; + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #eeeeee; + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #eeeeee; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05); + display: block; + background: transparent; + border-bottom-color: #c9c9c9; + border-radius: inherit; + cursor: pointer; + position: relative; +} + +.mytheme .v-accordion-item-caption > .v-caption:hover:before, .mytheme .v-accordion-item-caption > .v-caption:active:before { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: inherit; +} + +.mytheme .v-accordion-item-caption > .v-caption:hover:before { + background-color: rgba(186, 186, 186, 0.1); + border: none; +} + +.mytheme .v-accordion-item-caption > .v-caption:active:before { + background-color: rgba(125, 125, 125, 0.2); +} + +.mytheme .v-accordion-item-content { + -webkit-box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.05); + background-color: white; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.mytheme .v-accordion-item-content > .v-margin-top { + padding-top: 12px; +} + +.mytheme .v-accordion-item-content > .v-margin-right { + padding-right: 12px; +} + +.mytheme .v-accordion-item-content > .v-margin-bottom { + padding-bottom: 12px; +} + +.mytheme .v-accordion-item-content > .v-margin-left { + padding-left: 12px; +} + +.mytheme .v-accordion-borderless { + border: none; + border-radius: 0; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mytheme .v-accordion-borderless > .v-accordion-item, .mytheme .v-accordion-borderless > .v-accordion-item > div > .v-caption, .mytheme .v-accordion-borderless > .v-accordion-item > .v-accordion-item-content { + border-radius: 0; +} + +.mytheme .v-select-twincol { + white-space: normal; +} + +.mytheme .v-select-twincol select { + border: 1px solid #c5c5c5; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + color: #464646; +} + +.mytheme .v-select-twincol select:focus { + outline: none; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-select-twincol .v-textfield, .mytheme .v-select-twincol .v-nativebutton { + width: auto !important; + margin-top: 9px; +} + +.mytheme .v-select-twincol .v-nativebutton { + margin-left: 9px; +} + +.mytheme .v-select-twincol-caption-left, .mytheme .v-select-twincol-caption-right { + font-size: 14px; + font-weight: 400; + padding-bottom: 0.3em; + padding-left: 1px; +} + +.mytheme .v-select-twincol-buttons { + white-space: nowrap; + display: inline-block; + vertical-align: top; + position: relative; + min-width: 3.5em; +} + +.mytheme .v-select-twincol-buttons .v-button { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + display: inline-block; + vertical-align: top; + text-align: left; + white-space: normal; + position: absolute; + left: 9px; + right: 9px; + top: 36px; + padding: 0; + text-align: center; +} + +.mytheme .v-select-twincol-buttons .v-button:first-child { + top: 0; +} + +.mytheme .v-select-twincol-buttons .v-button-caption { + display: none; +} + +.mytheme .v-select-twincol-buttons .v-button:focus { + z-index: 1; +} + +.mytheme .v-select-twincol-buttons .v-button:first-child { + border-radius: 4px 4px 0 0; +} + +.mytheme .v-select-twincol-buttons .v-button:last-child { + border-radius: 0 0 4px 4px; +} + +.mytheme .v-select-twincol-buttons .v-button-wrap:before { + font-family: ThemeIcons; + content: "\f053"; +} + +.mytheme .v-select-twincol-buttons .v-button:first-child .v-button-wrap:before { + font-family: ThemeIcons; + content: "\f054"; +} + +.mytheme .v-select-twincol-error .v-select-twincol-options, .mytheme .v-select-twincol-error .v-select-twincol-selections { + border-color: #ed473b !important; + background: #fffbfb; + color: #6c2621; +} + +.mytheme .v-select select { + border: 1px solid #c5c5c5; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + color: #464646; +} + +.mytheme .v-select select:focus { + outline: none; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-select-select { + display: block; +} + +.mytheme .v-select-select + .v-textfield { + width: auto !important; + margin-top: 9px; +} + +.mytheme .v-select-select + .v-textfield + .v-nativebutton { + margin-top: 9px; + margin-left: 9px; +} + +.mytheme .v-select-error .v-select-select { + border-color: #ed473b !important; + background: #fffbfb; + color: #6c2621; +} + +.mytheme .v-calendar-header-day { + font-weight: 400; + text-align: center; + padding: 7px 0; +} + +.mytheme .v-calendar-header-week .v-calendar-back, .mytheme .v-calendar-header-week .v-calendar-next { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + background: transparent; + border: none; + padding: 0; + margin: 0; + cursor: pointer; + outline: none; + color: inherit; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-calendar-header-week .v-calendar-back:focus, .mytheme .v-calendar-header-week .v-calendar-next:focus { + outline: none; +} + +.mytheme .v-calendar-header-week .v-calendar-back:hover, .mytheme .v-calendar-header-week .v-calendar-next:hover { + opacity: 1; + filter: none ; +} + +.mytheme .v-calendar-header-week .v-calendar-back:active, .mytheme .v-calendar-header-week .v-calendar-next:active { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-calendar-header-week .v-calendar-back:before { + font-family: ThemeIcons; + content: "\f053"; +} + +.mytheme .v-calendar-header-week .v-calendar-next:before { + font-family: ThemeIcons; + content: "\f054"; +} + +.mytheme .v-calendar-month { + outline: none; + overflow: hidden; +} + +.mytheme .v-calendar-month td { + vertical-align: top; +} + +.mytheme .v-calendar-week-number { + cursor: pointer; + width: 20px; + text-align: center; + font-size: 0.8em; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-calendar-week-number:hover { + opacity: 1; + filter: none ; +} + +.mytheme .v-calendar-month-day { + outline: none; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + line-height: 1.2; +} + +.mytheme .v-calendar-bottom-spacer, .mytheme .v-calendar-spacer, .mytheme .v-calendar-bottom-spacer-empty { + height: 19px; + margin-bottom: 3px; +} + +.mytheme .v-calendar-bottom-spacer { + font-size: 0.8em; + padding: 0 5px; + cursor: pointer; +} + +.mytheme .v-calendar-bottom-spacer:hover { + color: #197de1; +} + +.mytheme .v-calendar-day-number { + line-height: 25px; + font-size: 16px; + text-align: right; + margin: 0 5px; + white-space: nowrap; + border-top: 1px solid #f2f2f2; + cursor: pointer; +} + +.mytheme .v-calendar-day-number:hover { + color: #197de1; +} + +.mytheme .v-calendar-month-day-today { + background: #eef3f8; +} + +.mytheme .v-calendar-month-day-today .v-calendar-day-number { + font-weight: 400; + color: #197de1; + border-top: 2px solid #197de1; + line-height: 24px; + margin: 0; + padding: 0 5px; +} + +.mytheme .v-calendar-month-day-selected { + background-color: #e3edf7; +} + +.mytheme .v-calendar-month-day-dragemphasis { + background-color: #a8a8a8; +} + +.mytheme .v-calendar-month-day-scrollable { + overflow-y: scroll; +} + +.mytheme .v-calendar-weekly-longevents { + margin-left: 50px; + border-bottom: 3px solid #e0e0e0; +} + +.mytheme .v-calendar-weekly-longevents .v-calendar-event-all-day { + height: 22px; + line-height: 1.6; + margin-bottom: 3px; +} + +.mytheme .v-calendar-header-week td { + vertical-align: middle !important; +} + +.mytheme .v-calendar-header-week .v-calendar-header-day { + cursor: pointer; +} + +.mytheme .v-calendar-times { + width: 50px; + font-size: 0.77em; + line-height: 1; + white-space: nowrap; +} + +.mytheme .v-calendar-time { + text-align: right; + padding-right: 9px; + margin-top: -6px; + padding-bottom: 6px; +} + +.mytheme .v-calendar-day-times, .mytheme .v-calendar-day-times-today { + outline: none; + border-right: 1px solid transparent; +} + +.mytheme .v-calendar-day-times:focus, .mytheme .v-calendar-day-times-today:focus { + outline: none; +} + +.mytheme .v-calendar .v-datecellslot, .mytheme .v-calendar .v-datecellslot-even { + border-top: 1px solid #dfdfdf; +} + +.mytheme .v-calendar .v-datecellslot:first-child, .mytheme .v-calendar .v-datecellslot-even:first-child { + border-top-color: transparent; +} + +.mytheme .v-calendar .v-datecellslot { + border-top-style: dotted; +} + +.mytheme .v-calendar .v-datecellslot, .mytheme .v-calendar .v-datecellslot-even { + margin-right: 5px; +} + +.mytheme .v-calendar-current-time { + background: #197de1; + line-height: 1px; + pointer-events: none; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-calendar-current-time:before { + content: "\2022"; + color: #197de1; + font-size: 22px; + margin-left: -0.07em; +} + +.mytheme .v-calendar .v-daterange { + position: relative; +} + +.mytheme .v-calendar .v-daterange:before { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: -1px; + left: 0; + background: #197de1; + opacity: 0.5; + filter: alpha(opacity=50) ; + border-radius: 4px 4px 0 0; +} + +.mytheme .v-calendar .v-daterange + .v-daterange { + border-color: transparent; +} + +.mytheme .v-calendar .v-daterange + .v-daterange:before { + border-radius: 0; +} + +.mytheme .v-calendar-event { + font-size: 0.85em; + overflow: hidden; + cursor: pointer; + outline: none; + border-radius: 4px; +} + +.mytheme .v-calendar-event:focus { + outline: none; +} + +.mytheme .v-calendar-event-month { + padding: 0 5px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + margin-bottom: 3px; + white-space: nowrap; + text-overflow: ellipsis; + height: 19px; + line-height: 19px; +} + +.mytheme .v-calendar-event-month .v-calendar-event-time { + float: right; + font-size: 0.9em; + line-height: 19px; + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-calendar-event-month:before { + content: "\25cf"; + margin-right: 0.2em; +} + +.mytheme .v-calendar-event-all-day { + padding: 0 5px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + height: 19px; + line-height: 19px; + border-radius: 0; + margin-left: -1px; + white-space: nowrap; +} + +.mytheme .v-calendar-event-all-day:before { + content: ""; +} + +.mytheme .v-calendar-event-start { + overflow: visible; + margin-left: 0; +} + +.mytheme .v-calendar-event-start.v-calendar-event-continued-to, .mytheme .v-calendar-event-start.v-calendar-event-end { + overflow: hidden; + text-overflow: ellipsis; +} + +.mytheme .v-calendar-event-start { + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + margin-left: 5px; +} + +.mytheme .v-calendar-event-end { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + margin-right: 5px; +} + +.mytheme .v-calendar-event-caption { + font-weight: 500; + line-height: 1.2; + padding: 5px 0; + position: absolute; + overflow: hidden; + right: 9px; + left: 5px; + bottom: 0; + top: 0; +} + +.mytheme .v-calendar-event-caption span { + font-weight: 300; + white-space: nowrap; +} + +.mytheme .v-calendar-week-wrapper .v-calendar-event { + overflow: visible; +} + +.mytheme .v-calendar-week-wrapper .v-calendar-event-content { + margin-top: -1px; + border-radius: 5px; + border: 1px solid #fafafa; + padding-top: 3px; + margin-right: 5px; +} + +.mytheme .v-calendar-event-month:before { + color: #00ace0; +} + +.mytheme .v-calendar-event-all-day { + background-color: #c8eaf4; + background-color: rgba(200, 234, 244, 0.8); + color: #00ace0; +} + +.mytheme .v-calendar-week-wrapper .v-calendar-event { + color: #00ace0; +} + +.mytheme .v-calendar-week-wrapper .v-calendar-event .v-calendar-event-content { + background-color: #c8eaf4; + background-color: rgba(200, 234, 244, 0.8); +} + +.mytheme .v-calendar-event-month[class*="color2"]:before { + color: #2d9f19; +} + +.mytheme .v-calendar-event-all-day[class*="color2"] { + background-color: #d1e7cd; + background-color: rgba(209, 231, 205, 0.8); + color: #2d9f19; +} + +.mytheme .v-calendar-week-wrapper .v-calendar-event[class*="color2"] { + color: #2d9f19; +} + +.mytheme .v-calendar-week-wrapper .v-calendar-event[class*="color2"] .v-calendar-event-content { + background-color: #d1e7cd; + background-color: rgba(209, 231, 205, 0.8); +} + +.mytheme .v-calendar-event-month[class*="color3"]:before { + color: #d18100; +} + +.mytheme .v-calendar-event-all-day[class*="color3"] { + background-color: #f1e1c8; + background-color: rgba(241, 225, 200, 0.8); + color: #d18100; +} + +.mytheme .v-calendar-week-wrapper .v-calendar-event[class*="color3"] { + color: #d18100; +} + +.mytheme .v-calendar-week-wrapper .v-calendar-event[class*="color3"] .v-calendar-event-content { + background-color: #f1e1c8; + background-color: rgba(241, 225, 200, 0.8); +} + +.mytheme .v-calendar-event-month[class*="color4"]:before { + color: #ce3812; +} + +.mytheme .v-calendar-event-all-day[class*="color4"] { + background-color: #f1d3cb; + background-color: rgba(241, 211, 203, 0.8); + color: #ce3812; +} + +.mytheme .v-calendar-week-wrapper .v-calendar-event[class*="color4"] { + color: #ce3812; +} + +.mytheme .v-calendar-week-wrapper .v-calendar-event[class*="color4"] .v-calendar-event-content { + background-color: #f1d3cb; + background-color: rgba(241, 211, 203, 0.8); +} + +.mytheme .v-calendar-event-month[class*="color5"]:before { + color: #2d55cd; +} + +.mytheme .v-calendar-event-all-day[class*="color5"] { + background-color: #d1d9f1; + background-color: rgba(209, 217, 241, 0.8); + color: #2d55cd; +} + +.mytheme .v-calendar-week-wrapper .v-calendar-event[class*="color5"] { + color: #2d55cd; +} + +.mytheme .v-calendar-week-wrapper .v-calendar-event[class*="color5"] .v-calendar-event-content { + background-color: #d1d9f1; + background-color: rgba(209, 217, 241, 0.8); +} + +.mytheme .v-calendar.v-disabled * { + cursor: default; +} + +.mytheme .v-label { + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} + +.mytheme .v-label.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-label-undef-w { + white-space: nowrap; +} + +.mytheme h1, .mytheme .v-label-h1, .mytheme h2, .mytheme .v-label-h2, .mytheme h3, .mytheme .v-label-h3 { + line-height: 1.1; + font-weight: 200; + color: #141414; +} + +.mytheme h1, .mytheme .v-label-h1 { + font-size: 2.4em; + margin-top: 1.4em; + margin-bottom: 1em; + + letter-spacing: -0.03em; +} + +.mytheme h2, .mytheme .v-label-h2 { + font-size: 1.6em; + + margin-top: 1.6em; + margin-bottom: 0.77em; + letter-spacing: -0.02em; +} + +.mytheme h3, .mytheme .v-label-h3 { + font-size: 1.2em; + + margin-top: 1.8em; + margin-bottom: 0.77em; + letter-spacing: 0; +} + +.mytheme h4, .mytheme .v-label-h4 { + line-height: 1.1; + font-weight: 500; + font-size: 14px; + color: #414141; + text-transform: uppercase; + letter-spacing: 0; + margin-top: 2.4em; + margin-bottom: 0.8em; +} + +.mytheme .v-csslayout > h1:first-child, .mytheme .v-csslayout > h2:first-child, .mytheme .v-csslayout > h3:first-child, .mytheme .v-csslayout > h4 > .v-label-h1:first-child, .mytheme .v-csslayout > .v-label-h2:first-child, .mytheme .v-csslayout > .v-label-h3:first-child, .mytheme .v-csslayout > .v-label-h4:first-child { + margin-top: 16px; +} + +.mytheme .v-verticallayout > .v-slot:first-child h1, .mytheme .v-verticallayout > .v-slot:first-child .v-label-h1, .mytheme .v-verticallayout > .v-slot:first-child h2, .mytheme .v-verticallayout > .v-slot:first-child .v-label-h2, .mytheme .v-verticallayout > .v-slot:first-child h3, .mytheme .v-verticallayout > .v-slot:first-child .v-label-h3, .mytheme .v-verticallayout > .v-slot:first-child h4, .mytheme .v-verticallayout > .v-slot:first-child .v-label-h4, .mytheme .v-verticallayout > div > .v-slot:first-child h1, .mytheme .v-verticallayout > div > .v-slot:first-child .v-label-h1, .mytheme .v-verticallayout > div > .v-slot:first-child h2, .mytheme .v-verticallayout > div > .v-slot:first-child .v-label-h2, .mytheme .v-verticallayout > div > .v-slot:first-child h3, .mytheme .v-verticallayout > div > .v-slot:first-child .v-label-h3, .mytheme .v-verticallayout > div > .v-slot:first-child h4, .mytheme .v-verticallayout > div > .v-slot:first-child .v-label-h4 { + margin-top: 16px; +} + +.mytheme .v-verticallayout > .v-slot:first-child .v-formlayout-contentcell h1, .mytheme .v-verticallayout > .v-slot:first-child .v-formlayout-contentcell .v-label-h1, .mytheme .v-verticallayout > .v-slot:first-child .v-formlayout-contentcell h2, .mytheme .v-verticallayout > .v-slot:first-child .v-formlayout-contentcell .v-label-h2, .mytheme .v-verticallayout > .v-slot:first-child .v-formlayout-contentcell h3, .mytheme .v-verticallayout > .v-slot:first-child .v-formlayout-contentcell .v-label-h3, .mytheme .v-verticallayout > .v-slot:first-child .v-formlayout-contentcell h4, .mytheme .v-verticallayout > .v-slot:first-child .v-formlayout-contentcell .v-label-h4, .mytheme .v-verticallayout > div > .v-slot:first-child .v-formlayout-contentcell h1, .mytheme .v-verticallayout > div > .v-slot:first-child .v-formlayout-contentcell .v-label-h1, .mytheme .v-verticallayout > div > .v-slot:first-child .v-formlayout-contentcell h2, .mytheme .v-verticallayout > div > .v-slot:first-child .v-formlayout-contentcell .v-label-h2, .mytheme .v-verticallayout > div > .v-slot:first-child .v-formlayout-contentcell h3, .mytheme .v-verticallayout > div > .v-slot:first-child .v-formlayout-contentcell .v-label-h3, .mytheme .v-verticallayout > div > .v-slot:first-child .v-formlayout-contentcell h4, .mytheme .v-verticallayout > div > .v-slot:first-child .v-formlayout-contentcell .v-label-h4 { + margin-top: -0.5em; +} + +.mytheme h1.no-margin, .mytheme .v-label-h1.no-margin, .mytheme h2.no-margin, .mytheme .v-label-h2.no-margin, .mytheme h3.no-margin, .mytheme .v-label-h3.no-margin, .mytheme h4.no-margin, .mytheme .v-label-h4.no-margin { + margin: 0 !important; +} + +.mytheme .v-label-colored { + color: #197de1; +} + +.mytheme .v-label-large { + font-size: 20px; +} + +.mytheme .v-label-small { + font-size: 14px; +} + +.mytheme .v-label-tiny { + font-size: 12px; +} + +.mytheme .v-label-huge { + font-size: 26px; +} + +.mytheme .v-label-bold { + font-weight: 500; +} + +.mytheme .v-label-light { + font-weight: 200; + color: #7d7d7d; +} + +.mytheme .v-label-align-right { + text-align: right; +} + +.mytheme .v-label-align-center { + text-align: center; +} + +.mytheme .v-label-spinner { + height: 24px !important; + width: 24px !important; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border: 2px solid rgba(25, 125, 225, 0.2); + border-top-color: #197de1; + border-right-color: #197de1; + border-radius: 100%; + -webkit-animation: v-rotate-360 500ms infinite linear; + -moz-animation: v-rotate-360 500ms infinite linear; + animation: v-rotate-360 500ms infinite linear; + pointer-events: none; +} + +.v-ie8 .mytheme .v-label-spinner, .v-ie9 .mytheme .v-label-spinner { + border: none; + border-radius: 4px; + background: #fff url(../valo/shared/img/spinner.gif) no-repeat 50% 50%; + background-size: 80%; +} + +.v-ie8 .mytheme .v-label-spinner { + min-width: 30px; + min-height: 30px; +} + +.mytheme .v-label-success, .mytheme .v-label-failure { + background: white; + color: #474747; + border: 2px solid #2c9720; + border-radius: 4px; + padding: 7px 19px 7px 37px; + font-weight: 400; + font-size: 15px; +} + +.mytheme .v-label-success:before, .mytheme .v-label-failure:before { + font-family: ThemeIcons; + content: "\f00c"; + margin-right: 0.5em; + margin-left: -19px; + color: #2c9720; +} + +.mytheme .v-label-failure { + border-color: #ed473b; +} + +.mytheme .v-label-failure:before { + content: "\f05e"; + color: #ed473b; +} + +.mytheme [draggable=true] { + -khtml-user-drag: element; + -webkit-user-drag: element; +} + +.mytheme .v-ddwrapper { + position: relative; +} + +.mytheme .v-ddwrapper-over:before, .mytheme .v-ddwrapper-over:after { + content: ""; + position: absolute; + z-index: 10; + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; + border: 0 solid #197de1; +} + +.mytheme .v-ddwrapper-over-top:before { + border-top-width: 2px; +} + +.mytheme .v-ddwrapper-over-right:before { + border-right-width: 2px; +} + +.mytheme .v-ddwrapper-over-bottom:before { + border-bottom-width: 2px; +} + +.mytheme .v-ddwrapper-over-left:before { + border-left-width: 2px; +} + +.mytheme .no-vertical-drag-hints .v-ddwrapper-over-top:before, .mytheme .no-vertical-drag-hints.v-ddwrapper-over-top:before { + border-top-width: 0; +} + +.mytheme .no-vertical-drag-hints .v-ddwrapper-over-top:after, .mytheme .no-vertical-drag-hints.v-ddwrapper-over-top:after { + border-width: 2px; + border-radius: 4px; + opacity: 0.3; + filter: alpha(opacity=30.0) ; + background: #8abef2; +} + +.mytheme .no-vertical-drag-hints .v-ddwrapper-over-bottom:before, .mytheme .no-vertical-drag-hints.v-ddwrapper-over-bottom:before { + border-bottom-width: 0; +} + +.mytheme .no-vertical-drag-hints .v-ddwrapper-over-bottom:after, .mytheme .no-vertical-drag-hints.v-ddwrapper-over-bottom:after { + border-width: 2px; + border-radius: 4px; + opacity: 0.3; + filter: alpha(opacity=30.0) ; + background: #8abef2; +} + +.mytheme .no-horizontal-drag-hints.v-ddwrapper-over-left:before, .mytheme .no-horizontal-drag-hints .v-ddwrapper-over-left:before { + border-left-width: 0; +} + +.mytheme .no-horizontal-drag-hints.v-ddwrapper-over-left:after, .mytheme .no-horizontal-drag-hints .v-ddwrapper-over-left:after { + border-width: 2px; + border-radius: 4px; + opacity: 0.3; + filter: alpha(opacity=30.0) ; + background: #8abef2; +} + +.mytheme .no-horizontal-drag-hints.v-ddwrapper-over-right:before, .mytheme .no-horizontal-drag-hints .v-ddwrapper-over-right:before { + border-right-width: 0; +} + +.mytheme .no-horizontal-drag-hints.v-ddwrapper-over-right:after, .mytheme .no-horizontal-drag-hints .v-ddwrapper-over-right:after { + border-width: 2px; + border-radius: 4px; + opacity: 0.3; + filter: alpha(opacity=30.0) ; + background: #8abef2; +} + +.mytheme .v-ddwrapper-over-middle:after, .mytheme .v-ddwrapper-over-center:after { + border-width: 2px; + border-radius: 4px; + opacity: 0.3; + filter: alpha(opacity=30.0) ; + background: #8abef2; +} + +.mytheme .no-box-drag-hints.v-ddwrapper:after, .mytheme .no-box-drag-hints .v-ddwrapper:after { + display: none !important; + content: none; +} + +.mytheme .v-nativebutton { + -webkit-touch-callout: none; +} + +.mytheme .v-select select { + border: 1px solid #c5c5c5; + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + color: #464646; +} + +.mytheme .v-select select:focus { + outline: none; + -webkit-box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); + box-shadow: 0 0 0 2px rgba(25, 125, 225, 0.5); +} + +.mytheme .v-select-select { + display: block; +} + +.mytheme .v-select-select + .v-textfield { + width: auto !important; + margin-top: 9px; +} + +.mytheme .v-select-select + .v-textfield + .v-nativebutton { + margin-top: 9px; + margin-left: 9px; +} + +.mytheme .v-select-error .v-select-select { + border-color: #ed473b !important; + background: #fffbfb; + color: #6c2621; +} + +.mytheme .v-popupview { + cursor: pointer; + color: #197de1; + text-decoration: underline; + font-weight: inherit; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; +} + +.mytheme .v-popupview:hover { + color: #4396ea; +} + +.mytheme .v-popupview.v-disabled { + opacity: 0.5; + filter: alpha(opacity=50) ; +} + +.mytheme .v-popupview-popup { + padding: 4px 4px; + border-radius: 4px; + background-color: white; + color: #474747; + -webkit-box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.1), 0 3px 5px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.09098); + box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.1), 0 3px 5px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.09098); + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; +} + +.mytheme .v-popupview-popup[class*="animate-in"] { + -webkit-animation: v-popupview-animate-in 120ms; + -moz-animation: v-popupview-animate-in 120ms; + animation: v-popupview-animate-in 120ms; +} + +.mytheme .v-popupview-popup[class*="animate-out"] { + -webkit-animation: valo-animate-out-fade 120ms; + -moz-animation: valo-animate-out-fade 120ms; + animation: valo-animate-out-fade 120ms; +} + +.mytheme .v-popupview-popup .popupContent > .v-margin-top { + padding-top: 12px; +} + +.mytheme .v-popupview-popup .popupContent > .v-margin-right { + padding-right: 12px; +} + +.mytheme .v-popupview-popup .popupContent > .v-margin-bottom { + padding-bottom: 12px; +} + +.mytheme .v-popupview-popup .popupContent > .v-margin-left { + padding-left: 12px; +} + +.mytheme .v-popupview-loading { + margin: 12px 12px; + height: 24px !important; + width: 24px !important; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border: 2px solid rgba(25, 125, 225, 0.2); + border-top-color: #197de1; + border-right-color: #197de1; + border-radius: 100%; + -webkit-animation: v-rotate-360 500ms infinite linear; + -moz-animation: v-rotate-360 500ms infinite linear; + animation: v-rotate-360 500ms infinite linear; + pointer-events: none; +} + +.v-ie8 .mytheme .v-popupview-loading, .v-ie9 .mytheme .v-popupview-loading { + border: none; + border-radius: 4px; + background: #fff url(../valo/shared/img/spinner.gif) no-repeat 50% 50%; + background-size: 80%; +} + +.v-ie8 .mytheme .v-popupview-loading { + min-width: 30px; + min-height: 30px; +} + +.mytheme .v-richtextarea { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + margin: 0; + font: inherit; + + font-weight: 400; + line-height: normal; + height: 37px; + border-radius: 4px; + padding: 0; + border: 1px solid #c5c5c5; + background: white; + color: #474747; + -webkit-box-shadow: inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 #f7f7f7, 0 1px 0 rgba(255, 255, 255, 0.1); + -webkit-transition: box-shadow 180ms, border 180ms; + -moz-transition: box-shadow 180ms, border 180ms; + transition: box-shadow 180ms, border 180ms; + height: auto; + overflow: hidden; +} + +.v-ie8 .mytheme .v-richtextarea, .v-ie9 .mytheme .v-richtextarea { + line-height: 37px; + padding-top: 0; + padding-bottom: 0; +} + +.mytheme .v-richtextarea[class*="prompt"] { + color: #a3a3a3; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar { + background-color: #fafafa; + background-image: -webkit-linear-gradient(top, #fafafa 2%, #efefef 98%); + background-image: linear-gradient(to bottom,#fafafa 2%, #efefef 98%); + -webkit-box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7; + box-shadow: inset 0 1px 0 white, inset 0 -1px 0 #e7e7e7; + border-bottom: 1px solid #c5c5c5; + color: #464646; +} + +.mytheme .v-richtextarea .gwt-ToggleButton, .mytheme .v-richtextarea .gwt-PushButton { + display: inline-block; + line-height: 37px; + width: 37px; + text-align: center; + outline: none; +} + +.mytheme .v-richtextarea .gwt-ToggleButton:hover, .mytheme .v-richtextarea .gwt-PushButton:hover { + color: black; +} + +.mytheme .v-richtextarea .gwt-ToggleButton-down, .mytheme .v-richtextarea .gwt-ToggleButton-down-hovering { + background-color: #e0e0e0; + background-image: -webkit-linear-gradient(bottom, #e0e0e0 2%, #dcdcdc 98%); + background-image: linear-gradient(to top,#e0e0e0 2%, #dcdcdc 98%); +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top img { + display: none; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div:before { + font-family: ThemeIcons; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Toggle Bold"]:before { + content: "\f032"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Toggle Italic"]:before { + content: "\f033"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Toggle Underline"]:before { + content: "\f0cd"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Toggle Subscript"]:before { + content: "\f12c"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Toggle Superscript"]:before { + content: "\f12b"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Left Justify"]:before { + content: "\f036"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Center"]:before { + content: "\f037"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Right Justify"]:before { + content: "\f038"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Toggle Strikethrough"]:before { + content: "\f0cc"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Indent Right"]:before { + content: "\f03c"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Indent Left"]:before { + content: "\f03b"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Insert Horizontal Rule"]:before { + content: "\2014"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Insert Ordered List"]:before { + content: "\f0cb"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Insert Unordered List"]:before { + content: "\f0ca"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Insert Image"]:before { + content: "\f03e"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Create Link"]:before { + content: "\f0c1"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Remove Link"]:before { + content: "\f127"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-top div[title="Remove Formatting"]:before { + content: "\f12d"; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-bottom { + font-size: 13px; + padding: 0 9px 9px 0; +} + +.mytheme .v-richtextarea .gwt-RichTextToolbar-bottom select { + margin: 9px 0 0 9px; +} + +.mytheme .v-richtextarea .gwt-RichTextArea { + background: #fff; + border: none; + display: block; +} + +.mytheme .v-richtextarea-readonly { + padding: 5px 7px; + background: transparent; +} + +.mytheme .v-upload .v-button { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + display: inline-block; + vertical-align: top; + text-align: left; + white-space: normal; +} + +.mytheme .v-upload-immediate .v-button { + width: 100%; +} + +.mytheme .v-upload-immediate input[type="file"] { + opacity: 0; + filter: alpha(opacity=0) ; + z-index: -1; + position: absolute; + right: 0; + height: 37px; + text-align: right; + border: none; + background: transparent; +} + +.mytheme .v-Notification.v-position-top { + top: 12px; +} + +.mytheme .v-Notification.v-position-right { + right: 12px; +} + +.mytheme .v-Notification.v-position-bottom { + bottom: 12px; +} + +.mytheme .v-Notification.v-position-left { + left: 12px; +} + +.mytheme .v-Notification.v-position-assistive { + top: -9999px; + left: -9999px; +} + +.mytheme .v-Notification-animate-in { + -webkit-animation: valo-animate-in-fade 180ms 10ms backwards; + -moz-animation: valo-animate-in-fade 180ms 10ms backwards; + animation: valo-animate-in-fade 180ms 10ms backwards; +} + +.mytheme .v-Notification-animate-in.v-position-top { + -webkit-animation: valo-animate-in-slide-down 400ms 10ms backwards; + -moz-animation: valo-animate-in-slide-down 400ms 10ms backwards; + animation: valo-animate-in-slide-down 400ms 10ms backwards; +} + +.mytheme .v-Notification-animate-in.v-position-bottom { + -webkit-animation: valo-animate-in-slide-up 400ms 10ms backwards; + -moz-animation: valo-animate-in-slide-up 400ms 10ms backwards; + animation: valo-animate-in-slide-up 400ms 10ms backwards; +} + +.mytheme .v-Notification-animate-out { + -webkit-animation: valo-animate-out-fade 150ms; + -moz-animation: valo-animate-out-fade 150ms; + animation: valo-animate-out-fade 150ms; +} + +.mytheme .v-Notification-animate-out.v-position-top, .mytheme .v-Notification-animate-out.v-position-bottom { + -webkit-animation: valo-animate-out-slide-down-fade 200ms; + -moz-animation: valo-animate-out-slide-down-fade 200ms; + animation: valo-animate-out-slide-down-fade 200ms; +} + +.mytheme .v-Notification { + border-radius: 4px; + text-align: center; + position: fixed !important; + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; + background: white; + -webkit-box-shadow: 0px 5px 15px 0px rgba(0, 0, 0, 0.15); + box-shadow: 0px 5px 15px 0px rgba(0, 0, 0, 0.15); + padding: 19px 22px; +} + +.mytheme .v-Notification .v-Notification-caption { + color: #197de1; + font-size: 19px; + line-height: 1; +} + +.mytheme .v-Notification .v-Notification-description { + line-height: 1.4; +} + +.mytheme .v-Notification-caption { + margin: 0; + display: inline-block; + text-align: left; + font-weight: inherit; + line-height: inherit; + white-space: nowrap; + letter-spacing: 0; +} + +.mytheme .v-Notification-description, .mytheme .v-Notification-details { + margin: 0; + display: inline-block; + vertical-align: middle; + max-width: 30em; + text-align: left; + max-height: 20em; + overflow: auto; +} + +.mytheme .v-Notification-caption ~ .v-Notification-description, .mytheme .v-Notification-caption ~ .v-Notification-details { + margin-left: 24px; +} + +.mytheme .v-icon + .v-Notification-caption { + margin-left: 16px; +} + +.mytheme .v-Notification-system { + left: 0 !important; + right: 0; + max-width: 100%; + margin: 0 !important; + border-radius: 0; + -webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.25); + box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.25); + padding: 12px 15px; + background-color: #444; + background-color: rgba(68, 68, 68, 0.9); + font-weight: 400; + line-height: 22px; +} + +.mytheme .v-Notification-system .v-Notification-description, .mytheme .v-Notification-system .v-Notification-details { + max-width: 50em; +} + +.mytheme .v-Notification-system.v-position-top { + top: 0; +} + +.mytheme .v-Notification-system.v-position-top[class*="animate-in"] { + -webkit-animation: valo-animate-in-slide-down 300ms 10ms backwards; + -moz-animation: valo-animate-in-slide-down 300ms 10ms backwards; + animation: valo-animate-in-slide-down 300ms 10ms backwards; +} + +.mytheme .v-Notification-system.v-position-top[class*="animate-out"] { + -webkit-animation: valo-animate-out-slide-up 200ms; + -moz-animation: valo-animate-out-slide-up 200ms; + animation: valo-animate-out-slide-up 200ms; +} + +.mytheme .v-Notification-system.v-position-bottom { + bottom: 0; +} + +.mytheme .v-Notification-system.v-position-bottom[class*="animate-in"] { + -webkit-animation: valo-animate-in-slide-up 300ms 10ms backwards; + -moz-animation: valo-animate-in-slide-up 300ms 10ms backwards; + animation: valo-animate-in-slide-up 300ms 10ms backwards; +} + +.mytheme .v-Notification-system.v-position-bottom[class*="animate-out"] { + -webkit-animation: valo-animate-out-slide-down 200ms; + -moz-animation: valo-animate-out-slide-down 200ms; + animation: valo-animate-out-slide-down 200ms; +} + +.mytheme .v-Notification-system .v-Notification-caption { + color: #fff; + vertical-align: middle; +} + +.mytheme .v-Notification-system .v-Notification-description, .mytheme .v-Notification-system .v-Notification-details { + color: #e6e6e6; +} + +.mytheme .v-Notification-system u { + text-decoration: none; +} + +.mytheme .v-Notification.tray { + text-align: left; +} + +.mytheme .v-Notification.tray .v-Notification-caption + .v-Notification-description { + display: block; + margin: 0.5em 0 0; +} + +.mytheme .v-Notification.warning { + background: #FFF3D2; +} + +.mytheme .v-Notification.warning .v-Notification-caption { + color: #AC7C00; +} + +.mytheme .v-Notification.warning .v-Notification-description { + color: #9D874D; +} + +.mytheme .v-Notification.error { + background: #ed473b; + font-weight: 400; + -webkit-box-shadow: 0px 5px 15px 0px rgba(0, 0, 0, 0.25); + box-shadow: 0px 5px 15px 0px rgba(0, 0, 0, 0.25); +} + +.mytheme .v-Notification.error .v-Notification-caption { + color: white; +} + +.mytheme .v-Notification.error .v-Notification-description { + color: #f4e0df; +} + +.mytheme .v-Notification.dark { + background-color: #444; + background-color: rgba(68, 68, 68, 0.9); + font-weight: 400; + line-height: 22px; +} + +.mytheme .v-Notification.dark .v-Notification-caption { + color: #fff; + vertical-align: middle; +} + +.mytheme .v-Notification.dark .v-Notification-description, .mytheme .v-Notification.dark .v-Notification-details { + color: #e6e6e6; +} + +.mytheme .v-Notification.bar { + left: 0 !important; + right: 0; + max-width: 100%; + margin: 0 !important; + border-radius: 0; + -webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.25); + box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.25); + padding: 12px 15px; +} + +.mytheme .v-Notification.bar .v-Notification-description, .mytheme .v-Notification.bar .v-Notification-details { + max-width: 50em; +} + +.mytheme .v-Notification.bar.v-position-top { + top: 0; +} + +.mytheme .v-Notification.bar.v-position-top[class*="animate-in"] { + -webkit-animation: valo-animate-in-slide-down 300ms 10ms backwards; + -moz-animation: valo-animate-in-slide-down 300ms 10ms backwards; + animation: valo-animate-in-slide-down 300ms 10ms backwards; +} + +.mytheme .v-Notification.bar.v-position-top[class*="animate-out"] { + -webkit-animation: valo-animate-out-slide-up 200ms; + -moz-animation: valo-animate-out-slide-up 200ms; + animation: valo-animate-out-slide-up 200ms; +} + +.mytheme .v-Notification.bar.v-position-bottom { + bottom: 0; +} + +.mytheme .v-Notification.bar.v-position-bottom[class*="animate-in"] { + -webkit-animation: valo-animate-in-slide-up 300ms 10ms backwards; + -moz-animation: valo-animate-in-slide-up 300ms 10ms backwards; + animation: valo-animate-in-slide-up 300ms 10ms backwards; +} + +.mytheme .v-Notification.bar.v-position-bottom[class*="animate-out"] { + -webkit-animation: valo-animate-out-slide-down 200ms; + -moz-animation: valo-animate-out-slide-down 200ms; + animation: valo-animate-out-slide-down 200ms; +} + +.mytheme .v-Notification.small { + padding: 11px 13px; +} + +.mytheme .v-Notification.small .v-Notification-caption { + font-size: 16px; +} + +.mytheme .v-Notification.small .v-Notification-description { + font-size: 14px; +} + +.mytheme .v-Notification.closable { + padding-right: 59px; + overflow: hidden !important; + cursor: pointer; +} + +.mytheme .v-Notification.closable:after { + content: "\00d7"; + font-size: 1.5em; + position: absolute; + top: 50%; + margin-top: -12px; + right: 12px; + width: 25px; + height: 25px; + line-height: 24px; + cursor: pointer; + color: #000; + opacity: 0.5; + filter: alpha(opacity=50) ; + text-align: center; + border: 1px solid #000; + border-color: rgba(0, 0, 0, 0.3); + border-radius: 50%; + -webkit-transition: opacity 200ms; + -moz-transition: opacity 200ms; + transition: opacity 200ms; +} + +.mytheme .v-Notification.closable:hover:after { + opacity: 1; + filter: none ; +} + +.mytheme .v-Notification.closable:active:after { + background-color: #000; + color: #fff; + opacity: 0.3; + filter: alpha(opacity=30.0) ; + -webkit-transition: none 200ms; + -moz-transition: none 200ms; + transition: none 200ms; +} + +.mytheme .v-Notification.closable.dark:after, .mytheme .v-Notification.closable.error:after, .mytheme .v-Notification.closable.system:after { + color: #fff; + border-color: #fff; + border-color: rgba(255, 255, 255, 0.3); +} + +.mytheme .v-Notification.closable.dark:active:after, .mytheme .v-Notification.closable.error:active:after, .mytheme .v-Notification.closable.system:active:after { + background-color: #fff; + color: #000; +} + +.mytheme .v-Notification.closable.tray:after { + top: 16px; + margin-top: 0; +} + +.mytheme .v-Notification.success, .mytheme .v-Notification.failure { + background: #fff; + color: #555; + border: 2px solid #2c9720; +} + +.mytheme .v-Notification.success .v-Notification-caption, .mytheme .v-Notification.failure .v-Notification-caption { + color: #2c9720; + font-weight: 400; +} + +.mytheme .v-Notification.success .v-Notification-caption:before, .mytheme .v-Notification.failure .v-Notification-caption:before { + font-family: ThemeIcons; + content: "\f00c"; + margin-right: 0.5em; +} + +.mytheme .v-Notification.success.bar, .mytheme .v-Notification.failure.bar { + margin: -2px !important; +} + +.mytheme .v-Notification.failure { + border-color: #ed473b; +} + +.mytheme .v-Notification.failure .v-Notification-caption { + color: #ed473b; +} + +.mytheme .v-Notification.failure .v-Notification-caption:before { + content: "\f05e"; +} + +.mytheme .valo-menu { + height: 100%; + background-color: #4b4b4b; + background-image: -webkit-linear-gradient(right, #414141 0%, #4b4b4b 9px); + background-image: linear-gradient(to left,#414141 0%, #4b4b4b 9px); + color: #a5a5a5; + font-size: 14px; + line-height: 30px; + border-right: 1px solid #3b3b3b; + white-space: nowrap; +} + +.mytheme .valo-menu-toggle { + display: none; + position: fixed; + z-index: 200; + top: 3px; + left: 3px; + min-width: 0; +} + +.mytheme .valo-menu-part { + border-left: 1px solid #414141; + height: 100%; + padding-bottom: 37px; + overflow: auto; +} + +.mytheme .valo-menu-part:first-child { + border-left: none; +} + +.mytheme .valo-menu-title, .mytheme .valo-menu-subtitle, .mytheme .valo-menu-item { + display: block; + line-height: inherit; + white-space: nowrap; + position: relative; +} + +.mytheme .valo-menu-title .valo-menu-badge, .mytheme .valo-menu-subtitle .valo-menu-badge, .mytheme .valo-menu-item .valo-menu-badge { + position: absolute; + right: 19px; +} + +.mytheme .valo-menu-title { + line-height: 1.2; + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + color: white; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05); + padding: 12px 19px; + font-size: 14px; + border-bottom: 1px solid #1362b1; + -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + text-align: center; +} + +.mytheme .valo-menu-title .v-menubar.v-menubar { + background: transparent; + border-color: #1362b1; + color: inherit; + -webkit-box-shadow: none; + box-shadow: none; + text-shadow: inherit; +} + +.mytheme .valo-menu-title .v-menubar-menuitem { + background: transparent; + -webkit-box-shadow: inset 0 1px 0 #4d98e6, inset 0 -1px 0 #166bca; + box-shadow: inset 0 1px 0 #4d98e6, inset 0 -1px 0 #166bca; + text-shadow: inherit; + font-size: 16px; + border-color: inherit; +} + +.mytheme .valo-menu-title h1, .mytheme .valo-menu-title .v-label-h1, .mytheme .valo-menu-title h2, .mytheme .valo-menu-title .v-label-h2, .mytheme .valo-menu-title h3, .mytheme .valo-menu-title .v-label-h3, .mytheme .valo-menu-title h4, .mytheme .valo-menu-title .v-label-h4 { + margin-top: 0; + margin-bottom: 0; + color: inherit; +} + +.mytheme .v-menubar-user-menu { + border: none; + border-radius: 0; + padding: 1px; + -webkit-box-shadow: none; + box-shadow: none; + text-shadow: none; + background: transparent; + color: inherit; + margin: 19px 7px; + display: block; + overflow: hidden; + text-align: center; + height: auto; + color: inherit; +} + +.mytheme .v-menubar-user-menu:focus:after { + display: none; +} + +.mytheme .v-menubar-user-menu .v-menubar-menuitem { + -webkit-box-shadow: none; + box-shadow: none; + border: none; + margin-right: 1px; + border-radius: 4px; + color: #197de1; + padding: 0 12px; + -webkit-transition: color 140ms; + -moz-transition: color 140ms; + transition: color 140ms; +} + +.mytheme .v-menubar-user-menu .v-menubar-menuitem:first-child, .mytheme .v-menubar-user-menu .v-menubar-menuitem:last-child, .mytheme .v-menubar-user-menu .v-menubar-menuitem:first-child:last-child { + border-radius: 4px; +} + +.mytheme .v-menubar-user-menu .v-menubar-menuitem:before { + content: none; +} + +.mytheme .v-menubar-user-menu .v-menubar-menuitem:hover { + color: #4396ea; +} + +.mytheme .v-menubar-user-menu .v-menubar-menuitem:active { + color: inherit; +} + +.mytheme .v-menubar-user-menu .v-menubar-menuitem-checked, .mytheme .v-menubar-user-menu .v-menubar-menuitem-checked:first-child { + border: 1px solid #c5c5c5; + color: #197de1; +} + +.mytheme .v-menubar-user-menu .v-menubar-menuitem-checked .v-menubar-menuitem-caption, .mytheme .v-menubar-user-menu .v-menubar-menuitem-checked:first-child .v-menubar-menuitem-caption { + position: relative; + top: -1px; +} + +.mytheme .v-menubar-user-menu .v-menubar-menuitem-selected { + color: #ecf2f8; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05); +} + +.mytheme .v-menubar-user-menu .v-menubar-menuitem-selected:hover { + color: #ecf2f8; +} + +.mytheme .v-menubar-user-menu .v-menubar-menuitem-disabled, .mytheme .v-menubar-user-menu .v-menubar-menuitem-disabled:hover { + color: inherit; +} + +.mytheme .v-menubar-user-menu > .v-menubar-menuitem { + color: inherit; + white-space: normal; + line-height: 1.4; + margin: 0; +} + +.mytheme .v-menubar-user-menu > .v-menubar-menuitem img.v-icon { + width: 56px; + height: 56px; + border-radius: 29px; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + display: block; + margin: 0 auto 0.3em; + border: 1px solid #c5c5c5; +} + +.mytheme .v-menubar-user-menu > .v-menubar-menuitem:after { + top: 0; + right: 0; + bottom: 0; + left: 0; +} + +.mytheme .v-menubar-user-menu .v-menubar-menuitem-selected { + background: transparent; +} + +.mytheme .valo-menu-subtitle { + color: #868686; + margin: 7px 0 7px 19px; + border-bottom: 1px solid #666666; +} + +.mytheme .valo-menu-subtitle [class*="badge"] { + color: #73a5d7; +} + +.mytheme .valo-menuitems { + display: block; +} + +.mytheme .valo-menu-item { + outline: none; + font-weight: 400; + padding: 0 37px 0 19px; + cursor: pointer; + position: relative; + overflow: hidden; + text-shadow: 0 2px 0 rgba(0, 0, 0, 0.05); + -webkit-transition: background-color 300ms, color 60ms; + -moz-transition: background-color 300ms, color 60ms; + transition: background-color 300ms, color 60ms; +} + +.mytheme .valo-menu-item [class*="caption"] { + vertical-align: middle; + display: inline-block; + width: 90%; + max-width: 15em; + padding-right: 19px; + text-overflow: ellipsis; + overflow: hidden; +} + +.mytheme .valo-menu-item [class*="badge"] { + color: #73a5d7; +} + +.mytheme .valo-menu-item.selected { + background: #434343; +} + +.mytheme .valo-menu-item.selected .v-icon { + color: #197de1; +} + +.mytheme .valo-menu-item.selected [class*="badge"] { + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + color: #c8dbed; +} + +.mytheme .valo-menu-item:focus, .mytheme .valo-menu-item:hover, .mytheme .valo-menu-item.selected { + color: white; +} + +.mytheme .valo-menu-item span.v-icon { + min-width: 1em; + margin-right: 19px; + text-align: center; + vertical-align: middle; + -webkit-mask-image: -webkit-gradient(linear, left top, left bottom, from(black), to(rgba(0, 0, 0, 0.75))); +} + +.mytheme .valo-menu-item span.v-icon + span { + margin-left: 0; +} + +.mytheme .valo-menu-item [class*="badge"] { + background-color: #585858; + -webkit-transition: background-color 300ms; + -moz-transition: background-color 300ms; + transition: background-color 300ms; + line-height: 1; + padding: 4px 6px; + min-width: 11px; + text-align: center; + top: 4px; + border-radius: 4px; +} + +.mytheme .valo-menu-part.large-icons { + background-color: #4b4b4b; + min-width: 74px; + max-width: 111px; +} + +.mytheme .valo-menu-part.large-icons .valo-menu-title { + font-size: 12px; +} + +.mytheme .valo-menu-part.large-icons .valo-menu-title .v-label-undef-w { + white-space: normal; +} + +.mytheme .valo-menu-part.large-icons .v-menubar-user-menu { + margin-left: 0; + margin-right: 0; + font-size: 11px; +} + +.mytheme .valo-menu-part.large-icons .v-menubar-user-menu img.v-icon { + width: 28px; + height: 28px; +} + +.mytheme .valo-menu-part.large-icons [class*="subtitle"] { + margin: 9px 0 0; + padding: 7px 25px 7px 9px; + line-height: 1; + border: none; + text-overflow: ellipsis; + overflow: hidden; + background: #3c3c3c; + font-size: 13px; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); +} + +.mytheme .valo-menu-part.large-icons [class*="subtitle"] [class*="badge"] { + right: 9px; +} + +.mytheme .valo-menu-part.large-icons [class*="subtitle"] + .valo-menu-item { + border-top: none; +} + +.mytheme .valo-menu-part.large-icons .valo-menu-item { + display: block; + font-size: 26px; + line-height: 1; + padding: 12px; + text-align: center; + border-top: 1px solid #555555; +} + +.mytheme .valo-menu-part.large-icons .valo-menu-item:first-child { + border-top: none; +} + +.mytheme .valo-menu-part.large-icons .valo-menu-item [class*="caption"] { + display: block; + width: auto; + margin: 0.3em 0 0; + padding: 0; + font-size: 11px; + line-height: 1.3; +} + +.mytheme .valo-menu-part.large-icons .valo-menu-item .v-icon { + margin: 0; +} + +.mytheme .valo-menu-part.large-icons .valo-menu-item span.v-icon { + opacity: 0.8; +} + +.mytheme .valo-menu-part.large-icons .valo-menu-item.selected { + background: #434343; +} + +.mytheme .valo-menu-part.large-icons .valo-menu-item.selected .v-icon { + opacity: 1; +} + +.mytheme .valo-menu-part.large-icons .valo-menu-item.selected [class*="badge"] { + border-color: #434343; +} + +.mytheme .valo-menu-part.large-icons .valo-menu-item [class*="badge"] { + padding-left: 4px; + padding-right: 4px; + top: 7px; + right: 7px; + border: 2px solid #4b4b4b; +} + +.mytheme .valo-menu-logo { + display: block; + overflow: hidden; + width: 44px !important; + height: 44px; + border-radius: 4px; + text-align: center; + background-color: #197de1; + background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%); + background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%); + color: white; + font-size: 25px; + line-height: 44px; + margin: 19px auto; + -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); +} + +.mytheme .valo-menu-logo:focus { + outline: none; +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part { + background-color: #4b4b4b; + min-width: 74px; + max-width: 111px; +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part .valo-menu-title { + font-size: 12px; +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part .valo-menu-title .v-label-undef-w { + white-space: normal; +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part .v-menubar-user-menu { + margin-left: 0; + margin-right: 0; + font-size: 11px; +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part .v-menubar-user-menu img.v-icon { + width: 28px; + height: 28px; +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part [class*="subtitle"] { + margin: 9px 0 0; + padding: 7px 25px 7px 9px; + line-height: 1; + border: none; + text-overflow: ellipsis; + overflow: hidden; + background: #3c3c3c; + font-size: 13px; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05); +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part [class*="subtitle"] [class*="badge"] { + right: 9px; +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part [class*="subtitle"] + .valo-menu-item { + border-top: none; +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part .valo-menu-item { + display: block; + font-size: 26px; + line-height: 1; + padding: 12px; + text-align: center; + border-top: 1px solid #555555; +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part .valo-menu-item:first-child { + border-top: none; +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part .valo-menu-item [class*="caption"] { + display: block; + width: auto; + margin: 0.3em 0 0; + padding: 0; + font-size: 11px; + line-height: 1.3; +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part .valo-menu-item .v-icon { + margin: 0; +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part .valo-menu-item span.v-icon { + opacity: 0.8; +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part .valo-menu-item.selected { + background: #434343; +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part .valo-menu-item.selected .v-icon { + opacity: 1; +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part .valo-menu-item.selected [class*="badge"] { + border-color: #434343; +} + +.mytheme .valo-menu-responsive[width-range~="801px-1100px"] .valo-menu-part .valo-menu-item [class*="badge"] { + padding-left: 4px; + padding-right: 4px; + top: 7px; + right: 7px; + border: 2px solid #4b4b4b; +} + +.mytheme .valo-menu-responsive[width-range~="0-800px"] { + padding-top: 37px; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +.mytheme .valo-menu-responsive[width-range~="0-800px"] .v-loading-indicator { + top: 37px; +} + +.mytheme .valo-menu-responsive[width-range~="0-800px"] > .v-widget { + position: relative !important; +} + +.mytheme .valo-menu-responsive[width-range~="0-800px"] .valo-menu { + border-right: none; +} + +.mytheme .valo-menu-responsive[width-range~="0-800px"] .valo-menu-part { + overflow: visible; +} + +.mytheme .valo-menu-responsive[width-range~="0-800px"] .valo-menu-toggle { + display: inline-block; +} + +.mytheme .valo-menu-responsive[width-range~="0-800px"] .valo-menu-title { + position: fixed; + z-index: 100; + top: 0; + left: 0; + right: 0; + height: 37px !important; + padding-top: 0; + padding-bottom: 0; + -webkit-backface-visibility: hidden; +} + +.mytheme .valo-menu-responsive[width-range~="0-800px"] .valo-menu .v-menubar-user-menu { + position: fixed; + z-index: 100; + top: 0; + right: 0; + margin: 0; + padding: 0; + height: 37px; + color: #97bee5; + max-width: 30%; + -webkit-backface-visibility: hidden; +} + +.mytheme .valo-menu-responsive[width-range~="0-800px"] .valo-menu .v-menubar-user-menu .v-menubar-menuitem { + line-height: 36px; + white-space: nowrap; +} + +.mytheme .valo-menu-responsive[width-range~="0-800px"] .valo-menu .v-menubar-user-menu img.v-icon { + display: inline-block; + margin: 0 6px 0 0; + width: 19px; + height: 19px; + border-radius: 10px; + border: none; +} + +.mytheme .valo-menu-responsive[width-range~="0-800px"] .valo-menuitems { + height: 100%; + background-color: #4b4b4b; + background-image: -webkit-linear-gradient(right, #414141 0%, #4b4b4b 9px); + background-image: linear-gradient(to left,#414141 0%, #4b4b4b 9px); + color: #a5a5a5; + font-size: 14px; + line-height: 30px; + border-right: 1px solid #3b3b3b; + white-space: nowrap; + position: fixed; + z-index: 9000; + top: 37px; + bottom: 0; + height: auto; + max-width: 100%; + overflow: auto; + padding: 19px 0; + -webkit-transform: translatex(-100%); + -moz-transform: translatex(-100%); + -ms-transform: translatex(-100%); + -o-transform: translatex(-100%); + transform: translatex(-100%); + -webkit-transition: all 300ms; + -moz-transition: all 300ms; + transition: all 300ms; +} + +.mytheme .valo-menu-responsive[width-range~="0-800px"] .valo-menu-visible .valo-menuitems, .mytheme .valo-menu-responsive[width-range~="0-800px"] .valo-menu-hover:hover .valo-menuitems { + -webkit-transform: translatex(0%); + -moz-transform: translatex(0%); + -ms-transform: translatex(0%); + -o-transform: translatex(0%); + transform: translatex(0%); +} + +.mytheme .valo-menu-responsive[width-range~="0-500px"] .valo-menu-toggle .v-button-caption { + display: none; +} + +.mytheme .valo-menu-responsive[width-range~="0-500px"] .valo-menu .v-menubar-user-menu .v-menubar-menuitem-caption { + display: inline-block; + width: 19px; + overflow: hidden; +} \ No newline at end of file diff --git a/libraries/src/main/webapp/VAADIN/themes/mytheme/styles.scss b/libraries/src/main/webapp/VAADIN/themes/mytheme/styles.scss new file mode 100644 index 0000000000..bba1d493c0 --- /dev/null +++ b/libraries/src/main/webapp/VAADIN/themes/mytheme/styles.scss @@ -0,0 +1,11 @@ +@import "mytheme.scss"; +@import "addons.scss"; + +// This file prefixes all rules with the theme name to avoid causing conflicts with other themes. +// The actual styles should be defined in mytheme.scss + +.mytheme { + @include addons; + @include mytheme; + +} diff --git a/libraries/src/main/webapp/VAADIN/themes/valo/addons.scss b/libraries/src/main/webapp/VAADIN/themes/valo/addons.scss new file mode 100644 index 0000000000..a5670b70c7 --- /dev/null +++ b/libraries/src/main/webapp/VAADIN/themes/valo/addons.scss @@ -0,0 +1,7 @@ +/* This file is automatically managed and will be overwritten from time to time. */ +/* Do not manually edit this file. */ + +/* Import and include this mixin into your project theme to include the addon themes */ +@mixin addons { +} + diff --git a/libraries/src/test/java/com/baeldung/awaitility/AsyncServiceUnitTest.java b/libraries/src/test/java/com/baeldung/awaitility/AsyncServiceUnitTest.java new file mode 100644 index 0000000000..43537965f8 --- /dev/null +++ b/libraries/src/test/java/com/baeldung/awaitility/AsyncServiceUnitTest.java @@ -0,0 +1,84 @@ +package com.baeldung.awaitility; + +import org.awaitility.Awaitility; +import org.awaitility.Duration; +import org.junit.Before; +import org.junit.Test; + +import java.util.concurrent.Callable; +import java.util.concurrent.TimeUnit; + +import static org.awaitility.Awaitility.await; +import static org.awaitility.Awaitility.fieldIn; +import static org.awaitility.Awaitility.given; +import static org.awaitility.proxy.AwaitilityClassProxy.to; +import static org.hamcrest.Matchers.equalTo; + +public class AsyncServiceUnitTest { + private AsyncService asyncService; + + @Before + public void setUp() { + asyncService = new AsyncService(); + } + + @Test + public void givenAsyncService_whenInitialize_thenInitOccurs1() { + asyncService.initialize(); + Callable isInitialized = asyncService::isInitialized; + await().until(isInitialized); + } + + @Test + public void givenAsyncService_whenInitialize_thenInitOccurs2() { + asyncService.initialize(); + Callable isInitialized = asyncService::isInitialized; + await().atLeast(Duration.ONE_HUNDRED_MILLISECONDS) + .atMost(Duration.FIVE_SECONDS) + .with().pollInterval(Duration.ONE_HUNDRED_MILLISECONDS) + .until(isInitialized); + } + + @Test + public void givenAsyncService_whenInitialize_thenInitOccurs_withDefualts() { + Awaitility.setDefaultPollInterval(10, TimeUnit.MILLISECONDS); + Awaitility.setDefaultPollDelay(Duration.ZERO); + Awaitility.setDefaultTimeout(Duration.ONE_MINUTE); + + asyncService.initialize(); + await().until(asyncService::isInitialized); + } + + @Test + public void givenAsyncService_whenInitialize_thenInitOccurs_withProxy() { + asyncService.initialize(); + await().untilCall(to(asyncService).isInitialized(), equalTo(true)); + } + + @Test + public void givenAsyncService_whenInitialize_thenInitOccurs3() { + asyncService.initialize(); + await().until(fieldIn(asyncService) + .ofType(boolean.class) + .andWithName("initialized"), equalTo(true)); + } + + @Test + public void givenValue_whenAddValue_thenValueAdded() { + asyncService.initialize(); + await().until(asyncService::isInitialized); + long value = 5; + asyncService.addValue(value); + await().until(asyncService::getValue, equalTo(value)); + } + + @Test + public void givenAsyncService_whenGetValue_thenExceptionIgnored() { + asyncService.initialize(); + given().ignoreException(IllegalStateException.class) + .await() + .atMost(Duration.FIVE_SECONDS) + .atLeast(Duration.FIVE_HUNDRED_MILLISECONDS) + .until(asyncService::getValue, equalTo(0L)); + } +} diff --git a/libraries/src/test/java/com/baeldung/cglib/proxy/BeanGeneratorIntegrationTest.java b/libraries/src/test/java/com/baeldung/cglib/proxy/BeanGeneratorIntegrationTest.java index 033cc47c74..1224d73724 100644 --- a/libraries/src/test/java/com/baeldung/cglib/proxy/BeanGeneratorIntegrationTest.java +++ b/libraries/src/test/java/com/baeldung/cglib/proxy/BeanGeneratorIntegrationTest.java @@ -19,14 +19,14 @@ public class BeanGeneratorIntegrationTest { beanGenerator.addProperty("name", String.class); Object myBean = beanGenerator.create(); Method setter = myBean - .getClass() - .getMethod("setName", String.class); + .getClass() + .getMethod("setName", String.class); setter.invoke(myBean, "some string value set by a cglib"); //then Method getter = myBean - .getClass() - .getMethod("getName"); + .getClass() + .getMethod("getName"); assertEquals("some string value set by a cglib", getter.invoke(myBean)); } } diff --git a/libraries/src/test/java/com/baeldung/cglib/proxy/MixinUnitTest.java b/libraries/src/test/java/com/baeldung/cglib/proxy/MixinUnitTest.java index a89d9fe2c3..93b34bf92b 100644 --- a/libraries/src/test/java/com/baeldung/cglib/proxy/MixinUnitTest.java +++ b/libraries/src/test/java/com/baeldung/cglib/proxy/MixinUnitTest.java @@ -1,6 +1,10 @@ package com.baeldung.cglib.proxy; -import com.baeldung.cglib.mixin.*; +import com.baeldung.cglib.mixin.Class1; +import com.baeldung.cglib.mixin.Class2; +import com.baeldung.cglib.mixin.Interface1; +import com.baeldung.cglib.mixin.Interface2; +import com.baeldung.cglib.mixin.MixinInterface; import net.sf.cglib.proxy.Mixin; import org.junit.Test; @@ -12,8 +16,8 @@ public class MixinUnitTest { public void givenTwoClasses_whenMixedIntoOne_thenMixinShouldHaveMethodsFromBothClasses() throws Exception { //when Mixin mixin = Mixin.create( - new Class[]{Interface1.class, Interface2.class, MixinInterface.class}, - new Object[]{new Class1(), new Class2()} + new Class[]{Interface1.class, Interface2.class, MixinInterface.class}, + new Object[]{new Class1(), new Class2()} ); MixinInterface mixinDelegate = (MixinInterface) mixin; diff --git a/libraries/src/test/java/com/baeldung/chronicle/queue/ChronicleQueueTest.java b/libraries/src/test/java/com/baeldung/chronicle/queue/ChronicleQueueTest.java new file mode 100644 index 0000000000..e64aaed544 --- /dev/null +++ b/libraries/src/test/java/com/baeldung/chronicle/queue/ChronicleQueueTest.java @@ -0,0 +1,43 @@ +package com.baeldung.chronicle.queue; + +import static org.junit.Assert.assertEquals; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; + +import org.junit.Test; + +import net.openhft.chronicle.Chronicle; +import net.openhft.chronicle.ChronicleQueueBuilder; +import net.openhft.chronicle.ExcerptTailer; +import net.openhft.chronicle.tools.ChronicleTools; + +public class ChronicleQueueTest { + + @Test + public void givenSetOfValues_whenWriteToQueue_thenWriteSuccesfully() throws IOException { + File queueDir = Files.createTempDirectory("chronicle-queue").toFile(); + ChronicleTools.deleteOnExit(queueDir.getPath()); + + Chronicle chronicle = ChronicleQueueBuilder.indexed(queueDir).build(); + String stringVal = "Hello World"; + int intVal = 101; + long longVal = System.currentTimeMillis(); + double doubleVal = 90.00192091d; + + ChronicleQueue.writeToQueue(chronicle, stringVal, intVal, longVal, doubleVal); + + ExcerptTailer tailer = chronicle.createTailer(); + while (tailer.nextIndex()) { + assertEquals(stringVal, tailer.readUTF()); + assertEquals(intVal, tailer.readInt()); + assertEquals(longVal, tailer.readLong()); + assertEquals((Double) doubleVal, (Double) tailer.readDouble()); + } + tailer.finish(); + tailer.close(); + chronicle.close(); + } + +} diff --git a/libraries/src/test/java/com/baeldung/commons/collections/BidiMapUnitTest.java b/libraries/src/test/java/com/baeldung/commons/collections/BidiMapUnitTest.java index 64a3932fb3..e46d8654a2 100644 --- a/libraries/src/test/java/com/baeldung/commons/collections/BidiMapUnitTest.java +++ b/libraries/src/test/java/com/baeldung/commons/collections/BidiMapUnitTest.java @@ -2,16 +2,12 @@ package com.baeldung.commons.collections; import org.apache.commons.collections4.BidiMap; import org.apache.commons.collections4.bidimap.DualHashBidiMap; -import org.apache.commons.collections4.bidimap.DualLinkedHashBidiMap; -import org.apache.commons.collections4.bidimap.DualTreeBidiMap; -import org.apache.commons.collections4.bidimap.TreeBidiMap; import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; -/** - * Created by smatt on 03/07/2017. - */ public class BidiMapUnitTest { @Test diff --git a/libraries/src/test/java/com/baeldung/commons/collections/CollectionUtilsGuideTest.java b/libraries/src/test/java/com/baeldung/commons/collections/CollectionUtilsGuideTest.java index 9166865484..aa8b799c9d 100644 --- a/libraries/src/test/java/com/baeldung/commons/collections/CollectionUtilsGuideTest.java +++ b/libraries/src/test/java/com/baeldung/commons/collections/CollectionUtilsGuideTest.java @@ -3,14 +3,17 @@ package com.baeldung.commons.collections; import com.baeldung.commons.collectionutil.Address; import com.baeldung.commons.collectionutil.Customer; -import org.apache.commons.collections4.Closure; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.Predicate; import org.apache.commons.collections4.Transformer; import org.junit.Before; import org.junit.Test; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -36,13 +39,13 @@ public class CollectionUtilsGuideTest { linkedList1 = new LinkedList<>(list1); } - + @Test public void givenList_whenAddIgnoreNull_thenNoNullAdded() { CollectionUtils.addIgnoreNull(list1, null); assertFalse(list1.contains(null)); } - + @Test public void givenTwoSortedLists_whenCollated_thenSorted() { List sortedList = CollectionUtils.collate(list1, list2); @@ -51,63 +54,69 @@ public class CollectionUtilsGuideTest { assertTrue(sortedList.get(0).getName().equals("Bob")); assertTrue(sortedList.get(2).getName().equals("Daniel")); } - + @Test public void givenListOfCustomers_whenTransformed_thenListOfAddress() { - Collection
addressCol = CollectionUtils.collect(list1, customer -> { - return new Address(customer.getLocality(), customer.getCity(), customer.getZip()); + Collection
addressCol = CollectionUtils.collect(list1, new Transformer() { + public Address transform(Customer customer) { + return new Address(customer.getLocality(), customer.getCity(), customer.getZip()); + } }); - + List
addressList = new ArrayList<>(addressCol); assertTrue(addressList.size() == 3); assertTrue(addressList.get(0).getLocality().equals("locality1")); } - + @Test public void givenCustomerList_whenFiltered_thenCorrectSize() { - - boolean isModified = CollectionUtils.filter(linkedList1, customer -> Arrays.asList("Daniel","Kyle").contains(customer.getName())); - + + boolean isModified = CollectionUtils.filter(linkedList1, new Predicate() { + public boolean evaluate(Customer customer) { + return Arrays.asList("Daniel", "Kyle").contains(customer.getName()); + } + }); + //filterInverse does the opposite. It removes the element from the list if the Predicate returns true //select and selectRejected work the same way except that they do not remove elements from the given collection and return a new collection - + assertTrue(isModified && linkedList1.size() == 2); } - + @Test public void givenNonEmptyList_whenCheckedIsNotEmpty_thenTrue() { List emptyList = new ArrayList<>(); List nullList = null; - + //Very handy at times where we want to check if a collection is not null and not empty too. //isNotEmpty does the opposite. Handy because using ! operator on isEmpty makes it missable while reading assertTrue(CollectionUtils.isNotEmpty(list1)); assertTrue(CollectionUtils.isEmpty(nullList)); assertTrue(CollectionUtils.isEmpty(emptyList)); } - + @Test public void givenCustomerListAndASubcollection_whenChecked_thenTrue() { assertTrue(CollectionUtils.isSubCollection(list3, list1)); } - + @Test public void givenTwoLists_whenIntersected_thenCheckSize() { Collection intersection = CollectionUtils.intersection(list1, list3); assertTrue(intersection.size() == 2); } - + @Test public void givenTwoLists_whenSubtracted_thenCheckElementNotPresentInA() { Collection result = CollectionUtils.subtract(list1, list3); assertFalse(result.contains(customer1)); } - + @Test public void givenTwoLists_whenUnioned_thenCheckElementPresentInResult() { Collection union = CollectionUtils.union(list1, list2); assertTrue(union.contains(customer1)); assertTrue(union.contains(customer4)); } - + } \ No newline at end of file diff --git a/libraries/src/test/java/com/baeldung/commons/collections/MapUtilsTest.java b/libraries/src/test/java/com/baeldung/commons/collections/MapUtilsTest.java new file mode 100644 index 0000000000..470eb46cb0 --- /dev/null +++ b/libraries/src/test/java/com/baeldung/commons/collections/MapUtilsTest.java @@ -0,0 +1,146 @@ +package com.baeldung.commons.collections; + +import org.apache.commons.collections4.MapIterator; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.collections4.PredicateUtils; +import org.apache.commons.collections4.TransformerUtils; +import org.junit.Before; +import org.junit.Test; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.HashMap; +import java.util.Map; + +import static org.hamcrest.Matchers.is; +import static org.hamcrest.collection.IsMapContaining.hasEntry; +import static org.hamcrest.collection.IsMapWithSize.aMapWithSize; +import static org.hamcrest.collection.IsMapWithSize.anEmptyMap; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + +public class MapUtilsTest { + + private String[][] color2DArray = new String[][]{ + {"RED", "#FF0000"}, + {"GREEN", "#00FF00"}, + {"BLUE", "#0000FF"} + }; + private String[] color1DArray = new String[]{ + "RED", "#FF0000", + "GREEN", "#00FF00", + "BLUE", "#0000FF" + }; + private Map colorMap; + + @Before + public void createMap() { + this.colorMap = MapUtils.putAll(new HashMap(), this.color2DArray); + } + + @Test + public void whenCreateMapFrom2DArray_theMapIsCreated() { + this.colorMap = MapUtils.putAll(new HashMap(), this.color2DArray); + + assertThat(this.colorMap, is(aMapWithSize(this.color2DArray.length))); + + assertThat(this.colorMap, hasEntry("RED", "#FF0000")); + assertThat(this.colorMap, hasEntry("GREEN", "#00FF00")); + assertThat(this.colorMap, hasEntry("BLUE", "#0000FF")); + } + + @Test + public void whenCreateMapFrom1DArray_theMapIsCreated() { + this.colorMap = MapUtils.putAll(new HashMap(), this.color1DArray); + + assertThat(this.colorMap, is(aMapWithSize(this.color1DArray.length / 2))); + + assertThat(this.colorMap, hasEntry("RED", "#FF0000")); + assertThat(this.colorMap, hasEntry("GREEN", "#00FF00")); + assertThat(this.colorMap, hasEntry("BLUE", "#0000FF")); + } + + @Test + public void whenVerbosePrintMap_thenMustPrintFormattedMap() { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + PrintStream outPrint = new PrintStream(out); + + outPrint.println("Optional Label = "); + outPrint.println("{"); + outPrint.println(" RED = #FF0000"); + outPrint.println(" BLUE = #0000FF"); + outPrint.println(" GREEN = #00FF00"); + outPrint.println("}"); + + out.reset(); + + MapUtils.verbosePrint(outPrint, "Optional Label", this.colorMap); + } + + @Test + public void whenGetKeyNotPresent_thenMustReturnDefaultValue() { + String defaultColorStr = "COLOR_NOT_FOUND"; + String color = MapUtils.getString(this.colorMap, "BLACK", defaultColorStr); + + assertEquals(color, defaultColorStr); + } + + @Test + public void whenGetOnNullMap_thenMustReturnDefaultValue() { + String defaultColorStr = "COLOR_NOT_FOUND"; + String color = MapUtils.getString(null, "RED", defaultColorStr); + + assertEquals(color, defaultColorStr); + } + + @Test + public void whenInvertMap_thenMustReturnInvertedMap() { + Map invColorMap = MapUtils.invertMap(this.colorMap); + assertEquals(this.colorMap.size(), invColorMap.size()); + + MapIterator itColorMap + = MapUtils.iterableMap(this.colorMap).mapIterator(); + + while (itColorMap.hasNext()) { + String colorMapKey = itColorMap.next(); + String colorMapValue = itColorMap.getValue(); + + String invColorMapValue = MapUtils.getString(invColorMap, colorMapValue); + + assertTrue(invColorMapValue.equals(colorMapKey)); + } + } + + @Test(expected = IllegalArgumentException.class) + public void whenCreateFixedSizedMapAndAdd_thenMustThrowException() { + Map rgbMap = MapUtils.fixedSizeMap(MapUtils.putAll( + new HashMap(), + this.color1DArray)); + + rgbMap.put("ORANGE", "#FFA500"); + } + + @Test(expected = IllegalArgumentException.class) + public void whenAddDuplicateToUniqueValuesPredicateMap_thenMustThrowException() { + Map uniqValuesMap + = MapUtils.predicatedMap(this.colorMap, null, PredicateUtils.uniquePredicate()); + + uniqValuesMap.put("NEW_RED", "#FF0000"); + } + + @Test + public void whenCreateLazyMap_theMapIsCreated() { + Map intStrMap = MapUtils.lazyMap( + new HashMap(), + TransformerUtils.stringValueTransformer()); + + assertThat(intStrMap, is(anEmptyMap())); + + intStrMap.get(1); + intStrMap.get(2); + intStrMap.get(3); + + assertThat(intStrMap, is(aMapWithSize(3))); + } +} diff --git a/libraries/src/test/java/com/baeldung/commons/collections/SetUtilsUnitTest.java b/libraries/src/test/java/com/baeldung/commons/collections/SetUtilsUnitTest.java index 4d264e3aea..7d214bc5c5 100644 --- a/libraries/src/test/java/com/baeldung/commons/collections/SetUtilsUnitTest.java +++ b/libraries/src/test/java/com/baeldung/commons/collections/SetUtilsUnitTest.java @@ -11,9 +11,6 @@ import java.util.Set; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -/** - * Created by smatt on 21/06/2017. - */ public class SetUtilsUnitTest { @Test(expected = IllegalArgumentException.class) @@ -27,33 +24,33 @@ public class SetUtilsUnitTest { @Test public void givenTwoSets_whenDifference_thenSetView() { - Set a = new HashSet<>(Arrays.asList(1,2,5)); - Set b = new HashSet<>(Arrays.asList(1,2)); + Set a = new HashSet<>(Arrays.asList(1, 2, 5)); + Set b = new HashSet<>(Arrays.asList(1, 2)); SetUtils.SetView result = SetUtils.difference(a, b); assertTrue(result.size() == 1 && result.contains(5)); } @Test public void givenTwoSets_whenUnion_thenUnionResult() { - Set a = new HashSet<>(Arrays.asList(1,2,5)); - Set b = new HashSet<>(Arrays.asList(1,2)); - Set expected = new HashSet<>(Arrays.asList(1,2,5)); + Set a = new HashSet<>(Arrays.asList(1, 2, 5)); + Set b = new HashSet<>(Arrays.asList(1, 2)); + Set expected = new HashSet<>(Arrays.asList(1, 2, 5)); SetUtils.SetView union = SetUtils.union(a, b); assertTrue(SetUtils.isEqualSet(expected, union)); } @Test public void givenTwoSets_whenIntersection_thenIntersectionResult() { - Set a = new HashSet<>(Arrays.asList(1,2,5)); - Set b = new HashSet<>(Arrays.asList(1,2)); - Set expected = new HashSet<>(Arrays.asList(1,2)); + Set a = new HashSet<>(Arrays.asList(1, 2, 5)); + Set b = new HashSet<>(Arrays.asList(1, 2)); + Set expected = new HashSet<>(Arrays.asList(1, 2)); SetUtils.SetView intersect = SetUtils.intersection(a, b); assertTrue(SetUtils.isEqualSet(expected, intersect)); } @Test public void givenSet_whenTransformedSet_thenTransformedResult() { - Set a = SetUtils.transformedSet(new HashSet<>(), (e) -> e * 2 ); + Set a = SetUtils.transformedSet(new HashSet<>(), (e) -> e * 2); a.add(2); assertEquals(a.toArray()[0], 4); @@ -65,19 +62,19 @@ public class SetUtilsUnitTest { @Test public void givenTwoSet_whenDisjunction_thenDisjunctionSet() { - Set a = new HashSet<>(Arrays.asList(1,2,5)); - Set b = new HashSet<>(Arrays.asList(1,2,3)); + Set a = new HashSet<>(Arrays.asList(1, 2, 5)); + Set b = new HashSet<>(Arrays.asList(1, 2, 3)); SetUtils.SetView result = SetUtils.disjunction(a, b); assertTrue(result.toSet().contains(5) && result.toSet().contains(3)); } @Test public void givenSet_when_OrderedSet_thenMaintainElementOrder() { - Set set = new HashSet<>(Arrays.asList(10,1,5)); + Set set = new HashSet<>(Arrays.asList(10, 1, 5)); System.out.println("unordered set: " + set); Set orderedSet = SetUtils.orderedSet(new HashSet<>()); - orderedSet.addAll(Arrays.asList(10,1,5)); + orderedSet.addAll(Arrays.asList(10, 1, 5)); System.out.println("ordered set = " + orderedSet); } } \ No newline at end of file diff --git a/libraries/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java b/libraries/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java index 6b2777c289..7a05228e51 100644 --- a/libraries/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java +++ b/libraries/src/test/java/com/baeldung/commons/collections/orderedmap/OrderedMapUnitTest.java @@ -1,10 +1,5 @@ package com.baeldung.commons.collections.orderedmap; -import static org.junit.Assert.assertEquals; - -import java.util.ArrayList; -import java.util.List; - import org.apache.commons.collections4.OrderedMap; import org.apache.commons.collections4.OrderedMapIterator; import org.apache.commons.collections4.map.LinkedMap; @@ -12,6 +7,11 @@ import org.apache.commons.collections4.map.ListOrderedMap; import org.junit.Before; import org.junit.Test; +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertEquals; + public class OrderedMapUnitTest { private String[] names = {"Emily", "Mathew", "Rose", "John", "Anna"}; diff --git a/libraries/src/test/java/com/baeldung/commons/dbutils/DbUtilsUnitTest.java b/libraries/src/test/java/com/baeldung/commons/dbutils/DbUtilsUnitTest.java new file mode 100644 index 0000000000..bc7623589c --- /dev/null +++ b/libraries/src/test/java/com/baeldung/commons/dbutils/DbUtilsUnitTest.java @@ -0,0 +1,163 @@ +package com.baeldung.commons.dbutils; + +import org.apache.commons.dbutils.AsyncQueryRunner; +import org.apache.commons.dbutils.DbUtils; +import org.apache.commons.dbutils.QueryRunner; +import org.apache.commons.dbutils.handlers.BeanListHandler; +import org.apache.commons.dbutils.handlers.MapListHandler; +import org.apache.commons.dbutils.handlers.ScalarHandler; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class DbUtilsUnitTest { + + private Connection connection; + + @Before + public void setupDB() throws Exception { + Class.forName("org.h2.Driver"); + String db = "jdbc:h2:mem:;INIT=runscript from 'classpath:/employees.sql'"; + connection = DriverManager.getConnection(db); + } + + @After + public void closeBD() { + DbUtils.closeQuietly(connection); + } + + @Test + public void givenResultHandler_whenExecutingQuery_thenExpectedList() throws SQLException { + MapListHandler beanListHandler = new MapListHandler(); + + QueryRunner runner = new QueryRunner(); + List> list = runner.query(connection, "SELECT * FROM employee", beanListHandler); + + assertEquals(list.size(), 5); + assertEquals(list.get(0) + .get("firstname"), "John"); + assertEquals(list.get(4) + .get("firstname"), "Christian"); + } + + @Test + public void givenResultHandler_whenExecutingQuery_thenEmployeeList() throws SQLException { + BeanListHandler beanListHandler = new BeanListHandler<>(Employee.class); + + QueryRunner runner = new QueryRunner(); + List employeeList = runner.query(connection, "SELECT * FROM employee", beanListHandler); + + assertEquals(employeeList.size(), 5); + assertEquals(employeeList.get(0) + .getFirstName(), "John"); + assertEquals(employeeList.get(4) + .getFirstName(), "Christian"); + } + + @Test + public void givenResultHandler_whenExecutingQuery_thenExpectedScalar() throws SQLException { + ScalarHandler scalarHandler = new ScalarHandler<>(); + + QueryRunner runner = new QueryRunner(); + String query = "SELECT COUNT(*) FROM employee"; + long count = runner.query(connection, query, scalarHandler); + + assertEquals(count, 5); + } + + @Test + public void givenResultHandler_whenExecutingQuery_thenEmailsSetted() throws SQLException { + EmployeeHandler employeeHandler = new EmployeeHandler(connection); + + QueryRunner runner = new QueryRunner(); + List employees = runner.query(connection, "SELECT * FROM employee", employeeHandler); + + assertEquals(employees.get(0) + .getEmails() + .size(), 2); + assertEquals(employees.get(2) + .getEmails() + .size(), 3); + assertNotNull(employees.get(0).getEmails().get(0).getEmployeeId()); + } + + @Test + public void givenResultHandler_whenExecutingQuery_thenAllPropertiesSetted() throws SQLException { + EmployeeHandler employeeHandler = new EmployeeHandler(connection); + + QueryRunner runner = new QueryRunner(); + String query = "SELECT * FROM employee_legacy"; + List employees = runner.query(connection, query, employeeHandler); + + assertEquals((int) employees.get(0).getId(), 1); + assertEquals(employees.get(0).getFirstName(), "John"); + } + + @Test + public void whenInserting_thenInserted() throws SQLException { + QueryRunner runner = new QueryRunner(); + String insertSQL = "INSERT INTO employee (firstname,lastname,salary, hireddate) VALUES (?, ?, ?, ?)"; + + int numRowsInserted = runner.update(connection, insertSQL, "Leia", "Kane", 60000.60, new Date()); + + assertEquals(numRowsInserted, 1); + } + + @Test + public void givenHandler_whenInserting_thenExpectedId() throws SQLException { + ScalarHandler scalarHandler = new ScalarHandler<>(); + + QueryRunner runner = new QueryRunner(); + String insertSQL = "INSERT INTO employee (firstname,lastname,salary, hireddate) VALUES (?, ?, ?, ?)"; + + int newId = runner.insert(connection, insertSQL, scalarHandler, "Jenny", "Medici", 60000.60, new Date()); + + assertEquals(newId, 6); + } + + @Test + public void givenSalary_whenUpdating_thenUpdated() throws SQLException { + double salary = 35000; + + QueryRunner runner = new QueryRunner(); + String updateSQL = "UPDATE employee SET salary = salary * 1.1 WHERE salary <= ?"; + int numRowsUpdated = runner.update(connection, updateSQL, salary); + + assertEquals(numRowsUpdated, 3); + } + + @Test + public void whenDeletingRecord_thenDeleted() throws SQLException { + QueryRunner runner = new QueryRunner(); + String deleteSQL = "DELETE FROM employee WHERE id = ?"; + int numRowsDeleted = runner.update(connection, deleteSQL, 3); + + assertEquals(numRowsDeleted, 1); + } + + @Test + public void givenAsyncRunner_whenExecutingQuery_thenExpectedList() throws Exception { + AsyncQueryRunner runner = new AsyncQueryRunner(Executors.newCachedThreadPool()); + + EmployeeHandler employeeHandler = new EmployeeHandler(connection); + String query = "SELECT * FROM employee"; + Future> future = runner.query(connection, query, employeeHandler); + List employeeList = future.get(10, TimeUnit.SECONDS); + + assertEquals(employeeList.size(), 5); + } + +} diff --git a/libraries/src/test/java/com/baeldung/commons/lang3/StringUtilsUnitTest.java b/libraries/src/test/java/com/baeldung/commons/lang3/StringUtilsUnitTest.java index 15620455aa..191387d088 100644 --- a/libraries/src/test/java/com/baeldung/commons/lang3/StringUtilsUnitTest.java +++ b/libraries/src/test/java/com/baeldung/commons/lang3/StringUtilsUnitTest.java @@ -2,9 +2,10 @@ package com.baeldung.commons.lang3; import org.apache.commons.lang3.StringUtils; import org.junit.Test; + import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; public class StringUtilsUnitTest { @Test diff --git a/libraries/src/test/java/com/baeldung/hikaricp/HikariCPUnitTest.java b/libraries/src/test/java/com/baeldung/hikaricp/HikariCPIntegrationTest.java similarity index 88% rename from libraries/src/test/java/com/baeldung/hikaricp/HikariCPUnitTest.java rename to libraries/src/test/java/com/baeldung/hikaricp/HikariCPIntegrationTest.java index 1a1c5ef868..80588ecc03 100644 --- a/libraries/src/test/java/com/baeldung/hikaricp/HikariCPUnitTest.java +++ b/libraries/src/test/java/com/baeldung/hikaricp/HikariCPIntegrationTest.java @@ -6,7 +6,7 @@ import java.util.List; import static org.junit.Assert.assertEquals; -public class HikariCPUnitTest { +public class HikariCPIntegrationTest { @Test public void givenConnection_thenFetchDbData() { diff --git a/libraries/src/test/java/com/baeldung/hll/HLLUnitTest.java b/libraries/src/test/java/com/baeldung/hll/HLLUnitTest.java new file mode 100644 index 0000000000..2745e1e681 --- /dev/null +++ b/libraries/src/test/java/com/baeldung/hll/HLLUnitTest.java @@ -0,0 +1,68 @@ +package com.baeldung.hll; + + +import com.google.common.hash.HashFunction; +import com.google.common.hash.Hashing; +import net.agkn.hll.HLL; +import org.junit.Test; + +import java.util.stream.LongStream; + +import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; + +public class HLLUnitTest { + + @Test + public void givenHLL_whenAddHugeAmountOfNumbers_thenShouldReturnEstimatedCardinality() { + //given + int numberOfElements = 100_000_000; + int toleratedDifference = 1_000_000; + HashFunction hashFunction = Hashing.murmur3_128(); + HLL hll = new HLL(14, 5); + + //when + LongStream.range(0, numberOfElements).forEach(element -> { + long hashedValue = hashFunction.newHasher().putLong(element).hash().asLong(); + hll.addRaw(hashedValue); + } + ); + + //then + long cardinality = hll.cardinality(); + assertThat(isSimilarTo(cardinality, numberOfElements, toleratedDifference)).isTrue(); + } + + @Test + public void givenTwoHLLs_whenAddHugeAmountOfNumbers_thenShouldReturnEstimatedCardinalityForUnionOfHLLs() { + //given + int numberOfElements = 100_000_000; + int toleratedDifference = 1_000_000; + HashFunction hashFunction = Hashing.murmur3_128(); + HLL firstHll = new HLL(15, 5); + HLL secondHLL = new HLL(15, 5); + + //when + LongStream.range(0, numberOfElements).forEach(element -> { + long hashedValue = hashFunction.newHasher().putLong(element).hash().asLong(); + firstHll.addRaw(hashedValue); + } + ); + + LongStream.range(numberOfElements, numberOfElements * 2).forEach(element -> { + long hashedValue = hashFunction.newHasher().putLong(element).hash().asLong(); + secondHLL.addRaw(hashedValue); + } + ); + + //then + firstHll.union(secondHLL); + long cardinality = firstHll.cardinality(); + assertThat(isSimilarTo(cardinality, numberOfElements * 2, + toleratedDifference * 2)).isTrue(); + } + + private boolean isSimilarTo(long cardinality, int numberOfElements, int maxToleratedDifference) { + System.out.println(cardinality); + return Math.abs(cardinality - numberOfElements) <= maxToleratedDifference; + } +} diff --git a/libraries/src/test/java/com/baeldung/jasypt/JasyptUnitTest.java b/libraries/src/test/java/com/baeldung/jasypt/JasyptUnitTest.java index 39d54085e2..5e65c585aa 100644 --- a/libraries/src/test/java/com/baeldung/jasypt/JasyptUnitTest.java +++ b/libraries/src/test/java/com/baeldung/jasypt/JasyptUnitTest.java @@ -8,7 +8,9 @@ import org.jasypt.util.text.BasicTextEncryptor; import org.junit.Ignore; import org.junit.Test; -import static junit.framework.Assert.*; +import static junit.framework.Assert.assertFalse; +import static junit.framework.Assert.assertNotSame; +import static junit.framework.Assert.assertTrue; import static junit.framework.TestCase.assertEquals; public class JasyptUnitTest { @@ -30,7 +32,7 @@ public class JasyptUnitTest { } @Test - public void givenTextPassword_whenOneWayEncryption_thenCompareEncryptedPasswordsShouldBeSame(){ + public void givenTextPassword_whenOneWayEncryption_thenCompareEncryptedPasswordsShouldBeSame() { String password = "secret-pass"; BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor(); String encryptedPassword = passwordEncryptor.encryptPassword(password); @@ -43,7 +45,7 @@ public class JasyptUnitTest { } @Test - public void givenTextPassword_whenOneWayEncryption_thenCompareEncryptedPasswordsShouldNotBeSame(){ + public void givenTextPassword_whenOneWayEncryption_thenCompareEncryptedPasswordsShouldNotBeSame() { String password = "secret-pass"; BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor(); String encryptedPassword = passwordEncryptor.encryptPassword(password); @@ -56,7 +58,6 @@ public class JasyptUnitTest { } - @Test @Ignore("should have installed local_policy.jar") public void givenTextPrivateData_whenDecrypt_thenCompareToEncryptedWithCustomAlgorithm() { @@ -77,7 +78,7 @@ public class JasyptUnitTest { @Test @Ignore("should have installed local_policy.jar") - public void givenTextPrivateData_whenDecryptOnHighPerformance_thenDecrypt(){ + public void givenTextPrivateData_whenDecryptOnHighPerformance_thenDecrypt() { //given String privateData = "secret-data"; PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor(); diff --git a/libraries/src/test/java/com/baeldung/jdo/GuideToJDOIntegrationTest.java b/libraries/src/test/java/com/baeldung/jdo/GuideToJDOIntegrationTest.java index 578f9ff902..e916a229f7 100644 --- a/libraries/src/test/java/com/baeldung/jdo/GuideToJDOIntegrationTest.java +++ b/libraries/src/test/java/com/baeldung/jdo/GuideToJDOIntegrationTest.java @@ -8,7 +8,6 @@ import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import javax.jdo.Query; import javax.jdo.Transaction; -import java.util.Iterator; import java.util.List; import static org.junit.Assert.assertEquals; diff --git a/libraries/src/test/java/com/baeldung/opennlp/OpenNLPTests.java b/libraries/src/test/java/com/baeldung/opennlp/OpenNLPTests.java deleted file mode 100644 index 38bc8e002b..0000000000 --- a/libraries/src/test/java/com/baeldung/opennlp/OpenNLPTests.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.baeldung.opennlp; - -import opennlp.tools.chunker.ChunkerME; -import opennlp.tools.chunker.ChunkerModel; -import opennlp.tools.cmdline.postag.POSModelLoader; -import opennlp.tools.doccat.DoccatFactory; -import opennlp.tools.doccat.DoccatModel; -import opennlp.tools.doccat.DocumentCategorizerME; -import opennlp.tools.doccat.DocumentSample; -import opennlp.tools.doccat.DocumentSampleStream; -import opennlp.tools.namefind.NameFinderME; -import opennlp.tools.namefind.TokenNameFinderModel; -import opennlp.tools.postag.POSModel; -import opennlp.tools.postag.POSSample; -import opennlp.tools.postag.POSTaggerME; -import opennlp.tools.sentdetect.SentenceDetectorME; -import opennlp.tools.sentdetect.SentenceModel; -import opennlp.tools.tokenize.WhitespaceTokenizer; -import opennlp.tools.util.InputStreamFactory; -import opennlp.tools.util.ObjectStream; -import opennlp.tools.util.PlainTextByLineStream; -import opennlp.tools.util.Span; -import opennlp.tools.util.TrainingParameters; -import org.junit.Test; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; - -import static org.junit.Assert.assertEquals; - -public class OpenNLPTests { - - private final static String text = "To get to the south: Go to the store. Buy a compass. Use the compass. Then walk to the south."; - private final static String sentence[] = new String[]{"James", "Jordan", "live", "in", "Oklahoma", "city", "."}; - - @Test - public void givenText_WhenDetectSentences_ThenCountSentences() { - InputStream is; - SentenceModel model; - try { - is = new FileInputStream("OpenNLP/en-sent.bin"); - model = new SentenceModel(is); - SentenceDetectorME sdetector = new SentenceDetectorME(model); - String sentences[] = sdetector.sentDetect(text); - assertEquals(4, sentences.length); - is.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Test - public void givenText_WhenDetectTokens_ThenVerifyNames() { - InputStream is; - TokenNameFinderModel model; - try { - is = new FileInputStream("OpenNLP/en-ner-person.bin"); - model = new TokenNameFinderModel(is); - is.close(); - NameFinderME nameFinder = new NameFinderME(model); - Span nameSpans[] = nameFinder.find(sentence); - String[] names = Span.spansToStrings(nameSpans, sentence); - assertEquals(1, names.length); - assertEquals("James Jordan", names[0]); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Test - public void givenText_WhenDetectTokens_ThenVerifyLocations() { - InputStream is; - TokenNameFinderModel model; - try { - is = new FileInputStream("OpenNLP/en-ner-location.bin"); - model = new TokenNameFinderModel(is); - is.close(); - NameFinderME nameFinder = new NameFinderME(model); - Span locationSpans[] = nameFinder.find(sentence); - String[] locations = Span.spansToStrings(locationSpans, sentence); - assertEquals(1, locations.length); - assertEquals("Oklahoma", locations[0]); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Test - public void givenText_WhenCategorizeDocument_ThenVerifyDocumentContent() { - DoccatModel docCatModel; - try { - InputStreamFactory isf = new InputStreamFactory() { - public InputStream createInputStream() throws IOException { - return new FileInputStream("OpenNLP/doc-cat.train"); - } - }; - ObjectStream lineStream = new PlainTextByLineStream(isf, "UTF-8"); - ObjectStream sampleStream = new DocumentSampleStream(lineStream); - DoccatFactory docCatFactory = new DoccatFactory(); - docCatModel = DocumentCategorizerME.train("en", sampleStream, TrainingParameters.defaultParams(), docCatFactory); - DocumentCategorizerME myCategorizer = new DocumentCategorizerME(docCatModel); - double[] outcomes = myCategorizer.categorize(sentence); - String category = myCategorizer.getBestCategory(outcomes); - assertEquals("GOOD", category); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Test - public void givenText_WhenTagDocument_ThenVerifyTaggedString() { - try { - POSModel posModel = new POSModelLoader().load(new File("OpenNLP/en-pos-maxent.bin")); - POSTaggerME posTaggerME = new POSTaggerME(posModel); - InputStreamFactory isf = new InputStreamFactory() { - public InputStream createInputStream() throws IOException { - return new FileInputStream("OpenNLP/PartOfSpeechTag.txt"); - } - }; - ObjectStream lineStream = new PlainTextByLineStream(isf, "UTF-8"); - String line; - while ((line = lineStream.read()) != null) { - String whitespaceTokenizerLine[] = WhitespaceTokenizer.INSTANCE.tokenize(line); - String[] tags = posTaggerME.tag(whitespaceTokenizerLine); - POSSample posSample = new POSSample(whitespaceTokenizerLine, tags); - assertEquals("Out_IN of_IN the_DT night_NN that_WDT covers_VBZ me_PRP", posSample.toString()); - } - lineStream.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Test - public void givenText_WhenChunked_ThenCountChunks() { - try { - InputStream is = new FileInputStream("OpenNLP/en-chunker.bin"); - ChunkerModel cModel = new ChunkerModel(is); - ChunkerME chunkerME = new ChunkerME(cModel); - String pos[] = new String[]{"NNP", "NNP", "NNP", "POS", "NNP", "NN", "VBD"}; - String chunks[] = chunkerME.chunk(sentence, pos); - assertEquals(7, chunks.length); - } catch (IOException e) { - e.printStackTrace(); - } - } - -} diff --git a/libraries/src/test/java/com/baeldung/pact/PactConsumerDrivenContractUnitTest.java b/libraries/src/test/java/com/baeldung/pact/PactConsumerDrivenContractUnitTest.java index 2952938cd9..b152b22964 100644 --- a/libraries/src/test/java/com/baeldung/pact/PactConsumerDrivenContractUnitTest.java +++ b/libraries/src/test/java/com/baeldung/pact/PactConsumerDrivenContractUnitTest.java @@ -8,7 +8,11 @@ import au.com.dius.pact.consumer.dsl.PactDslWithProvider; import au.com.dius.pact.model.RequestResponsePact; import org.junit.Rule; import org.junit.Test; -import org.springframework.http.*; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.web.client.RestTemplate; import java.util.HashMap; @@ -20,7 +24,7 @@ public class PactConsumerDrivenContractUnitTest { @Rule public PactProviderRuleMk2 mockProvider - = new PactProviderRuleMk2("test_provider", "localhost", 8080, this); + = new PactProviderRuleMk2("test_provider", "localhost", 8080, this); @Pact(consumer = "test_consumer") public RequestResponsePact createPact(PactDslWithProvider builder) { @@ -28,25 +32,25 @@ public class PactConsumerDrivenContractUnitTest { headers.put("Content-Type", "application/json"); return builder - .given("test GET ") - .uponReceiving("GET REQUEST") - .path("/") - .method("GET") - .willRespondWith() - .status(200) - .headers(headers) - .body("{\"condition\": true, \"name\": \"tom\"}") - .given("test POST") - .uponReceiving("POST REQUEST") - .method("POST") - .headers(headers) - .body("{\"name\": \"Michael\"}") - .path("/create") - .willRespondWith() - .status(201) - .headers(headers) - .body("") - .toPact(); + .given("test GET ") + .uponReceiving("GET REQUEST") + .path("/") + .method("GET") + .willRespondWith() + .status(200) + .headers(headers) + .body("{\"condition\": true, \"name\": \"tom\"}") + .given("test POST") + .uponReceiving("POST REQUEST") + .method("POST") + .headers(headers) + .body("{\"name\": \"Michael\"}") + .path("/create") + .willRespondWith() + .status(201) + .headers(headers) + .body("") + .toPact(); } @@ -55,7 +59,7 @@ public class PactConsumerDrivenContractUnitTest { public void givenGet_whenSendRequest_shouldReturn200WithProperHeaderAndBody() { //when ResponseEntity response - = new RestTemplate().getForEntity(mockProvider.getUrl(), String.class); + = new RestTemplate().getForEntity(mockProvider.getUrl(), String.class); //then assertThat(response.getStatusCode().value()).isEqualTo(200); @@ -69,10 +73,10 @@ public class PactConsumerDrivenContractUnitTest { //when ResponseEntity postResponse = new RestTemplate().exchange( - mockProvider.getUrl() + "/create", - HttpMethod.POST, - new HttpEntity<>(jsonBody, httpHeaders), - String.class + mockProvider.getUrl() + "/create", + HttpMethod.POST, + new HttpEntity<>(jsonBody, httpHeaders), + String.class ); //then diff --git a/libraries/src/test/java/com/baeldung/text/StrBuilderTest.java b/libraries/src/test/java/com/baeldung/text/StrBuilderTest.java index a8dbaadc5a..f08b43f69b 100644 --- a/libraries/src/test/java/com/baeldung/text/StrBuilderTest.java +++ b/libraries/src/test/java/com/baeldung/text/StrBuilderTest.java @@ -5,12 +5,12 @@ import org.junit.Assert; import org.junit.Test; public class StrBuilderTest { - + @Test public void whenReplaced_thenCorrect() { StrBuilder strBuilder = new StrBuilder("example StrBuilder!"); strBuilder.replaceAll("example", "new"); - + Assert.assertEquals(new StrBuilder("new StrBuilder!"), strBuilder); } @@ -21,4 +21,4 @@ public class StrBuilderTest { Assert.assertEquals(new StrBuilder(""), strBuilder); } -} +} \ No newline at end of file diff --git a/libraries/src/test/java/com/baeldung/text/WordUtilsTest.java b/libraries/src/test/java/com/baeldung/text/WordUtilsTest.java index b9268d67b3..fafba2fbb5 100644 --- a/libraries/src/test/java/com/baeldung/text/WordUtilsTest.java +++ b/libraries/src/test/java/com/baeldung/text/WordUtilsTest.java @@ -13,11 +13,11 @@ public class WordUtilsTest { Assert.assertEquals("To Be Capitalized!", result); } - + @Test public void whenContainsWords_thenCorrect() { boolean containsWords = WordUtils.containsAllWords("String to search", "to", "search"); - + Assert.assertTrue(containsWords); } } diff --git a/libraries/src/test/resources/employees.sql b/libraries/src/test/resources/employees.sql new file mode 100644 index 0000000000..c6109724cf --- /dev/null +++ b/libraries/src/test/resources/employees.sql @@ -0,0 +1,43 @@ +CREATE TABLE employee( + id int NOT NULL PRIMARY KEY auto_increment, + firstname varchar(255), + lastname varchar(255), + salary double, + hireddate date +); + +CREATE TABLE email( + id int NOT NULL PRIMARY KEY auto_increment, + employeeid int, + address varchar(255) +); + +CREATE TABLE employee_legacy( + id int NOT NULL PRIMARY KEY auto_increment, + first_name varchar(255), + last_name varchar(255), + salary double, + hired_date date +); + + +INSERT INTO employee (firstname,lastname,salary,hireddate) VALUES ('John', 'Doe', 10000.10, to_date('01-01-2001','dd-mm-yyyy')); +INSERT INTO employee (firstname,lastname,salary,hireddate) VALUES ('Kevin', 'Smith', 20000.20, to_date('02-02-2002','dd-mm-yyyy')); +INSERT INTO employee (firstname,lastname,salary,hireddate) VALUES ('Kim', 'Smith', 30000.30, to_date('03-03-2003','dd-mm-yyyy')); +INSERT INTO employee (firstname,lastname,salary,hireddate) VALUES ('Stephen', 'Torvalds', 40000.40, to_date('04-04-2004','dd-mm-yyyy')); +INSERT INTO employee (firstname,lastname,salary,hireddate) VALUES ('Christian', 'Reynolds', 50000.50, to_date('05-05-2005','dd-mm-yyyy')); + +INSERT INTO employee_legacy (first_name,last_name,salary,hired_date) VALUES ('John', 'Doe', 10000.10, to_date('01-01-2001','dd-mm-yyyy')); +INSERT INTO employee_legacy (first_name,last_name,salary,hired_date) VALUES ('Kevin', 'Smith', 20000.20, to_date('02-02-2002','dd-mm-yyyy')); +INSERT INTO employee_legacy (first_name,last_name,salary,hired_date) VALUES ('Kim', 'Smith', 30000.30, to_date('03-03-2003','dd-mm-yyyy')); +INSERT INTO employee_legacy (first_name,last_name,salary,hired_date) VALUES ('Stephen', 'Torvalds', 40000.40, to_date('04-04-2004','dd-mm-yyyy')); +INSERT INTO employee_legacy (first_name,last_name,salary,hired_date) VALUES ('Christian', 'Reynolds', 50000.50, to_date('05-05-2005','dd-mm-yyyy')); + +INSERT INTO email (employeeid,address) VALUES (1, 'john@baeldung.com'); +INSERT INTO email (employeeid,address) VALUES (1, 'john@gmail.com'); +INSERT INTO email (employeeid,address) VALUES (2, 'kevin@baeldung.com'); +INSERT INTO email (employeeid,address) VALUES (3, 'kim@baeldung.com'); +INSERT INTO email (employeeid,address) VALUES (3, 'kim@gmail.com'); +INSERT INTO email (employeeid,address) VALUES (3, 'kim@outlook.com'); +INSERT INTO email (employeeid,address) VALUES (4, 'stephen@baeldung.com'); +INSERT INTO email (employeeid,address) VALUES (5, 'christian@gmail.com'); diff --git a/liquibase/README.md b/liquibase/README.md new file mode 100644 index 0000000000..0e5bfcb8a6 --- /dev/null +++ b/liquibase/README.md @@ -0,0 +1,2 @@ +### Relevant Articles: +- [Introduction to Liquibase Rollback](http://www.baeldung.com/liquibase-rollback) diff --git a/log-mdc/README.md b/log-mdc/README.md index be0b2670c3..3841224824 100644 --- a/log-mdc/README.md +++ b/log-mdc/README.md @@ -2,6 +2,7 @@ - TBD - [Improved Java Logging with Mapped Diagnostic Context (MDC)](http://www.baeldung.com/mdc-in-log4j-2-logback) - [Java Logging with Nested Diagnostic Context (NDC)](http://www.baeldung.com/java-logging-ndc-log4j) +- [Drools Using Rules from Excel Files](http://www.baeldung.com/drools-excel) ### References diff --git a/metrics/README.md b/metrics/README.md index c98024c479..09fe925604 100644 --- a/metrics/README.md +++ b/metrics/README.md @@ -1,3 +1,4 @@ ## Relevant articles: - [Intro to Dropwizard Metrics](http://www.baeldung.com/dropwizard-metrics) +- [Introduction to Netflix Servo](http://www.baeldung.com/netflix-servo) diff --git a/metrics/pom.xml b/metrics/pom.xml index 794c53b157..574c1ac132 100644 --- a/metrics/pom.xml +++ b/metrics/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 @@ -15,7 +15,7 @@ 3.1.2 3.1.0 - 0.12.16 + 0.12.17 @@ -44,10 +44,24 @@ javax.servlet-api ${dep.ver.servlet} + com.netflix.servo servo-core ${netflix.servo.ver} + test + + + com.netflix.servo + servo-atlas + ${netflix.servo.ver} + test + + + com.fasterxml.jackson.dataformat + jackson-dataformat-smile + 2.8.9 + test diff --git a/metrics/src/test/java/com/baeldung/metrics/servo/AtlasObserverLiveTest.java b/metrics/src/test/java/com/baeldung/metrics/servo/AtlasObserverLiveTest.java new file mode 100644 index 0000000000..cc2d3aa393 --- /dev/null +++ b/metrics/src/test/java/com/baeldung/metrics/servo/AtlasObserverLiveTest.java @@ -0,0 +1,95 @@ +package com.baeldung.metrics.servo; + +import com.netflix.servo.DefaultMonitorRegistry; +import com.netflix.servo.monitor.BasicCounter; +import com.netflix.servo.monitor.Counter; +import com.netflix.servo.monitor.MonitorConfig; +import com.netflix.servo.publish.BasicMetricFilter; +import com.netflix.servo.publish.MonitorRegistryMetricPoller; +import com.netflix.servo.publish.PollRunnable; +import com.netflix.servo.publish.PollScheduler; +import com.netflix.servo.publish.atlas.AtlasMetricObserver; +import com.netflix.servo.publish.atlas.BasicAtlasConfig; +import com.netflix.servo.tag.BasicTagList; +import org.apache.commons.lang.math.RandomUtils; +import org.apache.http.HttpEntity; +import org.apache.http.impl.client.HttpClients; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import java.io.BufferedReader; +import java.io.InputStreamReader; + +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.apache.http.client.methods.RequestBuilder.get; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.not; +import static org.junit.Assert.assertThat; + +/** + * @author aiet + */ +public class AtlasObserverLiveTest { + + private final String atlasUri = "http://localhost:7101/api/v1"; + + @Before + public void prepareScheduler() { + System.setProperty("servo.pollers", "1000"); + System.setProperty("servo.atlas.batchSize", "1"); + System.setProperty("servo.atlas.uri", atlasUri + "/publish"); + AtlasMetricObserver observer = new AtlasMetricObserver(new BasicAtlasConfig(), BasicTagList.of("servo", "counter")); + + PollRunnable task = new PollRunnable(new MonitorRegistryMetricPoller(), new BasicMetricFilter(true), observer); + PollScheduler + .getInstance() + .start(); + PollScheduler + .getInstance() + .addPoller(task, 1, SECONDS); + } + + @After + public void stopScheduler() { + if (PollScheduler + .getInstance() + .isStarted()) { + PollScheduler + .getInstance() + .stop(); + } + } + + private String atlasValuesOfTag(String tagname) throws Exception { + HttpEntity entity = HttpClients + .createDefault() + .execute(get() + .setUri(atlasUri + "/tags/" + tagname) + .build()) + .getEntity(); + return new BufferedReader(new InputStreamReader(entity.getContent())).readLine(); + } + + @Test + public void givenAtlasAndCounter_whenRegister_thenPublishedToAtlas() throws Exception { + Counter counter = new BasicCounter(MonitorConfig + .builder("test") + .withTag("servo", "counter") + .build()); + DefaultMonitorRegistry + .getInstance() + .register(counter); + assertThat(atlasValuesOfTag("servo"), not(containsString("counter"))); + + for (int i = 0; i < 3; i++) { + counter.increment(RandomUtils.nextInt(10)); + SECONDS.sleep(1); + counter.increment(-1 * RandomUtils.nextInt(10)); + SECONDS.sleep(1); + } + + assertThat(atlasValuesOfTag("servo"), containsString("counter")); + } + +} diff --git a/mockito/src/test/java/com/baeldung/powermockito/introduction/CollaboratorForPartialMocking.java b/mockito/src/test/java/com/baeldung/powermockito/introduction/CollaboratorForPartialMocking.java index 771444f13d..9a3bc8875b 100644 --- a/mockito/src/test/java/com/baeldung/powermockito/introduction/CollaboratorForPartialMocking.java +++ b/mockito/src/test/java/com/baeldung/powermockito/introduction/CollaboratorForPartialMocking.java @@ -1,12 +1,12 @@ package com.baeldung.powermockito.introduction; -public class CollaboratorForPartialMocking { +class CollaboratorForPartialMocking { - public static String staticMethod() { + static String staticMethod() { return "Hello Baeldung!"; } - public final String finalMethod() { + final String finalMethod() { return "Hello Baeldung!"; } @@ -14,7 +14,7 @@ public class CollaboratorForPartialMocking { return "Hello Baeldung!"; } - public String privateMethodCaller() { + String privateMethodCaller() { return privateMethod() + " Welcome to the Java world."; } } \ No newline at end of file diff --git a/mockito/src/test/java/com/baeldung/powermockito/introduction/CollaboratorWithFinalMethods.java b/mockito/src/test/java/com/baeldung/powermockito/introduction/CollaboratorWithFinalMethods.java index 8287454782..f748b6a6fc 100644 --- a/mockito/src/test/java/com/baeldung/powermockito/introduction/CollaboratorWithFinalMethods.java +++ b/mockito/src/test/java/com/baeldung/powermockito/introduction/CollaboratorWithFinalMethods.java @@ -1,8 +1,8 @@ package com.baeldung.powermockito.introduction; -public class CollaboratorWithFinalMethods { +class CollaboratorWithFinalMethods { - public final String helloMethod() { + final String helloMethod() { return "Hello World!"; } diff --git a/mockito/src/test/java/com/baeldung/powermockito/introduction/CollaboratorWithStaticMethods.java b/mockito/src/test/java/com/baeldung/powermockito/introduction/CollaboratorWithStaticMethods.java index 2795ae97f1..1f416aefa7 100644 --- a/mockito/src/test/java/com/baeldung/powermockito/introduction/CollaboratorWithStaticMethods.java +++ b/mockito/src/test/java/com/baeldung/powermockito/introduction/CollaboratorWithStaticMethods.java @@ -1,16 +1,16 @@ package com.baeldung.powermockito.introduction; -public class CollaboratorWithStaticMethods { +class CollaboratorWithStaticMethods { - public static String firstMethod(String name) { + static String firstMethod(String name) { return "Hello " + name + " !"; } - public static String secondMethod() { + static String secondMethod() { return "Hello no one!"; } - public static String thirdMethod() { + static String thirdMethod() { return "Hello no one again!"; } } \ No newline at end of file diff --git a/mockito/src/test/java/org/baeldung/mockito/MockitoAnnotationIntegrationTest.java b/mockito/src/test/java/org/baeldung/mockito/MockitoAnnotationIntegrationTest.java index 4e090e6652..5e083adbf5 100644 --- a/mockito/src/test/java/org/baeldung/mockito/MockitoAnnotationIntegrationTest.java +++ b/mockito/src/test/java/org/baeldung/mockito/MockitoAnnotationIntegrationTest.java @@ -17,7 +17,7 @@ public class MockitoAnnotationIntegrationTest { private List mockedList; @Spy - List spiedList = new ArrayList(); + private List spiedList = new ArrayList<>(); @Before public void init() { @@ -87,6 +87,7 @@ public class MockitoAnnotationIntegrationTest { } @Captor + private ArgumentCaptor argCaptor; @Test @@ -98,10 +99,10 @@ public class MockitoAnnotationIntegrationTest { } @Mock - Map wordMap; + private Map wordMap; @InjectMocks - MyDictionary dic = new MyDictionary(); + private MyDictionary dic = new MyDictionary(); @Test public void whenUseInjectMocksAnnotation_thenCorrect() { diff --git a/mockito/src/test/java/org/baeldung/mockito/MockitoMockIntegrationTest.java b/mockito/src/test/java/org/baeldung/mockito/MockitoMockIntegrationTest.java index 6ec3b34db5..f846907fd7 100644 --- a/mockito/src/test/java/org/baeldung/mockito/MockitoMockIntegrationTest.java +++ b/mockito/src/test/java/org/baeldung/mockito/MockitoMockIntegrationTest.java @@ -24,7 +24,7 @@ public class MockitoMockIntegrationTest { } @Rule - public ExpectedException thrown = ExpectedException.none(); + private ExpectedException thrown = ExpectedException.none(); @Test public void whenUsingSimpleMock_thenCorrect() { diff --git a/mockito/src/test/java/org/baeldung/mockito/MyDictionary.java b/mockito/src/test/java/org/baeldung/mockito/MyDictionary.java index a613b28f59..8a0ea92502 100644 --- a/mockito/src/test/java/org/baeldung/mockito/MyDictionary.java +++ b/mockito/src/test/java/org/baeldung/mockito/MyDictionary.java @@ -3,19 +3,19 @@ package org.baeldung.mockito; import java.util.HashMap; import java.util.Map; -public class MyDictionary { +class MyDictionary { - Map wordMap; + private Map wordMap; - public MyDictionary() { - wordMap = new HashMap(); + MyDictionary() { + wordMap = new HashMap<>(); } public void add(final String word, final String meaning) { wordMap.put(word, meaning); } - public String getMeaning(final String word) { + String getMeaning(final String word) { return wordMap.get(word); } } diff --git a/mockito/src/test/java/org/baeldung/mockito/MyList.java b/mockito/src/test/java/org/baeldung/mockito/MyList.java index 548596e6b6..be69ef8a8a 100644 --- a/mockito/src/test/java/org/baeldung/mockito/MyList.java +++ b/mockito/src/test/java/org/baeldung/mockito/MyList.java @@ -2,7 +2,7 @@ package org.baeldung.mockito; import java.util.AbstractList; -public class MyList extends AbstractList { +class MyList extends AbstractList { @Override public String get(final int index) { diff --git a/pom.xml b/pom.xml index 818d131359..d01134fb30 100644 --- a/pom.xml +++ b/pom.xml @@ -25,6 +25,7 @@ + spring-activiti aws akka-streams algorithms @@ -57,6 +58,7 @@ guava guava18 guava19 + guava21 guice disruptor diff --git a/selenium-junit-testng/README.md b/selenium-junit-testng/README.md index cc1b728287..29393b956b 100644 --- a/selenium-junit-testng/README.md +++ b/selenium-junit-testng/README.md @@ -1,3 +1,4 @@ ### Relevant Articles: - [Guide to Selenium with JUnit / TestNG](http://www.baeldung.com/java-selenium-with-junit-and-testng) - [Testing a Site with Selenium / Webdriver](http://www.baeldung.com) +- [Testing with Selenium/WebDriver and the Page Object Pattern](http://www.baeldung.com/selenium-webdriver-page-object) diff --git a/spring-5-mvc/README.md b/spring-5-mvc/README.md new file mode 100644 index 0000000000..c031a9d10e --- /dev/null +++ b/spring-5-mvc/README.md @@ -0,0 +1,2 @@ +### Relevant Articles: +- [Spring Boot and Kotlin](http://www.baeldung.com/spring-boot-kotlin) diff --git a/spring-5/README.md b/spring-5/README.md index 510ee45f03..03b8121f90 100644 --- a/spring-5/README.md +++ b/spring-5/README.md @@ -7,4 +7,6 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Concurrent Test Execution in Spring 5](http://www.baeldung.com/spring-5-concurrent-tests) - [Introduction to the Functional Web Framework in Spring 5](http://www.baeldung.com/spring-5-functional-web) -- [Exploring the Spring MVC URL Matching Improvements](http://www.baeldung.com/spring-mvc-url-matching) +- [Exploring the Spring 5 MVC URL Matching Improvements](http://www.baeldung.com/spring-5-mvc-url-matching) + + diff --git a/spring-activiti/pom.xml b/spring-activiti/pom.xml new file mode 100644 index 0000000000..3d2f1386df --- /dev/null +++ b/spring-activiti/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + + com.example + spring-activiti + 0.0.1-SNAPSHOT + jar + + spring-activiti + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 1.5.4.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.activiti + activiti-spring-boot-starter-basic + 6.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + + com.h2database + h2 + runtime + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git a/spring-activiti/src/main/java/com/example/activitiwithspring/ActivitiController.java b/spring-activiti/src/main/java/com/example/activitiwithspring/ActivitiController.java new file mode 100644 index 0000000000..3924d31f68 --- /dev/null +++ b/spring-activiti/src/main/java/com/example/activitiwithspring/ActivitiController.java @@ -0,0 +1,60 @@ +package com.example.activitiwithspring; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +import org.activiti.engine.RuntimeService; +import org.activiti.engine.TaskService; +import org.activiti.engine.task.Task; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class ActivitiController { + private static final Logger logger = LoggerFactory.getLogger(ActivitiController.class); + @Autowired + private RuntimeService runtimeService; + + @Autowired + private TaskService taskService; + + @GetMapping("/start-process") + public String startProcess() { + runtimeService.startProcessInstanceByKey("my-process"); + return "Process started. Number of currently running process instances = " + runtimeService.createProcessInstanceQuery() + .count(); + } + + @GetMapping("/get-tasks/{processInstanceId}") + public List getTasks(@PathVariable String processInstanceId) { + List usertasks = taskService.createTaskQuery() + .processInstanceId(processInstanceId) + .list(); + + List tasks = usertasks.stream().map(task -> { + TaskRepresentation taskRepresentation = new TaskRepresentation(task.getId(), task.getName(), task.getProcessInstanceId()); + return taskRepresentation; + }).collect(Collectors.toList()); + return tasks; + } + + @GetMapping("/complete-task-A/{processInstanceId}") + public TaskRepresentation completeTaskA(@PathVariable String processInstanceId) { + Task task = taskService.createTaskQuery() + .processInstanceId(processInstanceId) + .singleResult(); + taskService.complete(task.getId()); + logger.info("Task completed"); + task = taskService.createTaskQuery() + .processInstanceId(processInstanceId) + .singleResult(); + + return new TaskRepresentation(task.getId(), task.getName(), task.getProcessInstanceId()); + } +} diff --git a/spring-activiti/src/main/java/com/example/activitiwithspring/ActivitiWithSpringApplication.java b/spring-activiti/src/main/java/com/example/activitiwithspring/ActivitiWithSpringApplication.java new file mode 100644 index 0000000000..e98b8ad7ca --- /dev/null +++ b/spring-activiti/src/main/java/com/example/activitiwithspring/ActivitiWithSpringApplication.java @@ -0,0 +1,12 @@ +package com.example.activitiwithspring; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class ActivitiWithSpringApplication { + + public static void main(String[] args) { + SpringApplication.run(ActivitiWithSpringApplication.class, args); + } +} diff --git a/spring-activiti/src/main/java/com/example/activitiwithspring/TaskRepresentation.java b/spring-activiti/src/main/java/com/example/activitiwithspring/TaskRepresentation.java new file mode 100644 index 0000000000..bb1412b057 --- /dev/null +++ b/spring-activiti/src/main/java/com/example/activitiwithspring/TaskRepresentation.java @@ -0,0 +1,43 @@ +package com.example.activitiwithspring; + +class TaskRepresentation { + + private String id; + private String name; + private String processInstanceId; + + public TaskRepresentation() { + super(); + } + + public TaskRepresentation(String id, String name, String processInstanceId) { + this.id = id; + this.name = name; + this.processInstanceId = processInstanceId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getProcessInstanceId() { + return processInstanceId; + } + + public void setProcessInstanceId(String processInstanceId) { + this.processInstanceId = processInstanceId; + } + +} diff --git a/spring-activiti/src/main/resources/processes/my-process.bpmn20.xml b/spring-activiti/src/main/resources/processes/my-process.bpmn20.xml new file mode 100644 index 0000000000..3ced8d6b7c --- /dev/null +++ b/spring-activiti/src/main/resources/processes/my-process.bpmn20.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-activiti/src/test/java/com/example/activitiwithspring/ActivitiControllerTest.java b/spring-activiti/src/test/java/com/example/activitiwithspring/ActivitiControllerTest.java new file mode 100644 index 0000000000..3176207664 --- /dev/null +++ b/spring-activiti/src/test/java/com/example/activitiwithspring/ActivitiControllerTest.java @@ -0,0 +1,120 @@ +package com.example.activitiwithspring; + +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; +import java.util.List; + +import org.activiti.engine.RuntimeService; +import org.activiti.engine.runtime.ProcessInstance; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.web.WebAppConfiguration; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.web.context.WebApplicationContext; + +import com.fasterxml.jackson.databind.ObjectMapper; + +@RunWith(SpringJUnit4ClassRunner.class) +@WebAppConfiguration +@SpringBootTest +public class ActivitiControllerTest { + private static final Logger logger = LoggerFactory.getLogger(ActivitiControllerTest.class); + private MockMvc mockMvc; + + @Autowired + private WebApplicationContext wac; + + @Autowired + RuntimeService runtimeService; + + @Before + public void setUp() { + this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac) + .build(); + + for (ProcessInstance instance : runtimeService.createProcessInstanceQuery() + .list()) { + runtimeService.deleteProcessInstance(instance.getId(), "Reset Processes"); + } + } + + @Test + public void givenProcess_whenStartProcess_thenIncreaseInProcessInstanceCount() throws Exception { + + String responseBody = this.mockMvc.perform(MockMvcRequestBuilders.get("/start-process")) + .andReturn() + .getResponse() + .getContentAsString(); + assertEquals("Process started. Number of currently running process instances = 1", responseBody); + + responseBody = this.mockMvc.perform(MockMvcRequestBuilders.get("/start-process")) + .andReturn() + .getResponse() + .getContentAsString(); + assertEquals("Process started. Number of currently running process instances = 2", responseBody); + + responseBody = this.mockMvc.perform(MockMvcRequestBuilders.get("/start-process")) + .andReturn() + .getResponse() + .getContentAsString(); + assertEquals("Process started. Number of currently running process instances = 3", responseBody); + } + + @Test + public void givenProcess_whenProcessInstance_thenReceivedRunningTask() throws Exception { + + this.mockMvc.perform(MockMvcRequestBuilders.get("/start-process")) + .andReturn() + .getResponse(); + ProcessInstance pi = runtimeService.createProcessInstanceQuery() + .orderByProcessInstanceId() + .desc() + .list() + .get(0); + + logger.info("process instance = " + pi.getId()); + String responseBody = this.mockMvc.perform(MockMvcRequestBuilders.get("/get-tasks/" + pi.getId())) + .andReturn() + .getResponse() + .getContentAsString(); + + ObjectMapper mapper = new ObjectMapper(); + List tasks = Arrays.asList(mapper.readValue(responseBody, TaskRepresentation[].class)); + assertEquals(1, tasks.size()); + assertEquals("A", tasks.get(0).getName()); + + } + + @Test + public void givenProcess_whenCompleteTaskA_thenReceivedNextTask() throws Exception { + + this.mockMvc.perform(MockMvcRequestBuilders.get("/start-process")) + .andReturn() + .getResponse(); + ProcessInstance pi = runtimeService.createProcessInstanceQuery() + .orderByProcessInstanceId() + .desc() + .list() + .get(0); + + logger.info("process instance = " + pi.getId()); + String responseBody = this.mockMvc.perform(MockMvcRequestBuilders.get("/complete-task-A/" + pi.getId())) + .andReturn() + .getResponse() + .getContentAsString(); + + ObjectMapper mapper = new ObjectMapper(); + TaskRepresentation task = mapper.readValue(responseBody, TaskRepresentation.class); + assertEquals("B", task.getName()); + + } +} diff --git a/spring-activiti/src/test/java/com/example/activitiwithspring/ActivitiWithSpringApplicationTests.java b/spring-activiti/src/test/java/com/example/activitiwithspring/ActivitiWithSpringApplicationTests.java new file mode 100644 index 0000000000..da22c6c7fa --- /dev/null +++ b/spring-activiti/src/test/java/com/example/activitiwithspring/ActivitiWithSpringApplicationTests.java @@ -0,0 +1,16 @@ +package com.example.activitiwithspring; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class ActivitiWithSpringApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git a/spring-all/src/main/resources/beanInjection-setter.xml b/spring-all/src/main/resources/beanInjection-setter.xml index b07826c31e..b2d3a05594 100644 --- a/spring-all/src/main/resources/beanInjection-setter.xml +++ b/spring-all/src/main/resources/beanInjection-setter.xml @@ -11,5 +11,4 @@ - \ No newline at end of file diff --git a/spring-boot-bootstrap/README.md b/spring-boot-bootstrap/README.md new file mode 100644 index 0000000000..75a2b35be7 --- /dev/null +++ b/spring-boot-bootstrap/README.md @@ -0,0 +1,2 @@ +### Relevant Articles: +- [Bootstrap a Simple Application using Spring Boot](http://www.baeldung.com/spring-boot-start) diff --git a/spring-boot/README.MD b/spring-boot/README.MD index 9a4a9f3686..e837c88804 100644 --- a/spring-boot/README.MD +++ b/spring-boot/README.MD @@ -23,4 +23,7 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Create a Custom Auto-Configuration with Spring Boot](http://www.baeldung.com/spring-boot-custom-auto-configuration) - [Testing in Spring Boot](http://www.baeldung.com/spring-boot-testing) - [Guide to @ConfigurationProperties in Spring Boot](http://www.baeldung.com/configuration-properties-in-spring-boot) +- [How to Get All Spring-Managed Beans?](http://www.baeldung.com/spring-show-all-beans) +- [A Java Client for a WebSockets API](http://www.baeldung.com/websockets-api-java-spring-client) - [Spring Boot and Togglz Aspect](http://www.baeldung.com/spring-togglz) + diff --git a/spring-boot/src/test/java/org/baeldung/boot/boottest/JsonUtil.java b/spring-boot/src/test/java/org/baeldung/boot/boottest/JsonUtil.java index 3d532ce54a..8c7e5576ce 100644 --- a/spring-boot/src/test/java/org/baeldung/boot/boottest/JsonUtil.java +++ b/spring-boot/src/test/java/org/baeldung/boot/boottest/JsonUtil.java @@ -5,8 +5,8 @@ import java.io.IOException; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.ObjectMapper; -public class JsonUtil { - public static byte[] toJson(Object object) throws IOException { +class JsonUtil { + static byte[] toJson(Object object) throws IOException { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); return mapper.writeValueAsBytes(object); diff --git a/spring-cloud-bus/spring-cloud-config-client/pom.xml b/spring-cloud-bus/spring-cloud-config-client/pom.xml new file mode 100644 index 0000000000..977f18b17f --- /dev/null +++ b/spring-cloud-bus/spring-cloud-config-client/pom.xml @@ -0,0 +1,81 @@ + + + 4.0.0 + + com.baeldung.spring.cloud + spring-cloud-config-client + 0.0.1-SNAPSHOT + jar + + spring-cloud-config-client + Demo Spring Cloud Config Client + + + org.springframework.boot + spring-boot-starter-parent + 1.5.4.RELEASE + + + + UTF-8 + UTF-8 + 1.8 + Dalston.SR1 + + + + + org.springframework.cloud + spring-cloud-starter-config + 1.3.1.RELEASE + + + org.springframework.boot + spring-boot-starter-web + 1.5.4.RELEASE + + + + org.springframework.boot + spring-boot-starter-test + 1.5.4.RELEASE + test + + + + org.springframework.boot + spring-boot-actuator + 1.5.4.RELEASE + + + + org.springframework.cloud + spring-cloud-starter-bus-amqp + 1.3.1.RELEASE + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + 1.5.4.RELEASE + + + + + diff --git a/spring-cloud-bus/spring-cloud-config-client/src/main/java/com/baeldung/SpringCloudConfigClientApplication.java b/spring-cloud-bus/spring-cloud-config-client/src/main/java/com/baeldung/SpringCloudConfigClientApplication.java new file mode 100644 index 0000000000..d0afd7f6bf --- /dev/null +++ b/spring-cloud-bus/spring-cloud-config-client/src/main/java/com/baeldung/SpringCloudConfigClientApplication.java @@ -0,0 +1,32 @@ +package com.baeldung; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.context.config.annotation.RefreshScope; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +@SpringBootApplication +@RestController +@RefreshScope +public class SpringCloudConfigClientApplication { + + @Value("${user.role}") + private String role; + + @Value("${user.password}") + private String password; + + public static void main(String[] args) { + SpringApplication.run(SpringCloudConfigClientApplication.class, args); + } + + @RequestMapping(value = "/whoami/{username}", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE) + public String whoami(@PathVariable("username") String username) { + return String.format("Hello %s! You are a(n) %s and your password is '%s'.\n", username, role, password); + } +} diff --git a/spring-cloud-bus/spring-cloud-config-client/src/main/resources/application.yml b/spring-cloud-bus/spring-cloud-config-client/src/main/resources/application.yml new file mode 100644 index 0000000000..547e0284f3 --- /dev/null +++ b/spring-cloud-bus/spring-cloud-config-client/src/main/resources/application.yml @@ -0,0 +1,7 @@ +--- +spring: + rabbitmq: + host: localhost + port: 5672 + username: guest + password: guest \ No newline at end of file diff --git a/spring-cloud-bus/spring-cloud-config-client/src/main/resources/bootstrap.properties b/spring-cloud-bus/spring-cloud-config-client/src/main/resources/bootstrap.properties new file mode 100644 index 0000000000..7b362614ba --- /dev/null +++ b/spring-cloud-bus/spring-cloud-config-client/src/main/resources/bootstrap.properties @@ -0,0 +1,7 @@ +spring.application.name=config-client +spring.profiles.active=development +spring.cloud.config.uri=http://localhost:8888 +spring.cloud.config.username=root +spring.cloud.config.password=s3cr3t +spring.cloud.config.fail-fast=true +management.security.enabled=false \ No newline at end of file diff --git a/spring-cloud-bus/spring-cloud-config-client/src/test/java/com/baeldung/SpringCloudConfigClientApplicationTests.java b/spring-cloud-bus/spring-cloud-config-client/src/test/java/com/baeldung/SpringCloudConfigClientApplicationTests.java new file mode 100644 index 0000000000..3b361f385a --- /dev/null +++ b/spring-cloud-bus/spring-cloud-config-client/src/test/java/com/baeldung/SpringCloudConfigClientApplicationTests.java @@ -0,0 +1,16 @@ +package com.baeldung; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class SpringCloudConfigClientApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git a/spring-cloud-bus/spring-cloud-config-server/pom.xml b/spring-cloud-bus/spring-cloud-config-server/pom.xml new file mode 100644 index 0000000000..e37f601d2c --- /dev/null +++ b/spring-cloud-bus/spring-cloud-config-server/pom.xml @@ -0,0 +1,82 @@ + + + 4.0.0 + + com.baeldung.spring.cloud + spring-cloud-config-server + 0.0.1-SNAPSHOT + jar + + spring-cloud-config-server + Demo Spring Cloud Config Server + + + org.springframework.boot + spring-boot-starter-parent + 1.5.4.RELEASE + + + + UTF-8 + UTF-8 + 1.8 + Dalston.SR1 + + + + + org.springframework.cloud + spring-cloud-config-server + 1.3.1.RELEASE + + + + org.springframework.boot + spring-boot-starter-security + 1.5.4.RELEASE + + + + org.springframework.boot + spring-boot-starter-test + 1.5.4.RELEASE + test + + + + org.springframework.cloud + spring-cloud-config-monitor + 1.3.1.RELEASE + + + + org.springframework.cloud + spring-cloud-starter-stream-rabbit + 1.2.1.RELEASE + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + 1.5.4.RELEASE + + + + + diff --git a/spring-cloud-bus/spring-cloud-config-server/src/main/java/com/baeldung/SpringCloudConfigServerApplication.java b/spring-cloud-bus/spring-cloud-config-server/src/main/java/com/baeldung/SpringCloudConfigServerApplication.java new file mode 100644 index 0000000000..4feace7c89 --- /dev/null +++ b/spring-cloud-bus/spring-cloud-config-server/src/main/java/com/baeldung/SpringCloudConfigServerApplication.java @@ -0,0 +1,14 @@ +package com.baeldung; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.config.server.EnableConfigServer; + +@SpringBootApplication +@EnableConfigServer +public class SpringCloudConfigServerApplication { + + public static void main(String[] args) { + SpringApplication.run(SpringCloudConfigServerApplication.class, args); + } +} diff --git a/spring-cloud-bus/spring-cloud-config-server/src/main/resources/application.properties b/spring-cloud-bus/spring-cloud-config-server/src/main/resources/application.properties new file mode 100644 index 0000000000..4c18c192c0 --- /dev/null +++ b/spring-cloud-bus/spring-cloud-config-server/src/main/resources/application.properties @@ -0,0 +1,12 @@ +server.port=8888 +spring.cloud.config.server.git.uri= +security.user.name=root +security.user.password=s3cr3t +encrypt.key-store.location=classpath:/config-server.jks +encrypt.key-store.password=my-s70r3-s3cr3t +encrypt.key-store.alias=config-server-key +encrypt.key-store.secret=my-k34-s3cr3t +spring.rabbitmq.host=localhost +spring.rabbitmq.port=5672 +spring.rabbitmq.username=guest +spring.rabbitmq.password=guest \ No newline at end of file diff --git a/spring-cloud-bus/spring-cloud-config-server/src/main/resources/config-server.jks b/spring-cloud-bus/spring-cloud-config-server/src/main/resources/config-server.jks new file mode 100644 index 0000000000..f3dddb4a8f Binary files /dev/null and b/spring-cloud-bus/spring-cloud-config-server/src/main/resources/config-server.jks differ diff --git a/spring-cloud-bus/spring-cloud-config-server/src/test/java/com/baeldung/SpringCloudConfigServerApplicationTests.java b/spring-cloud-bus/spring-cloud-config-server/src/test/java/com/baeldung/SpringCloudConfigServerApplicationTests.java new file mode 100644 index 0000000000..3969c7ba2d --- /dev/null +++ b/spring-cloud-bus/spring-cloud-config-server/src/test/java/com/baeldung/SpringCloudConfigServerApplicationTests.java @@ -0,0 +1,16 @@ +package com.baeldung; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class SpringCloudConfigServerApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git a/spring-cloud/spring-cloud-bootstrap/README.MD b/spring-cloud/spring-cloud-bootstrap/README.MD index a174fba3dd..164219c185 100644 --- a/spring-cloud/spring-cloud-bootstrap/README.MD +++ b/spring-cloud/spring-cloud-bootstrap/README.MD @@ -2,9 +2,9 @@ - [Spring Cloud – Bootstrapping](http://www.baeldung.com/spring-cloud-bootstrapping) - [Spring Cloud – Securing Services](http://www.baeldung.com/spring-cloud-securing-services) - [Spring Cloud – Tracing Services with Zipkin](http://www.baeldung.com/tracing-services-with-zipkin) +- [Spring Cloud Series – The Gateway Pattern](http://www.baeldung.com/spring-cloud-gateway-pattern) - [Spring Cloud – Adding Angular 4](http://www.baeldung.com/spring-cloud-angular) - - To run the project: - copy the appliction-config folder to c:\Users\{username}\ on Windows or /Users/{username}/ on *nix. Then open a git bash terminal in application-config and run: - git init diff --git a/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml b/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml index 7879031a2a..736a6114cf 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml @@ -1,78 +1,87 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.baeldung.spring.cloud - svc-rating - 1.0.0-SNAPSHOT + com.baeldung.spring.cloud + svc-rating + 1.0.0-SNAPSHOT - - parent-boot-4 - com.baeldung - 0.0.1-SNAPSHOT - ../../../parent-boot-4 - + + parent-boot-4 + com.baeldung + 0.0.1-SNAPSHOT + ../../../parent-boot-4 + - - - org.springframework.cloud - spring-cloud-starter-config - - - org.springframework.cloud - spring-cloud-starter-eureka - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-security - + + + org.springframework.cloud + spring-cloud-starter-config + + + org.springframework.cloud + spring-cloud-starter-eureka + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-security + - - org.springframework.session - spring-session - - - org.springframework.boot - spring-boot-starter-data-redis - + + org.springframework.session + spring-session + + + org.springframework.boot + spring-boot-starter-data-redis + - - org.springframework.boot - spring-boot-starter-data-jpa - + + org.springframework.boot + spring-boot-starter-data-jpa + - - com.h2database - h2 - runtime - + + org.springframework.cloud + spring-cloud-starter-hystrix + + + org.springframework.boot + spring-boot-starter-actuator + - - org.springframework.cloud - spring-cloud-starter-zipkin - + + com.h2database + h2 + runtime + - + + org.springframework.cloud + spring-cloud-starter-zipkin + - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud-dependencies.version} - pom - import - - - + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud-dependencies.version} + pom + import + + + + + + Brixton.SR7 + - - Brixton.SR7 - - \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/RatingServiceApplication.java b/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/RatingServiceApplication.java index 0d85c5c825..31ca69c139 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/RatingServiceApplication.java +++ b/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/RatingServiceApplication.java @@ -1,21 +1,32 @@ package com.baeldung.spring.cloud.bootstrap.svcrating; -import com.netflix.appinfo.InstanceInfo; -import com.netflix.discovery.EurekaClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; +import org.springframework.cloud.netflix.hystrix.EnableHystrix; import org.springframework.cloud.sleuth.metric.SpanMetricReporter; import org.springframework.cloud.sleuth.zipkin.HttpZipkinSpanReporter; import org.springframework.cloud.sleuth.zipkin.ZipkinProperties; import org.springframework.cloud.sleuth.zipkin.ZipkinSpanReporter; +import org.springframework.context.annotation.AdviceMode; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Primary; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +import com.netflix.appinfo.InstanceInfo; +import com.netflix.discovery.EurekaClient; +import com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect; + import zipkin.Span; @SpringBootApplication @EnableEurekaClient +@EnableHystrix +@EnableTransactionManagement(order=Ordered.LOWEST_PRECEDENCE, mode=AdviceMode.ASPECTJ) public class RatingServiceApplication { @Autowired private EurekaClient eurekaClient; @@ -48,4 +59,11 @@ public class RatingServiceApplication { } }; } + + @Bean + @Primary + @Order(value=Ordered.HIGHEST_PRECEDENCE) + public HystrixCommandAspect hystrixAspect() { + return new HystrixCommandAspect(); + } } \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/SecurityConfig.java b/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/SecurityConfig.java index 171fbba7af..9b6afc8059 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/SecurityConfig.java +++ b/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/SecurityConfig.java @@ -20,17 +20,20 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { - http.httpBasic() - .disable() + http .authorizeRequests() .regexMatchers("^/ratings\\?bookId.*$").authenticated() .antMatchers(HttpMethod.POST,"/ratings").authenticated() .antMatchers(HttpMethod.PATCH,"/ratings/*").hasRole("ADMIN") .antMatchers(HttpMethod.DELETE,"/ratings/*").hasRole("ADMIN") .antMatchers(HttpMethod.GET,"/ratings").hasRole("ADMIN") + .antMatchers(HttpMethod.GET,"/hystrix").authenticated() .anyRequest().authenticated() .and() + .httpBasic().and() .csrf() .disable(); + + } } diff --git a/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/SessionConfig.java b/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/SessionConfig.java index 62bc701868..6e8fcd10d4 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/SessionConfig.java +++ b/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/SessionConfig.java @@ -1,10 +1,28 @@ package com.baeldung.spring.cloud.bootstrap.svcrating; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.core.env.Environment; +import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; import org.springframework.session.web.context.AbstractHttpSessionApplicationInitializer; @Configuration @EnableRedisHttpSession public class SessionConfig extends AbstractHttpSessionApplicationInitializer { + @Autowired + Environment properties; + + @Bean + @Primary + public JedisConnectionFactory connectionFactory() { + JedisConnectionFactory factory = new JedisConnectionFactory(); + factory.setHostName(properties.getProperty("spring.redis.host","localhost")); + factory.setPort(properties.getProperty("spring.redis.port", Integer.TYPE,6379)); + factory.afterPropertiesSet(); + factory.setUsePool(true); + return factory; + } } diff --git a/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/rating/Rating.java b/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/rating/Rating.java index c37099f3c1..2c7069926c 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/rating/Rating.java +++ b/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/rating/Rating.java @@ -1,22 +1,34 @@ package com.baeldung.spring.cloud.bootstrap.svcrating.rating; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.Transient; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @Entity @JsonIgnoreProperties(ignoreUnknown = true) -public class Rating { +public class Rating implements Serializable { + /** + * + */ + private static final long serialVersionUID = 3308900941650386473L; @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private Long bookId; private int stars; + @Transient + private boolean fromCache; + @Transient + private Long cachedTS = -1L; + public Rating() { } @@ -54,4 +66,21 @@ public class Rating { public void setStars(int stars) { this.stars = stars; } + + public boolean isFromCache() { + return fromCache; + } + + public void setFromCache(boolean fromCache) { + this.fromCache = fromCache; + } + + public Long getCachedTS() { + return cachedTS; + } + + public void setCachedTS(Long cachedTS) { + this.cachedTS = cachedTS; + } + } diff --git a/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/rating/RatingCacheRepository.java b/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/rating/RatingCacheRepository.java new file mode 100644 index 0000000000..d9f3a3584e --- /dev/null +++ b/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/rating/RatingCacheRepository.java @@ -0,0 +1,118 @@ +package com.baeldung.spring.cloud.bootstrap.svcrating.rating; + +import java.io.IOException; +import java.util.List; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; +import org.springframework.data.redis.core.SetOperations; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.core.ValueOperations; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.stereotype.Repository; + +@Repository +public class RatingCacheRepository implements InitializingBean { + + @Autowired + private JedisConnectionFactory cacheConnectionFactory; + + private StringRedisTemplate redisTemplate; + private ValueOperations valueOps; + private SetOperations setOps; + + private ObjectMapper jsonMapper; + + public List findCachedRatingsByBookId(Long bookId) { + return setOps.members("book-" + bookId) + .stream() + .map(rtId -> { + try { + return jsonMapper.readValue(valueOps.get(rtId), Rating.class); + } catch (IOException ex) { + return null; + } + }) + .collect(Collectors.toList()); + } + + public Rating findCachedRatingById(Long ratingId) { + + try { + return jsonMapper.readValue(valueOps.get("rating-" + ratingId), Rating.class); + } catch (IOException e) { + return null; + } + + } + + public List findAllCachedRatings() { + List ratings = null; + + ratings = redisTemplate.keys("rating*") + .stream() + .map(rtId -> { + try { + + return jsonMapper.readValue(valueOps.get(rtId), Rating.class); + + } catch (IOException e) { + return null; + } + }) + .collect(Collectors.toList()); + + return ratings; + } + + public boolean createRating(Rating persisted) { + try { + valueOps.set("rating-" + persisted.getId(), jsonMapper.writeValueAsString(persisted)); + setOps.add("book-" + persisted.getBookId(), "rating-" + persisted.getId()); + return true; + } catch (JsonProcessingException ex) { + return false; + } + } + + public boolean updateRating(Rating persisted) { + try { + valueOps.set("rating-" + persisted.getId(), jsonMapper.writeValueAsString(persisted)); + return true; + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + return false; + } + + public boolean deleteRating(Long ratingId) { + Rating toDel; + try { + + toDel = jsonMapper.readValue(valueOps.get("rating-" + ratingId), Rating.class); + setOps.remove("book-" + toDel.getBookId(), "rating-" + ratingId); + redisTemplate.delete("rating-" + ratingId); + return true; + } catch (IOException e) { + e.printStackTrace(); + } + return false; + } + + @Override + public void afterPropertiesSet() throws Exception { + + this.redisTemplate = new StringRedisTemplate(cacheConnectionFactory); + + this.valueOps = redisTemplate.opsForValue(); + this.setOps = redisTemplate.opsForSet(); + + jsonMapper = new ObjectMapper(); + jsonMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + } +} \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/rating/RatingService.java b/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/rating/RatingService.java index 6ab5e0acff..395ff50bd7 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/rating/RatingService.java +++ b/spring-cloud/spring-cloud-bootstrap/svc-rating/src/main/java/com/baeldung/spring/cloud/bootstrap/svcrating/rating/RatingService.java @@ -1,14 +1,16 @@ package com.baeldung.spring.cloud.bootstrap.svcrating.rating; -import com.google.common.base.Preconditions; +import java.util.List; +import java.util.Map; +import java.util.Optional; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import com.google.common.base.Preconditions; +import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; @Service @Transactional(readOnly = true) @@ -17,30 +19,51 @@ public class RatingService { @Autowired private RatingRepository ratingRepository; + @Autowired + private RatingCacheRepository cacheRepository; + + @HystrixCommand(commandKey = "ratingsByBookIdFromDB", fallbackMethod = "findCachedRatingsByBookId") + public List findRatingsByBookId(Long bookId) { + return ratingRepository.findRatingsByBookId(bookId); + } + + public List findCachedRatingsByBookId(Long bookId) { + return cacheRepository.findCachedRatingsByBookId(bookId); + } + + @HystrixCommand(commandKey = "ratingsFromDB", fallbackMethod = "findAllCachedRatings") + public List findAllRatings() { + return ratingRepository.findAll(); + } + + public List findAllCachedRatings() { + return cacheRepository.findAllCachedRatings(); + } + + @HystrixCommand(commandKey = "ratingsByIdFromDB", fallbackMethod = "findCachedRatingById", ignoreExceptions = { RatingNotFoundException.class }) public Rating findRatingById(Long ratingId) { return Optional.ofNullable(ratingRepository.findOne(ratingId)) .orElseThrow(() -> new RatingNotFoundException("Rating not found. ID: " + ratingId)); } - public List findRatingsByBookId(Long bookId) { - return ratingRepository.findRatingsByBookId(bookId); - } - - public List findAllRatings() { - return ratingRepository.findAll(); + public Rating findCachedRatingById(Long ratingId) { + return cacheRepository.findCachedRatingById(ratingId); } @Transactional(propagation = Propagation.REQUIRED) public Rating createRating(Rating rating) { - final Rating newRating = new Rating(); + Rating newRating = new Rating(); newRating.setBookId(rating.getBookId()); newRating.setStars(rating.getStars()); - return ratingRepository.save(newRating); + Rating persisted = ratingRepository.save(newRating); + cacheRepository.createRating(persisted); + return persisted; } @Transactional(propagation = Propagation.REQUIRED) public void deleteRating(Long ratingId) { ratingRepository.delete(ratingId); + cacheRepository.deleteRating(ratingId); } @Transactional(propagation = Propagation.REQUIRED) @@ -54,7 +77,9 @@ public class RatingService { break; } }); - return ratingRepository.save(rating); + Rating persisted = ratingRepository.save(rating); + cacheRepository.updateRating(persisted); + return persisted; } @Transactional(propagation = Propagation.REQUIRED) @@ -64,4 +89,5 @@ public class RatingService { Preconditions.checkNotNull(ratingRepository.findOne(ratingId)); return ratingRepository.save(rating); } + } diff --git a/spring-data-mongodb/src/main/java/org/baeldung/annotation/CascadeSave.java b/spring-data-mongodb/src/main/java/org/baeldung/annotation/CascadeSave.java index 9fba40245b..aae0214d09 100644 --- a/spring-data-mongodb/src/main/java/org/baeldung/annotation/CascadeSave.java +++ b/spring-data-mongodb/src/main/java/org/baeldung/annotation/CascadeSave.java @@ -8,5 +8,4 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface CascadeSave { - } diff --git a/spring-data-mongodb/src/main/java/org/baeldung/config/MongoConfig.java b/spring-data-mongodb/src/main/java/org/baeldung/config/MongoConfig.java index 6910245b2b..80b177f4c9 100644 --- a/spring-data-mongodb/src/main/java/org/baeldung/config/MongoConfig.java +++ b/spring-data-mongodb/src/main/java/org/baeldung/config/MongoConfig.java @@ -1,8 +1,7 @@ package org.baeldung.config; -import java.util.ArrayList; -import java.util.List; - +import com.mongodb.Mongo; +import com.mongodb.MongoClient; import org.baeldung.converter.UserWriterConverter; import org.baeldung.event.CascadeSaveMongoEventListener; import org.baeldung.event.UserCascadeSaveMongoEventListener; @@ -14,8 +13,8 @@ import org.springframework.data.mongodb.core.convert.CustomConversions; import org.springframework.data.mongodb.gridfs.GridFsTemplate; import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; -import com.mongodb.Mongo; -import com.mongodb.MongoClient; +import java.util.ArrayList; +import java.util.List; @Configuration @EnableMongoRepositories(basePackages = "org.baeldung.repository") diff --git a/spring-data-mongodb/src/main/java/org/baeldung/config/SimpleMongoConfig.java b/spring-data-mongodb/src/main/java/org/baeldung/config/SimpleMongoConfig.java index 6140382f82..9653796d8d 100644 --- a/spring-data-mongodb/src/main/java/org/baeldung/config/SimpleMongoConfig.java +++ b/spring-data-mongodb/src/main/java/org/baeldung/config/SimpleMongoConfig.java @@ -1,13 +1,12 @@ package org.baeldung.config; +import com.mongodb.Mongo; +import com.mongodb.MongoClient; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; -import com.mongodb.Mongo; -import com.mongodb.MongoClient; - @Configuration @EnableMongoRepositories(basePackages = "org.baeldung.repository") public class SimpleMongoConfig { diff --git a/spring-data-mongodb/src/main/java/org/baeldung/converter/UserWriterConverter.java b/spring-data-mongodb/src/main/java/org/baeldung/converter/UserWriterConverter.java index 2dedda46ec..4a6970489e 100644 --- a/spring-data-mongodb/src/main/java/org/baeldung/converter/UserWriterConverter.java +++ b/spring-data-mongodb/src/main/java/org/baeldung/converter/UserWriterConverter.java @@ -1,11 +1,10 @@ package org.baeldung.converter; -import org.baeldung.model.User; -import org.springframework.core.convert.converter.Converter; -import org.springframework.stereotype.Component; - import com.mongodb.BasicDBObject; import com.mongodb.DBObject; +import org.baeldung.model.User; +import org.springframework.core.convert.converter.Converter; +import org.springframework.stereotype.Component; @Component public class UserWriterConverter implements Converter { diff --git a/spring-data-mongodb/src/main/java/org/baeldung/event/CascadeCallback.java b/spring-data-mongodb/src/main/java/org/baeldung/event/CascadeCallback.java index e01a1bc8c0..94cad4566a 100644 --- a/spring-data-mongodb/src/main/java/org/baeldung/event/CascadeCallback.java +++ b/spring-data-mongodb/src/main/java/org/baeldung/event/CascadeCallback.java @@ -12,7 +12,7 @@ public class CascadeCallback implements ReflectionUtils.FieldCallback { private Object source; private MongoOperations mongoOperations; - public CascadeCallback(final Object source, final MongoOperations mongoOperations) { + CascadeCallback(final Object source, final MongoOperations mongoOperations) { this.source = source; this.setMongoOperations(mongoOperations); } @@ -35,7 +35,7 @@ public class CascadeCallback implements ReflectionUtils.FieldCallback { } - public Object getSource() { + private Object getSource() { return source; } @@ -43,11 +43,11 @@ public class CascadeCallback implements ReflectionUtils.FieldCallback { this.source = source; } - public MongoOperations getMongoOperations() { + private MongoOperations getMongoOperations() { return mongoOperations; } - public void setMongoOperations(final MongoOperations mongoOperations) { + private void setMongoOperations(final MongoOperations mongoOperations) { this.mongoOperations = mongoOperations; } } diff --git a/spring-data-mongodb/src/main/java/org/baeldung/repository/UserRepository.java b/spring-data-mongodb/src/main/java/org/baeldung/repository/UserRepository.java index 7d51f7b6cc..8e442e8b7f 100644 --- a/spring-data-mongodb/src/main/java/org/baeldung/repository/UserRepository.java +++ b/spring-data-mongodb/src/main/java/org/baeldung/repository/UserRepository.java @@ -1,12 +1,12 @@ package org.baeldung.repository; -import java.util.List; - import org.baeldung.model.User; import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.data.mongodb.repository.Query; import org.springframework.data.querydsl.QueryDslPredicateExecutor; +import java.util.List; + public interface UserRepository extends MongoRepository, QueryDslPredicateExecutor { @Query("{ 'name' : ?0 }") List findUsersByName(String name); @@ -26,10 +26,10 @@ public interface UserRepository extends MongoRepository, QueryDslP List findByNameStartingWith(String regexp); List findByNameEndingWith(String regexp); - - @Query(value="{}", fields="{name : 1}") + + @Query(value = "{}", fields = "{name : 1}") List findNameAndId(); - - @Query(value="{}", fields="{_id : 0}") + + @Query(value = "{}", fields = "{_id : 0}") List findNameAndAgeExcludeId(); } diff --git a/spring-data-mongodb/src/test/java/org/baeldung/aggregation/ZipsAggregationLiveTest.java b/spring-data-mongodb/src/test/java/org/baeldung/aggregation/ZipsAggregationLiveTest.java index a25a904758..5686465c19 100644 --- a/spring-data-mongodb/src/test/java/org/baeldung/aggregation/ZipsAggregationLiveTest.java +++ b/spring-data-mongodb/src/test/java/org/baeldung/aggregation/ZipsAggregationLiveTest.java @@ -1,17 +1,10 @@ package org.baeldung.aggregation; -import static org.junit.Assert.*; -import static org.springframework.data.mongodb.core.aggregation.Aggregation.*; - -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.StreamSupport; - +import com.mongodb.DB; +import com.mongodb.DBCollection; +import com.mongodb.DBObject; +import com.mongodb.MongoClient; +import com.mongodb.util.JSON; import org.baeldung.aggregation.model.StatePopulation; import org.baeldung.config.MongoConfig; import org.junit.AfterClass; @@ -33,18 +26,30 @@ import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import com.mongodb.DB; -import com.mongodb.DBCollection; -import com.mongodb.DBObject; -import com.mongodb.MongoClient; -import com.mongodb.util.JSON; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.springframework.data.mongodb.core.aggregation.Aggregation.group; +import static org.springframework.data.mongodb.core.aggregation.Aggregation.limit; +import static org.springframework.data.mongodb.core.aggregation.Aggregation.match; +import static org.springframework.data.mongodb.core.aggregation.Aggregation.newAggregation; +import static org.springframework.data.mongodb.core.aggregation.Aggregation.project; +import static org.springframework.data.mongodb.core.aggregation.Aggregation.sort; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = MongoConfig.class) public class ZipsAggregationLiveTest { private static MongoClient client; - + @Autowired private MongoTemplate mongoTemplate; @@ -58,7 +63,7 @@ public class ZipsAggregationLiveTest { InputStream zipsJsonStream = ZipsAggregationLiveTest.class.getResourceAsStream("/zips.json"); BufferedReader reader = new BufferedReader(new InputStreamReader(zipsJsonStream)); reader.lines() - .forEach(line -> zipsCollection.insert((DBObject) JSON.parse(line))); + .forEach(line -> zipsCollection.insert((DBObject) JSON.parse(line))); reader.close(); } @@ -95,7 +100,7 @@ public class ZipsAggregationLiveTest { * decreasing population */ List actualList = StreamSupport.stream(result.spliterator(), false) - .collect(Collectors.toList()); + .collect(Collectors.toList()); List expectedList = new ArrayList<>(actualList); Collections.sort(expectedList, (sp1, sp2) -> sp2.getStatePop() - sp1.getStatePop()); @@ -111,7 +116,7 @@ public class ZipsAggregationLiveTest { GroupOperation averageStatePop = group("_id.state").avg("cityPop").as("avgCityPop"); SortOperation sortByAvgPopAsc = sort(new Sort(Direction.ASC, "avgCityPop")); ProjectionOperation projectToMatchModel = project().andExpression("_id").as("state") - .andExpression("avgCityPop").as("statePop"); + .andExpression("avgCityPop").as("statePop"); LimitOperation limitToOnlyFirstDoc = limit(1); Aggregation aggregation = newAggregation(sumTotalCityPop, averageStatePop, sortByAvgPopAsc, limitToOnlyFirstDoc, projectToMatchModel); @@ -121,7 +126,7 @@ public class ZipsAggregationLiveTest { assertEquals("ND", smallestState.getState()); assertTrue(smallestState.getStatePop() - .equals(1645)); + .equals(1645)); } @Test @@ -130,8 +135,8 @@ public class ZipsAggregationLiveTest { GroupOperation sumZips = group("state").count().as("zipCount"); SortOperation sortByCount = sort(Direction.ASC, "zipCount"); GroupOperation groupFirstAndLast = group().first("_id").as("minZipState") - .first("zipCount").as("minZipCount").last("_id").as("maxZipState") - .last("zipCount").as("maxZipCount"); + .first("zipCount").as("minZipCount").last("_id").as("maxZipState") + .last("zipCount").as("maxZipCount"); Aggregation aggregation = newAggregation(sumZips, sortByCount, groupFirstAndLast); diff --git a/spring-data-mongodb/src/test/java/org/baeldung/gridfs/GridFSLiveTest.java b/spring-data-mongodb/src/test/java/org/baeldung/gridfs/GridFSLiveTest.java index 3853a406fb..88205ba7fd 100644 --- a/spring-data-mongodb/src/test/java/org/baeldung/gridfs/GridFSLiveTest.java +++ b/spring-data-mongodb/src/test/java/org/baeldung/gridfs/GridFSLiveTest.java @@ -1,19 +1,8 @@ package org.baeldung.gridfs; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.Matchers.nullValue; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.List; - -import org.baeldung.config.MongoConfig; +import com.mongodb.BasicDBObject; +import com.mongodb.DBObject; +import com.mongodb.gridfs.GridFSDBFile; import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; @@ -27,9 +16,18 @@ import org.springframework.data.mongodb.gridfs.GridFsTemplate; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import com.mongodb.BasicDBObject; -import com.mongodb.DBObject; -import com.mongodb.gridfs.GridFSDBFile; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.nullValue; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; @ContextConfiguration("file:src/main/resources/mongoConfig.xml") @RunWith(SpringJUnit4ClassRunner.class) diff --git a/spring-data-mongodb/src/test/java/org/baeldung/mongotemplate/DocumentQueryLiveTest.java b/spring-data-mongodb/src/test/java/org/baeldung/mongotemplate/DocumentQueryLiveTest.java index df3ebcb2d2..729b0f6dfa 100644 --- a/spring-data-mongodb/src/test/java/org/baeldung/mongotemplate/DocumentQueryLiveTest.java +++ b/spring-data-mongodb/src/test/java/org/baeldung/mongotemplate/DocumentQueryLiveTest.java @@ -1,11 +1,5 @@ package org.baeldung.mongotemplate; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - -import java.util.Iterator; -import java.util.List; - import org.baeldung.config.MongoConfig; import org.baeldung.model.EmailAddress; import org.baeldung.model.User; @@ -23,6 +17,12 @@ import org.springframework.data.mongodb.core.query.Query; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import java.util.Iterator; +import java.util.List; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = MongoConfig.class) public class DocumentQueryLiveTest { diff --git a/spring-data-mongodb/src/test/java/org/baeldung/mongotemplate/MongoTemplateProjectionLiveTest.java b/spring-data-mongodb/src/test/java/org/baeldung/mongotemplate/MongoTemplateProjectionLiveTest.java index 61115faede..2d2117afbb 100644 --- a/spring-data-mongodb/src/test/java/org/baeldung/mongotemplate/MongoTemplateProjectionLiveTest.java +++ b/spring-data-mongodb/src/test/java/org/baeldung/mongotemplate/MongoTemplateProjectionLiveTest.java @@ -1,9 +1,5 @@ package org.baeldung.mongotemplate; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - import org.baeldung.config.SimpleMongoConfig; import org.baeldung.model.User; import org.junit.After; @@ -16,6 +12,10 @@ import org.springframework.data.mongodb.core.query.Query; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = SimpleMongoConfig.class) public class MongoTemplateProjectionLiveTest { @@ -42,14 +42,14 @@ public class MongoTemplateProjectionLiveTest { final Query query = new Query(); query.fields() - .include("name"); + .include("name"); mongoTemplate.find(query, User.class) - .forEach(user -> { - assertNotNull(user.getName()); - assertTrue(user.getAge() - .equals(0)); - }); + .forEach(user -> { + assertNotNull(user.getName()); + assertTrue(user.getAge() + .equals(0)); + }); } @Test @@ -59,13 +59,13 @@ public class MongoTemplateProjectionLiveTest { final Query query = new Query(); query.fields() - .exclude("_id"); + .exclude("_id"); mongoTemplate.find(query, User.class) - .forEach(user -> { - assertNull(user.getId()); - assertNotNull(user.getAge()); - }); + .forEach(user -> { + assertNull(user.getId()); + assertNotNull(user.getAge()); + }); } diff --git a/spring-data-mongodb/src/test/java/org/baeldung/mongotemplate/MongoTemplateQueryLiveTest.java b/spring-data-mongodb/src/test/java/org/baeldung/mongotemplate/MongoTemplateQueryLiveTest.java index 76162c6096..b7ce0cafae 100644 --- a/spring-data-mongodb/src/test/java/org/baeldung/mongotemplate/MongoTemplateQueryLiveTest.java +++ b/spring-data-mongodb/src/test/java/org/baeldung/mongotemplate/MongoTemplateQueryLiveTest.java @@ -1,11 +1,5 @@ package org.baeldung.mongotemplate; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; -import static org.hamcrest.Matchers.nullValue; - -import java.util.List; - import org.baeldung.config.MongoConfig; import org.baeldung.model.EmailAddress; import org.baeldung.model.User; @@ -26,6 +20,12 @@ import org.springframework.data.mongodb.core.query.Query; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import java.util.List; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.nullValue; +import static org.junit.Assert.assertThat; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = MongoConfig.class) public class MongoTemplateQueryLiveTest { diff --git a/spring-drools/src/main/java/com/baeldung/spring/drools/app/ApplicationRunner.java b/spring-drools/src/main/java/com/baeldung/spring/drools/app/ApplicationRunner.java index ce4b49451a..82b12cbc95 100644 --- a/spring-drools/src/main/java/com/baeldung/spring/drools/app/ApplicationRunner.java +++ b/spring-drools/src/main/java/com/baeldung/spring/drools/app/ApplicationRunner.java @@ -12,13 +12,12 @@ public class ApplicationRunner { public static void main(String[] args) { ApplicationContext context = new AnnotationConfigApplicationContext(TaxiFareConfiguration.class); - TaxiFareCalculatorService orderService = context.getBean(TaxiFareCalculatorService.class); - + TaxiFareCalculatorService taxiFareCalculatorService = (TaxiFareCalculatorService) context.getBean(TaxiFareCalculatorService.class); TaxiRide taxiRide = new TaxiRide(); - taxiRide.setbNightSurcharge(true); + taxiRide.setIsNightSurcharge(true); taxiRide.setDistanceInMile(190L); Fare rideFare = new Fare(); - orderService.calculateFare(taxiRide, rideFare); + taxiFareCalculatorService.calculateFare(taxiRide, rideFare); } } diff --git a/spring-drools/src/main/java/com/baeldung/spring/drools/model/Fare.java b/spring-drools/src/main/java/com/baeldung/spring/drools/model/Fare.java index 86044b281a..5a25ddc6d3 100644 --- a/spring-drools/src/main/java/com/baeldung/spring/drools/model/Fare.java +++ b/spring-drools/src/main/java/com/baeldung/spring/drools/model/Fare.java @@ -29,4 +29,5 @@ public class Fare { public Long getTotalFare() { return nightSurcharge + rideFare; } + } diff --git a/spring-drools/src/main/java/com/baeldung/spring/drools/model/TaxiRide.java b/spring-drools/src/main/java/com/baeldung/spring/drools/model/TaxiRide.java index 6dc08bbb60..8dc0f373b1 100644 --- a/spring-drools/src/main/java/com/baeldung/spring/drools/model/TaxiRide.java +++ b/spring-drools/src/main/java/com/baeldung/spring/drools/model/TaxiRide.java @@ -1,16 +1,16 @@ package com.baeldung.spring.drools.model; public class TaxiRide { - - private Boolean bNightSurcharge; + + private Boolean isNightSurcharge; private Long distanceInMile; - public Boolean getbNightSurcharge() { - return bNightSurcharge; + public Boolean getIsNightSurcharge() { + return isNightSurcharge; } - public void setbNightSurcharge(Boolean bNightSurcharge) { - this.bNightSurcharge = bNightSurcharge; + public void setIsNightSurcharge(Boolean isNightSurcharge) { + this.isNightSurcharge = isNightSurcharge; } public Long getDistanceInMile() { diff --git a/spring-drools/src/main/java/com/baeldung/spring/drools/service/TaxiFareCalculatorService.java b/spring-drools/src/main/java/com/baeldung/spring/drools/service/TaxiFareCalculatorService.java index 0407eff5d9..c2c5b399df 100644 --- a/spring-drools/src/main/java/com/baeldung/spring/drools/service/TaxiFareCalculatorService.java +++ b/spring-drools/src/main/java/com/baeldung/spring/drools/service/TaxiFareCalculatorService.java @@ -3,17 +3,19 @@ package com.baeldung.spring.drools.service; import org.kie.api.runtime.KieContainer; import org.kie.api.runtime.KieSession; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import com.baeldung.spring.drools.model.Fare; import com.baeldung.spring.drools.model.TaxiRide; +@Service public class TaxiFareCalculatorService { @Autowired - private KieContainer kieContainer; + private KieContainer kContainer; public Long calculateFare(TaxiRide taxiRide, Fare rideFare) { - KieSession kieSession = kieContainer.newKieSession(); + KieSession kieSession = kContainer.newKieSession(); kieSession.setGlobal("rideFare", rideFare); kieSession.insert(taxiRide); kieSession.fireAllRules(); diff --git a/spring-drools/src/main/java/com/baeldung/spring/drools/service/TaxiFareConfiguration.java b/spring-drools/src/main/java/com/baeldung/spring/drools/service/TaxiFareConfiguration.java index 8da1d4b992..e7b614694e 100644 --- a/spring-drools/src/main/java/com/baeldung/spring/drools/service/TaxiFareConfiguration.java +++ b/spring-drools/src/main/java/com/baeldung/spring/drools/service/TaxiFareConfiguration.java @@ -5,15 +5,16 @@ import org.kie.api.builder.KieBuilder; import org.kie.api.builder.KieFileSystem; import org.kie.api.builder.KieModule; import org.kie.api.runtime.KieContainer; -import org.kie.api.runtime.KieSession; import org.kie.internal.io.ResourceFactory; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @Configuration +@ComponentScan("com.baeldung.spring.drools.service") public class TaxiFareConfiguration { - private static final String drlFile = "TAXI_FARE_RULE.drl"; + public static final String drlFile = "TAXI_FARE_RULE.drl"; @Bean public KieContainer kieContainer() { @@ -26,10 +27,6 @@ public class TaxiFareConfiguration { KieModule kieModule = kieBuilder.getKieModule(); return kieServices.newKieContainer(kieModule.getReleaseId()); - } - - @Bean - public TaxiFareCalculatorService taxiFareCalculatorService() { - return new TaxiFareCalculatorService(); + } } diff --git a/spring-drools/src/main/resources/TAXI_FARE_RULE.drl b/spring-drools/src/main/resources/TAXI_FARE_RULE.drl index 56335c08b3..97f40ddae2 100644 --- a/spring-drools/src/main/resources/TAXI_FARE_RULE.drl +++ b/spring-drools/src/main/resources/TAXI_FARE_RULE.drl @@ -7,7 +7,7 @@ dialect "mvel" rule "Calculate Taxi Fare - Scenario 1" when - taxiRideInstance:TaxiRide(bNightSurcharge == false && distanceInMile < 10); + taxiRideInstance:TaxiRide(isNightSurcharge == false && distanceInMile < 10); then rideFare.setNightSurcharge(0); rideFare.setRideFare(70); @@ -15,7 +15,7 @@ end rule "Calculate Taxi Fare - Scenario 2" when - taxiRideInstance:TaxiRide(bNightSurcharge == true && distanceInMile < 10); + taxiRideInstance:TaxiRide(isNightSurcharge == true && distanceInMile < 10); then rideFare.setNightSurcharge(30); rideFare.setRideFare(70); @@ -24,7 +24,7 @@ end rule "Calculate Taxi Fare - Scenario 3" when - taxiRideInstance:TaxiRide(bNightSurcharge == false && distanceInMile >= 10 && distanceInMile < 100); + taxiRideInstance:TaxiRide(isNightSurcharge == false && distanceInMile >= 10 && distanceInMile < 100); then rideFare.setNightSurcharge(0); rideFare.setRideFare(70+(2*taxiRideInstance.getDistanceInMile())); @@ -33,7 +33,7 @@ end rule "Calculate Taxi Fare - Scenario 4" when - taxiRideInstance:TaxiRide(bNightSurcharge == true && distanceInMile >= 10 && distanceInMile < 100); + taxiRideInstance:TaxiRide(isNightSurcharge == true && distanceInMile >= 10 && distanceInMile < 100); then rideFare.setNightSurcharge(30+taxiRideInstance.getDistanceInMile()); rideFare.setRideFare(70+(2*taxiRideInstance.getDistanceInMile())); @@ -42,7 +42,7 @@ end rule "Calculate Taxi Fare - Scenario 5" when - taxiRideInstance:TaxiRide(bNightSurcharge == false && distanceInMile >= 100); + taxiRideInstance:TaxiRide(isNightSurcharge == false && distanceInMile >= 100); then rideFare.setNightSurcharge(0); rideFare.setRideFare(70+(1.5*taxiRideInstance.getDistanceInMile())); @@ -50,7 +50,7 @@ end rule "Calculate Taxi Fare - Scenario 6" when - taxiRideInstance:TaxiRide(bNightSurcharge == true && distanceInMile >= 100); + taxiRideInstance:TaxiRide(isNightSurcharge == true && distanceInMile >= 100); then rideFare.setNightSurcharge(30+taxiRideInstance.getDistanceInMile()); rideFare.setRideFare(70+(1.5*taxiRideInstance.getDistanceInMile())); diff --git a/spring-drools/src/test/java/com/baeldung/spring/drools/service/TaxiFareCalculatorServiceIntegrationTest.java b/spring-drools/src/test/java/com/baeldung/spring/drools/service/TaxiFareCalculatorServiceIntegrationTest.java index 97bd44316f..8ecd0d59a8 100644 --- a/spring-drools/src/test/java/com/baeldung/spring/drools/service/TaxiFareCalculatorServiceIntegrationTest.java +++ b/spring-drools/src/test/java/com/baeldung/spring/drools/service/TaxiFareCalculatorServiceIntegrationTest.java @@ -1,16 +1,17 @@ package com.baeldung.spring.drools.service; -import com.baeldung.spring.drools.model.Fare; -import com.baeldung.spring.drools.model.TaxiRide; -import org.junit.Assert; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import com.baeldung.spring.drools.model.Fare; +import com.baeldung.spring.drools.model.TaxiRide; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = TaxiFareConfiguration.class) @@ -20,9 +21,9 @@ public class TaxiFareCalculatorServiceIntegrationTest { private TaxiFareCalculatorService taxiFareCalculatorService; @Test - public void testCalculateFareScenario1() { + public void whenNightSurchargeFalseAndDistanceLessThan10_thenFixFareWithoutNightSurcharge() { TaxiRide taxiRide = new TaxiRide(); - taxiRide.setbNightSurcharge(false); + taxiRide.setIsNightSurcharge(false); taxiRide.setDistanceInMile(9L); Fare rideFare = new Fare(); Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare); @@ -30,11 +31,11 @@ public class TaxiFareCalculatorServiceIntegrationTest { assertNotNull(totalCharge); assertEquals(Long.valueOf(70), totalCharge); } - + @Test - public void testCalculateFareScenario2() { + public void whenNightSurchargeTrueAndDistanceLessThan10_thenFixFareWithNightSurcharge() { TaxiRide taxiRide = new TaxiRide(); - taxiRide.setbNightSurcharge(true); + taxiRide.setIsNightSurcharge(true); taxiRide.setDistanceInMile(5L); Fare rideFare = new Fare(); Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare); @@ -44,9 +45,9 @@ public class TaxiFareCalculatorServiceIntegrationTest { } @Test - public void testCalculateFareScenario3() { + public void whenNightSurchargeFalseAndDistanceLessThan100_thenDoubleFareWithoutNightSurcharge() { TaxiRide taxiRide = new TaxiRide(); - taxiRide.setbNightSurcharge(false); + taxiRide.setIsNightSurcharge(false); taxiRide.setDistanceInMile(50L); Fare rideFare = new Fare(); Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare); @@ -54,11 +55,11 @@ public class TaxiFareCalculatorServiceIntegrationTest { assertNotNull(totalCharge); assertEquals(Long.valueOf(170), totalCharge); } - + @Test - public void testCalculateFareScenario4() { + public void whenNightSurchargeTrueAndDistanceLessThan100_thenDoubleFareWithNightSurcharge() { TaxiRide taxiRide = new TaxiRide(); - taxiRide.setbNightSurcharge(true); + taxiRide.setIsNightSurcharge(true); taxiRide.setDistanceInMile(50L); Fare rideFare = new Fare(); Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare); @@ -66,11 +67,11 @@ public class TaxiFareCalculatorServiceIntegrationTest { assertNotNull(totalCharge); assertEquals(Long.valueOf(250), totalCharge); } - + @Test - public void testCalculateFareScenario5() { + public void whenNightSurchargeFalseAndDistanceGreaterThan100_thenExtraPercentFareWithoutNightSurcharge() { TaxiRide taxiRide = new TaxiRide(); - taxiRide.setbNightSurcharge(false); + taxiRide.setIsNightSurcharge(false); taxiRide.setDistanceInMile(100L); Fare rideFare = new Fare(); Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare); @@ -78,11 +79,11 @@ public class TaxiFareCalculatorServiceIntegrationTest { assertNotNull(totalCharge); assertEquals(Long.valueOf(220), totalCharge); } - + @Test - public void testCalculateFareScenario6() { + public void whenNightSurchargeTrueAndDistanceGreaterThan100_thenExtraPercentFareWithNightSurcharge() { TaxiRide taxiRide = new TaxiRide(); - taxiRide.setbNightSurcharge(true); + taxiRide.setIsNightSurcharge(true); taxiRide.setDistanceInMile(100L); Fare rideFare = new Fare(); Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare); diff --git a/spring-mvc-java/README.md b/spring-mvc-java/README.md index 504cfcdcc7..d42efa7ff6 100644 --- a/spring-mvc-java/README.md +++ b/spring-mvc-java/README.md @@ -23,3 +23,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Uploading and Displaying Excel Files with Spring MVC](http://www.baeldung.com/spring-mvc-excel-files) - [Spring MVC Custom Validation](http://www.baeldung.com/spring-mvc-custom-validator) - [web.xml vs Initializer with Spring](http://www.baeldung.com/spring-xml-vs-java-config) +- [The HttpMediaTypeNotAcceptableException in Spring MVC](http://www.baeldung.com/spring-httpmediatypenotacceptable) diff --git a/spring-mvc-java/pom.xml b/spring-mvc-java/pom.xml index eb8e1455a7..b939f0496d 100644 --- a/spring-mvc-java/pom.xml +++ b/spring-mvc-java/pom.xml @@ -5,7 +5,6 @@ spring-mvc-java 0.1-SNAPSHOT spring-mvc-java - war com.baeldung diff --git a/spring-mvc-java/src/test/java/com/baeldung/aop/AopLoggingIntegrationTest.java b/spring-mvc-java/src/test/java/com/baeldung/aop/AopLoggingIntegrationTest.java index 0837100bfa..698bae4c0f 100644 --- a/spring-mvc-java/src/test/java/com/baeldung/aop/AopLoggingIntegrationTest.java +++ b/spring-mvc-java/src/test/java/com/baeldung/aop/AopLoggingIntegrationTest.java @@ -24,7 +24,7 @@ import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; @RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = { TestConfig.class }, loader = AnnotationConfigContextLoader.class) +@ContextConfiguration(classes = {TestConfig.class}, loader = AnnotationConfigContextLoader.class) public class AopLoggingIntegrationTest { @Before diff --git a/spring-remoting/pom.xml b/spring-remoting/pom.xml index 0b751d1fc9..b40f77eb50 100644 --- a/spring-remoting/pom.xml +++ b/spring-remoting/pom.xml @@ -33,6 +33,7 @@ remoting-hessian-burlap remoting-amqp remoting-jms + spring-remoting-rmi \ No newline at end of file diff --git a/spring-remoting/spring-remoting-rmi/pom.xml b/spring-remoting/spring-remoting-rmi/pom.xml new file mode 100644 index 0000000000..723158775f --- /dev/null +++ b/spring-remoting/spring-remoting-rmi/pom.xml @@ -0,0 +1,19 @@ + + + + spring-remoting + com.baeldung + 1.0-SNAPSHOT + + 4.0.0 + pom + + remoting-rmi-server + remoting-rmi-client + + spring-remoting-rmi + + + \ No newline at end of file diff --git a/spring-remoting/spring-remoting-rmi/remoting-rmi-client/pom.xml b/spring-remoting/spring-remoting-rmi/remoting-rmi-client/pom.xml new file mode 100644 index 0000000000..003976dc7b --- /dev/null +++ b/spring-remoting/spring-remoting-rmi/remoting-rmi-client/pom.xml @@ -0,0 +1,30 @@ + + + + spring-remoting-rmi + com.baeldung + 1.0-SNAPSHOT + + 4.0.0 + + remoting-rmi-client + + + + org.springframework.boot + spring-boot-starter-activemq + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + com.baeldung + api + + + \ No newline at end of file diff --git a/spring-remoting/spring-remoting-rmi/remoting-rmi-client/src/main/java/com/baeldung/client/RmiClient.java b/spring-remoting/spring-remoting-rmi/remoting-rmi-client/src/main/java/com/baeldung/client/RmiClient.java new file mode 100644 index 0000000000..a568b749f9 --- /dev/null +++ b/spring-remoting/spring-remoting-rmi/remoting-rmi-client/src/main/java/com/baeldung/client/RmiClient.java @@ -0,0 +1,26 @@ +package com.baeldung.client; + +import com.baeldung.api.Booking; +import com.baeldung.api.BookingException; +import com.baeldung.api.CabBookingService; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.remoting.rmi.RmiProxyFactoryBean; + +@SpringBootApplication public class RmiClient { + + @Bean RmiProxyFactoryBean service() { + RmiProxyFactoryBean rmiProxyFactory = new RmiProxyFactoryBean(); + rmiProxyFactory.setServiceUrl("rmi://localhost:1099/CabBookingService"); + rmiProxyFactory.setServiceInterface(CabBookingService.class); + return rmiProxyFactory; + } + + public static void main(String[] args) throws BookingException { + CabBookingService service = SpringApplication.run(RmiClient.class, args).getBean(CabBookingService.class); + Booking bookingOutcome = service.bookRide("13 Seagate Blvd, Key Largo, FL 33037"); + System.out.println(bookingOutcome); + } + +} diff --git a/spring-remoting/spring-remoting-rmi/remoting-rmi-server/pom.xml b/spring-remoting/spring-remoting-rmi/remoting-rmi-server/pom.xml new file mode 100644 index 0000000000..5ce3f7f949 --- /dev/null +++ b/spring-remoting/spring-remoting-rmi/remoting-rmi-server/pom.xml @@ -0,0 +1,40 @@ + + + + spring-remoting-rmi + com.baeldung + 1.0-SNAPSHOT + + 4.0.0 + + remoting-rmi-server + + + UTF-8 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + com.baeldung + api + + + com.baeldung + api + ${project.version} + + + + \ No newline at end of file diff --git a/spring-remoting/spring-remoting-rmi/remoting-rmi-server/src/main/java/com/baeldung/server/CabBookingServiceImpl.java b/spring-remoting/spring-remoting-rmi/remoting-rmi-server/src/main/java/com/baeldung/server/CabBookingServiceImpl.java new file mode 100644 index 0000000000..55ec9c5733 --- /dev/null +++ b/spring-remoting/spring-remoting-rmi/remoting-rmi-server/src/main/java/com/baeldung/server/CabBookingServiceImpl.java @@ -0,0 +1,16 @@ +package com.baeldung.server; + +import com.baeldung.api.Booking; +import com.baeldung.api.BookingException; +import com.baeldung.api.CabBookingService; + +import static java.lang.Math.random; +import static java.util.UUID.randomUUID; + +public class CabBookingServiceImpl implements CabBookingService { + + @Override public Booking bookRide(String pickUpLocation) throws BookingException { + if (random() < 0.3) throw new BookingException("Cab unavailable"); + return new Booking(randomUUID().toString()); + } +} diff --git a/spring-remoting/spring-remoting-rmi/remoting-rmi-server/src/main/java/com/baeldung/server/RmiServer.java b/spring-remoting/spring-remoting-rmi/remoting-rmi-server/src/main/java/com/baeldung/server/RmiServer.java new file mode 100644 index 0000000000..7778c65e85 --- /dev/null +++ b/spring-remoting/spring-remoting-rmi/remoting-rmi-server/src/main/java/com/baeldung/server/RmiServer.java @@ -0,0 +1,34 @@ +package com.baeldung.server; + +import com.baeldung.api.CabBookingService; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.remoting.rmi.RmiServiceExporter; + +@SpringBootApplication public class RmiServer { + + @Bean CabBookingService bookingService() { + return new CabBookingServiceImpl(); + } + + @Bean RmiServiceExporter exporter(CabBookingService implementation) { + + // Expose a service via RMI. Remote obect URL is: + // rmi://:/ + // 1099 is the default port + + Class serviceInterface = CabBookingService.class; + RmiServiceExporter exporter = new RmiServiceExporter(); + exporter.setServiceInterface(serviceInterface); + exporter.setService(implementation); + exporter.setServiceName(serviceInterface.getSimpleName()); + exporter.setRegistryPort(1099); + return exporter; + } + + public static void main(String[] args) { + SpringApplication.run(RmiServer.class, args); + } + +} diff --git a/spring-rest/src/main/java/org/baeldung/config/WebConfig.java b/spring-rest/src/main/java/org/baeldung/config/WebConfig.java index 3661b2c561..f42c3cb283 100644 --- a/spring-rest/src/main/java/org/baeldung/config/WebConfig.java +++ b/spring-rest/src/main/java/org/baeldung/config/WebConfig.java @@ -1,15 +1,7 @@ package org.baeldung.config; -import java.text.SimpleDateFormat; -import java.util.List; - import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.http.converter.xml.MarshallingHttpMessageConverter; -import org.springframework.oxm.xstream.XStreamMarshaller; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @@ -26,30 +18,30 @@ public class WebConfig extends WebMvcConfigurerAdapter { } // + /* + @Override + public void configureMessageConverters(final List> messageConverters) { + final Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder(); + builder.indentOutput(true) + .dateFormat(new SimpleDateFormat("dd-MM-yyyy hh:mm")); + messageConverters.add(new MappingJackson2HttpMessageConverter(builder.build())); + // messageConverters.add(new MappingJackson2XmlHttpMessageConverter(builder.createXmlMapper(true).build())); - @Override - public void configureMessageConverters(final List> messageConverters) { - final Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder(); - builder.indentOutput(true) - .dateFormat(new SimpleDateFormat("dd-MM-yyyy hh:mm")); - messageConverters.add(new MappingJackson2HttpMessageConverter(builder.build())); - // messageConverters.add(new MappingJackson2XmlHttpMessageConverter(builder.createXmlMapper(true).build())); + // messageConverters.add(createXmlHttpMessageConverter()); + // messageConverters.add(new MappingJackson2HttpMessageConverter()); - // messageConverters.add(createXmlHttpMessageConverter()); - // messageConverters.add(new MappingJackson2HttpMessageConverter()); + // messageConverters.add(new ProtobufHttpMessageConverter()); + super.configureMessageConverters(messageConverters); + } - // messageConverters.add(new ProtobufHttpMessageConverter()); - super.configureMessageConverters(messageConverters); - } + private HttpMessageConverter createXmlHttpMessageConverter() { + final MarshallingHttpMessageConverter xmlConverter = new MarshallingHttpMessageConverter(); - private HttpMessageConverter createXmlHttpMessageConverter() { - final MarshallingHttpMessageConverter xmlConverter = new MarshallingHttpMessageConverter(); - - final XStreamMarshaller xstreamMarshaller = new XStreamMarshaller(); - xmlConverter.setMarshaller(xstreamMarshaller); - xmlConverter.setUnmarshaller(xstreamMarshaller); - - return xmlConverter; - } + final XStreamMarshaller xstreamMarshaller = new XStreamMarshaller(); + xmlConverter.setMarshaller(xstreamMarshaller); + xmlConverter.setUnmarshaller(xstreamMarshaller); + return xmlConverter; + } + */ } diff --git a/spring-rest/src/main/java/org/baeldung/web/controller/MyFooController.java b/spring-rest/src/main/java/org/baeldung/web/controller/MyFooController.java index 061213a3e9..251e0b23e7 100644 --- a/spring-rest/src/main/java/org/baeldung/web/controller/MyFooController.java +++ b/spring-rest/src/main/java/org/baeldung/web/controller/MyFooController.java @@ -32,7 +32,7 @@ public class MyFooController { // API - read - @RequestMapping(method = RequestMethod.GET) + @RequestMapping(method = RequestMethod.GET, produces = { "application/json" }) @ResponseBody public Collection findAll() { return myfoos.values(); diff --git a/spring-rest/src/main/webapp/WEB-INF/api-servlet.xml b/spring-rest/src/main/webapp/WEB-INF/api-servlet.xml index d133bcea22..7e7d820836 100644 --- a/spring-rest/src/main/webapp/WEB-INF/api-servlet.xml +++ b/spring-rest/src/main/webapp/WEB-INF/api-servlet.xml @@ -19,12 +19,11 @@ --> - + + - diff --git a/spring-rest/src/test/java/org/baeldung/client/RestTemplateBasicLiveTest.java b/spring-rest/src/test/java/org/baeldung/client/RestTemplateBasicLiveTest.java index 2d12262e85..7bcaab6a07 100644 --- a/spring-rest/src/test/java/org/baeldung/client/RestTemplateBasicLiveTest.java +++ b/spring-rest/src/test/java/org/baeldung/client/RestTemplateBasicLiveTest.java @@ -42,7 +42,7 @@ public class RestTemplateBasicLiveTest { @Before public void beforeTest() { restTemplate = new RestTemplate(); - restTemplate.setMessageConverters(Arrays.asList(new MappingJackson2HttpMessageConverter())); + // restTemplate.setMessageConverters(Arrays.asList(new MappingJackson2HttpMessageConverter())); } // GET @@ -78,7 +78,6 @@ public class RestTemplateBasicLiveTest { @Test public void givenFooService_whenCallHeadForHeaders_thenReceiveAllHeadersForThatResource() { final HttpHeaders httpHeaders = restTemplate.headForHeaders(fooResourceUrl); - assertTrue(httpHeaders.getContentType() .includes(MediaType.APPLICATION_JSON)); } @@ -248,4 +247,5 @@ public class RestTemplateBasicLiveTest { clientHttpRequestFactory.setConnectTimeout(timeout * 1000); return clientHttpRequestFactory; } + } diff --git a/spring-security-mvc-socket/README.md b/spring-security-mvc-socket/README.md index 2144765a04..5ae9d4f4cd 100644 --- a/spring-security-mvc-socket/README.md +++ b/spring-security-mvc-socket/README.md @@ -1,2 +1,2 @@ ### Relevant Articles: -- [Intro to Security and WebSockets](http://www.baeldung.com/intro-to-security-and-websockets) \ No newline at end of file +- [Intro to Security and WebSockets](http://www.baeldung.com/spring-security-websockets) diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/CsrfTokenController.java b/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/CsrfTokenController.java index f18162cba0..3d10dad391 100644 --- a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/CsrfTokenController.java +++ b/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/CsrfTokenController.java @@ -2,15 +2,14 @@ package com.baeldung.springsecuredsockets.controllers; import org.springframework.security.web.csrf.CsrfToken; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; @Controller public class CsrfTokenController { - @RequestMapping(value = "/csrf", method = RequestMethod.GET) + @GetMapping("/csrf") public @ResponseBody String getCsrfToken(HttpServletRequest request) { CsrfToken csrf = (CsrfToken) request.getAttribute(CsrfToken.class.getName()); diff --git a/spring-security-sso/README.md b/spring-security-sso/README.md new file mode 100644 index 0000000000..11b5f011d5 --- /dev/null +++ b/spring-security-sso/README.md @@ -0,0 +1,2 @@ +### Relevant Articles: +- [Simple Single Sign On with Spring Security OAuth2](http://www.baeldung.com/sso-spring-security-oauth2) diff --git a/spring-vertx/README.md b/spring-vertx/README.md new file mode 100644 index 0000000000..05d059e1b2 --- /dev/null +++ b/spring-vertx/README.md @@ -0,0 +1,2 @@ +### Relevant Articles: +- [Vert.x Spring Integration](http://www.baeldung.com/spring-vertx) diff --git a/structurizr/README.md b/structurizr/README.md new file mode 100644 index 0000000000..e596dfa458 --- /dev/null +++ b/structurizr/README.md @@ -0,0 +1,2 @@ +### Relevant Articles: +- [Intro to Structurizr](http://www.baeldung.com/structurizr) diff --git a/testng/pom.xml b/testng/pom.xml index 3defe4ce65..0ca775a00c 100644 --- a/testng/pom.xml +++ b/testng/pom.xml @@ -2,7 +2,6 @@ 4.0.0 - com.baeldung testng 0.1.0-SNAPSHOT jar @@ -43,27 +42,6 @@ - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - **/*IntegrationTest.java - **/*LongRunningUnitTest.java - **/*ManualTest.java - - - src\test\resources\parametrized_testng.xml - src\test\resources\test_group.xml - src\test\resources\test_setup.xml - src\test\resources\test_suite.xml - - - true - - - org.apache.maven.plugins maven-dependency-plugin diff --git a/testng/src/test/java/baeldung/com/ParametrizedUnitTest.java b/testng/src/test/java/baeldung/com/ParametrizedUnitTest.java deleted file mode 100644 index cf12d879de..0000000000 --- a/testng/src/test/java/baeldung/com/ParametrizedUnitTest.java +++ /dev/null @@ -1,77 +0,0 @@ -package baeldung.com; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.Assert; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -public class ParametrizedUnitTest { - - private static final Logger LOGGER = LoggerFactory.getLogger(ParametrizedUnitTest.class); - - @Test - @Parameters({"value", "isEven"}) - public void givenNumberFromXML_ifEvenCheckOK_thenCorrect(int value, boolean isEven) { - Assert.assertEquals(isEven, value % 2 == 0); - } - - @DataProvider(name = "numbers") - public static Object[][] evenNumbers() { - return new Object[][]{{1, false}, {2, true}, {4, true}}; - } - - @Test(dataProvider = "numbers") - public void givenNumberFromDataProvider_ifEvenCheckOK_thenCorrect(Integer number, boolean expected) { - Assert.assertEquals(expected, number % 2 == 0); - } - - @Test(dataProvider = "numbersObject") - public void givenNumberObjectFromDataProvider_ifEvenCheckOK_thenCorrect(EvenNumber number) { - Assert.assertEquals(number.isEven(), number.getValue() % 2 == 0); - } - - @DataProvider(name = "numbersObject") - public Object[][] parameterProvider() { - return new Object[][]{{new EvenNumber(1, false)}, {new EvenNumber(2, true)}, {new EvenNumber(4, true),}}; - } - -} - - -class EvenNumber { - private int value; - private boolean isEven; - - public EvenNumber(int number, boolean isEven) { - this.value = number; - this.isEven = isEven; - } - - public int getValue() { - return value; - } - - public void setValue(int value) { - this.value = value; - } - - public boolean isEven() { - return isEven; - } - - public void setEven(boolean even) { - isEven = even; - } - - @Override - public String toString() { - return "EvenNumber{" + - "value=" + value + - ", isEven=" + isEven + - '}'; - } -} - - diff --git a/testng/src/test/java/baeldung/com/PriorityUnitTest.java b/testng/src/test/java/baeldung/com/PriorityUnitTest.java deleted file mode 100644 index 4985cbaf55..0000000000 --- a/testng/src/test/java/baeldung/com/PriorityUnitTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package baeldung.com; - -import org.testng.Assert; -import org.testng.annotations.Test; - -public class PriorityUnitTest { - - private String testString = "10"; - private int testInt = 23; - - @Test(priority = 1) - public void givenString_whenChangedToInt_thenCorrect() { - Assert.assertTrue(Integer.valueOf(testString) instanceof Integer); - } - - @Test(priority = 2) - public void givenInt_whenChangedToString_thenCorrect() { - Assert.assertTrue(String.valueOf(testInt) instanceof String); - } - -} diff --git a/testng/src/test/java/baeldung/com/DependentUnitTest.java b/testng/src/test/java/com/baeldung/DependentLongRunningUnitTest.java similarity index 84% rename from testng/src/test/java/baeldung/com/DependentUnitTest.java rename to testng/src/test/java/com/baeldung/DependentLongRunningUnitTest.java index 315014f1cf..625f41c993 100644 --- a/testng/src/test/java/baeldung/com/DependentUnitTest.java +++ b/testng/src/test/java/com/baeldung/DependentLongRunningUnitTest.java @@ -1,25 +1,25 @@ -package baeldung.com; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.Assert; -import org.testng.annotations.Test; - -public class DependentUnitTest { - - private static final Logger LOGGER = LoggerFactory.getLogger(DependentUnitTest.class); - - private String email = "abc@qwe.com"; - - @Test - public void givenEmail_ifValid_thenTrue() { - boolean valid = email.contains("@"); - Assert.assertEquals(valid, true); - } - - @Test(dependsOnMethods = {"givenEmail_ifValid_thenTrue"}) - public void givenValidEmail_whenLoggedIn_thenTrue() { - LOGGER.info("Email {} valid >> logging in", email); - } -} - +package com.baeldung; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class DependentLongRunningUnitTest { + + private static final Logger LOGGER = LoggerFactory.getLogger(DependentLongRunningUnitTest.class); + + private String email = "abc@qwe.com"; + + @Test + public void givenEmail_ifValid_thenTrue() { + boolean valid = email.contains("@"); + Assert.assertEquals(valid, true); + } + + @Test(dependsOnMethods = {"givenEmail_ifValid_thenTrue"}) + public void givenValidEmail_whenLoggedIn_thenTrue() { + LOGGER.info("Email {} valid >> logging in", email); + } +} + diff --git a/testng/src/test/java/baeldung/com/GroupIntegrationTest.java b/testng/src/test/java/com/baeldung/GroupIntegrationTest.java similarity index 93% rename from testng/src/test/java/baeldung/com/GroupIntegrationTest.java rename to testng/src/test/java/com/baeldung/GroupIntegrationTest.java index 8bb389aeae..a47c34ffa3 100644 --- a/testng/src/test/java/baeldung/com/GroupIntegrationTest.java +++ b/testng/src/test/java/com/baeldung/GroupIntegrationTest.java @@ -1,44 +1,44 @@ -package baeldung.com; - -import org.testng.annotations.AfterGroups; -import org.testng.annotations.BeforeGroups; -import org.testng.annotations.Test; - -public class GroupIntegrationTest { - - @BeforeGroups("database") - public void setupDB() { - System.out.println("setupDB()"); - } - - @AfterGroups("database") - public void cleanDB() { - System.out.println("cleanDB()"); - } - - @Test(groups = "selenium-test") - public void runSelenium() { - System.out.println("runSelenium()"); - } - - @Test(groups = "selenium-test") - public void runSelenium1() { - System.out.println("runSelenium()1"); - } - - @Test(groups = "database") - public void testConnectOracle() { - System.out.println("testConnectOracle()"); - } - - @Test(groups = "database") - public void testConnectMsSQL() { - System.out.println("testConnectMsSQL"); - } - - @Test(dependsOnGroups = {"database", "selenium-test"}) - public void runFinal() { - System.out.println("runFinal"); - } - +package com.baeldung; + +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.Test; + +public class GroupIntegrationTest { + + @BeforeGroups("database") + public void setupDB() { + System.out.println("setupDB()"); + } + + @AfterGroups("database") + public void cleanDB() { + System.out.println("cleanDB()"); + } + + @Test(groups = "selenium-test") + public void runSelenium() { + System.out.println("runSelenium()"); + } + + @Test(groups = "selenium-test") + public void runSelenium1() { + System.out.println("runSelenium()1"); + } + + @Test(groups = "database") + public void testConnectOracle() { + System.out.println("testConnectOracle()"); + } + + @Test(groups = "database") + public void testConnectMsSQL() { + System.out.println("testConnectMsSQL"); + } + + @Test(dependsOnGroups = {"database", "selenium-test"}) + public void runFinal() { + System.out.println("runFinal"); + } + } \ No newline at end of file diff --git a/testng/src/test/java/baeldung/com/MultiThreadedIntegrationTest.java b/testng/src/test/java/com/baeldung/MultiThreadedIntegrationTest.java similarity index 90% rename from testng/src/test/java/baeldung/com/MultiThreadedIntegrationTest.java rename to testng/src/test/java/com/baeldung/MultiThreadedIntegrationTest.java index fc6c45ff55..2fa4541ae5 100644 --- a/testng/src/test/java/baeldung/com/MultiThreadedIntegrationTest.java +++ b/testng/src/test/java/com/baeldung/MultiThreadedIntegrationTest.java @@ -1,14 +1,14 @@ -package baeldung.com; - -import org.testng.Assert; -import org.testng.annotations.Test; - -public class MultiThreadedIntegrationTest { - - @Test(threadPoolSize = 5, invocationCount = 10, timeOut = 1000) - public void givenMethod_whenRunInThreads_thenCorrect() { - int count = Thread.activeCount(); - Assert.assertTrue(count > 1); - } - -} +package com.baeldung; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class MultiThreadedIntegrationTest { + + @Test(threadPoolSize = 5, invocationCount = 10, timeOut = 1000) + public void givenMethod_whenRunInThreads_thenCorrect() { + int count = Thread.activeCount(); + Assert.assertTrue(count > 1); + } + +} diff --git a/testng/src/test/java/com/baeldung/ParametrizedLongRunningUnitTest.java b/testng/src/test/java/com/baeldung/ParametrizedLongRunningUnitTest.java new file mode 100644 index 0000000000..4e8b939fef --- /dev/null +++ b/testng/src/test/java/com/baeldung/ParametrizedLongRunningUnitTest.java @@ -0,0 +1,74 @@ +package com.baeldung; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertEquals; + +public class ParametrizedLongRunningUnitTest { + + @Test + @Parameters({"value", "isEven"}) + public void givenNumberFromXML_ifEvenCheckOK_thenCorrect(int value, boolean isEven) { + assertEquals(isEven, value % 2 == 0); + } + + @DataProvider(name = "numbers") + public static Object[][] evenNumbers() { + return new Object[][]{{1, false}, {2, true}, {4, true}}; + } + + @Test(dataProvider = "numbers") + public void givenNumberFromDataProvider_ifEvenCheckOK_thenCorrect(Integer number, boolean expected) { + assertEquals(expected, number % 2 == 0); + } + + @Test(dataProvider = "numbersObject") + public void givenNumberObjectFromDataProvider_ifEvenCheckOK_thenCorrect(EvenNumber number) { + assertEquals(number.isEven(), number.getValue() % 2 == 0); + } + + @DataProvider(name = "numbersObject") + public Object[][] parameterProvider() { + return new Object[][]{{new EvenNumber(1, false)}, {new EvenNumber(2, true)}, {new EvenNumber(4, true),}}; + } + + class EvenNumber { + private int value; + private boolean isEven; + + EvenNumber(int number, boolean isEven) { + this.value = number; + this.isEven = isEven; + } + + int getValue() { + return value; + } + + public void setValue(int value) { + this.value = value; + } + + boolean isEven() { + return isEven; + } + + public void setEven(boolean even) { + isEven = even; + } + + @Override + public String toString() { + return "EvenNumber{" + + "value=" + value + + ", isEven=" + isEven + + '}'; + } + } +} + + + + diff --git a/testng/src/test/java/com/baeldung/PriorityLongRunningUnitTest.java b/testng/src/test/java/com/baeldung/PriorityLongRunningUnitTest.java new file mode 100644 index 0000000000..34fb22647f --- /dev/null +++ b/testng/src/test/java/com/baeldung/PriorityLongRunningUnitTest.java @@ -0,0 +1,21 @@ +package com.baeldung; + +import org.testng.annotations.Test; + +import static org.testng.Assert.assertTrue; + +public class PriorityLongRunningUnitTest { + + @Test(priority = 1) + public void givenString_whenChangedToInt_thenCorrect() { + String testString = "10"; + assertTrue(Integer.valueOf(testString) instanceof Integer); + } + + @Test(priority = 2) + public void givenInt_whenChangedToString_thenCorrect() { + int testInt = 23; + assertTrue(String.valueOf(testInt) instanceof String); + } + +} diff --git a/testng/src/test/java/baeldung/com/RegistrationUnitTest.java b/testng/src/test/java/com/baeldung/RegistrationLongRunningUnitTest.java similarity index 71% rename from testng/src/test/java/baeldung/com/RegistrationUnitTest.java rename to testng/src/test/java/com/baeldung/RegistrationLongRunningUnitTest.java index 663bb9c738..677b7b539c 100644 --- a/testng/src/test/java/baeldung/com/RegistrationUnitTest.java +++ b/testng/src/test/java/com/baeldung/RegistrationLongRunningUnitTest.java @@ -1,14 +1,14 @@ -package baeldung.com; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.annotations.Test; - -public class RegistrationUnitTest { - private static final Logger LOGGER = LoggerFactory.getLogger(RegistrationUnitTest.class); - - @Test - public void whenCalledFromSuite_thanOK() { - LOGGER.info("Registration successful"); - } -} +package com.baeldung; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.annotations.Test; + +public class RegistrationLongRunningUnitTest { + private static final Logger LOGGER = LoggerFactory.getLogger(RegistrationLongRunningUnitTest.class); + + @Test + public void whenCalledFromSuite_thanOK() { + LOGGER.info("Registration successful"); + } +} diff --git a/testng/src/test/java/baeldung/com/SignInUnitTest.java b/testng/src/test/java/com/baeldung/SignInLongRunningUnitTest.java similarity index 73% rename from testng/src/test/java/baeldung/com/SignInUnitTest.java rename to testng/src/test/java/com/baeldung/SignInLongRunningUnitTest.java index 85ccd43095..f642d274aa 100644 --- a/testng/src/test/java/baeldung/com/SignInUnitTest.java +++ b/testng/src/test/java/com/baeldung/SignInLongRunningUnitTest.java @@ -1,14 +1,14 @@ -package baeldung.com; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.annotations.Test; - -public class SignInUnitTest { - private static final Logger LOGGER = LoggerFactory.getLogger(SignInUnitTest.class); - - @Test - public void whenCalledFromSuite_thanOK() { - LOGGER.info("SignIn successful"); - } -} +package com.baeldung; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.annotations.Test; + +public class SignInLongRunningUnitTest { + private static final Logger LOGGER = LoggerFactory.getLogger(SignInLongRunningUnitTest.class); + + @Test + public void whenCalledFromSuite_thanOK() { + LOGGER.info("SignIn successful"); + } +} diff --git a/testng/src/test/java/baeldung/com/SimpleUnitTest.java b/testng/src/test/java/com/baeldung/SimpleLongRunningUnitTest.java similarity index 82% rename from testng/src/test/java/baeldung/com/SimpleUnitTest.java rename to testng/src/test/java/com/baeldung/SimpleLongRunningUnitTest.java index a46ee90ce2..991f1282dc 100644 --- a/testng/src/test/java/baeldung/com/SimpleUnitTest.java +++ b/testng/src/test/java/com/baeldung/SimpleLongRunningUnitTest.java @@ -1,28 +1,28 @@ -package baeldung.com; - -import org.testng.Assert; -import org.testng.TestNG; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -public class SimpleUnitTest extends TestNG { - private int number; - - @BeforeClass - public void setup() { - number = 12; - } - - @AfterClass - public void tearDown() { - number = 0; - } - - @Test - public void givenNumber_whenEven_thenTrue() { - Assert.assertTrue(number % 2 == 0); - } - -} - +package com.baeldung; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class SimpleLongRunningUnitTest extends TestNG { + private int number; + + @BeforeClass + public void setup() { + number = 12; + } + + @AfterClass + public void tearDown() { + number = 0; + } + + @Test + public void givenNumber_whenEven_thenTrue() { + Assert.assertTrue(number % 2 == 0); + } + +} + diff --git a/testng/src/test/java/baeldung/com/SummationServiceIntegrationTest.java b/testng/src/test/java/com/baeldung/SummationServiceIntegrationTest.java similarity index 84% rename from testng/src/test/java/baeldung/com/SummationServiceIntegrationTest.java rename to testng/src/test/java/com/baeldung/SummationServiceIntegrationTest.java index f8c9bdff43..6a6788fe51 100644 --- a/testng/src/test/java/baeldung/com/SummationServiceIntegrationTest.java +++ b/testng/src/test/java/com/baeldung/SummationServiceIntegrationTest.java @@ -1,98 +1,102 @@ -package baeldung.com; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.Assert; -import org.testng.TestNG; -import org.testng.annotations.*; - -import java.util.ArrayList; -import java.util.List; - -public class SummationServiceIntegrationTest extends TestNG { - private static final Logger LOGGER = LoggerFactory.getLogger(DependentUnitTest.class); - - private List numbers; - - private int testCount = 0; - - @BeforeClass - public void initialize() { - numbers = new ArrayList<>(); - } - - @AfterClass - public void tearDown() { - numbers = null; - } - - @BeforeSuite(groups = "regression") - public void runBeforeRegressionSuite() { - numbers = new ArrayList<>(); - numbers.add(-11); - numbers.add(2); - } - - @AfterSuite(groups = "regression") - public void runAfterRegressionSuite() { - numbers = null; - } - - @BeforeGroups("negative_tests") - public void runBeforeEachNegativeGroup() { - numbers.clear(); - } - - @BeforeGroups("regression") - public void runBeforeEachRegressionGroup() { - numbers.add(-11); - numbers.add(2); - } - - @BeforeGroups("positive_tests") - public void runBeforeEachPositiveGroup() { - numbers.add(1); - numbers.add(2); - numbers.add(3); - } - - @AfterGroups("positive_tests,regression,negative_tests") - public void runAfterEachGroup() { - numbers.clear(); - } - - @BeforeMethod - public void runBeforeEachTest() { - testCount++; - } - - @AfterMethod - public void runAfterEachTest() { - - } - - - @Test(groups = "positive_tests", enabled = false) - public void givenNumbers_sumEquals_thenCorrect() { - int sum = numbers.stream().reduce(0, Integer::sum); - Assert.assertEquals(sum, 6); - } - - @Test(groups = "negative_tests") - public void givenEmptyList_sumEqualsZero_thenCorrect() { - int sum = numbers.stream().reduce(0, Integer::sum); - Assert.assertEquals(0, sum); - } - - @Test(groups = "regression") - public void givenNegativeNumber_sumLessthanZero_thenCorrect() { - int sum = numbers.stream().reduce(0, Integer::sum); - Assert.assertTrue(sum < 0); - } - - @Test(expectedExceptions = ArithmeticException.class) - public void givenNumber_whenThrowsException_thenCorrect() { - int i = 1 / 0; - } - -} +package com.baeldung; + +import org.testng.Assert; +import org.testng.TestNG; +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeGroups; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Test; + +import java.util.ArrayList; +import java.util.List; + +public class SummationServiceIntegrationTest extends TestNG { + private List numbers; + + private int testCount = 0; + + @BeforeClass + public void initialize() { + numbers = new ArrayList<>(); + } + + @AfterClass + public void tearDown() { + numbers = null; + } + + @BeforeSuite(groups = "regression") + public void runBeforeRegressionSuite() { + numbers = new ArrayList<>(); + numbers.add(-11); + numbers.add(2); + } + + @AfterSuite(groups = "regression") + public void runAfterRegressionSuite() { + numbers = null; + } + + @BeforeGroups("negative_tests") + public void runBeforeEachNegativeGroup() { + numbers.clear(); + } + + @BeforeGroups("regression") + public void runBeforeEachRegressionGroup() { + numbers.add(-11); + numbers.add(2); + } + + @BeforeGroups("positive_tests") + public void runBeforeEachPositiveGroup() { + numbers.add(1); + numbers.add(2); + numbers.add(3); + } + + @AfterGroups("positive_tests,regression,negative_tests") + public void runAfterEachGroup() { + numbers.clear(); + } + + @BeforeMethod + public void runBeforeEachTest() { + testCount++; + } + + @AfterMethod + public void runAfterEachTest() { + + } + + + @Test(groups = "positive_tests", enabled = false) + public void givenNumbers_sumEquals_thenCorrect() { + int sum = numbers.stream().reduce(0, Integer::sum); + Assert.assertEquals(sum, 6); + } + + @Test(groups = "negative_tests") + public void givenEmptyList_sumEqualsZero_thenCorrect() { + int sum = numbers.stream().reduce(0, Integer::sum); + Assert.assertEquals(0, sum); + } + + @Test(groups = "regression") + public void givenNegativeNumber_sumLessthanZero_thenCorrect() { + int sum = numbers.stream().reduce(0, Integer::sum); + Assert.assertTrue(sum < 0); + } + + @Test(expectedExceptions = ArithmeticException.class) + public void givenNumber_whenThrowsException_thenCorrect() { + int i = 1 / 0; + } + +} diff --git a/testng/src/test/java/baeldung/com/TimeOutIntegrationTest.java b/testng/src/test/java/com/baeldung/TimeOutIntegrationTest.java similarity index 86% rename from testng/src/test/java/baeldung/com/TimeOutIntegrationTest.java rename to testng/src/test/java/com/baeldung/TimeOutIntegrationTest.java index 92ea847bcf..a2eec36cc4 100644 --- a/testng/src/test/java/baeldung/com/TimeOutIntegrationTest.java +++ b/testng/src/test/java/com/baeldung/TimeOutIntegrationTest.java @@ -1,11 +1,11 @@ -package baeldung.com; - -import org.testng.annotations.Test; - -public class TimeOutIntegrationTest { - - @Test(timeOut = 1000, enabled = false) - public void givenExecution_takeMoreTime_thenFail() { - while (true) ; - } -} +package com.baeldung; + +import org.testng.annotations.Test; + +public class TimeOutIntegrationTest { + + @Test(timeOut = 1000, enabled = false) + public void givenExecution_takeMoreTime_thenFail() { + while (true) ; + } +} diff --git a/testng/src/test/java/com/baeldung/reports/CustomisedListener.java b/testng/src/test/java/com/baeldung/reports/CustomisedListener.java index 1ec5629cdf..1a0ff190e3 100644 --- a/testng/src/test/java/com/baeldung/reports/CustomisedListener.java +++ b/testng/src/test/java/com/baeldung/reports/CustomisedListener.java @@ -14,14 +14,12 @@ public class CustomisedListener implements ITestListener { LOGGER.info("PASSED TEST CASES"); context.getPassedTests() .getAllResults() - .stream() .forEach(result -> { LOGGER.info(result.getName()); }); LOGGER.info("FAILED TEST CASES"); context.getFailedTests() .getAllResults() - .stream() .forEach(result -> { LOGGER.info(result.getName()); }); diff --git a/testng/src/test/resources/parametrized_testng.xml b/testng/src/test/resources/parametrized_testng.xml index bd70945457..d3a9a6dc51 100644 --- a/testng/src/test/resources/parametrized_testng.xml +++ b/testng/src/test/resources/parametrized_testng.xml @@ -7,7 +7,7 @@ - + \ No newline at end of file diff --git a/testng/src/test/resources/test_group.xml b/testng/src/test/resources/test_group.xml index c656e6145d..3f51c039d6 100644 --- a/testng/src/test/resources/test_group.xml +++ b/testng/src/test/resources/test_group.xml @@ -7,7 +7,7 @@ - + \ No newline at end of file diff --git a/testng/src/test/resources/test_setup.xml b/testng/src/test/resources/test_setup.xml index 2e466c91cc..dea9d9bf5a 100644 --- a/testng/src/test/resources/test_setup.xml +++ b/testng/src/test/resources/test_setup.xml @@ -7,7 +7,7 @@ - + diff --git a/testng/src/test/resources/test_suite.xml b/testng/src/test/resources/test_suite.xml index fb92b4f61b..7a01f1af08 100644 --- a/testng/src/test/resources/test_suite.xml +++ b/testng/src/test/resources/test_suite.xml @@ -5,9 +5,9 @@ - - - + + + \ No newline at end of file diff --git a/vavr/README.md b/vavr/README.md index e79e3269d5..d95e026bde 100644 --- a/vavr/README.md +++ b/vavr/README.md @@ -3,3 +3,4 @@ - [Guide to Try in Vavr](http://www.baeldung.com/javaslang-try) - [Guide to Pattern Matching in Vavr](http://www.baeldung.com/javaslang-pattern-matching) - [Property Testing Example With Vavr](http://www.baeldung.com/javaslang-property-testing) +- [Exceptions in Lambda Expression Using Vavr](http://www.baeldung.com/exceptions-using-vavr) diff --git a/vavr/pom.xml b/vavr/pom.xml index 5356417b3e..cbf2a37ec9 100644 --- a/vavr/pom.xml +++ b/vavr/pom.xml @@ -6,10 +6,11 @@ 1.0 vavr - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT + + org.springframework.boot + spring-boot-starter-parent + 2.0.0.BUILD-SNAPSHOT + @@ -24,9 +25,36 @@ junit ${junit.version} + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + com.h2database + h2 + + + + org.springframework.boot + spring-boot-starter-test + + + + + spring-snapshot + Spring Snapshot Repository + https://repo.spring.io/snapshot + + true + + + + 1.8 0.9.0 4.12 diff --git a/vavr/src/main/java/com/baeldung/Application.java b/vavr/src/main/java/com/baeldung/Application.java new file mode 100644 index 0000000000..d58049fb35 --- /dev/null +++ b/vavr/src/main/java/com/baeldung/Application.java @@ -0,0 +1,11 @@ +package com.baeldung; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } +} diff --git a/vavr/src/main/java/com/baeldung/repositories/VavrUserRepository.java b/vavr/src/main/java/com/baeldung/repositories/VavrUserRepository.java new file mode 100644 index 0000000000..a3dd7937f7 --- /dev/null +++ b/vavr/src/main/java/com/baeldung/repositories/VavrUserRepository.java @@ -0,0 +1,18 @@ +package com.baeldung.repositories; + +import org.springframework.data.repository.Repository; + +import com.baeldung.vavr.User; + +import io.vavr.collection.Seq; +import io.vavr.control.Option; + +public interface VavrUserRepository extends Repository { + + Option findById(long id); + + Seq findByName(String name); + + User save(User user); + +} diff --git a/vavr/src/main/java/com/baeldung/vavr/User.java b/vavr/src/main/java/com/baeldung/vavr/User.java new file mode 100644 index 0000000000..69dd9aea24 --- /dev/null +++ b/vavr/src/main/java/com/baeldung/vavr/User.java @@ -0,0 +1,32 @@ +package com.baeldung.vavr; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; + +@Entity +public class User { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String name; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/vavr/src/main/java/com/baeldung/vavr/either/EitherDemo.java b/vavr/src/main/java/com/baeldung/vavr/either/EitherDemo.java new file mode 100644 index 0000000000..95f8191342 --- /dev/null +++ b/vavr/src/main/java/com/baeldung/vavr/either/EitherDemo.java @@ -0,0 +1,37 @@ +package com.baeldung.vavr.either; + +import java.util.HashMap; +import java.util.Map; + +import io.vavr.control.Either; + +public class EitherDemo { + + public static Object[] computeWithoutEitherUsingArray(int marks) { + Object[] results = new Object[2]; + if (marks < 85) { + results[0] = "Marks not acceptable"; + } else { + results[1] = marks; + } + return results; + } + + public static Map computeWithoutEitherUsingMap(int marks) { + Map results = new HashMap<>(); + if (marks < 85) { + results.put("FAILURE", "Marks not acceptable"); + } else { + results.put("SUCCESS", marks); + } + return results; + } + + static Either computeWithEither(int marks) { + if (marks < 85) { + return Either.left("Marks not acceptable"); + } else { + return Either.right(marks); + } + } +} diff --git a/vavr/src/test/java/com/baeldung/vavr/PatternMatchingUnitTest.java b/vavr/src/test/java/com/baeldung/vavr/PatternMatchingUnitTest.java index ef5afe0e29..1adff2e845 100644 --- a/vavr/src/test/java/com/baeldung/vavr/PatternMatchingUnitTest.java +++ b/vavr/src/test/java/com/baeldung/vavr/PatternMatchingUnitTest.java @@ -100,13 +100,11 @@ public class PatternMatchingUnitTest { }))); } - - - public void displayEven() { + private void displayEven() { System.out.println("Input is even"); } - public void displayOdd() { + private void displayOdd() { System.out.println("Input is odd"); } } diff --git a/vavr/src/test/java/com/baeldung/vavr/either/EitherUnitTest.java b/vavr/src/test/java/com/baeldung/vavr/either/EitherUnitTest.java new file mode 100644 index 0000000000..6b0a34f9e4 --- /dev/null +++ b/vavr/src/test/java/com/baeldung/vavr/either/EitherUnitTest.java @@ -0,0 +1,38 @@ +package com.baeldung.vavr.either; + +import io.vavr.control.Either; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class EitherUnitTest { + + @Test + public void givenMarks_whenPassNumber_thenExpectNumber() { + Either result = EitherDemo.computeWithEither(100); + int marks = result.right() + .getOrElseThrow(x -> new IllegalStateException()); + + assertEquals(100, marks); + } + + @Test + public void givenMarks_whenFailNumber_thenExpectErrorMesssage() { + Either result = EitherDemo.computeWithEither(50); + String error = result.left() + .getOrNull(); + + assertEquals("Marks not acceptable", error); + } + + @Test + public void givenPassMarks_whenModified_thenExpectNumber() { + Either result = EitherDemo.computeWithEither(90); + int marks = result.right() + .map(x -> x * 2) + .get(); + + assertEquals(180, marks); + } + +} diff --git a/vavr/src/test/java/com/baeldung/vavr/repositories/VavrRepositoryIntegrationTest.java b/vavr/src/test/java/com/baeldung/vavr/repositories/VavrRepositoryIntegrationTest.java new file mode 100644 index 0000000000..c2e9f377dd --- /dev/null +++ b/vavr/src/test/java/com/baeldung/vavr/repositories/VavrRepositoryIntegrationTest.java @@ -0,0 +1,47 @@ +package com.baeldung.vavr.repositories; + +import com.baeldung.Application; +import com.baeldung.repositories.VavrUserRepository; +import com.baeldung.vavr.User; + +import io.vavr.collection.Seq; +import io.vavr.control.Option; + +import org.junit.Test; +import org.junit.Before; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import static org.junit.Assert.*; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = Application.class) +public class VavrRepositoryIntegrationTest { + + @Autowired + private VavrUserRepository userRepository; + + @Before + public void setup() { + User user1 = new User(); + user1.setName("John"); + User user2 = new User(); + user2.setName("John"); + + userRepository.save(user1); + userRepository.save(user2); + } + + @Test + public void whenAddUsers_thenGetUsers() { + Option user = userRepository.findById(1L); + assertFalse(user.isEmpty()); + assertTrue(user.get().getName().equals("John")); + + Seq users = userRepository.findByName("John"); + assertEquals(2, users.size()); + } + +}