View Javadoc

1   /*
2    * #%L
3    * Native ARchive plugin for Maven
4    * %%
5    * Copyright (C) 2002 - 2014 NAR Maven Plugin developers.
6    * %%
7    * Licensed under the Apache License, Version 2.0 (the "License");
8    * you may not use this file except in compliance with the License.
9    * You may obtain a copy of the License at
10   * 
11   * http://www.apache.org/licenses/LICENSE-2.0
12   * 
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   * #L%
19   */
20  package com.github.maven_nar.test;
21  
22  import java.io.File;
23  
24  import junit.framework.Assert;
25  import junit.framework.TestCase;
26  
27  import com.github.maven_nar.Library;
28  import com.github.maven_nar.NarFileLayout;
29  import com.github.maven_nar.NarFileLayout10;
30  
31  /**
32   * @author Mark Donszelmann (Mark.Donszelmann@gmail.com)
33   * @version $Id$
34   */
35  public class TestNarFileLayout10 extends TestCase {
36    protected NarFileLayout fileLayout;
37  
38    protected String artifactId;
39  
40    protected String version;
41  
42    protected String aol;
43  
44    protected String type;
45  
46    /*
47     * (non-Javadoc)
48     * 
49     * @see junit.framework.TestCase#setUp()
50     */
51    @Override
52    protected void setUp() throws Exception {
53      this.fileLayout = new NarFileLayout10();
54      this.artifactId = "artifactId";
55      this.version = "version";
56      this.aol = "x86_64-MacOSX-g++";
57      this.type = Library.SHARED;
58    }
59  
60    public final void testGetBinDirectory() {
61      Assert.assertEquals("bin" + File.separator + this.aol, this.fileLayout.getBinDirectory(this.aol));
62    }
63  
64    public final void testGetIncludeDirectory() {
65      Assert.assertEquals("include", this.fileLayout.getIncludeDirectory());
66    }
67  
68    public final void testGetLibDirectory() {
69      Assert.assertEquals("lib" + File.separator + this.aol + File.separator + this.type,
70          this.fileLayout.getLibDirectory(this.aol, this.type));
71    }
72  }