Skip to content

Commit

Permalink
Init stub manager
Browse files Browse the repository at this point in the history
  • Loading branch information
profesorfalken committed May 30, 2016
1 parent 963c86f commit 1ae35d5
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<configuration>
<archive>
<manifest>
<mainClass>com.profesorfalken.jsensors.TestSensorsLinux</mainClass>
<mainClass>com.profesorfalken.jsensors.JSensors</mainClass>
</manifest>
</archive>
<descriptorRefs>
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/profesorfalken/jsensors/JSensors.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Components components(SensorsManager manager) {
return SensorsLocator.get.getComponents(manager);
}

public static void main(String[] args) {
Components components = SensorsLocator.get.getComponents();
}

public List<String> warnings() {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.profesorfalken.jsensors.manager.stub;

import com.profesorfalken.jsensors.manager.SensorsManager;

/**
*
* @author javier
*/
public class StubSensorsManager extends SensorsManager {

public String getSensorsData() {
StringBuilder sensorsData = new StringBuilder();

return sensorsData.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public String getSensorsData() {
int init = initCSensors(cSensors);
if (init != 0) {
//TODO: handle
}
}

return normalizeSensorsData(cSensors);
}
Expand All @@ -46,7 +46,20 @@ private String normalizeSensorsData(CSensors cSensors) {

for (final CChip chip : chips) {
sensorsData.append(chip);

List<CFeature> features = features(cSensors, chip);

for (final CFeature feature : features) {
sensorsData.append(feature);

List<CSubFeature> subFeatures = subFeatures(cSensors, chip, feature);
for (final CSubFeature subFeature : subFeatures) {
sensorsData.append(subFeature);
}
}
}

System.out.println(sensorsData.toString());

return sensorsData.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private JSensors getJSensorsStub() {
/**
* Test Cpu information
*/
@Test
//@Test
public void testCpu() {
System.out.println("Testing CPU sensors");

Expand Down

0 comments on commit 1ae35d5

Please sign in to comment.