Browse Source

first commit

Demetrius Murray 5 years ago
commit
eb6added09

+ 1
- 0
.idea/.name View File

1
+JenkinsTest

+ 13
- 0
.idea/compiler.xml View File

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="CompilerConfiguration">
4
+    <annotationProcessing>
5
+      <profile name="Maven default annotation processors profile" enabled="true">
6
+        <sourceOutputDir name="target/generated-sources/annotations" />
7
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
8
+        <outputRelativeToContentRoot value="true" />
9
+        <module name="Jenkins" />
10
+      </profile>
11
+    </annotationProcessing>
12
+  </component>
13
+</project>

+ 14
- 0
.idea/misc.xml View File

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
4
+  <component name="MavenProjectsManager">
5
+    <option name="originalFiles">
6
+      <list>
7
+        <option value="$PROJECT_DIR$/pom.xml" />
8
+      </list>
9
+    </option>
10
+  </component>
11
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
12
+    <output url="file://$PROJECT_DIR$/out" />
13
+  </component>
14
+</project>

+ 50
- 0
.idea/workspace.xml View File

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ProjectFrameBounds" extendedState="6">
4
+    <option name="x" value="40" />
5
+    <option name="y" value="31" />
6
+    <option name="width" value="1240" />
7
+    <option name="height" value="777" />
8
+  </component>
9
+  <component name="PropertiesComponent">
10
+    <property name="WebServerToolWindowFactoryState" value="false" />
11
+    <property name="aspect.path.notification.shown" value="true" />
12
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1543607447728" />
13
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
14
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
15
+    <property name="project.structure.last.edited" value="Modules" />
16
+    <property name="project.structure.proportion" value="0.0" />
17
+    <property name="project.structure.side.proportion" value="0.0" />
18
+  </component>
19
+  <component name="RunManager">
20
+    <configuration name="FizzBuzzTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
21
+      <module name="Jenkins" />
22
+      <option name="PACKAGE_NAME" value="" />
23
+      <option name="MAIN_CLASS_NAME" value="FizzBuzzTest" />
24
+      <method v="2">
25
+        <option name="Make" enabled="true" />
26
+      </method>
27
+    </configuration>
28
+    <recent_temporary>
29
+      <list>
30
+        <item itemvalue="JUnit.FizzBuzzTest" />
31
+      </list>
32
+    </recent_temporary>
33
+  </component>
34
+  <component name="masterDetails">
35
+    <states>
36
+      <state key="ProjectJDKs.UI">
37
+        <settings>
38
+          <last-edited>1.8</last-edited>
39
+          <splitter-proportions>
40
+            <option name="proportions">
41
+              <list>
42
+                <option value="0.2" />
43
+              </list>
44
+            </option>
45
+          </splitter-proportions>
46
+        </settings>
47
+      </state>
48
+    </states>
49
+  </component>
50
+</project>

+ 2
- 0
Jenkins.iml View File

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module type="JAVA_MODULE" version="4" />

+ 20
- 0
pom.xml View File

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0"
3
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+    <modelVersion>4.0.0</modelVersion>
6
+
7
+    <groupId>com.Murray</groupId>
8
+    <artifactId>JenkinsTest</artifactId>
9
+    <version>1.0-SNAPSHOT</version>
10
+    <dependencies>
11
+        <dependency>
12
+            <groupId>junit</groupId>
13
+            <artifactId>junit</artifactId>
14
+            <version>RELEASE</version>
15
+            <scope>test</scope>
16
+        </dependency>
17
+    </dependencies>
18
+
19
+
20
+</project>

+ 14
- 0
src/main/java/FizzBuzz.java View File

1
+public class FizzBuzz {
2
+
3
+    public String fizzBuzz(int num){
4
+        if(num%3 == 0 && num%5 == 0){
5
+            return "FizzBuzz";
6
+        } else if (num%5 == 0){
7
+            return "Buzz";
8
+        } else if ((num%3 == 0)){
9
+            return "Fizz";
10
+        } else {
11
+            return Integer.toString(num);
12
+        }
13
+    }
14
+}

+ 46
- 0
src/test/java/FizzBuzzTest.java View File

1
+import org.junit.Assert;
2
+import org.junit.Test;
3
+
4
+public class FizzBuzzTest {
5
+    FizzBuzz fb = new FizzBuzz();
6
+
7
+    @Test
8
+    public void testFizzBuzz_3(){
9
+        String actual = fb.fizzBuzz(3);
10
+        String expected = "Fizz";
11
+
12
+        Assert.assertEquals(expected, actual);
13
+    }
14
+
15
+    @Test
16
+    public void testFizzBuzz_5(){
17
+        String actual = fb.fizzBuzz(5);
18
+        String expected = "Buzz";
19
+
20
+        Assert.assertEquals(expected, actual);
21
+    }
22
+
23
+    @Test
24
+    public void testFizzBuzz_15(){
25
+        String actual = fb.fizzBuzz(15);
26
+        String expected = "FizzBuzz";
27
+
28
+        Assert.assertEquals(expected, actual);
29
+    }
30
+
31
+    @Test
32
+    public void testFizzBuzz_else1(){
33
+        String actual = fb.fizzBuzz(2);
34
+        String expected = "2";
35
+
36
+        Assert.assertEquals(expected, actual);
37
+    }
38
+
39
+    @Test
40
+    public void testFizzBuzz_else2(){
41
+        String actual = fb.fizzBuzz(29);
42
+        String expected = "29";
43
+
44
+        Assert.assertEquals(expected, actual);
45
+    }
46
+}

BIN
target/classes/FizzBuzz.class View File


BIN
target/test-classes/FizzBuzzTest.class View File